clauder-hub 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/server/dist/index.js +878 -578
  3. package/web/dist/assets/{MonacoEditor-DPEn0mfK.js → MonacoEditor-BTVIBYvB.js} +3 -3
  4. package/web/dist/assets/{cssMode-BnQp8UjG.js → cssMode-C586Sf_r.js} +1 -1
  5. package/web/dist/assets/{freemarker2-Bq6-jIgC.js → freemarker2-C-cc3Gll.js} +1 -1
  6. package/web/dist/assets/{handlebars-CPxnw4Ez.js → handlebars-DvIHaXiS.js} +1 -1
  7. package/web/dist/assets/{html-9alhruC8.js → html-B6mVPILf.js} +1 -1
  8. package/web/dist/assets/{htmlMode-CxqKy1xn.js → htmlMode-DdTtdH0Z.js} +1 -1
  9. package/web/dist/assets/{index-BC8Mq4A8.js → index-BQk7iZCf.js} +1 -1
  10. package/web/dist/assets/index-BRBOC-HN.css +32 -0
  11. package/web/dist/assets/index-D7vjfqSK.js +640 -0
  12. package/web/dist/assets/{javascript-DXXrDfHX.js → javascript-B_oWtDTg.js} +1 -1
  13. package/web/dist/assets/{jsonMode-BLVPAS2X.js → jsonMode-qce5w2Wk.js} +1 -1
  14. package/web/dist/assets/{liquid-CBx4ZtYj.js → liquid-7IWcrKEP.js} +1 -1
  15. package/web/dist/assets/{lspLanguageFeatures-CkK7LqLK.js → lspLanguageFeatures-CmmvUFJp.js} +1 -1
  16. package/web/dist/assets/{mdx-B91KzbQp.js → mdx-C7aHCLPx.js} +1 -1
  17. package/web/dist/assets/{python--hOcHXXk.js → python-DM5DwMK7.js} +1 -1
  18. package/web/dist/assets/{razor-BmyGefOy.js → razor-B7mgUEn8.js} +1 -1
  19. package/web/dist/assets/{tsMode-CpLHuKwC.js → tsMode-DxSLItWY.js} +1 -1
  20. package/web/dist/assets/{typescript-BxzKoMhA.js → typescript-ByJ-uQZm.js} +1 -1
  21. package/web/dist/assets/{workers-CMzs0L1K.js → workers-CJj-afeH.js} +1 -1
  22. package/web/dist/assets/{xml-Dawpqrp-.js → xml-qEcmYLej.js} +1 -1
  23. package/web/dist/assets/{yaml-fC354fWd.js → yaml-DJRPJYdB.js} +1 -1
  24. package/web/dist/index.html +2 -2
  25. package/web/dist/assets/index-DV708jQJ.js +0 -630
  26. package/web/dist/assets/index-Dt3TWUGi.css +0 -32
@@ -0,0 +1,640 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MonacoEditor-BTVIBYvB.js","assets/MonacoEditor-BbYsqB7V.css"])))=>i.map(i=>d[i]);
2
+ var ly=e=>{throw TypeError(e)};var cy=(e,i,r)=>i.has(e)||ly("Cannot "+r);var mn=(e,i,r)=>(cy(e,i,"read from private field"),r?r.call(e):i.get(e)),uy=(e,i,r)=>i.has(e)?ly("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,r),Pp=(e,i,r,s)=>(cy(e,i,"write to private field"),s?s.call(e,r):i.set(e,r),r);function I3(e,i){for(var r=0;r<i.length;r++){const s=i[r];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in e)){const h=Object.getOwnPropertyDescriptor(s,l);h&&Object.defineProperty(e,l,h.get?h:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const h of l)if(h.type==="childList")for(const p of h.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function r(l){const h={};return l.integrity&&(h.integrity=l.integrity),l.referrerPolicy&&(h.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?h.credentials="include":l.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function s(l){if(l.ep)return;l.ep=!0;const h=r(l);fetch(l.href,h)}})();function xg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zp={exports:{}},El={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var hy;function H3(){if(hy)return El;hy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(s,l,h){var p=null;if(h!==void 0&&(p=""+h),l.key!==void 0&&(p=""+l.key),"key"in l){h={};for(var o in l)o!=="key"&&(h[o]=l[o])}else h=l;return l=h.ref,{$$typeof:e,type:s,key:p,ref:l!==void 0?l:null,props:h}}return El.Fragment=i,El.jsx=r,El.jsxs=r,El}var dy;function F3(){return dy||(dy=1,zp.exports=H3()),zp.exports}var m=F3(),Ip={exports:{}},He={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var fy;function U3(){if(fy)return He;fy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),p=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),_=Symbol.for("react.view_transition"),x=Symbol.iterator;function C(V){return V===null||typeof V!="object"?null:(V=x&&V[x]||V["@@iterator"],typeof V=="function"?V:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,b={};function S(V,ne,le){this.props=V,this.context=ne,this.refs=b,this.updater=le||y}S.prototype.isReactComponent={},S.prototype.setState=function(V,ne){if(typeof V!="object"&&typeof V!="function"&&V!=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,V,ne,"setState")},S.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function w(){}w.prototype=S.prototype;function T(V,ne,le){this.props=V,this.context=ne,this.refs=b,this.updater=le||y}var D=T.prototype=new w;D.constructor=T,g(D,S.prototype),D.isPureReactComponent=!0;var R=Array.isArray;function L(){}var A={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function j(V,ne,le){var K=le.ref;return{$$typeof:e,type:V,key:ne,ref:K!==void 0?K:null,props:le}}function z(V,ne){return j(V.type,ne,V.props)}function P(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function H(V){var ne={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(le){return ne[le]})}var F=/\/+/g;function W(V,ne){return typeof V=="object"&&V!==null&&V.key!=null?H(""+V.key):ne.toString(36)}function G(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(L,L):(V.status="pending",V.then(function(ne){V.status==="pending"&&(V.status="fulfilled",V.value=ne)},function(ne){V.status==="pending"&&(V.status="rejected",V.reason=ne)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function Q(V,ne,le,K,$){var oe=typeof V;(oe==="undefined"||oe==="boolean")&&(V=null);var ee=!1;if(V===null)ee=!0;else switch(oe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(V.$$typeof){case e:case i:ee=!0;break;case v:return ee=V._init,Q(ee(V._payload),ne,le,K,$)}}if(ee)return $=$(V),ee=K===""?"."+W(V,0):K,R($)?(le="",ee!=null&&(le=ee.replace(F,"$&/")+"/"),Q($,ne,le,"",function(Se){return Se})):$!=null&&(P($)&&($=z($,le+($.key==null||V&&V.key===$.key?"":(""+$.key).replace(F,"$&/")+"/")+ee)),ne.push($)),1;ee=0;var ue=K===""?".":K+":";if(R(V))for(var he=0;he<V.length;he++)K=V[he],oe=ue+W(K,he),ee+=Q(K,ne,le,oe,$);else if(he=C(V),typeof he=="function")for(V=he.call(V),he=0;!(K=V.next()).done;)K=K.value,oe=ue+W(K,he++),ee+=Q(K,ne,le,oe,$);else if(oe==="object"){if(typeof V.then=="function")return Q(G(V),ne,le,K,$);throw ne=String(V),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return ee}function X(V,ne,le){if(V==null)return V;var K=[],$=0;return Q(V,K,"","",function(oe){return ne.call(le,oe,$++)}),K}function I(V){if(V._status===-1){var ne=V._result,le=ne();le.then(function(K){(V._status===0||V._status===-1)&&(V._status=1,V._result=K,le.status===void 0&&(le.status="fulfilled",le.value=K))},function(K){(V._status===0||V._status===-1)&&(V._status=2,V._result=K,le.status===void 0&&(le.status="rejected",le.reason=K))}),V._status===-1&&(V._status=0,V._result=le)}if(V._status===1)return V._result.default;throw V._result}var O=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",V);return}console.error(V)};function Y(V){var ne=A.T,le={};le.types=ne!==null?ne.types:null,A.T=le;try{var K=V(),$=A.S;$!==null&&$(le,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(L,O)}catch(oe){O(oe)}finally{ne!==null&&le.types!==null&&(ne.types=le.types),A.T=ne}}function Z(V){var ne=A.T;if(ne!==null){var le=ne.types;le===null?ne.types=[V]:le.indexOf(V)===-1&&le.push(V)}else Y(Z.bind(null,V))}var U={map:X,forEach:function(V,ne,le){X(V,function(){ne.apply(this,arguments)},le)},count:function(V){var ne=0;return X(V,function(){ne++}),ne},toArray:function(V){return X(V,function(ne){return ne})||[]},only:function(V){if(!P(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return He.Activity=c,He.Children=U,He.Component=S,He.Fragment=r,He.Profiler=l,He.PureComponent=T,He.StrictMode=s,He.Suspense=u,He.ViewTransition=_,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,He.__COMPILER_RUNTIME={__proto__:null,c:function(V){return A.H.useMemoCache(V)}},He.addTransitionType=Z,He.cache=function(V){return function(){return V.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(V,ne,le){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var K=g({},V.props),$=V.key;if(ne!=null)for(oe in ne.key!==void 0&&($=""+ne.key),ne)!M.call(ne,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&ne.ref===void 0||(K[oe]=ne[oe]);var oe=arguments.length-2;if(oe===1)K.children=le;else if(1<oe){for(var ee=Array(oe),ue=0;ue<oe;ue++)ee[ue]=arguments[ue+2];K.children=ee}return j(V.type,$,K)},He.createContext=function(V){return V={$$typeof:p,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:h,_context:V},V},He.createElement=function(V,ne,le){var K,$={},oe=null;if(ne!=null)for(K in ne.key!==void 0&&(oe=""+ne.key),ne)M.call(ne,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&($[K]=ne[K]);var ee=arguments.length-2;if(ee===1)$.children=le;else if(1<ee){for(var ue=Array(ee),he=0;he<ee;he++)ue[he]=arguments[he+2];$.children=ue}if(V&&V.defaultProps)for(K in ee=V.defaultProps,ee)$[K]===void 0&&($[K]=ee[K]);return j(V,oe,$)},He.createRef=function(){return{current:null}},He.forwardRef=function(V){return{$$typeof:o,render:V}},He.isValidElement=P,He.lazy=function(V){return{$$typeof:v,_payload:{_status:-1,_result:V},_init:I}},He.memo=function(V,ne){return{$$typeof:d,type:V,compare:ne===void 0?null:ne}},He.startTransition=Y,He.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},He.use=function(V){return A.H.use(V)},He.useActionState=function(V,ne,le){return A.H.useActionState(V,ne,le)},He.useCallback=function(V,ne){return A.H.useCallback(V,ne)},He.useContext=function(V){return A.H.useContext(V)},He.useDebugValue=function(){},He.useDeferredValue=function(V,ne){return A.H.useDeferredValue(V,ne)},He.useEffect=function(V,ne){return A.H.useEffect(V,ne)},He.useEffectEvent=function(V){return A.H.useEffectEvent(V)},He.useId=function(){return A.H.useId()},He.useImperativeHandle=function(V,ne,le){return A.H.useImperativeHandle(V,ne,le)},He.useInsertionEffect=function(V,ne){return A.H.useInsertionEffect(V,ne)},He.useLayoutEffect=function(V,ne){return A.H.useLayoutEffect(V,ne)},He.useMemo=function(V,ne){return A.H.useMemo(V,ne)},He.useOptimistic=function(V,ne){return A.H.useOptimistic(V,ne)},He.useReducer=function(V,ne,le){return A.H.useReducer(V,ne,le)},He.useRef=function(V){return A.H.useRef(V)},He.useState=function(V){return A.H.useState(V)},He.useSyncExternalStore=function(V,ne,le){return A.H.useSyncExternalStore(V,ne,le)},He.useTransition=function(){return A.H.useTransition()},He.version="19.3.1",He}var py;function yg(){return py||(py=1,Ip.exports=U3()),Ip.exports}var N=yg();const Nl=xg(N),ya=I3({__proto__:null,default:Nl},[N]);var Hp={exports:{}},Tl={},Fp={exports:{}},Up={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var my;function $3(){return my||(my=1,(function(e){function i(G,Q){var X=G.length;G.push(Q);e:for(;0<X;){var I=X-1>>>1,O=G[I];if(0<l(O,Q))G[I]=Q,G[X]=O,X=I;else break e}}function r(G){return G.length===0?null:G[0]}function s(G){if(G.length===0)return null;var Q=G[0],X=G.pop();if(X!==Q){G[0]=X;e:for(var I=0,O=G.length,Y=O>>>1;I<Y;){var Z=2*(I+1)-1,U=G[Z],V=Z+1,ne=G[V];if(0>l(U,X))V<O&&0>l(ne,U)?(G[I]=ne,G[V]=X,I=V):(G[I]=U,G[Z]=X,I=Z);else if(V<O&&0>l(ne,X))G[I]=ne,G[V]=X,I=V;else break e}}return Q}function l(G,Q){var X=G.sortIndex-Q.sortIndex;return X!==0?X:G.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var p=Date,o=p.now();e.unstable_now=function(){return p.now()-o}}var u=[],d=[],v=1,c=null,_=3,x=!1,C=!1,y=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function T(G){for(var Q=r(d);Q!==null;){if(Q.callback===null)s(d);else if(Q.startTime<=G)s(d),Q.sortIndex=Q.expirationTime,i(u,Q);else break;Q=r(d)}}function D(G){if(y=!1,T(G),!C)if(r(u)!==null)C=!0,R||(R=!0,P());else{var Q=r(d);Q!==null&&W(D,Q.startTime-G)}}var R=!1,L=-1,A=5,M=-1;function j(){return g?!0:!(e.unstable_now()-M<A)}function z(){if(g=!1,R){var G=e.unstable_now();M=G;var Q=!0;try{e:{C=!1,y&&(y=!1,S(L),L=-1),x=!0;var X=_;try{t:{for(T(G),c=r(u);c!==null&&!(c.expirationTime>G&&j());){var I=c.callback;if(typeof I=="function"){c.callback=null,_=c.priorityLevel;var O=I(c.expirationTime<=G);if(G=e.unstable_now(),typeof O=="function"){c.callback=O,T(G),Q=!0;break t}c===r(u)&&s(u),T(G)}else s(u);c=r(u)}if(c!==null)Q=!0;else{var Y=r(d);Y!==null&&W(D,Y.startTime-G),Q=!1}}break e}finally{c=null,_=X,x=!1}Q=void 0}}finally{Q?P():R=!1}}}var P;if(typeof w=="function")P=function(){w(z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,F=H.port2;H.port1.onmessage=z,P=function(){F.postMessage(null)}}else P=function(){b(z,0)};function W(G,Q){L=b(function(){G(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(G){switch(_){case 1:case 2:case 3:var Q=3;break;default:Q=_}var X=_;_=Q;try{return G()}finally{_=X}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(G,Q){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var X=_;_=G;try{return Q()}finally{_=X}},e.unstable_scheduleCallback=function(G,Q,X){var I=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?I+X:I):X=I,G){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=X+O,G={id:v++,callback:Q,priorityLevel:G,startTime:X,expirationTime:O,sortIndex:-1},X>I?(G.sortIndex=X,i(d,G),r(u)===null&&G===r(d)&&(y?(S(L),L=-1):y=!0,W(D,X-I))):(G.sortIndex=O,i(u,G),C||x||(C=!0,R||(R=!0,P()))),G},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(G){var Q=_;return function(){var X=_;_=Q;try{return G.apply(this,arguments)}finally{_=X}}}})(Up)),Up}var gy;function q3(){return gy||(gy=1,Fp.exports=$3()),Fp.exports}var $p={exports:{}},gn={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var vy;function V3(){if(vy)return gn;vy=1;var e=yg();function i(v){var c="https://react.dev/errors/"+v;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)c+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+v+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal"),h=Symbol.for("react.recoverable"),p=Symbol.for("react.optimistic_key");function o(v,c,_){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:x==null?null:x===p?p:""+x,children:v,containerInfo:c,implementation:_}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(v,c){if(v==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,gn.browser=function(v){return{$$typeof:h,_reason:v}},gn.createPortal=function(v,c){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(i(299));return o(v,c,null,_)},gn.flushSync=function(v){var c=u.T,_=s.p;try{if(u.T=null,s.p=2,v)return v()}finally{u.T=c,s.p=_,s.d.f()}},gn.preconnect=function(v,c){typeof v=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,s.d.C(v,c))},gn.prefetchDNS=function(v){typeof v=="string"&&s.d.D(v)},gn.preinit=function(v,c){if(typeof v=="string"&&c&&typeof c.as=="string"){var _=c.as,x=d(_,c.crossOrigin),C=typeof c.integrity=="string"?c.integrity:void 0,y=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;_==="style"?s.d.S(v,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:x,integrity:C,fetchPriority:y}):_==="script"&&s.d.X(v,{crossOrigin:x,integrity:C,fetchPriority:y,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},gn.preinitModule=function(v,c){if(typeof v=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var _=d(c.as,c.crossOrigin);s.d.M(v,{crossOrigin:_,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0})}}else c==null&&s.d.M(v)},gn.preload=function(v,c){if(typeof v=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var _=c.as,x=d(_,c.crossOrigin);s.d.L(v,_,{crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},gn.preloadModule=function(v,c){if(typeof v=="string")if(c){var _=d(c.as,c.crossOrigin);s.d.m(v,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:_,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0})}else s.d.m(v)},gn.requestFormReset=function(v){s.d.r(v)},gn.unstable_batchedUpdates=function(v,c){return v(c)},gn.useFormState=function(v,c,_){return u.H.useFormState(v,c,_)},gn.useFormStatus=function(){return u.H.useHostTransitionStatus()},gn.version="19.3.1",gn}var _y;function Bw(){if(_y)return $p.exports;_y=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),$p.exports=V3(),$p.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var xy;function W3(){if(xy)return Tl;xy=1;var e=q3(),i=yg(),r=Bw();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){for(var n=t,a=n;a&&!a.alternate;)n=a,(n.flags&4098)!==0&&(t=n.return),a=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function p(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function o(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function u(t){if(h(t)!==t)throw Error(s(188))}function d(t){var n=t.alternate;if(!n){if(n=h(t),n===null)throw Error(s(188));return n!==t?null:t}for(var a=t,f=n;;){var k=a.return;if(k===null)break;var E=k.alternate;if(E===null){if(f=k.return,f!==null){a=f;continue}break}if(k.child===E.child){for(E=k.child;E;){if(E===a)return u(k),t;if(E===f)return u(k),n;E=E.sibling}throw Error(s(188))}if(a.return!==f.return)a=k,f=E;else{for(var B=!1,q=k.child;q;){if(q===a){B=!0,a=k,f=E;break}if(q===f){B=!0,f=k,a=E;break}q=q.sibling}if(!B){for(q=E.child;q;){if(q===a){B=!0,a=E,f=k;break}if(q===f){B=!0,f=E,a=k;break}q=q.sibling}if(!B)throw Error(s(189))}}if(a.alternate!==f)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:n}function v(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=v(t),n!==null)return n;t=t.sibling}return null}function c(t,n,a,f,k,E){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&a(t,f,k,E)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&c(t.child,n,a,f,k,E))return!0;t=t.sibling}return!1}function _(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function x(t){var n=!1;for(t=t.return;t!==null&&(t.tag===4&&(n=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return n}function C(t){var n=[null,null],a=_(t);return a===null||y(n,t,a.child,{foundSelf:!1}),n}function y(t,n,a,f){for(;a!==null;){if(a===n)f.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(f.foundSelf)return t[1]=a,!0;t[0]=a}else if((a.tag!==22||a.memoizedState===null)&&y(t,n,a.child,f))return!0;a=a.sibling}return!1}function g(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(s(559))}}var b=null,S=null;function w(t,n,a){return t===a?!0:t===n?(b=t,!0):!1}function T(t,n,a){return t===a?(S=t,!1):t===n?(S!==null&&(b=t),!0):!1}function D(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function R(t,n,a){for(var f=0,k=t;k;k=a(k))f++;k=0;for(var E=n;E;E=a(E))k++;for(;0<f-k;)t=a(t),f--;for(;0<k-f;)n=a(n),k--;for(;f--;){if(t===n||n!==null&&t===n.alternate)return t;t=a(t),n=a(n)}return null}var L=Object.assign,A=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),W=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),Z=Symbol.for("react.legacy_hidden"),U=Symbol.for("react.memo_cache_sentinel"),V=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),le=Symbol.iterator;function K(t){return t===null||typeof t!="object"?null:(t=le&&t[le]||t["@@iterator"],typeof t=="function"?t:null)}var $=Symbol.for("react.client.reference");function oe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case z:return"Fragment";case H:return"Profiler";case P:return"StrictMode";case Q:return"Suspense";case X:return"SuspenseList";case Y:return"Activity";case V:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case j:return"Portal";case W:return t.displayName||"Context";case F:return(t._context.displayName||"Context")+".Consumer";case G:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case I:return n=t.displayName||null,n!==null?n:oe(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return oe(t(n))}catch{}}return null}var ee=Array.isArray,ue=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se={pending:!1,data:null,method:null,action:null},we=[],Re=-1;function Ve(t){return{current:t}}function Ee(t){0>Re||(t.current=we[Re],we[Re]=null,Re--)}function Ie(t,n){Re++,we[Re]=t.current,t.current=n}var Ot=Ve(null),$e=Ve(null),Be=Ve(null),ze=Ve(null);function Te(t,n){switch(Ie(Be,n),Ie($e,t),Ie(Ot,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?vx(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=vx(n),t=_x(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Ee(Ot),Ie(Ot,t)}function We(){Ee(Ot),Ee($e),Ee(Be)}function gt(t){var n=t.memoizedState;n!==null&&(Zo._currentValue=n.memoizedState,Ie(ze,t)),n=Ot.current;var a=_x(n,t.type);n!==a&&(Ie($e,t),Ie(Ot,a))}function ot(t){$e.current===t&&(Ee(Ot),Ee($e)),ze.current===t&&(Ee(ze),Zo._currentValue=Se)}var fe,xe;function De(t){if(fe===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);fe=n&&n[1]||"",xe=-1<a.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+fe+t+xe}var Le=!1;function Fe(t,n){if(!t||Le)return"";Le=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(n){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ke){var ie=ke}Reflect.construct(t,[],me)}else{try{me.call()}catch(ke){ie=ke}me=!1;try{var ce=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),me=!0,new t}finally{me&&(ce!==void 0?Object.defineProperty(t.prototype,"props",ce):delete t.prototype.props)}}}else{try{throw Error()}catch(ke){ie=ke}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ke){if(ke&&ie&&typeof ke.stack=="string")return[ke.stack,ie.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=f.DetermineComponentFrameRoot(),B=E[0],q=E[1];if(B&&q){var J=B.split(`
45
+ `),se=q.split(`
46
+ `);for(k=f=0;f<J.length&&!J[f].includes("DetermineComponentFrameRoot");)f++;for(;k<se.length&&!se[k].includes("DetermineComponentFrameRoot");)k++;if(f===J.length||k===se.length)for(f=J.length-1,k=se.length-1;1<=f&&0<=k&&J[f]!==se[k];)k--;for(;1<=f&&0<=k;f--,k--)if(J[f]!==se[k]){if(f!==1||k!==1)do if(f--,k--,0>k||J[f]!==se[k]){var de=`
47
+ `+J[f].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=f&&0<=k);break}}}finally{Le=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?De(a):""}function je(t,n){switch(t.tag){case 26:case 27:case 5:return De(t.type);case 16:return De("Lazy");case 13:return t.child!==n&&n!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Fe(t.type,!1);case 11:return Fe(t.type.render,!1);case 1:return Fe(t.type,!0);case 31:return De("Activity");case 30:return De("ViewTransition");default:return""}}function At(t){try{var n="",a=null;do n+=je(t,a),a=t,t=t.return;while(t);return n}catch(f){return`
48
+ Error generating stack: `+f.message+`
49
+ `+f.stack}}var Yt=Object.prototype.hasOwnProperty,An=e.unstable_scheduleCallback,ti=e.unstable_cancelCallback,ni=e.unstable_shouldYield,co=e.unstable_requestPaint,Kt=e.unstable_now,Xt=e.unstable_getCurrentPriorityLevel,ii=e.unstable_ImmediatePriority,Sn=e.unstable_UserBlockingPriority,uo=e.unstable_NormalPriority,G5=e.unstable_LowPriority,Uv=e.unstable_IdlePriority,Y5=e.log,K5=e.unstable_setDisableYieldValue,Ma=null,Un=null;function Lr(t){if(typeof Y5=="function"&&K5(t),Un&&typeof Un.setStrictMode=="function")try{Un.setStrictMode(Ma,t)}catch{}}var $n=Math.clz32?Math.clz32:Z5,X5=Math.log,Q5=Math.LN2;function Z5(t){return t>>>=0,t===0?32:31-(X5(t)/Q5|0)|0}var fc=256,pc=262144,mc=4194304;function bs(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function gc(t,n,a){var f=t.pendingLanes;if(f===0)return 0;var k=0,E=t.suspendedLanes,B=t.pingedLanes;t=t.warmLanes;var q=f&134217727;return q!==0?(f=q&~E,f!==0?k=bs(f):(B&=q,B!==0?k=bs(B):a||(a=q&~t,a!==0&&(k=bs(a))))):(q=f&~E,q!==0?k=bs(q):B!==0?k=bs(B):a||(a=f&~t,a!==0&&(k=bs(a)))),k===0?0:n!==0&&n!==k&&(n&E)===0&&(E=k&-k,a=n&-n,E>=a||E===32&&(a&4194048)!==0)?n:k}function Na(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function $v(t,n){(n&8)!==0&&(n|=n&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=n;0<a;){var f=31-$n(a),k=1<<f;n|=t[f],a&=~k}return n}function J5(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 qv(){var t=mc;return mc<<=1,(mc&62914560)===0&&(mc=4194304),t}function cd(t){for(var n=[],a=0;31>a;a++)n.push(t);return n}function Oa(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ek(t,n,a,f,k,E){var B=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var q=t.entanglements,J=t.expirationTimes,se=t.hiddenUpdates;for(a=B&~a;0<a;){var de=31-$n(a),me=1<<de;q[de]=0,J[de]=-1;var ie=se[de];if(ie!==null)for(se[de]=null,de=0;de<ie.length;de++){var ce=ie[de];ce!==null&&(ce.lane&=-536870913)}a&=~me}f!==0&&Vv(t,f,0),E!==0&&k===0&&t.tag!==0&&(t.suspendedLanes|=E&~(B&~n))}function Vv(t,n,a){t.pendingLanes|=n,t.suspendedLanes&=~n;var f=31-$n(n);t.entangledLanes|=n,t.entanglements[f]=t.entanglements[f]|1073741824|a&261930}function Wv(t,n){var a=t.entangledLanes|=n;for(t=t.entanglements;a;){var f=31-$n(a),k=1<<f;k&n|t[f]&n&&(t[f]|=n),a&=~k}}function Gv(t,n){var a=n&-n;return a=(a&42)!==0?1:ud(a),(a&(t.suspendedLanes|n))!==0?0:a}function ud(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function hd(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Yv(){var t=he.p;return t!==0?t:(t=window.event,t===void 0?32:ty(t.type))}function Kv(t,n){var a=he.p;try{return he.p=t,n()}finally{he.p=a}}var Ji=Math.random().toString(36).slice(2),cn="__reactFiber$"+Ji,Dn="__reactProps$"+Ji,ho="__reactContainer$"+Ji,Xv="__reactEvents$"+Ji,tk="__reactListeners$"+Ji,nk="__reactHandles$"+Ji,Qv="__reactResources$"+Ji,Ba="__reactMarker$"+Ji,vc="__reactLoad$"+Ji;function _c(t){delete t[cn],delete t[Dn],delete t[tk],delete t[nk]}function ws(t){var n;if(n=t[cn])return n;for(var a=t.parentNode;a;){if(n=a[ho]||a[cn]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(t=Ox(t);t!==null;){if(a=t[cn])return a;t=Ox(t)}return n}t=a,a=t.parentNode}return null}function fo(t){if(t=t[cn]||t[ho]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Pa(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function po(t){var n=t[Qv];return n||(n=t[Qv]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function en(t){t[Ba]=!0}function Zv(t){t[vc]=void 0}var Jv=new Set,e_={};function Ss(t,n){mo(t,n),mo(t+"Capture",n)}function mo(t,n){for(e_[t]=n,t=0;t<n.length;t++)Jv.add(n[t])}var ik=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]*$"),t_={},n_={};function rk(t){return Yt.call(n_,t)?!0:Yt.call(t_,t)?!1:ik.test(t)?n_[t]=!0:(t_[t]=!0,!1)}var at=!1;function i_(){var t=at;return at=!1,t}function xc(t,n,a){if(rk(n))if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var f=n.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,a)}}function yc(t,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,a)}}function er(t,n,a,f){if(f===null)t.removeAttribute(a);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(n,a,f)}}function qn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function r_(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function sk(t,n,a){var f=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var k=f.get,E=f.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return k.call(this)},set:function(B){a=""+B,E.call(this,B)}}),Object.defineProperty(t,n,{enumerable:f.enumerable}),{getValue:function(){return a},setValue:function(B){a=""+B},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function dd(t){if(!t._valueTracker){var n=r_(t)?"checked":"value";t._valueTracker=sk(t,n,""+t[n])}}function s_(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var a=n.getValue(),f="";return t&&(f=r_(t)?t.checked?"true":"false":t.value),t=f,t!==a?(n.setValue(t),!0):!1}var ok=/[\n"\\]/g;function ri(t){return t.replace(ok,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function fd(t,n,a,f,k,E,B,q){t.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?t.type=B:t.removeAttribute("type"),n!=null?B==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+qn(n)):t.value!==""+qn(n)&&(t.value=""+qn(n)):B!=="submit"&&B!=="reset"||t.removeAttribute("value"),n!=null?B==="number"&&t.value==n?pd(t,qn(t.value)):pd(t,qn(n)):a!=null?pd(t,qn(a)):f!=null&&t.removeAttribute("value"),k==null&&E!=null&&(t.defaultChecked=!!E),k!=null&&(t.checked=k&&typeof k!="function"&&typeof k!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?t.name=""+qn(q):t.removeAttribute("name")}function o_(t,n,a,f,k,E,B,q){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(t.type=E),n!=null||a!=null){if(!(E!=="submit"&&E!=="reset"||n!=null)){dd(t);return}a=a!=null?""+qn(a):"",n=n!=null?""+qn(n):a,q||n===t.value||(t.value=n),t.defaultValue=n}f=f??k,f=typeof f!="function"&&typeof f!="symbol"&&!!f,t.checked=q?t.checked:!!f,t.defaultChecked=!!f,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(t.name=B),dd(t)}function pd(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function go(t,n,a,f){if(t=t.options,n){n={};for(var k=0;k<a.length;k++)n["$"+a[k]]=!0;for(a=0;a<t.length;a++)k=n.hasOwnProperty("$"+t[a].value),t[a].selected!==k&&(t[a].selected=k),k&&f&&(t[a].defaultSelected=!0)}else{for(a=""+qn(a),n=null,k=0;k<t.length;k++){if(t[k].value===a){t[k].selected=!0,f&&(t[k].defaultSelected=!0);return}n!==null||t[k].disabled||(n=t[k])}n!==null&&(n.selected=!0)}}function a_(t,n,a){if(n!=null&&(n=""+qn(n),n!==t.value&&(t.value=n),a==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=a!=null?""+qn(a):""}function l_(t,n,a,f){if(n==null){if(f!=null){if(a!=null)throw Error(s(92));if(ee(f)){if(1<f.length)throw Error(s(93));f=f[0]}a=f}a==null&&(a=""),n=a}a=qn(n),t.defaultValue=a,f=t.textContent,f===a&&f!==""&&f!==null&&(t.value=f),dd(t)}function vo(t,n){if(n){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=n;return}}t.textContent=n}var ak=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 c_(t,n,a){var f=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?f?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":f?t.setProperty(n,a):typeof a!="number"||a===0||ak.has(n)?n==="float"?t.cssFloat=a:t[n]=(""+a).trim():t[n]=a+"px"}function u_(t,n,a){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,a!=null){for(var f in a)!a.hasOwnProperty(f)||n!=null&&n.hasOwnProperty(f)||(f.indexOf("--")===0?t.setProperty(f,""):f==="float"?t.cssFloat="":t[f]="",at=!0);for(var k in n)f=n[k],n.hasOwnProperty(k)&&a[k]!==f&&(c_(t,k,f),at=!0)}else for(var E in n)n.hasOwnProperty(E)&&c_(t,E,n[E])}function md(t){if(t.indexOf("-")===-1)return!1;switch(t){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 lk=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"],["maskType","mask-type"],["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"]]),ck=/^[\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 bc(t){return ck.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Di(){}var gd=null;function vd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var _o=null,xo=null;function h_(t){var n=fo(t);if(n&&(t=n.stateNode)){var a=t[Dn]||null;e:switch(t=n.stateNode,n.type){case"input":if(fd(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ri(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var f=a[n];if(f!==t&&f.form===t.form){var k=f[Dn]||null;if(!k)throw Error(s(90));fd(f,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(n=0;n<a.length;n++)f=a[n],f.form===t.form&&s_(f)}break e;case"textarea":a_(t,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&go(t,!!a.multiple,n,!1)}}}var _d=!1;function d_(t,n,a){if(_d)return t(n,a);_d=!0;try{var f=t(n);return f}finally{if(_d=!1,(_o!==null||xo!==null)&&(bu(),_o&&(n=_o,t=xo,xo=_o=null,h_(n),t)))for(n=0;n<t.length;n++)h_(t[n])}}function za(t,n){var a=t.stateNode;if(a===null)return null;var f=a[Dn]||null;if(f===null)return null;a=f[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(t=t.type,f=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!f;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,n,typeof a));return a}var tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xd=!1;if(tr)try{var Ia={};Object.defineProperty(Ia,"passive",{get:function(){xd=!0}}),window.addEventListener("test",Ia,Ia),window.removeEventListener("test",Ia,Ia)}catch{xd=!1}var jr=null,yd=null,wc=null;function f_(){if(wc)return wc;var t,n=yd,a=n.length,f,k="value"in jr?jr.value:jr.textContent,E=k.length;for(t=0;t<a&&n[t]===k[t];t++);var B=a-t;for(f=1;f<=B&&n[a-f]===k[E-f];f++);return wc=k.slice(t,1<f?1-f:void 0)}function Sc(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Cc(){return!0}function p_(){return!1}function Cn(t){function n(a,f,k,E,B){this._reactName=a,this._targetInst=k,this.type=f,this.nativeEvent=E,this.target=B,this.currentTarget=null;for(var q in t)t.hasOwnProperty(q)&&(a=t[q],this[q]=a?a(E):E[q]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Cc:p_,this.isPropagationStopped=p_,this}return L(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Cc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Cc)},persist:function(){},isPersistent:Cc}),n}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kc=Cn(Mr),Ha=L({},Mr,{view:0,detail:0}),uk=Cn(Ha),bd,wd,Fa,Ec=L({},Ha,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Fa&&(Fa&&t.type==="mousemove"?(bd=t.screenX-Fa.screenX,wd=t.screenY-Fa.screenY):wd=bd=0,Fa=t),bd)},movementY:function(t){return"movementY"in t?t.movementY:wd}}),m_=Cn(Ec),hk=L({},Ec,{dataTransfer:0}),dk=Cn(hk),fk=L({},Ha,{relatedTarget:0}),Sd=Cn(fk),pk=L({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),mk=Cn(pk),gk=L({},Mr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),vk=Cn(gk),_k=L({},Mr,{data:0}),g_=Cn(_k),xk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yk={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"},bk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wk(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=bk[t])?!!n[t]:!1}function Cd(){return wk}var Sk=L({},Ha,{key:function(t){if(t.key){var n=xk[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Sc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?yk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cd,charCode:function(t){return t.type==="keypress"?Sc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Sc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Ck=Cn(Sk),kk=L({},Ec,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),v_=Cn(kk),Ek=L({},Mr,{submitter:0}),Tk=Cn(Ek),Rk=L({},Ha,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cd}),Ak=Cn(Rk),Dk=L({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lk=Cn(Dk),jk=L({},Ec,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Mk=Cn(jk),Nk=L({},Mr,{newState:0,oldState:0,source:0}),Ok=Cn(Nk),Bk=[9,13,27,32],kd=tr&&"CompositionEvent"in window,Ua=null;tr&&"documentMode"in document&&(Ua=document.documentMode);var Pk=tr&&"TextEvent"in window&&!Ua,__=tr&&(!kd||Ua&&8<Ua&&11>=Ua),x_=" ",y_=!1;function b_(t,n){switch(t){case"keyup":return Bk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yo=!1;function zk(t,n){switch(t){case"compositionend":return w_(n);case"keypress":return n.which!==32?null:(y_=!0,x_);case"textInput":return t=n.data,t===x_&&y_?null:t;default:return null}}function Ik(t,n){if(yo)return t==="compositionend"||!kd&&b_(t,n)?(t=f_(),wc=yd=jr=null,yo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return __&&n.locale!=="ko"?null:n.data;default:return null}}var Hk={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 S_(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Hk[t.type]:n==="textarea"}function C_(t,n,a,f){_o?xo?xo.push(f):xo=[f]:_o=f,n=Tu(n,"onChange"),0<n.length&&(a=new kc("onChange","change",null,a,f),t.push({event:a,listeners:n}))}var $a=null,qa=null;function Fk(t){hx(t,0)}function Tc(t){var n=Pa(t);if(s_(n))return t}function k_(t,n){if(t==="change")return n}var E_=!1;if(tr){var Ed;if(tr){var Td="oninput"in document;if(!Td){var T_=document.createElement("div");T_.setAttribute("oninput","return;"),Td=typeof T_.oninput=="function"}Ed=Td}else Ed=!1;E_=Ed&&(!document.documentMode||9<document.documentMode)}function R_(){$a&&($a.detachEvent("onpropertychange",A_),qa=$a=null)}function A_(t){if(t.propertyName==="value"&&Tc(qa)){var n=[];C_(n,qa,t,vd(t)),d_(Fk,n)}}function Uk(t,n,a){t==="focusin"?(R_(),$a=n,qa=a,$a.attachEvent("onpropertychange",A_)):t==="focusout"&&R_()}function $k(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tc(qa)}function qk(t,n){if(t==="click")return Tc(n)}function Vk(t,n){if(t==="input"||t==="change")return Tc(n)}function Wk(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Vn=typeof Object.is=="function"?Object.is:Wk;function Va(t,n){if(Vn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var a=Object.keys(t),f=Object.keys(n);if(a.length!==f.length)return!1;for(f=0;f<a.length;f++){var k=a[f];if(!Yt.call(n,k)||!Vn(t[k],n[k]))return!1}return!0}function Rd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function D_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function L_(t,n){var a=D_(t);t=0;for(var f;a;){if(a.nodeType===3){if(f=t+a.textContent.length,t<=n&&f>=n)return{node:a,offset:n-t};t=f}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=D_(a)}}function j_(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?j_(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function M_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Rd(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=Rd(t.document)}return n}function Ad(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Gk=tr&&"documentMode"in document&&11>=document.documentMode,bo=null,Dd=null,Wa=null,Ld=!1;function N_(t,n,a){var f=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ld||bo==null||bo!==Rd(f)||(f=bo,"selectionStart"in f&&Ad(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Wa&&Va(Wa,f)||(Wa=f,f=Tu(Dd,"onSelect"),0<f.length&&(n=new kc("onSelect","select",null,n,a),t.push({event:n,listeners:f}),n.target=bo)))}function Cs(t,n){var a={};return a[t.toLowerCase()]=n.toLowerCase(),a["Webkit"+t]="webkit"+n,a["Moz"+t]="moz"+n,a}var wo={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},jd={},O_={};tr&&(O_=document.createElement("div").style,"AnimationEvent"in window||(delete wo.animationend.animation,delete wo.animationiteration.animation,delete wo.animationstart.animation),"TransitionEvent"in window||delete wo.transitionend.transition);function ks(t){if(jd[t])return jd[t];if(!wo[t])return t;var n=wo[t],a;for(a in n)if(n.hasOwnProperty(a)&&a in O_)return jd[t]=n[a];return t}var B_=ks("animationend"),P_=ks("animationiteration"),z_=ks("animationstart"),Yk=ks("transitionrun"),Kk=ks("transitionstart"),Xk=ks("transitioncancel"),I_=ks("transitionend"),H_=new Map,Md="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Md.push("scrollEnd");function xi(t,n){H_.set(t,n),Ss(n,[t])}var Qk=0;function nr(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=Si.identifierPrefix;var a=Qk++;return t="_"+t+"t_"+a.toString(32)+"_",n.autoName=t}function F_(t){if(t==null||typeof t=="string")return t;var n=null,a=Uo;if(a!==null)for(var f=0;f<a.length;f++){var k=t[a[f]];if(k!=null){if(k==="none")return"none";n=n==null?k:n+(" "+k)}}return n??t.default}function ir(t,n){return t=F_(t),n=F_(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var Rc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},si=[],So=0,Nd=0;function Ac(){for(var t=So,n=Nd=So=0;n<t;){var a=si[n];si[n++]=null;var f=si[n];si[n++]=null;var k=si[n];si[n++]=null;var E=si[n];if(si[n++]=null,f!==null&&k!==null){var B=f.pending;B===null?k.next=k:(k.next=B.next,B.next=k),f.pending=k}E!==0&&U_(a,k,E)}}function Dc(t,n,a,f){si[So++]=t,si[So++]=n,si[So++]=a,si[So++]=f,Nd|=f,t.lanes|=f,t=t.alternate,t!==null&&(t.lanes|=f)}function Od(t,n,a,f){return Dc(t,n,a,f),Lc(t)}function Es(t,n){return Dc(t,null,null,n),Lc(t)}function U_(t,n,a){t.lanes|=a;var f=t.alternate;f!==null&&(f.lanes|=a);for(var k=!1,E=t.return;E!==null;)E.childLanes|=a,f=E.alternate,f!==null&&(f.childLanes|=a),E.tag===22&&(t=E.stateNode,t===null||t._visibility&1||(k=!0)),t=E,E=E.return;return t.tag===3?(E=t.stateNode,k&&n!==null&&(k=31-$n(a),t=E.hiddenUpdates,f=t[k],f===null?t[k]=[n]:f.push(n),n.lane=a|536870912),E):null}function Lc(t){if(50<pl)throw pl=0,yu=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Co={};function Zk(t,n,a,f){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(t,n,a,f){return new Zk(t,n,a,f)}function Bd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function rr(t,n){var a=t.alternate;return a===null?(a=Ln(t.tag,n,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=n,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&1206910976,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,n=t.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function $_(t,n){t.flags&=1206910978;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,n=a.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function jc(t,n,a,f,k,E){var B=0;if(f=t,typeof f=="function")Bd(f)&&(B=1);else if(typeof f=="string")B=E3(t,a,Ot.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(f){case Y:return t=Ln(31,a,n,k),t.elementType=Y,t.lanes=E,t;case z:return Ts(a.children,k,E,n);case P:B=8,k|=24;break;case H:return t=Ln(12,a,n,k|2),t.elementType=H,t.lanes=E,t;case Q:return t=Ln(13,a,n,k),t.elementType=Q,t.lanes=E,t;case X:return t=Ln(19,a,n,k),t.elementType=X,t.lanes=E,t;case Z:case V:return t=k|32,t=Ln(30,a,n,t),t.elementType=V,t.lanes=E,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case W:B=10;break e;case F:B=9;break e;case G:B=11;break e;case I:B=14;break e;case O:B=16,f=null;break e}B=29,a=Error(s(130,t===null?"null":typeof t,"")),f=null}return n=Ln(B,a,n,k),n.elementType=t,n.type=f,n.lanes=E,n}function Ts(t,n,a,f){return t=Ln(7,t,f,n),t.lanes=a,t}function Pd(t,n,a){return t=Ln(6,t,null,n),t.lanes=a,t}function q_(t){var n=Ln(18,null,null,0);return n.stateNode=t,n}function zd(t,n,a){return n=Ln(4,t.children!==null?t.children:[],t.key,n),n.lanes=a,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var V_=new WeakMap;function oi(t,n){if(typeof t=="object"&&t!==null){var a=V_.get(t);return a!==void 0?a:(n={value:t,source:n,stack:At(n)},V_.set(t,n),n)}return{value:t,source:n,stack:At(n)}}var ko=[],Eo=0,Mc=null,Ga=0,ai=[],li=0,Nr=null,Li=1,ji="";function sr(t,n){ko[Eo++]=Ga,ko[Eo++]=Mc,Mc=t,Ga=n}function W_(t,n,a){ai[li++]=Li,ai[li++]=ji,ai[li++]=Nr,Nr=t;var f=Li;t=ji;var k=32-$n(f)-1;f&=~(1<<k),a+=1;var E=32-$n(n)+k;if(30<E){var B=k-k%5;E=(f&(1<<B)-1).toString(32),f>>=B,k-=B,Li=1<<32-$n(n)+k|a<<k|f,ji=E+t}else Li=1<<E|a<<k|f,ji=t}function Nc(t){t.return!==null&&(sr(t,1),W_(t,1,0))}function Id(t){for(;t===Mc;)Mc=ko[--Eo],ko[Eo]=null,Ga=ko[--Eo],ko[Eo]=null;for(;t===Nr;)Nr=ai[--li],ai[li]=null,ji=ai[--li],ai[li]=null,Li=ai[--li],ai[li]=null}function G_(t,n){ai[li++]=Li,ai[li++]=ji,ai[li++]=Nr,Li=n.id,ji=n.overflow,Nr=t}var tn=null,Ct=null,Qe=!1,Or=null,ci=!1,Hd=Error(s(519));function Br(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ya(oi(n,t)),Hd}function Y_(t){var n=t.stateNode,a=t.type,f=t.memoizedProps;switch(n[cn]=t,n[Dn]=f,a){case"dialog":et("cancel",n),et("close",n);break;case"iframe":case"object":case"embed":et("load",n);break;case"video":case"audio":for(a=0;a<gl.length;a++)et(gl[a],n);break;case"source":et("error",n);break;case"img":case"image":case"link":et("error",n),et("load",n);break;case"details":et("toggle",n);break;case"input":et("invalid",n),o_(n,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":et("invalid",n);break;case"textarea":et("invalid",n),l_(n,f.value,f.defaultValue,f.children)}a=f.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||f.suppressHydrationWarning===!0||mx(n.textContent,a)?(f.popover!=null&&(et("beforetoggle",n),et("toggle",n)),f.onScroll!=null&&et("scroll",n),f.onScrollEnd!=null&&et("scrollend",n),f.onClick!=null&&(n.onclick=Di),n=!0):n=!1,n||Br(t,!0)}function Oc(t){for(tn=t.return;tn;)switch(tn.tag){case 5:case 31:case 13:ci=!1;return;case 27:case 3:ci=!0;return;default:tn=tn.return}}function To(t){if(t!==tn)return!1;if(!Qe)return Oc(t),Qe=!0,!1;var n=t.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||vp(t.type,t.memoizedProps)),a=!a),a&&Ct&&Br(t),Oc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Ct=Nx(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Ct=Nx(t)}else n===27?(n=Ct,Zr(t.type)?(t=Ep,Ep=null,Ct=t):Ct=n):Ct=tn?hi(t.stateNode.nextSibling):null;return!0}function Rs(){Ct=tn=null,Qe=!1}function Fd(){var t=Or;return t!==null&&(Nn===null?Nn=t:Nn.push.apply(Nn,t),Or=null),t}function Ya(t){Or===null?Or=[t]:Or.push(t)}var Ud=Ve(null),As=null,or=null;function Pr(t,n,a){Ie(Ud,n._currentValue),n._currentValue=a}function ar(t){t._currentValue=Ud.current,Ee(Ud)}function Bc(t,n,a){for(;t!==null;){var f=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,f!==null&&(f.childLanes|=n)):f!==null&&(f.childLanes&n)!==n&&(f.childLanes|=n),t===a)break;t=t.return}}function $d(t,n,a,f){var k=t.child;for(k!==null&&(k.return=t);k!==null;){var E=k.dependencies;if(E!==null){var B=k.child;E=E.firstContext;e:for(;E!==null;){var q=E;E=k;for(var J=0;J<n.length;J++)if(q.context===n[J]){E.lanes|=a,q=E.alternate,q!==null&&(q.lanes|=a),Bc(E.return,a,t),f||(B=null);break e}E=q.next}}else if(k.tag===18){if(B=k.return,B===null)throw Error(s(341));B.lanes|=a,E=B.alternate,E!==null&&(E.lanes|=a),Bc(B,a,t),B=null}else k.tag===13&&k.memoizedState!==null&&k.memoizedState.dehydrated===null?(k.lanes|=a,B=k.alternate,B!==null&&(B.lanes|=a),Bc(k.return,a,t),B=k.child,B=B!==null?B.sibling:null):B=k.child;if(B!==null)B.return=k;else for(B=k;B!==null;){if(B===t){B=null;break}if(k=B.sibling,k!==null){k.return=B.return,B=k;break}B=B.return}k=B}}function Ds(t,n,a,f){t=null;for(var k=n,E=!1;k!==null;){if(!E){if((k.flags&524288)!==0)E=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var B=k.alternate;if(B===null)throw Error(s(387));if(B=B.memoizedProps,B!==null){var q=k.type;Vn(k.pendingProps.value,B.value)||(t!==null?t.push(q):t=[q])}}else if(k===ze.current){if(B=k.alternate,B===null)throw Error(s(387));B.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(t!==null?t.push(Zo):t=[Zo])}k=k.return}return t!==null&&$d(n,t,a,f),n.flags|=262144,t!==null}function Pc(t){for(t=t.firstContext;t!==null;){if(!Vn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ls(t){As=t,or=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function un(t){return K_(As,t)}function zc(t,n){return As===null&&Ls(t),K_(t,n)}function K_(t,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},or===null){if(t===null)throw Error(s(308));or=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else or=or.next=n;return a}var Jk=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(a,f){t.push(f)}};this.abort=function(){n.aborted=!0,t.forEach(function(a){return a()})}},eE=e.unstable_scheduleCallback,tE=e.unstable_NormalPriority,It={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qd(){return{controller:new Jk,data:new Map,refCount:0}}function Ka(t){t.refCount--,t.refCount===0&&eE(tE,function(){t.controller.abort()})}function X_(t,n){if((t.pendingLanes&4194048)!==0){var a=t.transitionTypes;for(a===null&&(a=t.transitionTypes=[]),t=0;t<n.length;t++){var f=n[t];a.indexOf(f)===-1&&a.push(f)}}}var Xa=null;function nE(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var Qa=null,Vd=0,js=0,Ro=null;function iE(t,n){if(Qa===null){var a=Qa=[];Vd=0,js=lp(),Ro={status:"pending",value:void 0,then:function(f){a.push(f)}}}return Vd++,n.then(Q_,Q_),n}function Q_(){if(--Vd===0&&(Xa=null,Qa!==null)){Ro!==null&&(Ro.status="fulfilled");var t=Qa;Qa=null,js=0,Ro=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function rE(t,n){var a=[],f={status:"pending",value:null,reason:null,then:function(k){a.push(k)}};return t.then(function(){f.status="fulfilled",f.value=n;for(var k=0;k<a.length;k++)(0,a[k])(n)},function(k){for(f.status="rejected",f.reason=k,k=0;k<a.length;k++)(0,a[k])(void 0)}),f}var Z_=ue.S;ue.S=function(t,n){if(q0=Kt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&iE(t,n),Xa!==null)for(var a=Wo;a!==null;)X_(a,Xa),a=a.next;if(a=t.types,a!==null){for(var f=Wo;f!==null;)X_(f,a),f=f.next;if(js!==0){f=Xa,f===null&&(f=Xa=[]);for(var k=0;k<a.length;k++){var E=a[k];f.indexOf(E)===-1&&f.push(E)}}}Z_!==null&&Z_(t,n)};var Ms=Ve(null);function Wd(){var t=Ms.current;return t!==null?t:xt.pooledCache}function Ic(t,n){n===null?Ie(Ms,Ms.current):Ie(Ms,n.pool)}function J_(){var t=Wd();return t===null?null:{parent:It._currentValue,pool:t}}var Ao=Error(s(460)),Gd=Error(s(474)),Hc=Error(s(542)),Fc={then:function(){}};function e1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function t1(t,n,a){switch(a=t[a],a===void 0?t.push(n):a!==n&&(n.then(Di,Di),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,i1(t),t===void 0&&!("reason"in n)?Error(s(600)):t;default:if(typeof n.status=="string")n.then(Di,Di);else{if(t=xt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(f){if(n.status==="pending"){var k=n;k.status="fulfilled",k.value=f}},function(f){if(n.status==="pending"){var k=n;k.status="rejected",k.reason=f}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,i1(t),t}throw Os=n,Ao}}function Ns(t){try{var n=t._init;return n(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Os=a,Ao):a}}var Os=null;function n1(){if(Os===null)throw Error(s(459));var t=Os;return Os=null,t}function i1(t){if(t===Ao||t===Hc)throw Error(s(483))}var Do=null,Za=0;function Uc(t){var n=Za;return Za+=1,Do===null&&(Do=[]),t1(Do,t,n)}function zr(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function $c(t,n){throw n.$$typeof===A?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function r1(t){function n(re,te){if(t){var ae=re.deletions;ae===null?(re.deletions=[te],re.flags|=16):ae.push(te)}}function a(re,te){if(!t)return null;for(;te!==null;)n(re,te),te=te.sibling;return null}function f(re){for(var te=new Map;re!==null;)re.key===null?te.set(re.index,re):te.set(re.key,re),re=re.sibling;return te}function k(re,te){return re=rr(re,te),re.index=0,re.sibling=null,re}function E(re,te,ae){return re.index=ae,t?(ae=re.alternate,ae!==null?(ae=ae.index,ae<te?(re.flags|=2,te):ae):(re.flags|=134217730,te)):(re.flags|=1048576,te)}function B(re){return t&&re.alternate===null&&(re.flags|=134217730),re}function q(re,te,ae,pe){return te===null||te.tag!==6?(te=Pd(ae,re.mode,pe),te.return=re,te):(te=k(te,ae),te.return=re,te)}function J(re,te,ae,pe){var Ae=ae.type;return Ae===z?(re=de(re,te,ae.props.children,pe,ae.key),zr(re,ae),re):te!==null&&(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&Ns(Ae)===te.type)?(te=k(te,ae.props),zr(te,ae),te.return=re,te):(te=jc(ae.type,ae.key,ae.props,null,re.mode,pe),zr(te,ae),te.return=re,te)}function se(re,te,ae,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==ae.containerInfo||te.stateNode.implementation!==ae.implementation?(te=zd(ae,re.mode,pe),te.return=re,te):(te=k(te,ae.children||[]),te.return=re,te)}function de(re,te,ae,pe,Ae){return te===null||te.tag!==7?(te=Ts(ae,re.mode,pe,Ae),te.return=re,te):(te=k(te,ae),te.return=re,te)}function me(re,te,ae){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Pd(""+te,re.mode,ae),te.return=re,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case M:return ae=jc(te.type,te.key,te.props,null,re.mode,ae),zr(ae,te),ae.return=re,ae;case j:return te=zd(te,re.mode,ae),te.return=re,te;case O:return te=Ns(te),me(re,te,ae)}if(ee(te)||K(te))return te=Ts(te,re.mode,ae,null),te.return=re,te;if(typeof te.then=="function")return me(re,Uc(te),ae);if(te.$$typeof===W)return me(re,zc(re,te),ae);$c(re,te)}return null}function ie(re,te,ae,pe){var Ae=te!==null?te.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Ae!==null?null:q(re,te,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case M:return ae.key===Ae?J(re,te,ae,pe):null;case j:return ae.key===Ae?se(re,te,ae,pe):null;case O:return ae=Ns(ae),ie(re,te,ae,pe)}if(ee(ae)||K(ae))return Ae!==null?null:de(re,te,ae,pe,null);if(typeof ae.then=="function")return ie(re,te,Uc(ae),pe);if(ae.$$typeof===W)return ie(re,te,zc(re,ae),pe);$c(re,ae)}return null}function ce(re,te,ae,pe,Ae){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return re=re.get(ae)||null,q(te,re,""+pe,Ae);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case M:return re=re.get(pe.key===null?ae:pe.key)||null,J(te,re,pe,Ae);case j:return re=re.get(pe.key===null?ae:pe.key)||null,se(te,re,pe,Ae);case O:return pe=Ns(pe),ce(re,te,ae,pe,Ae)}if(ee(pe)||K(pe))return re=re.get(ae)||null,de(te,re,pe,Ae,null);if(typeof pe.then=="function")return ce(re,te,ae,Uc(pe),Ae);if(pe.$$typeof===W)return ce(re,te,ae,zc(te,pe),Ae);$c(te,pe)}return null}function ke(re,te,ae,pe){for(var Ae=null,nt=null,Ne=te,Pe=te=0,Ut=null;Ne!==null&&Pe<ae.length;Pe++){Ne.index>Pe?(Ut=Ne,Ne=null):Ut=Ne.sibling;var st=ie(re,Ne,ae[Pe],pe);if(st===null){Ne===null&&(Ne=Ut);break}t&&Ne&&st.alternate===null&&n(re,Ne),te=E(st,te,Pe),nt===null?Ae=st:nt.sibling=st,nt=st,Ne=Ut}if(Pe===ae.length)return a(re,Ne),Qe&&sr(re,Pe),Ae;if(Ne===null){for(;Pe<ae.length;Pe++)Ne=me(re,ae[Pe],pe),Ne!==null&&(te=E(Ne,te,Pe),nt===null?Ae=Ne:nt.sibling=Ne,nt=Ne);return Qe&&sr(re,Pe),Ae}for(Ne=f(Ne);Pe<ae.length;Pe++)Ut=ce(Ne,re,Pe,ae[Pe],pe),Ut!==null&&(t&&(st=Ut.alternate,st!==null&&Ne.delete(st.key===null?Pe:st.key)),te=E(Ut,te,Pe),nt===null?Ae=Ut:nt.sibling=Ut,nt=Ut);return t&&Ne.forEach(function(is){return n(re,is)}),Qe&&sr(re,Pe),Ae}function Me(re,te,ae,pe){if(ae==null)throw Error(s(151));for(var Ae=null,nt=null,Ne=te,Pe=te=0,Ut=null,st=ae.next();Ne!==null&&!st.done;Pe++,st=ae.next()){Ne.index>Pe?(Ut=Ne,Ne=null):Ut=Ne.sibling;var is=ie(re,Ne,st.value,pe);if(is===null){Ne===null&&(Ne=Ut);break}t&&Ne&&is.alternate===null&&n(re,Ne),te=E(is,te,Pe),nt===null?Ae=is:nt.sibling=is,nt=is,Ne=Ut}if(st.done)return a(re,Ne),Qe&&sr(re,Pe),Ae;if(Ne===null){for(;!st.done;Pe++,st=ae.next())st=me(re,st.value,pe),st!==null&&(te=E(st,te,Pe),nt===null?Ae=st:nt.sibling=st,nt=st);return Qe&&sr(re,Pe),Ae}for(Ne=f(Ne);!st.done;Pe++,st=ae.next())st=ce(Ne,re,Pe,st.value,pe),st!==null&&(t&&(Ut=st.alternate,Ut!==null&&Ne.delete(Ut.key===null?Pe:Ut.key)),te=E(st,te,Pe),nt===null?Ae=st:nt.sibling=st,nt=st);return t&&Ne.forEach(function(z3){return n(re,z3)}),Qe&&sr(re,Pe),Ae}function Ye(re,te,ae,pe){if(typeof ae=="object"&&ae!==null&&ae.type===z&&ae.key===null&&ae.props.ref===void 0&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case M:e:{for(var Ae=ae.key;te!==null;){if(te.key===Ae){if(Ae=ae.type,Ae===z){if(te.tag===7){a(re,te.sibling),pe=k(te,ae.props.children),zr(pe,ae),pe.return=re,re=pe;break e}}else if(te.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===O&&Ns(Ae)===te.type){a(re,te.sibling),pe=k(te,ae.props),zr(pe,ae),pe.return=re,re=pe;break e}a(re,te);break}else n(re,te);te=te.sibling}ae.type===z?(pe=Ts(ae.props.children,re.mode,pe,ae.key),zr(pe,ae),pe.return=re,re=pe):(pe=jc(ae.type,ae.key,ae.props,null,re.mode,pe),zr(pe,ae),pe.return=re,re=pe)}return B(re);case j:e:{for(Ae=ae.key;te!==null;){if(te.key===Ae)if(te.tag===4&&te.stateNode.containerInfo===ae.containerInfo&&te.stateNode.implementation===ae.implementation){a(re,te.sibling),pe=k(te,ae.children||[]),pe.return=re,re=pe;break e}else{a(re,te);break}else n(re,te);te=te.sibling}pe=zd(ae,re.mode,pe),pe.return=re,re=pe}return B(re);case O:return ae=Ns(ae),Ye(re,te,ae,pe)}if(ee(ae))return ke(re,te,ae,pe);if(K(ae)){if(Ae=K(ae),typeof Ae!="function")throw Error(s(150));return ae=Ae.call(ae),Me(re,te,ae,pe)}if(typeof ae.then=="function")return Ye(re,te,Uc(ae),pe);if(ae.$$typeof===W)return Ye(re,te,zc(re,ae),pe);$c(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,te!==null&&te.tag===6?(a(re,te.sibling),pe=k(te,ae),pe.return=re,re=pe):(a(re,te),pe=Pd(ae,re.mode,pe),pe.return=re,re=pe),B(re)):a(re,te)}return function(re,te,ae,pe){try{Za=0;var Ae=Ye(re,te,ae,pe);return Do=null,Ae}catch(Ne){if(Ne===Ao||Ne===Hc)throw Ne;var nt=Ln(29,Ne,null,re.mode);return nt.lanes=pe,nt.return=re,nt}finally{}}}var Bs=r1(!0),s1=r1(!1),Ir=!1;function Yd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Hr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Fr(t,n,a){var f=t.updateQueue;if(f===null)return null;if(f=f.shared,(ct&2)!==0){var k=f.pending;return k===null?n.next=n:(n.next=k.next,k.next=n),f.pending=n,n=Lc(t),U_(t,null,a),n}return Dc(t,f,n,a),Lc(t)}function Ja(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var f=n.lanes;f&=t.pendingLanes,a|=f,n.lanes=a,Wv(t,a)}}function Xd(t,n){var a=t.updateQueue,f=t.alternate;if(f!==null&&(f=f.updateQueue,a===f)){var k=null,E=null;if(a=a.firstBaseUpdate,a!==null){do{var B={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};E===null?k=E=B:E=E.next=B,a=a.next}while(a!==null);E===null?k=E=n:E=E.next=n}else k=E=n;a={baseState:f.baseState,firstBaseUpdate:k,lastBaseUpdate:E,shared:f.shared,callbacks:f.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var Qd=!1;function el(){if(Qd){var t=Ro;if(t!==null)throw t}}function tl(t,n,a,f){Qd=!1;var k=t.updateQueue;Ir=!1;var E=k.firstBaseUpdate,B=k.lastBaseUpdate,q=k.shared.pending;if(q!==null){k.shared.pending=null;var J=q,se=J.next;J.next=null,B===null?E=se:B.next=se,B=J;var de=t.alternate;de!==null&&(de=de.updateQueue,q=de.lastBaseUpdate,q!==B&&(q===null?de.firstBaseUpdate=se:q.next=se,de.lastBaseUpdate=J))}if(E!==null){var me=k.baseState;B=0,de=se=J=null,q=E;do{var ie=q.lane&-536870913,ce=ie!==q.lane;if(ce?(tt&ie)===ie:(f&ie)===ie){ie!==0&&ie===js&&(Qd=!0),de!==null&&(de=de.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var ke=t,Me=q;ie=n;var Ye=a;switch(Me.tag){case 1:if(ke=Me.payload,typeof ke=="function"){me=ke.call(Ye,me,ie);break e}me=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Me.payload,ie=typeof ke=="function"?ke.call(Ye,me,ie):ke,ie==null)break e;me=L({},me,ie);break e;case 2:Ir=!0}}ie=q.callback,ie!==null&&(t.flags|=64,ce&&(t.flags|=8192),ce=k.callbacks,ce===null?k.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:q.tag,payload:q.payload,callback:q.callback,next:null},de===null?(se=de=ce,J=me):de=de.next=ce,B|=ie;if(q=q.next,q===null){if(q=k.shared.pending,q===null)break;ce=q,q=ce.next,ce.next=null,k.lastBaseUpdate=ce,k.shared.pending=null}}while(!0);de===null&&(J=me),k.baseState=J,k.firstBaseUpdate=se,k.lastBaseUpdate=de,E===null&&(k.shared.lanes=0),Yr|=B,t.lanes=B,t.memoizedState=me}}function o1(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function a1(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)o1(a[t],n)}var Ur=Ve(null),qc=Ve(0);function l1(t,n){t=dr,Ie(qc,t),Ie(Ur,n),dr=t|n.baseLanes}function Zd(){Ie(qc,dr),Ie(Ur,Ur.current)}function Jd(){dr=qc.current,Ee(Ur),Ee(qc)}var hn=Ve(null),yn=null;function $r(t){var n=t.alternate;Ie(dn,dn.current&1),Ie(hn,t),yn===null&&(n===null||Ur.current!==null||n.memoizedState!==null)&&(yn=t)}function ef(t){Ie(dn,dn.current),Ie(hn,t),yn===null&&(yn=t)}function c1(t){t.tag===22?(Ie(dn,dn.current),Ie(hn,t),yn===null&&(yn=t)):qr()}function qr(){Ie(dn,dn.current),Ie(hn,hn.current)}function Wn(t){Ee(hn),yn===t&&(yn=null),Ee(dn)}var dn=Ve(0);function nl(t,n){Ie(hn,hn.current),Ie(dn,n)}function tf(t){Ee(dn),Ee(hn),yn===t&&(yn=null)}function Vc(t){for(var n=t;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Cp(a)||kp(a)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var lr=0,Ge=null,vt=null,Ht=null,Wc=!1,Lo=!1,Ps=!1,Gc=0,il=0,jo=null,sE=0;function Lt(){throw Error(s(321))}function nf(t,n){if(n===null)return!1;for(var a=0;a<n.length&&a<t.length;a++)if(!Vn(t[a],n[a]))return!1;return!0}function rf(t,n,a,f,k,E){return lr=E,Ge=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ue.H=t===null||t.memoizedState===null?W1:G1,Ps=!1,E=a(f,k),Ps=!1,Lo&&(E=h1(n,a,f,k)),u1(t),E}function u1(t){ue.H=eu;var n=vt!==null&&vt.next!==null;if(lr=0,Ht=vt=Ge=null,Wc=!1,il=0,jo=null,n)throw Error(s(300));t===null||Ft||(t=t.dependencies,t!==null&&Pc(t)&&(Ft=!0))}function h1(t,n,a,f){Ge=t;var k=0;do{if(Lo&&(jo=null),il=0,Lo=!1,25<=k)throw Error(s(301));if(k+=1,Ht=vt=null,t.updateQueue!=null){var E=t.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}ue.H=fE,E=n(a,f)}while(Lo);return E}function oE(){var t=ue.H,n=t.useState()[0];return n=typeof n.then=="function"?rl(n):n,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(Ge.flags|=1024),n}function sf(){var t=Gc!==0;return Gc=0,t}function of(t,n,a){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~a}function af(t){if(Wc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Wc=!1}lr=0,Ht=vt=Ge=null,Lo=!1,il=Gc=0,jo=null}function kn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Ge.memoizedState=Ht=t:Ht=Ht.next=t,Ht}function Bt(){if(vt===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var n=Ht===null?Ge.memoizedState:Ht.next;if(n!==null)Ht=n,vt=t;else{if(t===null)throw Ge.alternate===null?Error(s(467)):Error(s(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Ht===null?Ge.memoizedState=Ht=t:Ht=Ht.next=t}return Ht}function Yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rl(t){var n=il;return il+=1,jo===null&&(jo=[]),t=t1(jo,t,n),n=Ge,(Ht===null?n.memoizedState:Ht.next)===null&&(n=n.alternate,ue.H=n===null||n.memoizedState===null?W1:G1),t}function Kc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return rl(t);if(t.$$typeof===ne)return;if(t.$$typeof===W)return un(t)}throw Error(s(438,String(t)))}function lf(t){var n=null,a=Ge.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var f=Ge.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(n={data:f.data.map(function(k){return k.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Yc(),Ge.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(t),f=0;f<t;f++)a[f]=U;return n.index++,a}function cr(t,n){return typeof n=="function"?n(t):n}function Xc(t){var n=Bt();return cf(n,vt,t)}function cf(t,n,a){var f=t.queue;if(f===null)throw Error(s(311));f.lastRenderedReducer=a;var k=t.baseQueue,E=f.pending;if(E!==null){if(k!==null){var B=k.next;k.next=E.next,E.next=B}n.baseQueue=k=E,f.pending=null}if(E=t.baseState,k===null)t.memoizedState=E;else{n=k.next;var q=B=null,J=null,se=n,de=!1;do{var me=se.lane&-536870913;if(me!==se.lane?(tt&me)===me:(lr&me)===me){var ie=se.revertLane;if(ie===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),me===js&&(de=!0);else if((lr&ie)===ie){se=se.next,ie===js&&(de=!0);continue}else me={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=me,B=E):J=J.next=me,Ge.lanes|=ie,Yr|=ie;me=se.action,Ps&&a(E,me),E=se.hasEagerState?se.eagerState:a(E,me)}else ie={lane:me,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},J===null?(q=J=ie,B=E):J=J.next=ie,Ge.lanes|=me,Yr|=me;se=se.next}while(se!==null&&se!==n);if(J===null?B=E:J.next=q,!Vn(E,t.memoizedState)&&(Ft=!0,de&&(a=Ro,a!==null)))throw a;t.memoizedState=E,t.baseState=B,t.baseQueue=J,f.lastRenderedState=E}return k===null&&(f.lanes=0),[t.memoizedState,f.dispatch]}function uf(t){var n=Bt(),a=n.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var f=a.dispatch,k=a.pending,E=n.memoizedState;if(k!==null){a.pending=null;var B=k=k.next;do E=t(E,B.action),B=B.next;while(B!==k);Vn(E,n.memoizedState)||(Ft=!0),n.memoizedState=E,n.baseQueue===null&&(n.baseState=E),a.lastRenderedState=E}return[E,f]}function d1(t,n,a){var f=Ge,k=Bt(),E=Qe;if(E){if(a===void 0)throw Error(s(407));a=a()}else a=n();var B=!Vn((vt||k).memoizedState,a);if(B&&(k.memoizedState=a,Ft=!0),k=k.queue,ff(m1.bind(null,f,k,t),[t]),t=k.getSnapshot!==n||B||Ht!==null&&(Ht.memoizedState.tag&1)!==0,Mo(t?9:8,{destroy:void 0},p1.bind(null,f,k,a,n),null),t){if(f.flags|=2048,xt===null)throw Error(s(349));E||(lr&127)!==0||f1(f,n,a)}return a}function f1(t,n,a){t.flags|=16384,t={getSnapshot:n,value:a},n=Ge.updateQueue,n===null?(n=Yc(),Ge.updateQueue=n,n.stores=[t]):(a=n.stores,a===null?n.stores=[t]:a.push(t))}function p1(t,n,a,f){n.value=a,n.getSnapshot=f,g1(n)&&v1(t)}function m1(t,n,a){return a(function(){g1(n)&&v1(t)})}function g1(t){var n=t.getSnapshot;t=t.value;try{var a=n();return!Vn(t,a)}catch{return!0}}function v1(t){var n=Es(t,2);n!==null&&On(n,t,2)}function hf(t){var n=kn();if(typeof t=="function"){var a=t;if(t=a(),Ps){Lr(!0);try{a()}finally{Lr(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:t},n}function _1(t,n,a,f){return t.baseState=a,cf(t,vt,typeof f=="function"?f:cr)}function aE(t,n,a,f,k){if(Jc(t))throw Error(s(485));if(t=n.action,t!==null){var E={payload:k,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){E.listeners.push(B)}};ue.T!==null?a(!0):E.isTransition=!1,f(E),a=n.pending,a===null?(E.next=n.pending=E,x1(n,E)):(E.next=a.next,n.pending=a.next=E)}}function x1(t,n){var a=n.action,f=n.payload,k=t.state;if(n.isTransition){var E=ue.T,B={};B.types=E!==null?E.types:null,ue.T=B;try{var q=a(k,f),J=ue.S;J!==null&&J(B,q),y1(t,n,q)}catch(se){df(t,n,se)}finally{E!==null&&B.types!==null&&(E.types=B.types),ue.T=E}}else try{E=a(k,f),y1(t,n,E)}catch(se){df(t,n,se)}}function y1(t,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(f){b1(t,n,f)},function(f){return df(t,n,f)}):b1(t,n,a)}function b1(t,n,a){n.status="fulfilled",n.value=a,w1(n),t.state=a,n=t.pending,n!==null&&(a=n.next,a===n?t.pending=null:(a=a.next,n.next=a,x1(t,a)))}function df(t,n,a){var f=t.pending;if(t.pending=null,f!==null){f=f.next;do n.status="rejected",n.reason=a,w1(n),n=n.next;while(n!==f)}t.action=null}function w1(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function S1(t,n){return n}function C1(t,n){if(Qe){var a=xt.formState;if(a!==null){e:{var f=Ge;if(Qe){if(Ct){t:{for(var k=Ct,E=ci;k.nodeType!==8;){if(!E){k=null;break t}if(k=hi(k.nextSibling),k===null){k=null;break t}}E=k.data,k=E==="F!"||E==="F"?k:null}if(k){Ct=hi(k.nextSibling),f=k.data==="F!";break e}}Br(f)}f=!1}f&&(n=a[0])}}return a=kn(),a.memoizedState=a.baseState=n,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:S1,lastRenderedState:n},a.queue=f,a=$1.bind(null,Ge,f),f.dispatch=a,f=hf(!1),E=_f.bind(null,Ge,!1,f.queue),f=kn(),k={state:n,dispatch:null,action:t,pending:null},f.queue=k,a=aE.bind(null,Ge,k,E,a),k.dispatch=a,f.memoizedState=t,[n,a,!1]}function k1(t){var n=Bt();return E1(n,vt,t)}function E1(t,n,a){if(n=cf(t,n,S1)[0],t=Xc(cr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var f=rl(n)}catch(B){throw B===Ao?Hc:B}else f=n;n=Bt();var k=n.queue,E=k.dispatch;return a!==n.memoizedState&&(Ge.flags|=2048,Mo(9,{destroy:void 0},lE.bind(null,k,a),null)),[f,E,t]}function lE(t,n){t.action=n}function T1(t){var n=Bt(),a=vt;if(a!==null)return E1(n,a,t);Bt(),n=n.memoizedState,a=Bt();var f=a.queue.dispatch;return a.memoizedState=t,[n,f,!1]}function Mo(t,n,a,f){return t={tag:t,create:a,deps:f,inst:n,next:null},n=Ge.updateQueue,n===null&&(n=Yc(),Ge.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=t.next=t:(f=a.next,a.next=t,t.next=f,n.lastEffect=t),t}function R1(){return Bt().memoizedState}function Qc(t,n,a,f){var k=kn();Ge.flags|=t,k.memoizedState=Mo(1|n,{destroy:void 0},a,f===void 0?null:f)}function Zc(t,n,a,f){var k=Bt();f=f===void 0?null:f;var E=k.memoizedState.inst;vt!==null&&f!==null&&nf(f,vt.memoizedState.deps)?k.memoizedState=Mo(n,E,a,f):(Ge.flags|=t,k.memoizedState=Mo(1|n,E,a,f))}function A1(t,n){Qc(8390656,8,t,n)}function ff(t,n){Zc(2048,8,t,n)}function cE(t){Ge.flags|=4;var n=Ge.updateQueue;if(n===null)n=Yc(),Ge.updateQueue=n,n.events=[t];else{var a=n.events;a===null?n.events=[t]:a.push(t)}}function D1(t){var n=Bt().memoizedState;return cE({ref:n,nextImpl:t}),function(){if((ct&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function L1(t,n){return Zc(4,2,t,n)}function j1(t,n){return Zc(4,4,t,n)}function M1(t,n){if(typeof n=="function"){t=t();var a=n(t);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function N1(t,n,a){a=a!=null?a.concat([t]):null,Zc(4,4,M1.bind(null,n,t),a)}function pf(){}function O1(t,n){var a=Bt();n=n===void 0?null:n;var f=a.memoizedState;return n!==null&&nf(n,f[1])?f[0]:(a.memoizedState=[t,n],t)}function B1(t,n){var a=Bt();n=n===void 0?null:n;var f=a.memoizedState;if(n!==null&&nf(n,f[1]))return f[0];if(f=t(),Ps){Lr(!0);try{t()}finally{Lr(!1)}}return a.memoizedState=[f,n],f}function mf(t,n,a){return a===void 0||(lr&1073741824)!==0&&(tt&261930)===0?t.memoizedState=n:(t.memoizedState=a,t=W0(),Ge.lanes|=t,Yr|=t,a)}function P1(t,n,a,f){return Vn(a,n)?a:Ur.current!==null?(t=mf(t,a,f),Vn(t,n)||(Ft=!0),t):(lr&106)===0||(lr&1073741824)!==0&&(tt&261930)===0?(Ft=!0,t.memoizedState=a):(t=W0(),Ge.lanes|=t,Yr|=t,n)}function z1(t,n,a,f,k){var E=he.p;he.p=E!==0&&8>E?E:8;var B=ue.T,q={};q.types=B!==null?B.types:null,ue.T=q,_f(t,!1,n,a);try{var J=k(),se=ue.S;if(se!==null&&se(q,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var de=rE(J,f);sl(t,n,de,Xn(t))}else sl(t,n,f,Xn(t))}catch(me){sl(t,n,{then:function(){},status:"rejected",reason:me},Xn())}finally{he.p=E,B!==null&&q.types!==null&&(B.types=q.types),ue.T=B}}function uE(){}function gf(t,n,a,f){if(t.tag!==5)throw Error(s(476));var k=I1(t).queue;z1(t,k,n,Se,a===null?uE:function(){return H1(t),a(f)})}function I1(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Se,baseState:Se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:Se},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function H1(t){var n=I1(t);n.next===null&&(n=t.alternate.memoizedState),sl(t,n.next.queue,{},Xn())}function vf(){return un(Zo)}function F1(){return Bt().memoizedState}function U1(){return Bt().memoizedState}function hE(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=Xn();t=Hr(a);var f=Fr(n,t,a);f!==null&&(On(f,n,a),Ja(f,n,a)),n={cache:qd()},t.payload=n;return}n=n.return}}function dE(t,n,a){var f=Xn();a={lane:f,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Jc(t)?q1(n,a):(a=Od(t,n,a,f),a!==null&&(On(a,t,f),V1(a,n,f)))}function $1(t,n,a){var f=Xn();sl(t,n,a,f)}function sl(t,n,a,f){var k={lane:f,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Jc(t))q1(n,k);else{var E=t.alternate;if(t.lanes===0&&(E===null||E.lanes===0)&&(E=n.lastRenderedReducer,E!==null))try{var B=n.lastRenderedState,q=E(B,a);if(k.hasEagerState=!0,k.eagerState=q,Vn(q,B))return Dc(t,n,k,0),xt===null&&Ac(),!1}catch{}finally{}if(a=Od(t,n,k,f),a!==null)return On(a,t,f),V1(a,n,f),!0}return!1}function _f(t,n,a,f){if(f={lane:2,revertLane:lp(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Jc(t)){if(n)throw Error(s(479))}else n=Od(t,a,f,2),n!==null&&On(n,t,2)}function Jc(t){var n=t.alternate;return t===Ge||n!==null&&n===Ge}function q1(t,n){Lo=Wc=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function V1(t,n,a){if((a&4194048)!==0){var f=n.lanes;f&=t.pendingLanes,a|=f,n.lanes=a,Wv(t,a)}}var eu={readContext:un,use:Kc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt,useEffectEvent:Lt},W1={readContext:un,use:Kc,useCallback:function(t,n){return kn().memoizedState=[t,n===void 0?null:n],t},useContext:un,useEffect:A1,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Qc(4194308,4,M1.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Qc(4194308,4,t,n)},useInsertionEffect:function(t,n){Qc(4,2,t,n)},useMemo:function(t,n){var a=kn();n=n===void 0?null:n;var f=t();if(Ps){Lr(!0);try{t()}finally{Lr(!1)}}return a.memoizedState=[f,n],f},useReducer:function(t,n,a){var f=kn();if(a!==void 0){var k=a(n);if(Ps){Lr(!0);try{a(n)}finally{Lr(!1)}}}else k=n;return f.memoizedState=f.baseState=k,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:k},f.queue=t,t=t.dispatch=dE.bind(null,Ge,t),[f.memoizedState,t]},useRef:function(t){var n=kn();return t={current:t},n.memoizedState=t},useState:function(t){t=hf(t);var n=t.queue,a=$1.bind(null,Ge,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:pf,useDeferredValue:function(t,n){var a=kn();return mf(a,t,n)},useTransition:function(){var t=hf(!1);return t=z1.bind(null,Ge,t.queue,!0,!1),kn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var f=Ge,k=kn();if(Qe){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),xt===null)throw Error(s(349));(tt&127)!==0||f1(f,n,a)}k.memoizedState=a;var E={value:a,getSnapshot:n};return k.queue=E,A1(m1.bind(null,f,E,t),[t]),f.flags|=2048,Mo(9,{destroy:void 0},p1.bind(null,f,E,a,n),null),a},useId:function(){var t=kn(),n=xt.identifierPrefix;if(Qe){var a=ji,f=Li;a=(f&~(1<<32-$n(f)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Gc++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=sE++,n="_"+n+"r_"+a.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:vf,useFormState:C1,useActionState:C1,useOptimistic:function(t){var n=kn();n.memoizedState=n.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=_f.bind(null,Ge,!0,a),a.dispatch=n,[t,n]},useMemoCache:lf,useCacheRefresh:function(){return kn().memoizedState=hE.bind(null,Ge)},useEffectEvent:function(t){var n=kn(),a={impl:t};return n.memoizedState=a,function(){if((ct&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},G1={readContext:un,use:Kc,useCallback:O1,useContext:un,useEffect:ff,useImperativeHandle:N1,useInsertionEffect:L1,useLayoutEffect:j1,useMemo:B1,useReducer:Xc,useRef:R1,useState:function(){return Xc(cr)},useDebugValue:pf,useDeferredValue:function(t,n){var a=Bt();return P1(a,vt.memoizedState,t,n)},useTransition:function(){var t=Xc(cr)[0],n=Bt().memoizedState;return[typeof t=="boolean"?t:rl(t),n]},useSyncExternalStore:d1,useId:F1,useHostTransitionStatus:vf,useFormState:k1,useActionState:k1,useOptimistic:function(t,n){var a=Bt();return _1(a,vt,t,n)},useMemoCache:lf,useCacheRefresh:U1,useEffectEvent:D1},fE={readContext:un,use:Kc,useCallback:O1,useContext:un,useEffect:ff,useImperativeHandle:N1,useInsertionEffect:L1,useLayoutEffect:j1,useMemo:B1,useReducer:uf,useRef:R1,useState:function(){return uf(cr)},useDebugValue:pf,useDeferredValue:function(t,n){var a=Bt();return vt===null?mf(a,t,n):P1(a,vt.memoizedState,t,n)},useTransition:function(){var t=uf(cr)[0],n=Bt().memoizedState;return[typeof t=="boolean"?t:rl(t),n]},useSyncExternalStore:d1,useId:F1,useHostTransitionStatus:vf,useFormState:T1,useActionState:T1,useOptimistic:function(t,n){var a=Bt();return vt!==null?_1(a,vt,t,n):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:lf,useCacheRefresh:U1,useEffectEvent:D1};function xf(t,n,a,f){n=t.memoizedState,a=a(f,n),a=a==null?n:L({},n,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var yf={enqueueSetState:function(t,n,a){t=t._reactInternals;var f=Xn(),k=Hr(f);k.payload=n,a!=null&&(k.callback=a),n=Fr(t,k,f),n!==null&&(On(n,t,f),Ja(n,t,f))},enqueueReplaceState:function(t,n,a){t=t._reactInternals;var f=Xn(),k=Hr(f);k.tag=1,k.payload=n,a!=null&&(k.callback=a),n=Fr(t,k,f),n!==null&&(On(n,t,f),Ja(n,t,f))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var a=Xn(),f=Hr(a);f.tag=2,n!=null&&(f.callback=n),n=Fr(t,f,a),n!==null&&(On(n,t,a),Ja(n,t,a))}};function Y1(t,n,a,f,k,E,B){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(f,E,B):n.prototype&&n.prototype.isPureReactComponent?!Va(a,f)||!Va(k,E):!0}function K1(t,n,a,f){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,f),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,f),n.state!==t&&yf.enqueueReplaceState(n,n.state,null)}function zs(t,n){var a=n;if("ref"in n){a={};for(var f in n)f!=="ref"&&(a[f]=n[f])}if(t=t.defaultProps){a===n&&(a=L({},a));for(var k in t)a[k]===void 0&&(a[k]=t[k])}return a}function X1(t){Rc(t)}function Q1(t){console.error(t)}function Z1(t){Rc(t)}function tu(t,n){try{var a=t.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(f){setTimeout(function(){throw f})}}function J1(t,n,a){try{var f=t.onCaughtError;f(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function bf(t,n,a){return a=Hr(a),a.tag=3,a.payload={element:null},a.callback=function(){tu(t,n)},a}function e0(t){return t=Hr(t),t.tag=3,t}function t0(t,n,a,f){var k=a.type.getDerivedStateFromError;if(typeof k=="function"){var E=f.value;t.payload=function(){return k(E)},t.callback=function(){J1(n,a,f)}}var B=a.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(t.callback=function(){J1(n,a,f),typeof k!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var q=f.stack;this.componentDidCatch(f.value,{componentStack:q!==null?q:""})})}function pE(t,n,a,f,k){if(a.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(n=a.alternate,n!==null&&Ds(n,a,k,!0),a=hn.current,a!==null){switch(a.tag){case 31:case 13:case 19:return yn===null?wu():a.alternate===null&&jt===0&&(jt=3),a.flags&=-257,a.flags|=65536,a.lanes=k,f===Fc?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([f]):n.add(f),sp(t,f,k)),!1;case 22:return a.flags|=65536,f===Fc?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([f])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([f]):a.add(f)),sp(t,f,k)),!1}throw Error(s(435,a.tag))}return sp(t,f,k),wu(),!1}if(Qe)return n=hn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=k,f!==Hd&&(t=Error(s(422),{cause:f}),Ya(oi(t,a)))):(f!==Hd&&(n=Error(s(423),{cause:f}),Ya(oi(n,a))),t=t.current.alternate,t.flags|=65536,k&=-k,t.lanes|=k,f=oi(f,a),k=bf(t.stateNode,f,k),Xd(t,k),jt!==4&&(jt=2)),!1;var E=Error(s(520),{cause:f});if(E=oi(E,a),fl===null?fl=[E]:fl.push(E),jt!==4&&(jt=2),n===null)return!0;f=oi(f,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,t=k&-k,a.lanes|=t,t=bf(a.stateNode,f,t),Xd(a,t),!1;case 1:if(n=a.type,E=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Kr===null||!Kr.has(E))))return a.flags|=65536,k&=-k,a.lanes|=k,k=e0(k),t0(k,t,a,f),Xd(a,k),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var wf=Error(s(461)),Ft=!1;function Qt(t,n,a,f){n.child=t===null?s1(n,null,a,f):Bs(n,t.child,a,f)}function n0(t,n,a,f,k){a=a.render;var E=n.ref;if("ref"in f){var B={};for(var q in f)q!=="ref"&&(B[q]=f[q])}else B=f;return Ls(n),f=rf(t,n,a,B,E,k),q=sf(),t!==null&&!Ft?(of(t,n,k),ur(t,n,k)):(Qe&&q&&Nc(n),n.flags|=1,Qt(t,n,f,k),n.child)}function i0(t,n,a,f,k){if(t===null){var E=a.type;return typeof E=="function"&&!Bd(E)&&E.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=E,r0(t,n,E,f,k)):(t=jc(a.type,null,f,n,n.mode,k),t.ref=n.ref,t.return=n,n.child=t)}if(E=t.child,!Df(t,k)){var B=E.memoizedProps;if(a=a.compare,a=a!==null?a:Va,a(B,f)&&t.ref===n.ref)return ur(t,n,k)}return n.flags|=1,t=rr(E,f),t.ref=n.ref,t.return=n,n.child=t}function r0(t,n,a,f,k){if(t!==null){var E=t.memoizedProps;if(Va(E,f)&&t.ref===n.ref)if(Ft=!1,n.pendingProps=f=E,Df(t,k))(t.flags&131072)!==0&&(Ft=!0);else return n.lanes=t.lanes,ur(t,n,k)}return Sf(t,n,a,f,k)}function s0(t,n,a,f){var k=f.children,E=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((n.flags&128)!==0){if(E=E!==null?E.baseLanes|a:a,t!==null){for(f=n.child=t.child,k=0;f!==null;)k=k|f.lanes|f.childLanes,f=f.sibling;f=k&~E}else f=0,n.child=null;return o0(t,n,E,a,f)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ic(n,E!==null?E.cachePool:null),E!==null?l1(n,E):Zd(),c1(n);else return f=n.lanes=536870912,o0(t,n,E!==null?E.baseLanes|a:a,a,f)}else E!==null?(Ic(n,E.cachePool),l1(n,E),qr(),n.memoizedState=null):(t!==null&&Ic(n,null),Zd(),qr());return Qt(t,n,k,a),n.child}function ol(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function o0(t,n,a,f,k){var E=Wd();return E=E===null?null:{parent:It._currentValue,pool:E},n.memoizedState={baseLanes:a,cachePool:E},t!==null&&Ic(n,null),Zd(),c1(n),t!==null&&Ds(t,n,f,!0),n.childLanes=k,null}function nu(t,n){return n=iu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function a0(t,n,a){return Bs(n,t.child,null,a),t=nu(n,n.pendingProps),t.flags|=2,Wn(n),n.memoizedState=null,t}function mE(t,n,a){var f=n.pendingProps,k=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Qe){if(f.mode==="hidden")return t=nu(n,f),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},ol(null,t);if(ef(n),(t=Ct)?(t=Mx(t,ci),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Nr!==null?{id:Li,overflow:ji}:null,retryLane:536870912,hydrationErrors:null},a=q_(t),a.return=n,n.child=a,tn=n,Ct=null)):t=null,t===null)throw Br(n);return n.lanes=536870912,null}return nu(n,f)}var E=t.memoizedState;if(E!==null){var B=E.dehydrated;if(ef(n),k)if(n.flags&256)n.flags&=-257,n=a0(t,n,a);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(Ft||Ds(t,n,a,!1),k=(a&t.childLanes)!==0,Ft||k){if(Ur.current===null){if(f=xt,f!==null&&(B=Gv(f,a),B!==0&&B!==E.retryLane))throw E.retryLane=B,Es(t,B),On(f,t,B),wf;wu()}n=a0(t,n,a)}else t=E.treeContext,Ct=hi(B.nextSibling),tn=n,Qe=!0,Or=null,ci=!1,t!==null&&G_(n,t),n=nu(n,f),n.flags|=134221824;return n}return t=rr(t.child,{mode:f.mode,children:f.children}),t.ref=n.ref,n.child=t,t.return=n,t}function No(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function Sf(t,n,a,f,k){return Ls(n),a=rf(t,n,a,f,void 0,k),f=sf(),t!==null&&!Ft?(of(t,n,k),ur(t,n,k)):(Qe&&f&&Nc(n),n.flags|=1,Qt(t,n,a,k),n.child)}function l0(t,n,a,f,k,E){return Ls(n),n.updateQueue=null,a=h1(n,f,a,k),u1(t),f=sf(),t!==null&&!Ft?(of(t,n,E),ur(t,n,E)):(Qe&&f&&Nc(n),n.flags|=1,Qt(t,n,a,E),n.child)}function c0(t,n,a,f,k){if(Ls(n),n.stateNode===null){var E=Co,B=a.contextType;typeof B=="object"&&B!==null&&(E=un(B)),E=new a(f,E),n.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=yf,n.stateNode=E,E._reactInternals=n,E=n.stateNode,E.props=f,E.state=n.memoizedState,E.refs={},Yd(n),B=a.contextType,E.context=typeof B=="object"&&B!==null?un(B):Co,E.state=n.memoizedState,B=a.getDerivedStateFromProps,typeof B=="function"&&(xf(n,a,B,f),E.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(B=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),B!==E.state&&yf.enqueueReplaceState(E,E.state,null),tl(n,f,E,k),el(),E.state=n.memoizedState),typeof E.componentDidMount=="function"&&(n.flags|=4194308),f=!0}else if(t===null){E=n.stateNode;var q=n.memoizedProps,J=zs(a,q);E.props=J;var se=E.context,de=a.contextType;B=Co,typeof de=="object"&&de!==null&&(B=un(de));var me=a.getDerivedStateFromProps;de=typeof me=="function"||typeof E.getSnapshotBeforeUpdate=="function",q=n.pendingProps!==q,de||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(q||se!==B)&&K1(n,E,f,B),Ir=!1;var ie=n.memoizedState;E.state=ie,tl(n,f,E,k),el(),se=n.memoizedState,q||ie!==se||Ir?(typeof me=="function"&&(xf(n,a,me,f),se=n.memoizedState),(J=Ir||Y1(n,a,J,f,ie,se,B))?(de||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=f,n.memoizedState=se),E.props=f,E.state=se,E.context=B,f=J):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),f=!1)}else{E=n.stateNode,Kd(t,n),B=n.memoizedProps,de=zs(a,B),E.props=de,me=n.pendingProps,ie=E.context,se=a.contextType,J=Co,typeof se=="object"&&se!==null&&(J=un(se)),q=a.getDerivedStateFromProps,(se=typeof q=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(B!==me||ie!==J)&&K1(n,E,f,J),Ir=!1,ie=n.memoizedState,E.state=ie,tl(n,f,E,k),el();var ce=n.memoizedState;B!==me||ie!==ce||Ir||t!==null&&t.dependencies!==null&&Pc(t.dependencies)?(typeof q=="function"&&(xf(n,a,q,f),ce=n.memoizedState),(de=Ir||Y1(n,a,de,f,ie,ce,J)||t!==null&&t.dependencies!==null&&Pc(t.dependencies))?(se||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(f,ce,J),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(f,ce,J)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||B===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),n.memoizedProps=f,n.memoizedState=ce),E.props=f,E.state=ce,E.context=J,f=de):(typeof E.componentDidUpdate!="function"||B===t.memoizedProps&&ie===t.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ie===t.memoizedState||(n.flags|=1024),f=!1)}return E=f,No(t,n),f=(n.flags&128)!==0,E||f?(E=n.stateNode,a=f&&typeof a.getDerivedStateFromError!="function"?null:E.render(),n.flags|=1,t!==null&&f?(n.child=Bs(n,t.child,null,k),n.child=Bs(n,null,a,k)):Qt(t,n,a,k),n.memoizedState=E.state,t=n.child):t=ur(t,n,k),t}function u0(t,n,a,f){return Rs(),n.flags|=256,Qt(t,n,a,f),n.child}var Cf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kf(t){return{baseLanes:t,cachePool:J_()}}function Ef(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=Kn),t}function h0(t,n,a){var f=n.pendingProps,k=!1,E=(n.flags&128)!==0,B;if((B=E)||(B=t!==null&&t.memoizedState===null?!1:(dn.current&2)!==0),B&&(k=!0,n.flags&=-129),B=(n.flags&32)!==0,n.flags&=-33,t===null){if(Qe){if(k?$r(n):qr(),(t=Ct)?(t=Mx(t,ci),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Nr!==null?{id:Li,overflow:ji}:null,retryLane:536870912,hydrationErrors:null},a=q_(t),a.return=n,n.child=a,tn=n,Ct=null)):t=null,t===null)throw Br(n);return kp(t)?n.lanes=32:n.lanes=536870912,null}return E=f.children,f=f.fallback,k?(qr(),k=n.mode,E=iu({mode:"hidden",children:E},k),f=Ts(f,k,a,null),E.return=n,f.return=n,E.sibling=f,n.child=E,f=n.child,f.memoizedState=kf(a),f.childLanes=Ef(t,B,a),n.memoizedState=Cf,ol(null,f)):($r(n),Tf(n,E))}var q=t.memoizedState;if(q!==null){var J=q.dehydrated;if(J!==null)return gE(t,n,E,B,f,J,q,a)}return k?(qr(),k=f.fallback,E=n.mode,q=t.child,J=q.sibling,f=rr(q,{mode:"hidden",children:f.children}),f.subtreeFlags=q.subtreeFlags&1206910976,J!==null?k=rr(J,k):(k=Ts(k,E,a,null),k.flags|=2),k.return=n,f.return=n,f.sibling=k,n.child=f,ol(null,f),f=n.child,k=t.child.memoizedState,k===null?k=kf(a):(E=k.cachePool,E!==null?(q=It._currentValue,E=E.parent!==q?{parent:q,pool:q}:E):E=J_(),k={baseLanes:k.baseLanes|a,cachePool:E}),f.memoizedState=k,f.childLanes=Ef(t,B,a),n.memoizedState=Cf,ol(t.child,f)):($r(n),a=t.child,t=a.sibling,a=rr(a,{mode:"visible",children:f.children}),a.return=n,a.sibling=null,t!==null&&(B=n.deletions,B===null?(n.deletions=[t],n.flags|=16):B.push(t)),n.child=a,n.memoizedState=null,a)}function Tf(t,n){return n=iu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function iu(t,n){return t=Ln(22,t,null,n),t.lanes=0,t}function ru(t,n,a){return Bs(n,t.child,null,a),t=Tf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function gE(t,n,a,f,k,E,B,q){if(a)return n.flags&256?($r(n),n.flags&=-257,ru(t,n,q)):n.memoizedState!==null?(qr(),n.child=t.child,n.flags|=128,null):(qr(),E=k.fallback,B=n.mode,k=iu({mode:"visible",children:k.children},B),E=Ts(E,B,q,null),E.flags|=2,k.return=n,E.return=n,k.sibling=E,n.child=k,Bs(n,t.child,null,q),k=n.child,k.memoizedState=kf(q),k.childLanes=Ef(t,f,q),n.memoizedState=Cf,ol(null,k));if($r(n),kp(E)){if(f=E.nextSibling&&E.nextSibling.dataset,f)var J=f.dgst;return f=J,f!==""&&(k=Error(s(419)),k.stack="",k.digest=f,Ya({value:k,source:null,stack:null})),ru(t,n,q)}if(Ft||Ds(t,n,q,!1),f=(q&t.childLanes)!==0,Ft||f){if(Ur.current!==null)return ru(t,n,q);if(f=xt,f!==null&&(k=Gv(f,q),k!==0&&k!==B.retryLane))throw B.retryLane=k,Es(t,k),On(f,t,k),wf;return Cp(E)||wu(),ru(t,n,q)}return Cp(E)?(n.flags|=192,n.child=t.child,null):(t=B.treeContext,Ct=hi(E.nextSibling),tn=n,Qe=!0,Or=null,ci=!1,t!==null&&G_(n,t),n=Tf(n,k.children),n.flags|=134221824,n)}function d0(t,n,a){t.lanes|=n;var f=t.alternate;f!==null&&(f.lanes|=n),Bc(t.return,n,a)}function f0(t){for(var n=null;t!==null;){var a=t.alternate;a!==null&&Vc(a)===null&&(n=t),t=t.sibling}return n}function su(t,n,a,f,k,E){var B=t.memoizedState;B===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:f,tail:a,tailMode:k,treeForkCount:E}:(B.isBackwards=n,B.rendering=null,B.renderingStartTime=0,B.last=f,B.tail=a,B.tailMode=k,B.treeForkCount=E)}function Rf(t){var n=t.child;for(t.child=null;n!==null;){var a=n.sibling;n.sibling=t.child,t.child=n,n=a}}function Af(t,n,a){var f=n.pendingProps,k=f.revealOrder,E=f.tail;f=f.children;var B=dn.current;if(n.flags&128)return nl(n,B),null;var q=(B&2)!==0;if(q?(B=B&1|2,n.flags|=128):B&=1,nl(n,B),k==="backwards"&&t!==null?(Rf(t),Qt(t,n,f,a),Rf(t)):Qt(t,n,f,a),f=Qe?Ga:0,!q&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&d0(t,a,n);else if(t.tag===19)d0(t,a,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(k){case"backwards":a=f0(n.child),a===null?(k=n.child,n.child=null):(k=a.sibling,a.sibling=null,Rf(n)),su(n,!0,k,null,E,f);break;case"unstable_legacy-backwards":for(a=null,k=n.child,n.child=null;k!==null;){if(t=k.alternate,t!==null&&Vc(t)===null){n.child=k;break}t=k.sibling,k.sibling=a,a=k,k=t}su(n,!0,a,null,E,f);break;case"together":su(n,!1,null,null,void 0,f);break;case"independent":n.memoizedState=null;break;default:a=f0(n.child),a===null?(k=n.child,n.child=null):(k=a.sibling,a.sibling=null),su(n,!1,k,a,E,f)}return n.child}function p0(t,n,a){var f=n.pendingProps;return Pr(n,n.type,f.value),Qt(t,n,f.children,a),n.child}function ur(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),Yr|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(Ds(t,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,a=rr(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=rr(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function Df(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Pc(t)))}function vE(t,n,a){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),Pr(n,It,t.memoizedState.cache),Rs();break;case 27:case 5:gt(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:Pr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,ef(n),null;break;case 13:var f=n.memoizedState;if(f!==null){if(f.dehydrated!==null)return $r(n),n.flags|=128,null;f=Ds(t,n,a,!1);var k=n.child.childLanes;return f||(a&k)!==0?h0(t,n,a):($r(n),t=ur(t,n,a),t!==null?t.sibling:null)}$r(n);break;case 19:if(n.flags&128)return Af(t,n,a);if(k=(t.flags&128)!==0,f=(a&n.childLanes)!==0,f||(Ds(t,n,a,!1),f=(a&n.childLanes)!==0),k){if(f)return Af(t,n,a);n.flags|=128}if(k=n.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),nl(n,dn.current),f)break;return null;case 22:return n.lanes=0,s0(t,n,a,n.pendingProps);case 24:Pr(n,It,t.memoizedState.cache)}return ur(t,n,a)}function m0(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ft=!0;else{if(!Df(t,a)&&(n.flags&128)===0)return Ft=!1,vE(t,n,a);Ft=(t.flags&131072)!==0}else Ft=!1,Qe&&(n.flags&1048576)!==0&&W_(n,Ga,n.index);switch(n.lanes=0,n.tag){case 16:e:{var f=n.pendingProps;if(t=Ns(n.elementType),n.type=t,typeof t=="function")Bd(t)?(f=zs(t,f),n.tag=1,n=c0(null,n,t,f,a)):(n.tag=0,n=Sf(null,n,t,f,a));else{if(t!=null){var k=t.$$typeof;if(k===G){n.tag=11,n=n0(null,n,t,f,a);break e}else if(k===I){n.tag=14,n=i0(null,n,t,f,a);break e}else if(k===W){n.tag=10,n.type=t,n=p0(null,n,a);break e}}throw n=oe(t)||t,Error(s(306,n,""))}}return n;case 0:return Sf(t,n,n.type,n.pendingProps,a);case 1:return f=n.type,k=zs(f,n.pendingProps),c0(t,n,f,k,a);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(s(387));f=n.pendingProps;var E=n.memoizedState;k=E.element,Kd(t,n),tl(n,f,null,a);var B=n.memoizedState;if(f=B.cache,Pr(n,It,f),f!==E.cache&&$d(n,[It],a,!0),el(),f=B.element,E.isDehydrated)if(E={element:f,isDehydrated:!1,cache:B.cache},n.updateQueue.baseState=E,n.memoizedState=E,n.flags&256){n=u0(t,n,f,a);break e}else if(f!==k){k=oi(Error(s(424)),n),Ya(k),n=u0(t,n,f,a);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ct=hi(t.firstChild),tn=n,Qe=!0,Or=null,ci=!0,a=s1(n,null,f,a),n.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling}else{if(Rs(),f===k){n=ur(t,n,a);break e}Qt(t,n,f,a)}n=n.child}return n;case 26:return No(t,n),t===null?(a=Hx(n.type,null,n.pendingProps,null))?n.memoizedState=a:Qe||(n.stateNode=xx(n.type,n.pendingProps,Be.current,n)):n.memoizedState=Hx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return gt(n),t===null&&Qe&&(f=n.stateNode=Bx(n.type,n.pendingProps,Be.current),tn=n,ci=!0,k=Ct,Zr(n.type)?(Ep=k,Ct=hi(f.firstChild)):Ct=k),Qt(t,n,n.pendingProps.children,a),No(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Qe&&((k=f=Ct)&&(f=h3(f,n.type,n.pendingProps,ci),f!==null?(n.stateNode=f,tn=n,Ct=hi(f.firstChild),ci=!1,k=!0):k=!1),k||Br(n)),gt(n),k=n.type,E=n.pendingProps,B=t!==null?t.memoizedProps:null,f=E.children,vp(k,E)?f=null:B!==null&&vp(k,B)&&(n.flags|=32),n.memoizedState!==null&&(k=rf(t,n,oE,null,null,a),Zo._currentValue=k),No(t,n),Qt(t,n,f,a),n.child;case 6:return t===null&&Qe&&((t=a=Ct)&&(a=d3(a,n.pendingProps,ci),a!==null?(n.stateNode=a,tn=n,Ct=null,t=!0):t=!1),t||Br(n)),null;case 13:return h0(t,n,a);case 4:return Te(n,n.stateNode.containerInfo),f=n.pendingProps,t===null?n.child=Bs(n,null,f,a):Qt(t,n,f,a),n.child;case 11:return n0(t,n,n.type,n.pendingProps,a);case 7:return f=n.pendingProps,No(t,n),Qt(t,n,f,a),n.child;case 8:return Qt(t,n,n.pendingProps.children,a),n.child;case 12:return Qt(t,n,n.pendingProps.children,a),n.child;case 10:return p0(t,n,a);case 9:return k=n.type._context,f=n.pendingProps.children,Ls(n),k=un(k),f=f(k),n.flags|=1,Qt(t,n,f,a),n.child;case 14:return i0(t,n,n.type,n.pendingProps,a);case 15:return r0(t,n,n.type,n.pendingProps,a);case 19:return Af(t,n,a);case 31:return mE(t,n,a);case 22:return s0(t,n,a,n.pendingProps);case 24:return Ls(n),f=un(It),t===null?(k=Wd(),k===null&&(k=xt,E=qd(),k.pooledCache=E,E.refCount++,E!==null&&(k.pooledCacheLanes|=a),k=E),n.memoizedState={parent:f,cache:k},Yd(n),Pr(n,It,k)):((t.lanes&a)!==0&&(Kd(t,n),tl(n,null,null,a),el()),k=t.memoizedState,E=n.memoizedState,k.parent!==f?(k={parent:f,cache:f},n.memoizedState=k,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=k),Pr(n,It,f)):(f=E.cache,Pr(n,It,f),f!==k.cache&&$d(n,[It],a,!0))),Qt(t,n,n.pendingProps.children,a),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),f=n.pendingProps,f.name!=null&&f.name!=="auto"?n.flags|=t===null?18882560:18874368:Qe&&Nc(n),t!==null&&t.memoizedProps.name!==f.name?n.flags|=4194816:No(t,n),Qt(t,n,f.children,a),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function hr(t){t.flags|=4}function Lf(t,n,a,f,k){var E;if((E=(t.mode&32)!==0)&&(E=a===null?qx(n,f):qx(n,f)&&(f.src!==a.src||f.srcSet!==a.srcSet)),E){if(t.flags|=16777216,(k&335544128)===k)if(t.stateNode.complete)t.flags|=8192;else if(X0())t.flags|=8192;else throw Os=Fc,Gd}else t.flags&=-16777217}function g0(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Vx(n))if(X0())t.flags|=8192;else throw Os=Fc,Gd}function ou(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?qv():536870912,t.lanes|=n,Io|=n)}function al(t,n){if(!Qe)switch(t.tailMode){case"visible":break;case"collapsed":for(var a=t.tail,f=null;a!==null;)a.alternate!==null&&(f=a),a=a.sibling;f===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:f.sibling=null;break;default:for(n=t.tail,a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null}}function kt(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,f=0;if(n)for(var k=t.child;k!==null;)a|=k.lanes|k.childLanes,f|=k.subtreeFlags&1206910976,f|=k.flags&1206910976,k.return=t,k=k.sibling;else for(k=t.child;k!==null;)a|=k.lanes|k.childLanes,f|=k.subtreeFlags,f|=k.flags,k.return=t,k=k.sibling;return t.subtreeFlags|=f,t.childLanes=a,n}function _E(t,n,a){var f=n.pendingProps;switch(Id(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return a=n.stateNode,f=null,t!==null&&(f=t.memoizedState.cache),n.memoizedState.cache!==f&&(n.flags|=2048),ar(It),We(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(To(n)?hr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Fd())),kt(n),null;case 26:var k=n.type,E=n.memoizedState;return t===null?(hr(n),E!==null?(kt(n),g0(n,E)):(kt(n),Lf(n,k,null,f,a))):E?E!==t.memoizedState?(hr(n),kt(n),g0(n,E)):(kt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==f&&hr(n),kt(n),Lf(n,k,t,f,a)),null;case 27:if(ot(n),a=Be.current,k=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==f&&hr(n);else{if(!f){if(n.stateNode===null)throw Error(s(166));return kt(n),n.subtreeFlags&=-33554433,null}t=Ot.current,To(n)?Y_(n):(t=Bx(k,f,a),n.stateNode=t,hr(n))}return kt(n),n.subtreeFlags&=-33554433,null;case 5:if(ot(n),k=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==f&&hr(n);else{if(!f){if(n.stateNode===null)throw Error(s(166));return kt(n),n.subtreeFlags&=-33554433,null}if(E=Ot.current,To(n))Y_(n);else{var B=_l(Be.current);switch(E){case 1:E=B.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:E=B.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":E=B.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":E=B.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":E=B.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof f.is=="string"?B.createElement("select",{is:f.is}):B.createElement("select"),f.multiple?E.multiple=!0:f.size&&(E.size=f.size);break;default:E=typeof f.is=="string"?B.createElement(k,{is:f.is}):B.createElement(k)}}E[cn]=n,E[Dn]=f;e:for(B=n.child;B!==null;){if(B.tag===5||B.tag===6)E.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===n)break e;for(;B.sibling===null;){if(B.return===null||B.return===n)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}n.stateNode=E;e:switch(pn(E,k,f),k){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&hr(n)}}return kt(n),n.subtreeFlags&=-33554433,Lf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==f&&hr(n);else{if(typeof f!="string"&&n.stateNode===null)throw Error(s(166));if(t=Be.current,To(n)){if(t=n.stateNode,a=n.memoizedProps,f=null,k=tn,k!==null)switch(k.tag){case 27:case 5:f=k.memoizedProps}t[cn]=n,t=!!(t.nodeValue===a||f!==null&&f.suppressHydrationWarning===!0||mx(t.nodeValue,a)),t||Br(n,!0)}else t=_l(t).createTextNode(f),t[cn]=n,n.stateNode=t}return kt(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(f=To(n),a!==null){if(t===null){if(!f)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[cn]=n}else Rs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),t=!1}else a=Fd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(Wn(n),n):(Wn(n),null);if((n.flags&128)!==0)throw Error(s(558))}return kt(n),null;case 13:if(f=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(k=To(n),f!==null&&f.dehydrated!==null){if(t===null){if(!k)throw Error(s(318));if(k=n.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(s(317));k[cn]=n}else Rs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),k=!1}else k=Fd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=k),k=!0;if(!k)return n.flags&256?(Wn(n),n):(Wn(n),null)}return Wn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=f!==null,t=t!==null&&t.memoizedState!==null,a&&(f=n.child,k=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(k=f.alternate.memoizedState.cachePool.pool),E=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(E=f.memoizedState.cachePool.pool),E!==k&&(f.flags|=2048)),a!==t&&a&&(n.child.flags|=8192),ou(n,n.updateQueue),kt(n),null);case 4:return We(),t===null&&dp(n.stateNode.containerInfo),n.flags|=67108864,kt(n),null;case 10:return ar(n.type),kt(n),null;case 19:if(tf(n),f=n.memoizedState,f===null)return kt(n),null;if(k=(n.flags&128)!==0,E=f.rendering,E===null)if(k)al(f,!1);else{if(jt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(E=Vc(t),E!==null){for(n.flags|=128,al(f,!1),t=E.updateQueue,n.updateQueue=t,ou(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)$_(a,t),a=a.sibling;return nl(n,dn.current&1|2),Qe&&sr(n,f.treeForkCount),n.child}t=t.sibling}f.tail!==null&&Kt()>_u&&(n.flags|=128,k=!0,al(f,!1),n.lanes=4194304)}else{if(!k)if(t=Vc(E),t!==null){if(n.flags|=128,k=!0,t=t.updateQueue,n.updateQueue=t,ou(n,t),al(f,!0),f.tail===null&&f.tailMode!=="collapsed"&&f.tailMode!=="visible"&&!E.alternate&&!Qe)return kt(n),null}else 2*Kt()-f.renderingStartTime>_u&&a!==536870912&&(n.flags|=128,k=!0,al(f,!1),n.lanes=4194304);f.isBackwards?(E.sibling=n.child,n.child=E):(t=f.last,t!==null?t.sibling=E:n.child=E,f.last=E)}if(f.tail!==null){t=f.tail;e:{for(a=t;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return f.rendering=t,f.tail=t.sibling,f.renderingStartTime=Kt(),t.sibling=null,E=dn.current,E=k?E&1|2:E&1,f.tailMode==="visible"||f.tailMode==="collapsed"||!a||Qe?nl(n,E):(a=E,Ie(hn,n),Ie(dn,a),yn===null&&(yn=n)),Qe&&sr(n,f.treeForkCount),t}return kt(n),null;case 22:case 23:return Wn(n),Jd(),f=n.memoizedState!==null,t!==null?t.memoizedState!==null!==f&&(n.flags|=8192):f&&(n.flags|=8192),f?(a&536870912)!==0&&(n.flags&128)===0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),a=n.updateQueue,a!==null&&ou(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),f=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(f=n.memoizedState.cachePool.pool),f!==a&&(n.flags|=2048),t!==null&&Ee(Ms),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),ar(It),kt(n),null;case 25:return null;case 30:return n.flags|=33554432,kt(n),null}throw Error(s(156,n.tag))}function xE(t,n){switch(Id(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ar(It),We(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return ot(n),null;case 31:if(n.memoizedState!==null){if(Wn(n),n.alternate===null)throw Error(s(340));Rs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Wn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Rs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return tf(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return We(),null;case 10:return ar(n.type),null;case 22:case 23:return Wn(n),Jd(),t!==null&&Ee(Ms),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ar(It),null;case 25:return null;default:return null}}function v0(t,n){switch(Id(n),n.tag){case 3:ar(It),We();break;case 26:case 27:case 5:ot(n);break;case 4:We();break;case 31:n.memoizedState!==null&&Wn(n);break;case 13:Wn(n);break;case 19:tf(n);break;case 10:ar(n.type);break;case 22:case 23:Wn(n),Jd(),t!==null&&Ee(Ms);break;case 24:ar(It)}}function ll(t,n){try{var a=n.updateQueue,f=a!==null?a.lastEffect:null;if(f!==null){var k=f.next;a=k;do{if((a.tag&t)===t){f=void 0;var E=a.create,B=a.inst;f=E(),B.destroy=f}a=a.next}while(a!==k)}}catch(q){ft(n,n.return,q)}}function Vr(t,n,a){try{var f=n.updateQueue,k=f!==null?f.lastEffect:null;if(k!==null){var E=k.next;f=E;do{if((f.tag&t)===t){var B=f.inst,q=B.destroy;if(q!==void 0){B.destroy=void 0,k=n;var J=a,se=q;try{se()}catch(de){ft(k,J,de)}}}f=f.next}while(f!==E)}}catch(de){ft(n,n.return,de)}}function _0(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{a1(n,a)}catch(f){ft(t,t.return,f)}}}function x0(t,n,a){a.props=zs(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(f){ft(t,n,f)}}function Mi(t,n){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var f=t.stateNode;break;case 30:var k=t.stateNode,E=nr(t.memoizedProps,k);(k.ref===null||k.ref.name!==E)&&(k.ref=Ex(E)),f=k.ref;break;case 7:if(t.stateNode===null){var B=new Qn(t);c(t.child,!1,c3,B,void 0,void 0),t.stateNode=B}f=t.stateNode;break;default:f=t.stateNode}typeof a=="function"?t.refCleanup=a(f):a.current=f}}catch(q){ft(t,n,q)}}function fn(t,n){var a=t.ref,f=t.refCleanup;if(a!==null)if(typeof f=="function")try{f()}catch(k){ft(t,n,k)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(k){ft(t,n,k)}else a.current=null}function au(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var a=0;a<n.length;a++)jx(t.stateNode,n[a])}function y0(t){for(var n=t.return;n!==null&&(Mf(n)&&jx(t.stateNode,n.stateNode),!jf(n));)n=n.return}function cl(t){for(var n=t.return;n!==null&&(Mf(n)&&u3(t.stateNode,n.stateNode),!jf(n));)n=n.return}function jf(t){return t.tag===5||t.tag===3||t.tag===27}function Mf(t){return t&&t.tag===7&&t.stateNode!==null}function Nf(t){var n=t.type,a=t.memoizedProps,f=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&f.focus();break e;case"img":a.src?f.src=a.src:a.srcSet&&(f.srcset=a.srcSet)}}catch(k){ft(t,t.return,k)}}function Of(t,n,a){try{var f=t.stateNode;VE(f,t.type,a,n),f[Dn]=n}catch(k){ft(t,t.return,k)}}function b0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Zr(t.type)||t.tag===4}function Bf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||b0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Zr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pf(t,n,a,f){var k=t.tag;if(k===5||k===6)k=t.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(k,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(k),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Di)),au(t,f),at=!0;else if(k!==4&&(k===27&&(au(t,f),f=null,Zr(t.type)&&(a=t.stateNode,n=null)),t=t.child,t!==null))for(Pf(t,n,a,f),t=t.sibling;t!==null;)Pf(t,n,a,f),t=t.sibling}function lu(t,n,a,f){var k=t.tag;if(k===5||k===6)k=t.stateNode,n?a.insertBefore(k,n):a.appendChild(k),au(t,f),at=!0;else if(k!==4&&(k===27&&(au(t,f),f=null,Zr(t.type)&&(a=t.stateNode)),t=t.child,t!==null))for(lu(t,n,a,f),t=t.sibling;t!==null;)lu(t,n,a,f),t=t.sibling}function w0(t){var n=t.stateNode,a=t.memoizedProps;try{for(var f=t.type,k=n.attributes;k.length;)n.removeAttributeNode(k[0]);pn(n,f,a),n[cn]=t,n[Dn]=a}catch(E){ft(t,t.return,E)}}var cu=!1,Gn=null;function S0(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(cu=!0)}var Ni=null;function C0(){var t=Ni;return Ni=null,t}var jn=0;function Oo(t,n,a,f,k){return jn=0,k0(t.child,n,a,f,k)}function k0(t,n,a,f,k){for(var E=!1;t!==null;){if(t.tag===5){var B=t.stateNode;if(f!==null){var q=yp(B);f.push(q),q.view&&(E=!0)}else E||yp(B).view&&(E=!0);cu=!0,Cx(B,jn===0?n:n+"_"+jn,a),jn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&k||k0(t.child,n,a,f,k)&&(E=!0));t=t.sibling}return E}function Oi(t,n){for(;t!==null;)t.tag===5?kx(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Oi(t.child,n)),t=t.sibling}function uu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(uu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var n=t.memoizedProps;if(n.name==null||n.name==="auto")throw Error(s(544));var a=n.name;n=ir(n.default,n.share),n!=="none"&&(Oo(t,a,n,null,!1)||Oi(t.child,!1))}t=t.sibling}}function zf(t,n){if(t.tag===30){var a=t.stateNode,f=t.memoizedProps,k=nr(f,a),E=ir(f.default,a.paired?f.share:f.enter);E!=="none"?Oo(t,k,E,null,!1)?(uu(t),a.paired||n||$o(t,f.onEnter)):Oi(t.child,!1):uu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)zf(t,n),t=t.sibling;else uu(t)}function If(t){if(Gn!==null&&Gn.size!==0){var n=Gn;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var a=t.memoizedProps,f=a.name;if(f!=null&&f!=="auto"){var k=n.get(f);if(k!==void 0){var E=ir(a.default,a.share);if(E!=="none"&&(Oo(t,f,E,null,!1)?(E=t.stateNode,k.paired=E,E.paired=k,$o(t,a.onShare)):Oi(t.child,!1)),n.delete(f),n.size===0)break}}}If(t)}t=t.sibling}}}function Hf(t){if(t.tag===30){var n=t.memoizedProps,a=nr(n,t.stateNode),f=Gn!==null?Gn.get(a):void 0,k=ir(n.default,f!==void 0?n.share:n.exit);k!=="none"&&(Oo(t,a,k,null,!1)?f!==void 0?(k=t.stateNode,f.paired=k,k.paired=f,Gn.delete(a),$o(t,n.onShare)):$o(t,n.onExit):Oi(t.child,!1)),Gn!==null&&If(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Hf(t),t=t.sibling;else Gn!==null&&If(t)}function E0(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,a=nr(n,t.stateNode);n=ir(n.default,n.update),t.flags&=-5,n!=="none"&&Oo(t,a,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&E0(t);t=t.sibling}}function Ff(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var n=t.stateNode;n.paired!==null&&(n.paired=null,Oi(t.child,!1))}Ff(t)}t=t.sibling}}function hu(t){if(t.tag===30)t.stateNode.paired=null,Oi(t.child,!1),Ff(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)hu(t),t=t.sibling;else Ff(t)}function T0(t){for(t=t.child;t!==null;)t.tag===30?Oi(t.child,!1):(t.subtreeFlags&33554432)!==0&&T0(t),t=t.sibling}function Uf(t,n,a,f,k,E,B){for(var q=!1;n!==null;){if(n.tag===5){var J=n.stateNode;if(E!==null&&jn<E.length){var se=E[jn],de=yp(J);(se.view||de.view)&&(q=!0);var me;if(me=(t.flags&4)===0)if(de.clip)me=!0;else{me=se.rect;var ie=de.rect;me=me.y!==ie.y||me.x!==ie.x||me.height!==ie.height||me.width!==ie.width}me&&(t.flags|=4),de.abs?de=!se.abs:(se=se.rect,de=de.rect,de=se.height!==de.height||se.width!==de.width),de&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&Cx(J,jn===0?a:a+"_"+jn,k),q&&(t.flags&4)!==0||(Ni===null&&(Ni=[]),Ni.push(J,jn===0?f:f+"_"+jn,n.memoizedProps)),jn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&B?t.flags|=n.flags&32:Uf(t,n.child,a,f,k,E,B)&&(q=!0));n=n.sibling}return q}function R0(t,n){for(t=t.child;t!==null;){if(t.tag===30){var a=t.memoizedProps,f=t.stateNode,k=nr(a,f),E=ir(a.default,a.update),B;B=t.memoizedState,t.memoizedState=null,f=t;var q=t.child;jn=0,k=Uf(f,q,k,k,E,B,!1),(t.flags&4)!==0&&k&&$o(t,a.onUpdate)}else(t.subtreeFlags&33554432)!==0&&R0(t);t=t.sibling}}var nn=!1,ut=!1,Bi=!1,$f=!1,A0=typeof WeakSet=="function"?WeakSet:Set,rn=null,Pi=!1,ul=!1,du=!1,qf=!1;function yE(t,n,a){if(t=t.containerInfo,mp=Jo,t=M_(t),Ad(t)){if("selectionStart"in t)var f={start:t.selectionStart,end:t.selectionEnd};else e:{f=(f=t.ownerDocument)&&f.defaultView||window;var k=f.getSelection&&f.getSelection();if(k&&k.rangeCount!==0){f=k.anchorNode;var E=k.anchorOffset,B=k.focusNode;k=k.focusOffset;try{f.nodeType,B.nodeType}catch{f=null;break e}var q=0,J=-1,se=-1,de=0,me=0,ie=t,ce=null;t:for(;;){for(var ke;ie!==f||E!==0&&ie.nodeType!==3||(J=q+E),ie!==B||k!==0&&ie.nodeType!==3||(se=q+k),ie.nodeType===3&&(q+=ie.nodeValue.length),(ke=ie.firstChild)!==null;)ce=ie,ie=ke;for(;;){if(ie===t)break t;if(ce===f&&++de===E&&(J=q),ce===B&&++me===k&&(se=q),(ke=ie.nextSibling)!==null)break;ie=ce,ce=ie.parentNode}ie=ke}f=J===-1||se===-1?null:{start:J,end:se}}else f=null}f=f||{start:0,end:0}}else f=null;for(gp={focusedElem:t,selectionRange:f},Jo=!1,a=(a&335544064)===a,rn=n,n=a?9270:1024;rn!==null;){if(t=rn,a&&(f=t.deletions,f!==null))for(E=0;E<f.length;E++)a&&Hf(f[E]);if(t.alternate===null&&(t.flags&2)!==0)a&&S0(t),fu(a);else{if(t.tag===22){if(f=t.alternate,t.memoizedState!==null){f!==null&&f.memoizedState===null&&a&&Hf(f),fu(a);continue}else if(f!==null&&f.memoizedState!==null){a&&S0(t),fu(a);continue}}f=t.child,(t.subtreeFlags&n)!==0&&f!==null?(f.return=t,rn=f):(a&&E0(t),fu(a))}}Gn=null}function fu(t){for(;rn!==null;){var n=rn,a=t,f=n.alternate,k=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((k&1024)!==0&&f!==null){a=void 0,k=f.memoizedProps,f=f.memoizedState;var E=n.stateNode;try{var B=zs(n.type,k);a=E.getSnapshotBeforeUpdate(B,f),E.__reactInternalSnapshotBeforeUpdate=a}catch(q){ft(n,n.return,q)}}break;case 3:if((k&1024)!==0){if(f=n.stateNode.containerInfo,a=f.nodeType,a===9)Sp(f);else if(a===1)switch(f.nodeName){case"HEAD":case"HTML":case"BODY":Sp(f);break;default:f.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&f!==null&&(a=nr(f.memoizedProps,f.stateNode),k=n.memoizedProps,k=ir(k.default,k.update),k!=="none"&&Oo(f,a,k,f.memoizedState=[],!0));break;default:if((k&1024)!==0)throw Error(s(163))}if(f=n.sibling,f!==null){f.return=n.return,rn=f;break}rn=n.return}}function D0(t,n,a){var f=a.flags;switch(a.tag){case 0:case 11:case 15:zi(t,a),f&4&&ll(5,a);break;case 1:if(zi(t,a),f&4)if(t=a.stateNode,n===null)try{t.componentDidMount()}catch(B){ft(a,a.return,B)}else{var k=zs(a.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(k,n,t.__reactInternalSnapshotBeforeUpdate)}catch(B){ft(a,a.return,B)}}f&64&&_0(a),f&512&&Mi(a,a.return);break;case 3:if(zi(t,a),f&64&&(t=a.updateQueue,t!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{a1(t,n)}catch(B){ft(a,a.return,B)}}break;case 27:n===null&&f&4&&w0(a);case 26:case 5:zi(t,a),n===null&&f&4&&Nf(a),f&512&&Mi(a,a.return);break;case 12:zi(t,a);break;case 31:zi(t,a),f&4&&N0(t,a);break;case 13:zi(t,a),f&4&&O0(t,a),f&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=jE.bind(null,a),f3(t,a))));break;case 22:if(f=a.memoizedState!==null||nn,!f){var E=n!==null&&n.memoizedState!==null||ut;n=nn,k=ut,nn=f,(ut=E)&&!k?(f=2,(a.subtreeFlags&8772)!==0&&(f|=1),wi(t,a,f)):zi(t,a),nn=n,ut=k}break;case 30:zi(t,a),f&512&&Mi(a,a.return);break;case 7:f&512&&Mi(a,a.return);default:zi(t,a)}}function Vf(t,n){for(t=t.child;t!==null;)L0(t,n),t=t.sibling}function L0(t,n){switch(t.tag){case 5:case 26:try{var a=t.stateNode;if(n){var f=a.style;typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"}else{var k=t.stateNode,E=t.memoizedProps.style,B=E!=null&&E.hasOwnProperty("display")?E.display:null;k.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(J){ft(t,t.return,J)}Wf(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,at=!0}catch(J){ft(t,t.return,J)}break;case 18:try{var q=t.stateNode;n?Sx(q,!0):Sx(t.stateNode,!1)}catch(J){ft(t,t.return,J)}break;case 22:case 23:t.memoizedState===null&&Vf(t,n);break;default:Vf(t,n)}}function Wf(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var a=t,f=n;switch(a.tag){case 4:L0(a,f);break e;case 22:a.memoizedState===null&&Wf(a,f);break e;default:Wf(a,f)}}t=t.sibling}}function j0(t){var n=t.alternate;n!==null&&(t.alternate=null,j0(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&_c(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Rt=null,Mn=!1;function yi(t,n,a){for(a=a.child;a!==null;)M0(t,n,a),a=a.sibling}function M0(t,n,a){if(Un&&typeof Un.onCommitFiberUnmount=="function")try{Un.onCommitFiberUnmount(Ma,a)}catch{}switch(a.tag){case 26:ut||fn(a,n),yi(t,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!ut&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ut||fn(a,n),cl(a);var f=Rt,k=Mn;Zr(a.type)&&(Rt=a.stateNode,Mn=!1),yi(t,n,a),Px(a.stateNode,a.type,a.memoizedProps),Rt=f,Mn=k;break;case 5:ut||fn(a,n),cl(a);case 6:if(a.tag===6&&cl(a),f=Rt,k=Mn,Rt=null,yi(t,n,a),Rt=f,Mn=k,Rt!==null)if(Mn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(a.stateNode),at=!0}catch(E){ft(a,n,E)}else try{Rt.removeChild(a.stateNode),at=!0}catch(E){ft(a,n,E)}break;case 18:Rt!==null&&(Mn?(t=Rt,wx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ea(t)):wx(Rt,a.stateNode));break;case 4:f=Rt,k=Mn,Rt=a.stateNode.containerInfo,Mn=!0,yi(t,n,a),Rt=f,Mn=k;break;case 0:case 11:case 14:case 15:Vr(2,a,n),ut||Vr(4,a,n),yi(t,n,a);break;case 1:ut||(fn(a,n),f=a.stateNode,typeof f.componentWillUnmount=="function"&&x0(a,n,f)),yi(t,n,a);break;case 21:yi(t,n,a);break;case 22:ut=(f=ut)||a.memoizedState!==null,yi(t,n,a),ut=f;break;case 30:fn(a,n),yi(t,n,a);break;case 7:ut||fn(a,n),yi(t,n,a);break;default:yi(t,n,a)}}function N0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ea(t)}catch(a){ft(n,n.return,a)}}}function O0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ea(t)}catch(a){ft(n,n.return,a)}}function bE(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new A0),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new A0),n;default:throw Error(s(435,t.tag))}}function pu(t,n){var a=bE(t);n.forEach(function(f){if(!a.has(f)){a.add(f);var k=ME.bind(null,t,f);f.then(k,k)}})}function En(t,n,a){var f=n.deletions;if(f!==null)for(var k=0;k<f.length;k++){var E=f[k],B=t,q=n,J=q;e:for(;J!==null;){switch(J.tag){case 27:if(Zr(J.type)){Rt=J.stateNode,Mn=!1;break e}break;case 5:Rt=J.stateNode,Mn=!1;break e;case 3:case 4:Rt=J.stateNode.containerInfo,Mn=!0;break e}J=J.return}if(Rt===null)throw Error(s(160));M0(B,q,E),Rt=null,Mn=!1,B=E.alternate,B!==null&&(B.return=null),E.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)B0(n,t,a),n=n.sibling}var bi=null;function B0(t,n,a){var f=t.alternate,k=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(k&4&&(f=t.updateQueue,f=f!==null?f.events:null,f!==null))for(var E=0;E<f.length;E++){var B=f[E];B.ref.impl=B.nextImpl}En(n,t,a),Tn(t),k&4&&(Vr(3,t,t.return),ll(3,t),Vr(5,t,t.return));break;case 1:En(n,t,a),Tn(t),k&512&&(ut||f===null||fn(f,f.return)),k&64&&nn&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:if(E=bi,En(n,t,a),Tn(t),k&512&&(ut||f===null||fn(f,f.return)),k&4)if(k=f!==null?f.memoizedState:null,a=t.memoizedState,f===null)if(a===null)if(t.stateNode===null)if(nn)t.stateNode=xx(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,a=t.memoizedProps,k=E.ownerDocument||E;t:switch(n){case"title":f=k.getElementsByTagName("title")[0],(!f||f[Ba]||f[cn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=k.createElement(n),k.head.insertBefore(f,k.querySelector("head > title"))),pn(f,n,a),f[cn]=t,en(f),n=f;break e;case"link":if(E=$x("link","href",k).get(n+(a.href||""))){for(B=0;B<E.length;B++)if(f=E[B],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){E.splice(B,1);break t}}f=k.createElement(n),pn(f,n,a),k.head.appendChild(f);break;case"meta":if(E=$x("meta","content",k).get(n+(a.content||""))){for(B=0;B<E.length;B++)if(f=E[B],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){E.splice(B,1);break t}}f=k.createElement(n),pn(f,n,a),k.head.appendChild(f);break;default:throw Error(s(468,n))}f[cn]=t,en(f),n=f}t.stateNode=n}else nn||Dp(E,t.type,t.stateNode);else t.stateNode=Ux(E,a,t.memoizedProps);else k!==a?(k===null?(n=f.stateNode,n===null||ut||n.parentNode.removeChild(n)):k.count--,a===null?nn||Dp(E,t.type,t.stateNode):Ux(E,a,t.memoizedProps)):a===null&&t.stateNode!==null&&Of(t,t.memoizedProps,f.memoizedProps);break;case 27:En(n,t,a),Tn(t),k&512&&(ut||f===null||fn(f,f.return)),f!==null&&k&4&&Of(t,t.memoizedProps,f.memoizedProps);break;case 5:if(E=Bi,Bi=!1,En(n,t,a),Bi=E,Tn(t),k&512&&(ut||f===null||fn(f,f.return)),t.flags&32){n=t.stateNode;try{vo(n,""),at=!0}catch(de){ft(t,t.return,de)}}k&4&&t.stateNode!=null&&(n=t.memoizedProps,Of(t,n,f!==null?f.memoizedProps:n)),k&1024&&($f=!0);break;case 6:if(En(n,t,a),Tn(t),k&4){if(t.stateNode===null)throw Error(s(162));n=t.memoizedProps,a=t.stateNode;try{a.nodeValue=n,at=!0}catch(de){ft(t,t.return,de)}}break;case 3:if(at=!1,Au=null,E=bi,bi=xl(n.containerInfo),En(n,t,a),bi=E,Tn(t),k&4&&f!==null&&f.memoizedState.isDehydrated)try{ea(n.containerInfo)}catch(de){ft(t,t.return,de)}$f&&($f=!1,P0(t)),at=!1;break;case 4:k=Bi,Bi=nn,f=i_(),E=bi,bi=xl(t.stateNode.containerInfo),En(n,t,a),Tn(t),bi=E,at&&ul&&(du=!0),at=f,Bi=k;break;case 12:En(n,t,a),Tn(t);break;case 31:En(n,t,a),Tn(t),k&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,pu(t,n)));break;case 13:En(n,t,a),Tn(t),t.child.flags&8192&&t.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(vu=Kt()),k&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,pu(t,n)));break;case 22:E=t.memoizedState!==null,B=f!==null&&f.memoizedState!==null;var q=nn,J=ut,se=Bi;nn=q||E,Bi=se||E,ut=J||B,En(n,t,a),ut=J,Bi=se,nn=q,Tn(t),k&8192&&(n=t.stateNode,n._visibility=E?n._visibility&-2:n._visibility|1,!E||f===null||B||nn||ut||(n=B||ut,a=nn,f=ut,nn=E||nn,ut=n,Wr(t,2),nn=a,ut=f),!E&&Bi||Vf(t,E)),k&4&&(n=t.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,pu(t,a))));break;case 19:En(n,t,a),Tn(t),k&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,pu(t,n)));break;case 30:k&512&&(ut||f===null||fn(f,f.return)),k=i_(),E=ul,B=(a&335544064)===a,q=t.memoizedProps,ul=B&&ir(q.default,q.update)!=="none",En(n,t,a),Tn(t),B&&f!==null&&at&&(t.flags|=4),ul=E,at=k;break;case 21:break;case 7:k&512&&(ut||f===null||fn(f,f.return)),f&&f.stateNode!==null&&(f.stateNode._fragmentFiber=t);default:En(n,t,a),Tn(t)}}function Tn(t){var n=t.flags;if(n&2){try{for(var a,f=t.return;f!==null;){if(b0(f)){a=f;break}f=f.return}f=null;for(var k=t.return;k!==null;){if(Mf(k)){var E=k.stateNode;f===null?f=[E]:f.push(E)}if(jf(k))break;k=k.return}var B=f;if(a==null)throw Error(s(160));switch(a.tag){case 27:var q=a.stateNode,J=Bf(t);lu(t,J,q,B);break;case 5:var se=a.stateNode;a.flags&32&&(vo(se,""),a.flags&=-33);var de=Bf(t);lu(t,de,se,B);break;case 3:case 4:var me=a.stateNode.containerInfo,ie=Bf(t);Pf(t,ie,me,B);break;default:throw Error(s(161))}}catch(ce){ft(t,t.return,ce)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function P0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;P0(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,Jo=!0,n.reset(),Jo=!1),t=t.sibling}}function Bo(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)z0(n,t),n=n.sibling;else R0(n)}function z0(t,n){var a=t.alternate;if(a===null)zf(t,!1);else switch(t.tag){case 3:if(qf=Pi=!1,C0(),Bo(n,t),!Pi&&!du){if(t=Ni,t!==null)for(var f=0;f<t.length;f+=3){a=t[f];var k=t[f+1];kx(a,t[f+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+k+")"})}t=n.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),qf=!0}Ni=null;break;case 5:Bo(n,t);break;case 4:f=Pi,Pi=!1,Bo(n,t),Pi&&(du=!0),Pi=f;break;case 22:t.memoizedState===null&&(a.memoizedState!==null?zf(t,!1):Bo(n,t));break;case 30:f=Pi,k=C0(),Pi=!1,Bo(n,t),Pi&&(t.flags|=4);var E=t.memoizedProps,B=t.stateNode;n=nr(E,B),B=nr(a.memoizedProps,B);var q=ir(E.default,E.update);q==="none"?n=!1:(E=a.memoizedState,a.memoizedState=null,a=t.child,jn=0,n=Uf(t,a,n,B,q,E,!0),jn!==(E===null?0:E.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?($o(t,t.memoizedProps.onUpdate),Ni=k):k!==null&&(k.push.apply(k,Ni),Ni=k),Pi=(t.flags&32)!==0?!0:f;break;default:Bo(n,t)}}function zi(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)D0(t,n.alternate,n),n=n.sibling}function Wr(t,n){for(t=t.child;t!==null;){var a=t,f=n;switch(a.tag){case 0:case 11:case 14:case 15:Vr(4,a,a.return),Wr(a,f);break;case 1:fn(a,a.return);var k=a.stateNode;typeof k.componentWillUnmount=="function"&&x0(a,a.return,k),Wr(a,f);break;case 27:(f&2)!==0&&Px(a.stateNode,a.type,a.memoizedProps);case 5:fn(a,a.return),a.tag!==5&&a.tag!==27||cl(a),Wr(a,f);break;case 6:cl(a);break;case 26:fn(a,a.return),k=a.stateNode,a.memoizedState!==null||k===null||ut||k.parentNode.removeChild(k),Wr(a,f);break;case 22:a.memoizedState===null&&Wr(a,f);break;case 30:fn(a,a.return),Wr(a,f);break;case 7:fn(a,a.return);default:Wr(a,f)}t=t.sibling}}function wi(t,n,a){for(a=(n.subtreeFlags&8772)!==0?a:a&-2,n=n.child;n!==null;){var f=n.alternate,k=t,E=n,B=E.flags,q=(a&1)!==0;switch(E.tag){case 0:case 11:case 15:wi(k,E,a),ll(4,E);break;case 1:if(wi(k,E,a),f=E,k=f.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(de){ft(f,f.return,de)}if(f=E,k=f.updateQueue,k!==null){var J=f.stateNode;try{var se=k.shared.hiddenCallbacks;if(se!==null)for(k.shared.hiddenCallbacks=null,k=0;k<se.length;k++)o1(se[k],J)}catch(de){ft(f,f.return,de)}}q&&B&64&&_0(E),Mi(E,E.return);break;case 27:(a&2)!==0&&w0(E);case 5:E.tag!==5&&E.tag!==27||y0(E),wi(k,E,a),q&&f===null&&B&4&&Nf(E),Mi(E,E.return);break;case 6:y0(E);break;case 26:J=E.stateNode,E.memoizedState!==null||J===null||nn||Dp(xl(J.ownerDocument),E.type,J),wi(k,E,a),q&&f===null&&B&4&&Nf(E),Mi(E,E.return);break;case 12:wi(k,E,a);break;case 31:wi(k,E,a),q&&B&4&&N0(k,E);break;case 13:wi(k,E,a),q&&B&4&&O0(k,E);break;case 22:E.memoizedState===null&&wi(k,E,a),Mi(E,E.return);break;case 30:wi(k,E,a),Mi(E,E.return);break;case 7:Mi(E,E.return);default:wi(k,E,a)}n=n.sibling}}function Gf(t,n){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Ka(a))}function Yf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ka(t))}function ui(t,n,a,f){var k=(a&335544064)===a;if(n.subtreeFlags&(k?10262:10256))for(n=n.child;n!==null;)I0(t,n,a,f),n=n.sibling;else k&&T0(n)}function I0(t,n,a,f){var k=(a&335544064)===a;k&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&hu(n);var E=n.flags;switch(n.tag){case 0:case 11:case 15:ui(t,n,a,f),E&2048&&ll(9,n);break;case 1:ui(t,n,a,f);break;case 3:ui(t,n,a,f),k&&qf&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),E&2048&&(E=null,n.alternate!==null&&(E=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==E&&(n.refCount++,E!=null&&Ka(E)));break;case 12:if(E&2048){ui(t,n,a,f),E=n.stateNode;try{var B=n.memoizedProps,q=B.id,J=B.onPostCommit;typeof J=="function"&&J(q,n.alternate===null?"mount":"update",E.passiveEffectDuration,-0)}catch(se){ft(n,n.return,se)}}else ui(t,n,a,f);break;case 31:ui(t,n,a,f);break;case 13:ui(t,n,a,f);break;case 23:break;case 22:B=n.stateNode,q=n.alternate,n.memoizedState!==null?(k&&q!==null&&q.memoizedState===null&&hu(q),B._visibility&2?ui(t,n,a,f):hl(t,n)):(k&&q!==null&&q.memoizedState!==null&&hu(n),B._visibility&2?ui(t,n,a,f):(B._visibility|=2,Po(t,n,a,f,(n.subtreeFlags&10256)!==0||!1))),E&2048&&Gf(q,n);break;case 24:ui(t,n,a,f),E&2048&&Yf(n.alternate,n);break;case 30:k&&(E=n.alternate,E!==null&&(Oi(E.child,!0),Oi(n.child,!0))),ui(t,n,a,f);break;default:ui(t,n,a,f)}}function Po(t,n,a,f,k){for(k=k&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var E=t,B=n,q=a,J=f,se=B.flags;switch(B.tag){case 0:case 11:case 15:Po(E,B,q,J,k),ll(8,B);break;case 23:break;case 22:var de=B.stateNode;B.memoizedState!==null?de._visibility&2?Po(E,B,q,J,k):hl(E,B):(de._visibility|=2,Po(E,B,q,J,k)),k&&se&2048&&Gf(B.alternate,B);break;case 24:Po(E,B,q,J,k),k&&se&2048&&Yf(B.alternate,B);break;default:Po(E,B,q,J,k)}n=n.sibling}}function hl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=t,f=n,k=f.flags;switch(f.tag){case 22:hl(a,f),k&2048&&Gf(f.alternate,f);break;case 24:hl(a,f),k&2048&&Yf(f.alternate,f);break;default:hl(a,f)}n=n.sibling}}var Is=8192;function Hs(t,n,a){if(t.subtreeFlags&Is)for(t=t.child;t!==null;)H0(t,n,a),t=t.sibling}function H0(t,n,a){switch(t.tag){case 26:Hs(t,n,a),t.flags&Is&&(t.memoizedState!==null?T3(a,bi,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&Gx(a,t)));break;case 5:Hs(t,n,a),t.flags&Is&&(t=t.stateNode,(n&335544128)===n&&Gx(a,t));break;case 3:case 4:var f=bi;bi=xl(t.stateNode.containerInfo),Hs(t,n,a),bi=f;break;case 22:t.memoizedState===null&&(f=t.alternate,f!==null&&f.memoizedState!==null?(f=Is,Is=16777216,Hs(t,n,a),Is=f):Hs(t,n,a));break;case 30:if((t.flags&Is)!==0&&(f=t.memoizedProps.name,f!=null&&f!=="auto")){var k=t.stateNode;k.paired=null,Gn===null&&(Gn=new Map),Gn.set(f,k)}Hs(t,n,a);break;default:Hs(t,n,a)}}function F0(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function dl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var f=n[a];rn=f,$0(f,t)}F0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)U0(t),t=t.sibling}function U0(t){switch(t.tag){case 0:case 11:case 15:dl(t),t.flags&2048&&Vr(9,t,t.return);break;case 3:dl(t);break;case 12:dl(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,mu(t)):dl(t);break;default:dl(t)}}function mu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var f=n[a];rn=f,$0(f,t)}F0(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Vr(8,n,n.return),mu(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,mu(n));break;default:mu(n)}t=t.sibling}}function $0(t,n){for(;rn!==null;){var a=rn;switch(a.tag){case 0:case 11:case 15:Vr(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var f=a.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Ka(a.memoizedState.cache)}if(f=a.child,f!==null)f.return=a,rn=f;else e:for(a=t;rn!==null;){f=rn;var k=f.sibling,E=f.return;if(j0(f),f===a){rn=null;break e}if(k!==null){k.return=E,rn=k;break e}rn=E}}}var wE={getCacheForType:function(t){var n=un(It),a=n.data.get(t);return a===void 0&&(a=t(),n.data.set(t,a)),a},cacheSignal:function(){return un(It).controller.signal}},SE=typeof WeakMap=="function"?WeakMap:Map,ct=0,xt=null,Je=null,tt=0,dt=0,Yn=null,Gr=!1,zo=!1,Kf=!1,dr=0,jt=0,Yr=0,Fs=0,gu=0,Kn=0,Io=0,fl=null,Nn=null,Xf=!1,vu=0,q0=0,_u=1/0,xu=null,Kr=null,Dt=0,Si=null,Us=null,Ii=0,Qf=0,Zf=null,V0=null,Ho=null,Fo=null,Uo=null,pl=0,yu=null;function Xn(){return(ct&2)!==0&&tt!==0?tt&-tt:ue.T!==null?lp():Yv()}function W0(){if(Kn===0)if((tt&536870912)===0||Qe){var t=pc;pc<<=1,(pc&3932160)===0&&(pc=262144),Kn=t}else Kn=536870912;return t=hn.current,t!==null&&(t.flags|=32),Kn}function $o(t,n){if(n!=null){var a=t.stateNode,f=a.ref;f===null&&(f=a.ref=Ex(nr(t.memoizedProps,a))),Fo===null&&(Fo=[]),Fo.push(n.bind(null,f))}}function On(t,n,a){(t===xt&&(dt===2||dt===9)||t.cancelPendingCommit!==null)&&(qo(t,0),Xr(t,tt,Kn,!1)),Oa(t,a),((ct&2)===0||t!==xt)&&(t===xt&&((ct&2)===0&&(Fs|=a),jt===4&&Xr(t,tt,Kn,!1)),Hi(t))}function G0(t,n,a){if((ct&6)!==0)throw Error(s(327));var f=!a&&(n&127)===0&&(n&t.expiredLanes)===0||Na(t,n),k=f?EE(t,n):ep(t,n,!0),E=f;do{if(k===0){zo&&!f&&Xr(t,n,0,!1);break}else{if(a=t.current.alternate,E&&!CE(a)){k=ep(t,n,!1),E=!1;continue}if(k===2){if(E=n,t.errorRecoveryDisabledLanes&E)var B=0;else B=t.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){n=B;e:{var q=t;k=fl;var J=q.current.memoizedState.isDehydrated;if(J&&(qo(q,B).flags|=256),B=ep(q,B,!1),B!==2&&B!==6){if(Kf&&!J){q.errorRecoveryDisabledLanes|=E,Fs|=E,k=4;break e}E=Nn,Nn=k,E!==null&&(Nn===null?Nn=E:Nn.push.apply(Nn,E))}k=B}if(E=!1,k!==2)continue}}if(k===1){qo(t,0),Xr(t,n,0,!0);break}e:{switch(f=t,E=k,E){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:Xr(f,n,Kn,!Gr);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(k=vu+300-Kt(),10<k)){if(Xr(f,n,Kn,!Gr),gc(f,0,!0)!==0)break e;Ii=n,f.timeoutHandle=xp(Y0.bind(null,f,a,Nn,xu,Xf,n,Kn,Fs,Io,Gr,E,"Throttled",-0,0),k);break e}Y0(f,a,Nn,xu,Xf,n,Kn,Fs,Io,Gr,E,null,-0,0)}}break}while(!0);Hi(t)}function Y0(t,n,a,f,k,E,B,q,J,se,de,me,ie,ce){t.timeoutHandle=-1;var ke=n.subtreeFlags,Me=(E&335544064)===E;if(me=null,(Me||ke&8192||(ke&16785408)===16785408)&&(me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Di},Gn=null,H0(n,E,me),Me&&(ke=me,Me=t.containerInfo,Me=(Me.nodeType===9?Me:Me.ownerDocument).__reactViewTransition,Me!=null&&(ke.count++,ke.waitingForViewTransition=!0,ke=wl.bind(ke),Me.finished.then(ke,ke))),ke=(E&62914560)===E?vu-Kt():(E&4194048)===E?q0-Kt():0,ke=R3(me,ke),ke!==null)){Ii=E,t.cancelPendingCommit=ke(nx.bind(null,t,n,E,a,f,k,B,q,J,se,de,me,null,ie,ce)),Xr(t,E,B,!se);return}nx(t,n,E,a,f,k,B,q,J,se,de,me)}function CE(t){for(var n=t;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var f=0;f<a.length;f++){var k=a[f],E=k.getSnapshot;k=k.value;try{if(!Vn(E(),k))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Xr(t,n,a,f){n=$v(t,n),n&=~gu,n&=~Fs,t.suspendedLanes|=n,t.pingedLanes&=~n,f&&(t.warmLanes|=n),f=t.expirationTimes;for(var k=n;0<k;){var E=31-$n(k),B=1<<E;f[E]=-1,k&=~B}a!==0&&Vv(t,a,n)}function bu(){return(ct&6)===0?(ml(0),!1):!0}function Jf(){if(Je!==null){if(dt===0)var t=Je.return;else t=Je,or=As=null,af(t),Do=null,Za=0,t=Je;for(;t!==null;)v0(t.alternate,t),t=t.return;Je=null}}function qo(t,n){var a=t.timeoutHandle;return a!==-1&&(t.timeoutHandle=-1,YE(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Ii=0,Jf(),xt=t,Je=a=rr(t.current,null),tt=n,dt=0,Yn=null,Gr=!1,zo=Na(t,n),Kf=!1,Io=Kn=gu=Fs=Yr=jt=0,Nn=fl=null,Xf=!1,dr=$v(t,n),Ac(),a}function K0(t,n){Ge=null,ue.H=eu,n===Ao||n===Hc?(n=n1(),dt=3):n===Gd?(n=n1(),dt=4):dt=n===wf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yn=n,Je===null&&(jt=1,tu(t,oi(n,t.current)))}function X0(){var t=hn.current;return t===null?!0:(tt&4194048)===tt?yn===null:(tt&62914560)===tt||(tt&536870912)!==0?t===yn:!1}function Q0(){var t=ue.H;return ue.H=eu,t===null?eu:t}function Z0(){var t=ue.A;return ue.A=wE,t}function wu(){jt=4,Gr||(tt&4194048)!==tt&&hn.current!==null||(zo=!0),(Yr&134217727)===0&&(Fs&134217727)===0||xt===null||Xr(xt,tt,Kn,!1)}function ep(t,n,a){var f=ct;ct|=2;var k=Q0(),E=Z0();(xt!==t||tt!==n)&&(xu=null,qo(t,n)),n=!1;var B=jt;e:do try{if(dt!==0&&Je!==null){var q=Je,J=Yn;switch(dt){case 8:Jf(),B=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(n=!0);var se=dt;if(dt=0,Yn=null,Vo(t,q,J,se),a&&zo){B=0;break e}break;default:se=dt,dt=0,Yn=null,Vo(t,q,J,se)}}kE(),B=jt;break}catch(de){K0(t,de)}while(!0);return n&&t.shellSuspendCounter++,or=As=null,ct=f,ue.H=k,ue.A=E,Je===null&&(xt=null,tt=0,Ac()),B}function kE(){for(;Je!==null;)J0(Je)}function EE(t,n){var a=ct;ct|=2;var f=Q0(),k=Z0();xt!==t||tt!==n?(xu=null,_u=Kt()+500,qo(t,n)):zo=Na(t,n);e:do try{if(dt!==0&&Je!==null){n=Je;var E=Yn;t:switch(dt){case 1:dt=0,Yn=null,Vo(t,n,E,1);break;case 2:case 9:if(e1(E)){dt=0,Yn=null,ex(n);break}n=function(){dt!==2&&dt!==9||xt!==t||(dt=7),Hi(t)},E.then(n,n);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:e1(E)?(dt=0,Yn=null,ex(n)):(dt=0,Yn=null,Vo(t,n,E,7));break;case 5:var B=null;switch(Je.tag){case 26:B=Je.memoizedState;case 5:case 27:var q=Je;if(B?Vx(B):q.stateNode.complete){dt=0,Yn=null;var J=q.sibling;if(J!==null)Je=J;else{var se=q.return;se!==null?(Je=se,Su(se)):Je=null}break t}}dt=0,Yn=null,Vo(t,n,E,5);break;case 6:dt=0,Yn=null,Vo(t,n,E,6);break;case 8:Jf(),jt=6;break e;default:throw Error(s(462))}}TE();break}catch(de){K0(t,de)}while(!0);return or=As=null,ue.H=f,ue.A=k,ct=a,Je!==null?0:(xt=null,tt=0,Ac(),jt)}function TE(){for(;Je!==null&&!ni();)J0(Je)}function J0(t){var n=m0(t.alternate,t,dr);t.memoizedProps=t.pendingProps,n===null?Su(t):Je=n}function ex(t){var n=t,a=n.alternate;switch(n.tag){case 15:case 0:n=l0(a,n,n.pendingProps,n.type,void 0,tt);break;case 11:n=l0(a,n,n.pendingProps,n.type.render,n.ref,tt);break;case 5:af(n);var f=n;f===tn&&(Qe?(Oc(f),f.tag===5&&f.stateNode!=null&&(Ct=f.stateNode)):(Oc(f),Qe=!0));default:v0(a,n),n=Je=$_(n,dr),n=m0(a,n,dr)}t.memoizedProps=t.pendingProps,n===null?Su(t):Je=n}function Vo(t,n,a,f){or=As=null,af(n),Do=null,Za=0;var k=n.return;try{if(pE(t,k,n,a,tt)){jt=1,tu(t,oi(a,t.current)),Je=null;return}}catch(E){if(k!==null)throw Je=k,E;jt=1,tu(t,oi(a,t.current)),Je=null;return}n.flags&32768?(Qe||f===1?t=!0:zo||(tt&536870912)!==0?t=!1:(Gr=t=!0,(f===2||f===9||f===3||f===6)&&(f=hn.current,f!==null&&f.tag===13&&(f.flags|=16384))),tx(n,t)):Su(n)}function Su(t){var n=t;do{if((n.flags&32768)!==0){tx(n,Gr);return}t=n.return;var a=_E(n.alternate,n,dr);if(a!==null){Je=a;return}if(n=n.sibling,n!==null){Je=n;return}Je=n=t}while(n!==null);jt===0&&(jt=5)}function tx(t,n){do{var a=xE(t.alternate,t);if(a!==null){a.flags&=32767,Je=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(t=t.sibling,t!==null)){Je=t;return}Je=t=a}while(t!==null);jt=6,Je=null}function nx(t,n,a,f,k,E,B,q,J,se,de,me){t.cancelPendingCommit=null;do Cu();while(Dt!==0);if((ct&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));t===xt&&(Je=xt=null,tt=0),Us=n,Si=t,Ii=a,Zf=k,V0=f,RE(t,n,a,B,q,J,me)}}function RE(t,n,a,f,k,E,B){var q=n.lanes|n.childLanes;if(Qf=q,q|=Nd,ek(t,a,q,f,k,E),Fo=null,(a&335544064)===a?(Uo=nE(t),f=10262):(Uo=null,f=10256),(n.subtreeFlags&f)!==0||(n.flags&f)!==0?(t.callbackNode=null,t.callbackPriority=0,NE(uo,function(){return rp(),null})):(t.callbackNode=null,t.callbackPriority=0),cu=!1,f=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||f){f=ue.T,ue.T=null,k=he.p,he.p=2,E=ct,ct|=4;try{yE(t,n,a)}finally{ct=E,he.p=k,ue.T=f}}Dt=1,cu?Ho=e3(B,t.containerInfo,Uo,tp,np,DE,ip,rp,AE):(tp(),np(),ip())}function AE(t){if(Dt!==0){var n=Si.onRecoverableError;n(t,{componentStack:null})}}function DE(){Dt===3&&(Dt=0,z0(Us,Si),Dt=4)}function tp(){if(Dt===1){Dt=0;var t=Si,n=Us,a=Ii,f=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||f){f=ue.T,ue.T=null;var k=he.p;he.p=2;var E=ct;ct|=4;try{ul=du=!1,B0(n,t,a),a=gp;var B=M_(t.containerInfo),q=a.focusedElem,J=a.selectionRange;if(B!==q&&q&&q.ownerDocument&&j_(q.ownerDocument.documentElement,q)){if(J!==null&&Ad(q)){var se=J.start,de=J.end;if(de===void 0&&(de=se),"selectionStart"in q)q.selectionStart=se,q.selectionEnd=Math.min(de,q.value.length);else{var me=q.ownerDocument||document,ie=me&&me.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),ke=q.textContent.length,Me=Math.min(J.start,ke),Ye=J.end===void 0?Me:Math.min(J.end,ke);!ce.extend&&Me>Ye&&(B=Ye,Ye=Me,Me=B);var re=L_(q,Me),te=L_(q,Ye);if(re&&te&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==te.node||ce.focusOffset!==te.offset)){var ae=me.createRange();ae.setStart(re.node,re.offset),ce.removeAllRanges(),Me>Ye?(ce.addRange(ae),ce.extend(te.node,te.offset)):(ae.setEnd(te.node,te.offset),ce.addRange(ae))}}}}for(me=[],ce=q;ce=ce.parentNode;)ce.nodeType===1&&me.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<me.length;q++){var pe=me[q];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Jo=!!mp,gp=mp=null}finally{ct=E,he.p=k,ue.T=f}}t.current=n,Dt=2}}function np(){if(Dt===2){Dt=0;var t=Si,n=Us,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=ue.T,ue.T=null;var f=he.p;he.p=2;var k=ct;ct|=4;try{D0(t,n.alternate,n)}finally{ct=k,he.p=f,ue.T=a}}Dt=3}}function ip(){if(Dt===4||Dt===3){Dt=0;var t=Ho;Ho=null,co();var n=Si,a=Us,f=Ii,k=V0,E=(f&335544064)===f?10262:10256;if((a.subtreeFlags&E)!==0||(a.flags&E)!==0?Dt=5:(Dt=0,Us=Si=null,ix(n,n.pendingLanes)),E=n.pendingLanes,E===0&&(Kr=null),hd(f),a=a.stateNode,Un&&typeof Un.onCommitFiberRoot=="function")try{Un.onCommitFiberRoot(Ma,a,void 0,(a.current.flags&128)===128)}catch{}if(k!==null){a=ue.T,E=he.p,he.p=2,ue.T=null;try{for(var B=n.onRecoverableError,q=0;q<k.length;q++){var J=k[q];B(J.value,{componentStack:J.stack})}}finally{ue.T=a,he.p=E}}if(k=Fo,B=Uo,Uo=null,k!==null&&(Fo=null,B===null&&(B=[]),t!==null))for(J=0;J<k.length;J++)a=(0,k[J])(B),a!==void 0&&t.finished.finally(a);(Ii&3)!==0&&Cu(),Hi(n),E=n.pendingLanes,(f&261930)!==0&&(E&42)!==0?n===yu?pl++:(pl=0,yu=n):(pl=0,yu=null),ml(0)}}function ix(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ka(n)))}function Cu(){return Ho!==null&&(Ho.skipTransition(),Ho=null),tp(),np(),ip(),rp()}function rp(){if(Dt!==5)return!1;var t=Si,n=Qf;Qf=0;var a=hd(Ii),f=ue.T,k=he.p;try{he.p=32>a?32:a,ue.T=null,a=Zf,Zf=null;var E=Si,B=Ii;if(Dt=0,Us=Si=null,Ii=0,(ct&6)!==0)throw Error(s(331));var q=ct;if(ct|=4,U0(E.current),I0(E,E.current,B,a),ct=q,ml(0,!1),Un&&typeof Un.onPostCommitFiberRoot=="function")try{Un.onPostCommitFiberRoot(Ma,E)}catch{}return!0}finally{he.p=k,ue.T=f,ix(t,n)}}function rx(t,n,a){n=oi(a,n),n=bf(t.stateNode,n,2),t=Fr(t,n,2),t!==null&&(Oa(t,2),Hi(t))}function ft(t,n,a){if(t.tag===3)rx(t,t,a);else for(;n!==null;){if(n.tag===3){rx(n,t,a);break}else if(n.tag===1){var f=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Kr===null||!Kr.has(f))){t=oi(a,t),a=e0(2),f=Fr(n,a,2),f!==null&&(t0(a,f,n,t),Oa(f,2),Hi(f));break}}n=n.return}}function sp(t,n,a){var f=t.pingCache;if(f===null){f=t.pingCache=new SE;var k=new Set;f.set(n,k)}else k=f.get(n),k===void 0&&(k=new Set,f.set(n,k));k.has(a)||(Kf=!0,k.add(a),t=LE.bind(null,t,n,a),n.then(t,t))}function LE(t,n,a){var f=t.pingCache;f!==null&&f.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,xt===t&&(tt&a)===a&&((jt===4||jt===3&&(tt&62914560)===tt&&300>Kt()-vu)&&(ct&2)===0?qo(t,0):gu|=a,Io===tt&&(Io=0)),Hi(t)}function sx(t,n){n===0&&(n=qv()),t=Es(t,n),t!==null&&(Oa(t,n),Hi(t))}function jE(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),sx(t,a)}function ME(t,n){var a=0;switch(t.tag){case 31:case 13:var f=t.stateNode,k=t.memoizedState;k!==null&&(a=k.retryLane);break;case 19:f=t.stateNode;break;case 22:f=t.stateNode._retryCache;break;default:throw Error(s(314))}f!==null&&f.delete(n),sx(t,a)}function NE(t,n){return An(t,n)}var Wo=null,Go=null,op=!1,ku=!1,ap=!1,Qr=0;function Hi(t){t!==Go&&t.next===null&&(Go===null?Wo=Go=t:Go=Go.next=t),ku=!0,op||(op=!0,BE())}function ml(t,n){if(!ap&&ku){ap=!0;do for(var a=!1,f=Wo;f!==null;){if(t!==0){var k=f.pendingLanes;if(k===0)var E=0;else{var B=f.suspendedLanes,q=f.pingedLanes;E=(1<<31-$n(42|t)+1)-1,E&=k&~(B&~q),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(a=!0,cx(f,E))}else E=tt,E=gc(f,f===xt?E:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(E&3)===0||Na(f,E)||(a=!0,cx(f,E));f=f.next}while(a);ap=!1}}function OE(){ox()}function ox(){ku=op=!1;var t=0;Qr!==0&&GE()&&(t=Qr);for(var n=Kt(),a=null,f=Wo;f!==null;){var k=f.next,E=ax(f,n);E===0?(f.next=null,a===null?Wo=k:a.next=k,k===null&&(Go=a)):(a=f,(t!==0||(E&3)!==0)&&(ku=!0)),f=k}Dt!==0&&Dt!==5||ml(t),Qr!==0&&(Qr=0)}function ax(t,n){for(var a=t.suspendedLanes,f=t.pingedLanes,k=t.expirationTimes,E=t.pendingLanes&-62914561;0<E;){var B=31-$n(E),q=1<<B,J=k[B];J===-1?((q&a)===0||(q&f)!==0)&&(k[B]=J5(q,n)):J<=n&&(t.expiredLanes|=q),E&=~q}if(n=xt,a=tt,a=gc(t,t===n?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),f=t.callbackNode,a===0||t===n&&(dt===2||dt===9)||t.cancelPendingCommit!==null)return f!==null&&f!==null&&ti(f),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Na(t,a)){if(n=a&-a,n===t.callbackPriority)return n;switch(f!==null&&ti(f),hd(a)){case 2:case 8:a=Sn;break;case 32:a=uo;break;case 268435456:a=Uv;break;default:a=uo}return f=lx.bind(null,t),a=An(a,f),t.callbackPriority=n,t.callbackNode=a,n}return f!==null&&f!==null&&ti(f),t.callbackPriority=2,t.callbackNode=null,2}function lx(t,n){if(Dt!==0&&Dt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Cu()&&t.callbackNode!==a)return null;var f=tt;return f=gc(t,t===xt?f:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),f===0?null:(G0(t,f,n),ax(t,Kt()),t.callbackNode!=null&&t.callbackNode===a?lx.bind(null,t):null)}function cx(t,n){if(Cu())return null;G0(t,n,!0)}function BE(){KE(function(){(ct&6)!==0?An(ii,OE):ox()})}function lp(){if(Qr===0){var t=js;t===0&&(t=fc,fc<<=1,(fc&261888)===0&&(fc=256)),Qr=t}return Qr}function ux(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:bc(t)}function PE(t,n,a,f,k){if(n==="submit"&&a&&a.stateNode===k){var E=ux((k[Dn]||null).action),B=f.submitter;B&&(n=(n=B[Dn]||null)?ux(n.formAction):B.getAttribute("formAction"),n!==null&&(E=n,B=null));var q=new kc("action","action",null,f,k);t.push({event:q,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Qr!==0){var J=new FormData(k,B);gf(a,{pending:!0,data:J,method:k.method,action:E},null,J)}}else typeof E=="function"&&(q.preventDefault(),J=new FormData(k,B),gf(a,{pending:!0,data:J,method:k.method,action:E},E,J))},currentTarget:k}]})}}for(var cp=0;cp<Md.length;cp++){var up=Md[cp],zE=up.toLowerCase(),IE=up[0].toUpperCase()+up.slice(1);xi(zE,"on"+IE)}xi(B_,"onAnimationEnd"),xi(P_,"onAnimationIteration"),xi(z_,"onAnimationStart"),xi("dblclick","onDoubleClick"),xi("focusin","onFocus"),xi("focusout","onBlur"),xi(Yk,"onTransitionRun"),xi(Kk,"onTransitionStart"),xi(Xk,"onTransitionCancel"),xi(I_,"onTransitionEnd"),mo("onMouseEnter",["mouseout","mouseover"]),mo("onMouseLeave",["mouseout","mouseover"]),mo("onPointerEnter",["pointerout","pointerover"]),mo("onPointerLeave",["pointerout","pointerover"]),Ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ss("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gl="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(" "),HE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gl));function hx(t,n){n=(n&4)!==0;for(var a=0;a<t.length;a++){var f=t[a],k=f.event;f=f.listeners;e:{var E=void 0;if(n)for(var B=f.length-1;0<=B;B--){var q=f[B],J=q.instance,se=q.currentTarget;if(q=q.listener,J!==E&&k.isPropagationStopped())break e;E=q,k.currentTarget=se;try{E(k)}catch(de){Rc(de)}k.currentTarget=null,E=J}else for(B=0;B<f.length;B++){if(q=f[B],J=q.instance,se=q.currentTarget,q=q.listener,J!==E&&k.isPropagationStopped())break e;E=q,k.currentTarget=se;try{E(k)}catch(de){Rc(de)}k.currentTarget=null,E=J}}}}function et(t,n){var a=n[Xv];a===void 0&&(a=n[Xv]=new Set);var f=t+"__bubble";a.has(f)||(dx(n,t,2,!1),a.add(f))}function hp(t,n,a){var f=0;n&&(f|=4),dx(a,t,f,n)}var Eu="_reactListening"+Math.random().toString(36).slice(2);function dp(t){if(!t[Eu]){t[Eu]=!0,Jv.forEach(function(a){a!=="selectionchange"&&(HE.has(a)||hp(a,!1,t),hp(a,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Eu]||(n[Eu]=!0,hp("selectionchange",!1,n))}}function dx(t,n,a,f){switch(ty(n)){case 2:var k=j3;break;case 8:k=M3;break;default:k=jp}a=k.bind(null,n,a,t),k=void 0,!xd||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(k=!0),f?k!==void 0?t.addEventListener(n,a,{capture:!0,passive:k}):t.addEventListener(n,a,!0):k!==void 0?t.addEventListener(n,a,{passive:k}):t.addEventListener(n,a,!1)}function fp(t,n,a,f,k){var E=f;if((n&1)===0&&(n&2)===0&&f!==null)e:for(;;){if(f===null)return;var B=f.tag;if(B===3||B===4){var q=f.stateNode.containerInfo;if(q===k)break;if(B===4)for(B=f.return;B!==null;){var J=B.tag;if((J===3||J===4)&&B.stateNode.containerInfo===k)return;B=B.return}for(;q!==null;){if(B=ws(q),B===null)return;if(J=B.tag,J===5||J===6||J===26||J===27){f=E=B;continue e}q=q.parentNode}}f=f.return}d_(function(){var se=E,de=vd(a),me=[];e:{var ie=H_.get(t);if(ie!==void 0){var ce=kc,ke=t;switch(t){case"keypress":if(Sc(a)===0)break e;case"keydown":case"keyup":ce=Ck;break;case"focusin":ke="focus",ce=Sd;break;case"focusout":ke="blur",ce=Sd;break;case"beforeblur":case"afterblur":ce=Sd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=m_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=dk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=Ak;break;case B_:case P_:case z_:ce=mk;break;case I_:ce=Lk;break;case"scroll":case"scrollend":ce=uk;break;case"wheel":ce=Mk;break;case"copy":case"cut":case"paste":ce=vk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=v_;break;case"submit":ce=Tk;break;case"toggle":case"beforetoggle":ce=Ok}var Me=(n&4)!==0,Ye=!Me&&(t==="scroll"||t==="scrollend"),re=Me?ie!==null?ie+"Capture":null:ie;Me=[];for(var te=se,ae;te!==null;){var pe=te;if(ae=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ae===null||re===null||(pe=za(te,re),pe!=null&&Me.push(vl(te,pe,ae))),Ye)break;te=te.return}0<Me.length&&(ie=new ce(ie,ke,null,a,de),me.push({event:ie,listeners:Me}))}}if((n&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",ce&&a!==gd&&(ke=a.relatedTarget||a.fromElement)&&(ws(ke)||ke[ho]))break e;(ie||ce)&&(ke=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ie?(ce=a.relatedTarget||a.toElement,ie=se,ce=ce?ws(ce):null,ce!==null&&(Ye=h(ce),Me=ce.tag,ce!==Ye||Me!==5&&Me!==27&&Me!==6)&&(ce=null)):(ie=null,ce=se),ie!==ce&&(Me=m_,pe="onMouseLeave",re="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(Me=v_,pe="onPointerLeave",re="onPointerEnter",te="pointer"),Ye=ie==null?ke:Pa(ie),ae=ce==null?ke:Pa(ce),ke=new Me(pe,te+"leave",ie,a,de),ke.target=Ye,ke.relatedTarget=ae,pe=null,ws(de)===se&&(Me=new Me(re,te+"enter",ce,a,de),Me.target=ae,Me.relatedTarget=Ye,pe=Me),Ye=pe,Me=ie&&ce?R(ie,ce,FE):null,ie!==null&&fx(me,ke,ie,Me,!1),ce!==null&&Ye!==null&&fx(me,Ye,ce,Me,!0)))}e:{if(ie=se?Pa(se):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var Ae=k_;else if(S_(ie))if(E_)Ae=Vk;else{Ae=$k;var nt=Uk}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?se&&md(se.elementType)&&(Ae=k_):Ae=qk;if(Ae&&(Ae=Ae(t,se))){C_(me,Ae,a,de);break e}nt&&nt(t,ie,se)}switch(nt=se?Pa(se):window,t){case"focusin":(S_(nt)||nt.contentEditable==="true")&&(bo=nt,Dd=se,Wa=null);break;case"focusout":Wa=Dd=bo=null;break;case"mousedown":Ld=!0;break;case"contextmenu":case"mouseup":case"dragend":Ld=!1,N_(me,a,de);break;case"selectionchange":if(Gk)break;case"keydown":case"keyup":N_(me,a,de)}var Ne;if(kd)e:{switch(t){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else yo?b_(t,a)&&(Pe="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Pe="onCompositionStart");Pe&&(__&&a.locale!=="ko"&&(yo||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&yo&&(Ne=f_()):(jr=de,yd="value"in jr?jr.value:jr.textContent,yo=!0)),nt=Tu(se,Pe),0<nt.length&&(Pe=new g_(Pe,t,null,a,de),me.push({event:Pe,listeners:nt}),Ne?Pe.data=Ne:(Ne=w_(a),Ne!==null&&(Pe.data=Ne)))),(Ne=Pk?zk(t,a):Ik(t,a))&&(Pe=Tu(se,"onBeforeInput"),0<Pe.length&&(nt=new g_("onBeforeInput","beforeinput",null,a,de),me.push({event:nt,listeners:Pe}),nt.data=Ne)),PE(me,t,se,a,de)}hx(me,n)})}function vl(t,n,a){return{instance:t,listener:n,currentTarget:a}}function Tu(t,n){for(var a=n+"Capture",f=[];t!==null;){var k=t,E=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||E===null||(k=za(t,a),k!=null&&f.unshift(vl(t,k,E)),k=za(t,n),k!=null&&f.push(vl(t,k,E))),t.tag===3)return f;t=t.return}return[]}function FE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function fx(t,n,a,f,k){for(var E=n._reactName,B=[];a!==null&&a!==f;){var q=a,J=q.alternate,se=q.stateNode;if(q=q.tag,J!==null&&J===f)break;q!==5&&q!==26&&q!==27||se===null||(J=se,k?(se=za(a,E),se!=null&&B.unshift(vl(a,se,J))):k||(se=za(a,E),se!=null&&B.push(vl(a,se,J)))),a=a.return}B.length!==0&&t.push({event:n,listeners:B})}var UE=/\r\n?/g,$E=/\u0000|\uFFFD/g;function px(t){return(typeof t=="string"?t:""+t).replace(UE,`
50
+ `).replace($E,"")}function mx(t,n){return n=px(n),px(t)===n}function pt(t,n,a,f,k,E){switch(a){case"children":if(typeof f=="string")n==="body"||n==="textarea"&&f===""||vo(t,f);else if(typeof f=="number"||typeof f=="bigint")n!=="body"&&vo(t,""+f);else return;break;case"className":yc(t,"class",f);break;case"tabIndex":yc(t,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":yc(t,a,f);break;case"style":u_(t,f,E);return;case"data":if(n!=="object"){yc(t,"data",f);break}case"src":case"href":if(f===""&&(n!=="a"||a!=="href")){t.removeAttribute(a);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(a);break}f=bc(f),t.setAttribute(a,f);break;case"action":case"formAction":if(typeof f=="function"){t.setAttribute(a,"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 E=="function"&&(a==="formAction"?(n!=="input"&&pt(t,n,"name",k.name,k,null),pt(t,n,"formEncType",k.formEncType,k,null),pt(t,n,"formMethod",k.formMethod,k,null),pt(t,n,"formTarget",k.formTarget,k,null)):(pt(t,n,"encType",k.encType,k,null),pt(t,n,"method",k.method,k,null),pt(t,n,"target",k.target,k,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(a);break}f=bc(f),t.setAttribute(a,f);break;case"onClick":f!=null&&(t.onclick=Di);return;case"onScroll":f!=null&&et("scroll",t);return;case"onScrollEnd":f!=null&&et("scrollend",t);return;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(s(61));if(a=f.__html,a!=null){if(k.children!=null)throw Error(s(60));(E!=null?E.__html:void 0)!==a&&(t.innerHTML=a)}}break;case"multiple":t.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":t.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){t.removeAttribute("xlink:href");break}a=bc(f),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(a,f):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":f&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":f===!0?t.setAttribute(a,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(a,f):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?t.setAttribute(a,f):t.removeAttribute(a);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?t.removeAttribute(a):t.setAttribute(a,f);break;case"popover":et("beforetoggle",t),et("toggle",t),xc(t,"popover",f);break;case"xlinkActuate":er(t,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":er(t,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":er(t,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":er(t,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":er(t,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":er(t,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":er(t,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":er(t,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":er(t,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":xc(t,"is",f);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=lk.get(a)||a,xc(t,a,f);else return}at=!0}function pp(t,n,a,f,k,E){switch(a){case"style":u_(t,f,E);return;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(s(61));if(a=f.__html,a!=null){if(k.children!=null)throw Error(s(60));(E!=null?E.__html:void 0)!==a&&(t.innerHTML=a)}}break;case"children":if(typeof f=="string")vo(t,f);else if(typeof f=="number"||typeof f=="bigint")vo(t,""+f);else return;break;case"onScroll":f!=null&&et("scroll",t);return;case"onScrollEnd":f!=null&&et("scrollend",t);return;case"onClick":f!=null&&(t.onclick=Di);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!e_.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(k=a.endsWith("Capture"),E=a.slice(2,k?a.length-7:void 0),n=t[Dn]||null,n=n!=null?n[a]:null,typeof n=="function"&&t.removeEventListener(E,n,k),typeof f=="function")){typeof n!="function"&&n!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(E,f,k);break e}at=!0,a in t?t[a]=f:f===!0?t.setAttribute(a,""):xc(t,a,f)}return}at=!0}function pn(t,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var f=!1,k=!1,E;for(E in a)if(a.hasOwnProperty(E)){var B=a[E];if(B!=null)switch(E){case"src":f=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,E,B,a,null)}}k&&pt(t,n,"srcSet",a.srcSet,a,null),f&&pt(t,n,"src",a.src,a,null);return;case"input":et("invalid",t);var q=E=B=k=null,J=null,se=null;for(f in a)if(a.hasOwnProperty(f)){var de=a[f];if(de!=null)switch(f){case"name":k=de;break;case"type":B=de;break;case"checked":J=de;break;case"defaultChecked":se=de;break;case"value":E=de;break;case"defaultValue":q=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,n));break;default:pt(t,n,f,de,a,null)}}o_(t,E,q,J,se,B,k,!1);return;case"select":et("invalid",t),f=B=E=null;for(k in a)if(a.hasOwnProperty(k)&&(q=a[k],q!=null))switch(k){case"value":E=q;break;case"defaultValue":B=q;break;case"multiple":f=q;default:pt(t,n,k,q,a,null)}n=E,a=B,t.multiple=!!f,n!=null?go(t,!!f,n,!1):a!=null&&go(t,!!f,a,!0);return;case"textarea":et("invalid",t),E=k=f=null;for(B in a)if(a.hasOwnProperty(B)&&(q=a[B],q!=null))switch(B){case"value":f=q;break;case"defaultValue":k=q;break;case"children":E=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(91));break;default:pt(t,n,B,q,a,null)}l_(t,f,k,E);return;case"option":for(J in a)if(a.hasOwnProperty(J)&&(f=a[J],f!=null))switch(J){case"selected":t.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:pt(t,n,J,f,a,null)}return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(f=0;f<gl.length;f++)et(gl[f],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in a)if(a.hasOwnProperty(se)&&(f=a[se],f!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:pt(t,n,se,f,a,null)}return;default:if(md(n)){for(de in a)a.hasOwnProperty(de)&&(f=a[de],f!==void 0&&pp(t,n,de,f,a,void 0));return}}for(q in a)a.hasOwnProperty(q)&&(f=a[q],f!=null&&pt(t,n,q,f,a,null))}var qE={};function VE(t,n,a,f){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,E=null,B=null,q=null,J=null,se=null,de=null;for(ce in a){var me=a[ce];if(a.hasOwnProperty(ce)&&me!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":J=me;default:f.hasOwnProperty(ce)||pt(t,n,ce,null,f,me)}}for(var ie in f){var ce=f[ie];if(me=a[ie],f.hasOwnProperty(ie)&&(ce!=null||me!=null))switch(ie){case"type":ce!==me&&(at=!0),E=ce;break;case"name":ce!==me&&(at=!0),k=ce;break;case"checked":ce!==me&&(at=!0),se=ce;break;case"defaultChecked":ce!==me&&(at=!0),de=ce;break;case"value":ce!==me&&(at=!0),B=ce;break;case"defaultValue":ce!==me&&(at=!0),q=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,n));break;default:ce!==me&&pt(t,n,ie,ce,f,me)}}fd(t,B,q,J,se,de,E,k);return;case"select":ce=B=q=ie=null;for(E in a)if(J=a[E],a.hasOwnProperty(E)&&J!=null)switch(E){case"value":break;case"multiple":ce=J;default:f.hasOwnProperty(E)||pt(t,n,E,null,f,J)}for(k in f)if(E=f[k],J=a[k],f.hasOwnProperty(k)&&(E!=null||J!=null))switch(k){case"value":E!==J&&(at=!0),ie=E;break;case"defaultValue":E!==J&&(at=!0),q=E;break;case"multiple":E!==J&&(at=!0),B=E;default:E!==J&&pt(t,n,k,E,f,J)}n=q,a=B,f=ce,ie!=null?go(t,!!a,ie,!1):!!f!=!!a&&(n!=null?go(t,!!a,n,!0):go(t,!!a,a?[]:"",!1));return;case"textarea":ce=ie=null;for(q in a)if(k=a[q],a.hasOwnProperty(q)&&k!=null&&!f.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:pt(t,n,q,null,f,k)}for(B in f)if(k=f[B],E=a[B],f.hasOwnProperty(B)&&(k!=null||E!=null))switch(B){case"value":k!==E&&(at=!0),ie=k;break;case"defaultValue":k!==E&&(at=!0),ce=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:k!==E&&pt(t,n,B,k,f,E)}a_(t,ie,ce);return;case"option":for(var ke in a)if(ie=a[ke],a.hasOwnProperty(ke)&&ie!=null&&!f.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:pt(t,n,ke,null,f,ie)}for(J in f)if(ie=f[J],ce=a[J],f.hasOwnProperty(J)&&ie!==ce&&(ie!=null||ce!=null))switch(J){case"selected":ie!==ce&&(at=!0),t.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:pt(t,n,J,ie,f,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in a)ie=a[Me],a.hasOwnProperty(Me)&&ie!=null&&!f.hasOwnProperty(Me)&&pt(t,n,Me,null,f,ie);for(se in f)if(ie=f[se],ce=a[se],f.hasOwnProperty(se)&&ie!==ce&&(ie!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,n));break;default:pt(t,n,se,ie,f,ce)}return;default:if(md(n)){for(var Ye in a)ie=a[Ye],a.hasOwnProperty(Ye)&&ie!==void 0&&!f.hasOwnProperty(Ye)&&pp(t,n,Ye,void 0,f,ie);for(de in f)ie=f[de],ce=a[de],!f.hasOwnProperty(de)||ie===ce||ie===void 0&&ce===void 0||pp(t,n,de,ie,f,ce);return}}for(var re in a)ie=a[re],a.hasOwnProperty(re)&&ie!=null&&!f.hasOwnProperty(re)&&pt(t,n,re,null,f,ie);for(me in f)ie=f[me],ce=a[me],!f.hasOwnProperty(me)||ie===ce||ie==null&&ce==null||pt(t,n,me,ie,f,ce)}function gx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function WE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,a=performance.getEntriesByType("resource"),f=0;f<a.length;f++){var k=a[f],E=k.transferSize,B=k.initiatorType,q=k.duration;if(E&&q&&gx(B)){for(B=0,q=k.responseEnd,f+=1;f<a.length;f++){var J=a[f],se=J.startTime;if(se>q)break;var de=J.transferSize,me=J.initiatorType;de&&gx(me)&&(J=J.responseEnd,B+=de*(J<q?1:(q-se)/(J-se)))}if(--f,n+=8*(E+B)/(k.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var mp=null,gp=null;function _l(t){return t.nodeType===9?t:t.ownerDocument}function vx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _x(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function xx(t,n,a,f){return a=_l(a).createElement(t),a[cn]=f,a[Dn]=n,pn(a,t,n),en(a),a}function vp(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var _p=null;function GE(){var t=window.event;return t&&t.type==="popstate"?t===_p?!1:(_p=t,!0):(_p=null,!1)}var xp=typeof setTimeout=="function"?setTimeout:void 0,YE=typeof clearTimeout=="function"?clearTimeout:void 0,yx=typeof Promise=="function"?Promise:void 0,bx=typeof requestAnimationFrame=="function"?requestAnimationFrame:xp,KE=typeof queueMicrotask=="function"?queueMicrotask:typeof yx<"u"?function(t){return yx.resolve(null).then(t).catch(XE)}:xp;function XE(t){setTimeout(function(){throw t})}function Zr(t){return t==="head"}function wx(t,n){var a=n,f=0;do{var k=a.nextSibling;if(t.removeChild(a),k&&k.nodeType===8)if(a=k.data,a==="/$"||a==="/&"){if(f===0){t.removeChild(k),ea(n);return}f--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")f++;else if(a==="html")Tp(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Tp(a);for(var E=a.firstChild;E;){var B=E.nextSibling,q=E.nodeName;E[Ba]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&E.rel.toLowerCase()==="stylesheet"||a.removeChild(E),E=B}}else a==="body"&&Tp(t.ownerDocument.body);a=k}while(a);ea(n)}function Sx(t,n){var a=t;t=0;do{var f=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=f}while(a)}function Cx(t,n,a){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,t.style.viewTransitionName=n,a!=null&&(t.style.viewTransitionClass=a),a=getComputedStyle(t),a.display==="inline"){if(n=t.getClientRects(),n.length===1)var f=1;else for(var k=f=0;k<n.length;k++){var E=n[k];0<E.width&&0<E.height&&f++}f===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+a.paddingTop,t.marginBottom="-"+a.paddingBottom)}}function kx(t,n){t=t.style,n=n.style;var a=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;t.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,t.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),t.display==="inline-block"&&(n==null?t.display=t.margin="":(a=n.display,t.display=a==null||typeof a=="boolean"?"":a,a=n.margin,a!=null?t.margin=a:(a=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],t.marginTop=a==null||typeof a=="boolean"?"":a,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],t.marginBottom=n==null||typeof n=="boolean"?"":n)))}function QE(t,n,a){return a=a.ownerDocument.defaultView,{rect:t,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=a.innerHeight&&t.left<=a.innerWidth}}function yp(t){var n=t.getBoundingClientRect(),a=getComputedStyle(t);return QE(n,a,t)}function ZE(t){return t.documentElement.clientHeight}function JE(t){this.addEventListener("load",t),this.addEventListener("error",t)}function e3(t,n,a,f,k,E,B,q,J){var se=n.nodeType===9?n:n.ownerDocument;try{var de=se.startViewTransition({update:function(){var ie=se.defaultView,ce=ie.navigation&&ie.navigation.transition,ke=se.fonts.status;f();var Me=[];if(ke==="loaded"&&(ZE(se),se.fonts.status==="loading"&&Me.push(se.fonts.ready)),ke=Me.length,t!==null)for(var Ye=t.suspenseyImages,re=0,te=0;te<Ye.length;te++){var ae=Ye[te];if(!ae.complete){var pe=ae.getBoundingClientRect();if(0<pe.bottom&&0<pe.right&&pe.top<ie.innerHeight&&pe.left<ie.innerWidth){if(re+=Wx(ae),re>Du){Me.length=ke;break}ae=new Promise(JE.bind(ae)),Me.push(ae)}}}if(0<Me.length)return ie=Promise.race([Promise.all(Me),new Promise(function(Ae){return setTimeout(Ae,500)})]).then(k,k),(ce?Promise.allSettled([ce.finished,ie]):ie).then(E,E);if(k(),ce)return ce.finished.then(E,E);E()},types:a});se.__reactViewTransition=de;var me=[];return de.ready.then(function(){for(var ie=se.documentElement.getAnimations({subtree:!0}),ce=0;ce<ie.length;ce++){var ke=ie[ce],Me=ke.effect,Ye=Me.pseudoElement;if(Ye!=null&&Ye.startsWith("::view-transition")){me.push(ke),ke=Me.getKeyframes();for(var re=Ye=void 0,te=!0,ae=0;ae<ke.length;ae++){var pe=ke[ae],Ae=pe.width;if(Ye===void 0)Ye=Ae;else if(Ye!==Ae){te=!1;break}if(Ae=pe.height,re===void 0)re=Ae;else if(re!==Ae){te=!1;break}delete pe.width,delete pe.height,pe.transform==="none"&&delete pe.transform}te&&Ye!==void 0&&re!==void 0&&(Me.setKeyframes(ke),te=getComputedStyle(Me.target,Me.pseudoElement),te.width!==Ye||te.height!==re)&&(te=ke[0],te.width=Ye,te.height=re,te=ke[ke.length-1],te.width=Ye,te.height=re,Me.setKeyframes(ke))}}B()},function(ie){se.__reactViewTransition===de&&(se.__reactViewTransition=null);try{if(typeof ie=="object"&&ie!==null)switch(ie.name){case"InvalidStateError":(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null)}ie!==null&&J(ie)}finally{f(),k(),B()}}),de.finished.finally(function(){for(var ie=0;ie<me.length;ie++)me[ie].cancel();se.__reactViewTransition===de&&(se.__reactViewTransition=null),q()}),de}catch{return f(),k(),B(),null}}function $s(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}$s.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:L({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},$s.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,a=t.getAnimations({subtree:!0}),f=[],k=0;k<a.length;k++){var E=a[k].effect;E!==null&&E.target===t&&E.pseudoElement===n&&f.push(a[k])}return f},$s.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ex(t){return{name:t,group:new $s("group",t),imagePair:new $s("image-pair",t),old:new $s("old",t),new:new $s("new",t)}}function Qn(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Qn.prototype.addEventListener=function(t,n,a){var f=null,k=null;if(!(a!=null&&typeof a!="boolean"&&(f=a.signal||null,f!==null&&f.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var E=this._eventListeners;if(Rx(E,t,n,a)===-1){var B=this,q=n;a!=null&&typeof a!="boolean"&&a.once===!0&&(q=function(J){B.removeEventListener(t,n,a),typeof n=="function"?n.call(this,J):n.handleEvent(J)}),f!==null&&(k=B.removeEventListener.bind(B,t,n,a),f.addEventListener("abort",k,{once:!0}),k=f.removeEventListener.bind(f,"abort",k)),f=Yo(a),E.push({type:t,listener:n,optionsOrUseCapture:a,attachedListener:q,cleanup:k}),c(this._fragmentFiber.child,!1,t3,t,q,f)}this._eventListeners=E}};function t3(t,n,a,f){return g(t).addEventListener(n,a,f),!1}Qn.prototype.removeEventListener=function(t,n,a){var f=this._eventListeners;if(f!==null&&(n=Rx(f,t,n,a),n!==-1)){var k=f[n];a=k.attachedListener;var E=k.cleanup;k=Yo(k.optionsOrUseCapture),c(this._fragmentFiber.child,!1,n3,t,a,k),f.splice(n,1),E!==null&&E()}};function n3(t,n,a,f){return g(t).removeEventListener(n,a,f),!1}function Yo(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function Tx(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function Rx(t,n,a,f){if(t.length===0)return-1;f=Tx(f);for(var k=0;k<t.length;k++){var E=t[k];if(E.type===n&&E.listener===a&&Tx(E.optionsOrUseCapture)===f)return k}return-1}Qn.prototype.dispatchEvent=function(t){var n=_(this._fragmentFiber);if(n===null)return!0;n=g(n);var a=this._eventListeners;if(a!==null&&0<a.length||!t.bubbles){var f=n.nodeType===9?n.createComment(""):document.createTextNode("");if(a)for(var k=0;k<a.length;k++){var E=a[k];f.addEventListener(E.type,E.attachedListener,Yo(E.optionsOrUseCapture))}if(n.appendChild(f),t=f.dispatchEvent(t),a)for(k=0;k<a.length;k++)E=a[k],f.removeEventListener(E.type,E.attachedListener,Yo(E.optionsOrUseCapture));return n.removeChild(f),t}return n.dispatchEvent(t)},Qn.prototype.focus=function(t){c(this._fragmentFiber.child,!0,Ax,t,void 0,void 0)};function Ax(t,n){return t.tag===6?!1:(t=g(t),p3(t,n))}Qn.prototype.focusLast=function(t){var n=[];c(this._fragmentFiber.child,!0,bp,n,void 0,void 0);for(var a=n.length-1;0<=a&&!Ax(n[a],t);a--);};function bp(t,n){return n.push(t),!1}Qn.prototype.blur=function(){var t=_(this._fragmentFiber);t!==null&&(t=g(t),t=_l(t).activeElement,t!==null&&c(this._fragmentFiber.child,!1,i3,t,void 0,void 0))};function i3(t,n){return t.tag===6?!1:(t=g(t),t===n||t.contains(n)?(n.blur(),!0):!1)}Qn.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),c(this._fragmentFiber.child,!1,r3,t,void 0,void 0)};function r3(t,n){return t.tag===6||(t=g(t),n.observe(t)),!1}Qn.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),c(this._fragmentFiber.child,!1,s3,t,void 0,void 0);for(var a=n=0;a<Ci.length;a++){var f=Ci[a];f.fragmentInstance===this&&f.observer===t?t.unobserve(f.instance):Ci[n++]=f}Ci.length=n}};function s3(t,n){return t.tag===6||(t=g(t),n.unobserve(t)),!1}var Ci=[],wp=!1;function o3(t,n,a){Ci.push({fragmentInstance:t,observer:n,instance:a}),wp||(wp=!0,m3(function(){wp=!1;var f=Ci;Ci=[];for(var k=0;k<f.length;k++){var E=f[k];E.observer.unobserve(E.instance)}}))}Qn.prototype.getClientRects=function(){var t=[];return c(this._fragmentFiber.child,!1,a3,t,void 0,void 0),t};function a3(t,n){if(t.tag===6){t=t.stateNode;var a=t.ownerDocument.createRange();a.selectNodeContents(t),n.push.apply(n,a.getClientRects())}else t=g(t),n.push.apply(n,t.getClientRects());return!1}Qn.prototype.getRootNode=function(t){var n=_(this._fragmentFiber);return n===null?this:g(n).getRootNode(t)},Qn.prototype.compareDocumentPosition=function(t){var n=_(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];c(this._fragmentFiber.child,!1,bp,a,void 0,void 0);var f=g(n);if(a.length===0){if(a=f,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(a=n)}n=this._fragmentFiber;var k=f=a.compareDocumentPosition(t);return a===t?k=Node.DOCUMENT_POSITION_CONTAINS:f&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=C(n)[1],a===null?k=Node.DOCUMENT_POSITION_PRECEDING:(t=g(a).compareDocumentPosition(t),k=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),k|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=g(a[0]),k=g(a[a.length-1]);var E=x(this._fragmentFiber)?n.parentElement:f;if(E==null)return Node.DOCUMENT_POSITION_DISCONNECTED;f=E.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,E=E.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_CONTAINED_BY;var B=n.compareDocumentPosition(t),q=k.compareDocumentPosition(t),J=B&Node.DOCUMENT_POSITION_CONTAINED_BY||q&Node.DOCUMENT_POSITION_CONTAINED_BY;return q=f&&E&&B&Node.DOCUMENT_POSITION_FOLLOWING&&q&Node.DOCUMENT_POSITION_PRECEDING,n=f&&n===t||E&&k===t||J||q?Node.DOCUMENT_POSITION_CONTAINED_BY:!f&&n===t||!E&&k===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:B,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||l3(n,this._fragmentFiber,a[0],a[a.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function l3(t,n,a,f,k){var E=ws(k);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!E)e:{for(;E!==null;){if(E.tag===7&&(E===n||E.alternate===n)){a=!0;break e}E=E.return}a=!1}return a}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(E===null)return E=k.ownerDocument,k===E||k===E.documentElement||k===E.body;e:{for(E=n,n=_(n);E!==null;){if(!(E.tag!==5&&E.tag!==3&&E.tag!==27||E!==n&&E.alternate!==n)){E=!0;break e}E=E.return}E=!1}return E}return t&Node.DOCUMENT_POSITION_PRECEDING?((n=!!E)&&!(n=E===a)&&(n=R(a,E,D),n===null?n=!1:(c(n,!0,w,E,a),E=b,b=null,n=E!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!E)&&!(n=E===f)&&(n=R(f,E,D),n===null?n=!1:(c(n,!0,T,E,f),E=b,S=b=null,n=E!==null)),n):!1}function Dx(t,n){var a=t.ownerDocument.createRange();a.selectNodeContents(t),t=a.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}Qn.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(s(566));var n=[];c(this._fragmentFiber.child,!1,bp,n,void 0,void 0);var a=t!==!1;if(n.length===0){var f=C(this._fragmentFiber);if(f=a?f[1]||f[0]||_(this._fragmentFiber):f[0]||f[1],f===null)return;if(f.tag===6){t=g(f),Dx(t,a);return}if(f=g(f),f.nodeType!==9){if(f.nodeType===11){a="host"in f?f.host:null,a!==null&&a.scrollIntoView(t);return}f.scrollIntoView(t)}}for(f=a?n.length-1:0;f!==(a?-1:n.length);){var k=n[f];k.tag===6?(k=g(k),Dx(k,a)):g(k).scrollIntoView(t),f+=a?-1:1}};function c3(t,n){return t=g(t),Lx(t,n),!1}function Lx(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function jx(t,n){var a=n._eventListeners;if(a!==null)for(var f=0;f<a.length;f++){var k=a[f];t.addEventListener(k.type,k.attachedListener,Yo(k.optionsOrUseCapture))}t.nodeType!==3&&(a=n._observers,a!==null&&a.forEach(function(E){for(var B=0,q=0;q<Ci.length;q++){var J=Ci[q];(J.fragmentInstance!==n||J.observer!==E||J.instance!==t)&&(Ci[B++]=J)}Ci.length=B,E.observe(t)}),Lx(t,n))}function u3(t,n){var a=n._eventListeners;if(a!==null)for(var f=0;f<a.length;f++){var k=a[f];t.removeEventListener(k.type,k.attachedListener,Yo(k.optionsOrUseCapture))}t.nodeType!==3&&(a=n._observers,a!==null&&a.forEach(function(E){typeof E.rootMargin=="string"?o3(n,E,t):E.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function Sp(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Sp(a),_c(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function h3(t,n,a,f){for(;t.nodeType===1;){var k=a;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!f&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(f){if(!t[Ba])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(E=t.getAttribute("rel"),E==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(E!==k.rel||t.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||t.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||t.getAttribute("title")!==(k.title==null?null:k.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(E=t.getAttribute("src"),(E!==(k.src==null?null:k.src)||t.getAttribute("type")!==(k.type==null?null:k.type)||t.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&E&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var E=k.name==null?null:""+k.name;if(k.type==="hidden"&&t.getAttribute("name")===E)return t}else return t;if(t=hi(t.nextSibling),t===null)break}return null}function d3(t,n,a){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=hi(t.nextSibling),t===null))return null;return t}function Mx(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=hi(t.nextSibling),t===null))return null;return t}function Cp(t){return t.data==="$?"||t.data==="$~"}function kp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function f3(t,n){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||a.readyState!=="loading")n();else{var f=function(){n(),a.removeEventListener("DOMContentLoaded",f)};a.addEventListener("DOMContentLoaded",f),t._reactRetry=f}}function hi(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Ep=null;function Nx(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(n===0)return hi(t.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}t=t.nextSibling}return null}function Ox(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return t;n--}else a!=="/$"&&a!=="/&"||n++}t=t.previousSibling}return null}function p3(t,n){function a(){f=!0}if(t.ownerDocument.activeElement===t)return!0;var f=!1;try{t.ownerDocument.addEventListener("focus",a,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",a,!0)}return f}function m3(t){bx(function(){bx(function(n){return t(n)})})}function Bx(t,n,a){switch(n=_l(a),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Px(t,n,a){for(var f in a){var k=a[f];a.hasOwnProperty(f)&&k!=null&&pt(t,n,f,null,qE,k)}a.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Di&&(t.onclick=null),_c(t)}function Tp(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);_c(t)}var di=new Map,zx=new Set;function xl(t){if(typeof t.getRootNode=="function"){var n=t.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return t.nodeType===9?t:t.ownerDocument}var fr=he.d;he.d={f:g3,r:v3,D:_3,C:x3,L:y3,m:b3,X:S3,S:w3,M:C3};function g3(){var t=fr.f(),n=bu();return t||n}function v3(t){var n=fo(t);n!==null&&n.tag===5&&n.type==="form"?H1(n):fr.r(t)}var Ko=typeof document>"u"?null:document;function Ix(t,n,a){var f=Ko;if(f&&typeof n=="string"&&n){var k=ri(n);k='link[rel="'+t+'"][href="'+k+'"]',typeof a=="string"&&(k+='[crossorigin="'+a+'"]'),zx.has(k)||(zx.add(k),t={rel:t,crossOrigin:a,href:n},f.querySelector(k)===null&&(n=f.createElement("link"),pn(n,"link",t),en(n),f.head.appendChild(n)))}}function _3(t){fr.D(t),Ix("dns-prefetch",t,null)}function x3(t,n){fr.C(t,n),Ix("preconnect",t,n)}function y3(t,n,a){fr.L(t,n,a);var f=Ko;if(f&&t&&n){var k='link[rel="preload"][as="'+ri(n)+'"]';n==="image"&&a&&a.imageSrcSet?(k+='[imagesrcset="'+ri(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(k+='[imagesizes="'+ri(a.imageSizes)+'"]')):k+='[href="'+ri(t)+'"]';var E=k;switch(n){case"style":E=Xo(t);break;case"script":E=Qo(t)}if(!(di.has(E)||(t=L({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),di.set(E,t),f.querySelector(k)!==null||n==="style"&&f.querySelector(yl(E))||n==="script"&&f.querySelector(bl(E))))){var B=f.createElement("link");pn(B,"link",t),n==="style"&&(B[vc]=!0,B.onload=B.onerror=function(){Zv(B)}),en(B),f.head.appendChild(B)}}}function b3(t,n){fr.m(t,n);var a=Ko;if(a&&t){var f=n&&typeof n.as=="string"?n.as:"script",k='link[rel="modulepreload"][as="'+ri(f)+'"][href="'+ri(t)+'"]',E=k;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Qo(t)}if(!di.has(E)&&(t=L({rel:"modulepreload",href:t},n),di.set(E,t),a.querySelector(k)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bl(E)))return}f=a.createElement("link"),pn(f,"link",t),en(f),a.head.appendChild(f)}}}function w3(t,n,a){fr.S(t,n,a);var f=Ko;if(f&&t){var k=po(f).hoistableStyles,E=Xo(t);n=n||"default";var B=k.get(E);if(!B){var q={loading:0,preload:null};if(B=f.querySelector(yl(E)))q.loading=5;else{t=L({rel:"stylesheet",href:t,"data-precedence":n},a),(a=di.get(E))&&Rp(t,a);var J=B=f.createElement("link");en(J),pn(J,"link",t),J._p=new Promise(function(se,de){J.onload=se,J.onerror=de}),J.addEventListener("load",function(){q.loading|=1}),J.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Ru(B,n,f)}B={type:"stylesheet",instance:B,count:1,state:q},k.set(E,B)}}}function S3(t,n){fr.X(t,n);var a=Ko;if(a&&t){var f=po(a).hoistableScripts,k=Qo(t),E=f.get(k);E||(E=a.querySelector(bl(k)),E||(t=L({src:t,async:!0},n),(n=di.get(k))&&Ap(t,n),E=a.createElement("script"),en(E),pn(E,"link",t),a.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},f.set(k,E))}}function C3(t,n){fr.M(t,n);var a=Ko;if(a&&t){var f=po(a).hoistableScripts,k=Qo(t),E=f.get(k);E||(E=a.querySelector(bl(k)),E||(t=L({src:t,async:!0,type:"module"},n),(n=di.get(k))&&Ap(t,n),E=a.createElement("script"),en(E),pn(E,"link",t),a.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},f.set(k,E))}}function Hx(t,n,a,f){var k=(k=Be.current)?xl(k):null;if(!k)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=Xo(a.href),n=po(k).hoistableStyles,f=n.get(a),f||(f={type:"style",instance:null,count:0,state:null},n.set(a,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Xo(a.href);var E=po(k).hoistableStyles,B=E.get(t);if(B||(k=k.ownerDocument||k,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(t,B),(E=k.querySelector(yl(t)))?E._p||(B.instance=E,B.state.loading=5):(E=di.get(t),E||(E={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},di.set(t,E)),k3(k,t,E,B.state))),n&&f===null)throw Error(s(528,""));return B}if(n&&f!==null)throw Error(s(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(a=Qo(a),n=po(k).hoistableScripts,f=n.get(a),f||(f={type:"script",instance:null,count:0,state:null},n.set(a,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Xo(t){return'href="'+ri(t)+'"'}function yl(t){return'link[rel="stylesheet"]['+t+"]"}function Fx(t){return L({},t,{"data-precedence":t.precedence,precedence:null})}function k3(t,n,a,f){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[vc]!==!0){f.loading=1;return}}else n=t.createElement("link"),n[vc]=!0,n.onload=n.onerror=Zv.bind(null,n),pn(n,"link",a),en(n),t.head.appendChild(n);f.preload=n,n.addEventListener("load",function(){return f.loading|=1}),n.addEventListener("error",function(){return f.loading|=2})}function Qo(t){return'[src="'+ri(t)+'"]'}function bl(t){return"script[async]"+t}function Ux(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var f=t.querySelector('style[data-href~="'+ri(a.href)+'"]');if(f)return n.instance=f,en(f),f;var k=L({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return f=(t.ownerDocument||t).createElement("style"),en(f),pn(f,"style",k),Ru(f,a.precedence,t),n.instance=f;case"stylesheet":k=Xo(a.href);var E=t.querySelector(yl(k));if(E)return n.state.loading|=4,n.instance=E,en(E),E;f=Fx(a),(k=di.get(k))&&Rp(f,k),E=(t.ownerDocument||t).createElement("link"),en(E);var B=E;return B._p=new Promise(function(q,J){B.onload=q,B.onerror=J}),pn(E,"link",f),n.state.loading|=4,Ru(E,a.precedence,t),n.instance=E;case"script":return E=Qo(a.src),(k=t.querySelector(bl(E)))?(n.instance=k,en(k),k):(f=a,(k=di.get(E))&&(f=L({},a),Ap(f,k)),t=t.ownerDocument||t,k=t.createElement("script"),en(k),pn(k,"link",f),t.head.appendChild(k),n.instance=k);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(f=n.instance,n.state.loading|=4,Ru(f,a.precedence,t));return n.instance}function Ru(t,n,a){for(var f=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=f.length?f[f.length-1]:null,E=k,B=0;B<f.length;B++){var q=f[B];if(q.dataset.precedence===n)E=q;else if(E!==k)break}E?E.parentNode.insertBefore(t,E.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(t,n.firstChild))}function Rp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Ap(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Au=null;function $x(t,n,a){if(Au===null){var f=new Map,k=Au=new Map;k.set(a,f)}else k=Au,f=k.get(a),f||(f=new Map,k.set(a,f));if(f.has(t))return f;for(f.set(t,null),a=a.getElementsByTagName(t),k=0;k<a.length;k++){var E=a[k];if(!(E[Ba]||E[cn]||t==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var B=E.getAttribute(n)||"";B=t+B;var q=f.get(B);q?q.push(E):f.set(B,[E])}}return f}function Dp(t,n,a){t=t.ownerDocument||t,t.head.insertBefore(a,n==="title"?t.querySelector("head > title"):null)}function E3(t,n,a){if(a===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function qx(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Vx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Wx(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Gx(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=Wx(n),t.suspenseyImages.push(n)),t=A3.bind(t),n.decode().then(t,t))}function T3(t,n,a,f){if(a.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var k=Xo(f.href),E=n.querySelector(yl(k));if(E){n=E._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=wl.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=E,en(E);return}E=n.ownerDocument||n,f=Fx(f),(k=di.get(k))&&Rp(f,k),E=E.createElement("link"),en(E);var B=E;B._p=new Promise(function(q,J){B.onload=q,B.onerror=J}),pn(E,"link",f),a.instance=E}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=wl.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var Du=0;function R3(t,n){return t.stylesheets&&t.count===0&&ju(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var f=setTimeout(function(){if(t.stylesheets&&ju(t,t.stylesheets),t.unsuspend){var E=t.unsuspend;t.unsuspend=null,E()}},6e4+n);0<t.imgBytes&&Du===0&&(Du=62500*WE());var k=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&ju(t,t.stylesheets),t.unsuspend)){var E=t.unsuspend;t.unsuspend=null,E()}},(t.imgBytes>Du?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(f),clearTimeout(k)}}:null}function Yx(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)ju(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function wl(){this.count--,Yx(this)}function A3(){this.imgCount--,Yx(this)}var Lu=null;function ju(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Lu=new Map,n.forEach(D3,t),Lu=null,wl.call(t))}function D3(t,n){if(!(n.state.loading&4)){var a=Lu.get(t);if(a)var f=a.get(null);else{a=new Map,Lu.set(t,a);for(var k=t.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<k.length;E++){var B=k[E];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(a.set(B.dataset.precedence,B),f=B)}f&&a.set(null,f)}k=n.instance,B=k.getAttribute("data-precedence"),E=a.get(B)||f,E===f&&a.set(null,k),a.set(B,k),this.count++,f=wl.bind(this),k.addEventListener("load",f),k.addEventListener("error",f),E?E.parentNode.insertBefore(k,E.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(k,t.firstChild)),n.state.loading|=4}}var Zo={$$typeof:W,Provider:null,Consumer:null,_currentValue:Se,_currentValue2:Se,_threadCount:0};function L3(t,n,a,f,k,E,B,q,J){this.tag=1,this.containerInfo=t,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=cd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cd(0),this.hiddenUpdates=cd(null),this.identifierPrefix=f,this.onUncaughtError=k,this.onCaughtError=E,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.transitionTypes=null,this.incompleteTransitions=new Map}function Kx(t,n,a,f,k,E,B,q,J,se,de,me){return t=new L3(t,n,a,B,J,se,de,me,q),n=1,E===!0&&(n|=24),E=Ln(3,null,null,n),t.current=E,E.stateNode=t,n=qd(),n.refCount++,t.pooledCache=n,n.refCount++,E.memoizedState={element:f,isDehydrated:a,cache:n},Yd(E),t}function Xx(t){return t?(t=Co,t):Co}function Qx(t,n,a,f,k,E){k=Xx(k),f.context===null?f.context=k:f.pendingContext=k,f=Hr(n),f.payload={element:a},E=E===void 0?null:E,E!==null&&(f.callback=E),a=Fr(t,f,n),a!==null&&(On(a,t,n),Ja(a,t,n))}function Zx(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<n?a:n}}function Lp(t,n){Zx(t,n),(t=t.alternate)&&Zx(t,n)}function Jx(t){if(t.tag===13||t.tag===31){var n=Es(t,67108864);n!==null&&On(n,t,67108864),Lp(t,67108864)}}function ey(t){if(t.tag===13||t.tag===31){var n=Xn();n=ud(n);var a=Es(t,n);a!==null&&On(a,t,n),Lp(t,n)}}var Jo=!0;function j3(t,n,a,f){var k=ue.T;ue.T=null;var E=he.p;try{he.p=2,jp(t,n,a,f)}finally{he.p=E,ue.T=k}}function M3(t,n,a,f){var k=ue.T;ue.T=null;var E=he.p;try{he.p=8,jp(t,n,a,f)}finally{he.p=E,ue.T=k}}function jp(t,n,a,f){if(Jo){var k=Mp(f);if(k===null)fp(t,n,f,Mu,a),ny(t,f);else if(O3(k,t,n,a,f))f.stopPropagation();else if(ny(t,f),n&4&&-1<N3.indexOf(t)){for(;k!==null;){var E=fo(k);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var B=bs(E.pendingLanes);if(B!==0){var q=E;for(q.pendingLanes|=2,q.entangledLanes|=2;B;){var J=1<<31-$n(B);q.entanglements[1]|=J,B&=~J}Hi(E),(ct&6)===0&&(_u=Kt()+500,ml(0))}}break;case 31:case 13:q=Es(E,2),q!==null&&On(q,E,2),bu(),Lp(E,2)}if(E=Mp(f),E===null&&fp(t,n,f,Mu,a),E===k)break;k=E}k!==null&&f.stopPropagation()}else fp(t,n,f,null,a)}}function Mp(t){return t=vd(t),Np(t)}var Mu=null;function Np(t){if(Mu=null,t=ws(t),t!==null){var n=h(t);if(n===null)t=null;else{var a=n.tag;if(a===13){if(t=p(n),t!==null)return t;t=null}else if(a===31){if(t=o(n),t!==null)return t;t=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Mu=t,null}function ty(t){switch(t){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Xt()){case ii:return 2;case Sn:return 8;case uo:case G5:return 32;case Uv:return 268435456;default:return 32}default:return 32}}var Op=!1,Jr=null,es=null,ts=null,Sl=new Map,Cl=new Map,ns=[],N3="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 ny(t,n){switch(t){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":es=null;break;case"mouseover":case"mouseout":ts=null;break;case"pointerover":case"pointerout":Sl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cl.delete(n.pointerId)}}function kl(t,n,a,f,k,E){return t===null||t.nativeEvent!==E?(t={blockedOn:n,domEventName:a,eventSystemFlags:f,nativeEvent:E,targetContainers:[k]},n!==null&&(n=fo(n),n!==null&&Jx(n)),t):(t.eventSystemFlags|=f,n=t.targetContainers,k!==null&&n.indexOf(k)===-1&&n.push(k),t)}function O3(t,n,a,f,k){switch(n){case"focusin":return Jr=kl(Jr,t,n,a,f,k),!0;case"dragenter":return es=kl(es,t,n,a,f,k),!0;case"mouseover":return ts=kl(ts,t,n,a,f,k),!0;case"pointerover":var E=k.pointerId;return Sl.set(E,kl(Sl.get(E)||null,t,n,a,f,k)),!0;case"gotpointercapture":return E=k.pointerId,Cl.set(E,kl(Cl.get(E)||null,t,n,a,f,k)),!0}return!1}function iy(t){var n=ws(t.target);if(n!==null){var a=h(n);if(a!==null){if(n=a.tag,n===13){if(n=p(a),n!==null){t.blockedOn=n,Kv(t.priority,function(){ey(a)});return}}else if(n===31){if(n=o(a),n!==null){t.blockedOn=n,Kv(t.priority,function(){ey(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Nu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var a=Mp(t.nativeEvent);if(a===null){a=t.nativeEvent;var f=new a.constructor(a.type,a);gd=f,a.target.dispatchEvent(f),gd=null}else return n=fo(a),n!==null&&Jx(n),t.blockedOn=a,!1;n.shift()}return!0}function ry(t,n,a){Nu(t)&&a.delete(n)}function B3(){Op=!1,Jr!==null&&Nu(Jr)&&(Jr=null),es!==null&&Nu(es)&&(es=null),ts!==null&&Nu(ts)&&(ts=null),Sl.forEach(ry),Cl.forEach(ry)}function Ou(t,n){t.blockedOn===n&&(t.blockedOn=null,Op||(Op=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,B3)))}var Bu=null;function sy(t){Bu!==t&&(Bu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Bu===t&&(Bu=null);for(var n=0;n<t.length;n+=3){var a=t[n],f=t[n+1],k=t[n+2];if(typeof f!="function"){if(Np(f||a)===null)continue;break}var E=fo(a);E!==null&&(t.splice(n,3),n-=3,gf(E,{pending:!0,data:k,method:a.method,action:f},f,k))}}))}function ea(t){function n(J){return Ou(J,t)}Jr!==null&&Ou(Jr,t),es!==null&&Ou(es,t),ts!==null&&Ou(ts,t),Sl.forEach(n),Cl.forEach(n);for(var a=0;a<ns.length;a++){var f=ns[a];f.blockedOn===t&&(f.blockedOn=null)}for(;0<ns.length&&(a=ns[0],a.blockedOn===null);)iy(a),a.blockedOn===null&&ns.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(f=0;f<a.length;f+=3){var k=a[f],E=a[f+1],B=k[Dn]||null;if(typeof E=="function")B||sy(a);else if(B){var q=null;if(E&&E.hasAttribute("formAction")){if(k=E,B=E[Dn]||null)q=B.formAction;else if(Np(k)!==null)continue}else q=B.action;typeof q=="function"?a[f+1]=q:(a.splice(f,3),f-=3),sy(a)}}}function oy(){function t(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(B){return k=B})},focusReset:"manual",scroll:"manual"})}function n(){k!==null&&(k(),k=null),f||setTimeout(a,20)}function a(){if(!f&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,k=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){f=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),k!==null&&(k(),k=null)}}}function Bp(t){this._internalRoot=t}Pu.prototype.render=Bp.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var a=n.current,f=Xn();Qx(a,f,t,n,null,null)},Pu.prototype.unmount=Bp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Qx(t.current,2,null,t,null,null),bu(),n[ho]=null}};function Pu(t){this._internalRoot=t}Pu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Yv();t={blockedOn:null,target:t,priority:n};for(var a=0;a<ns.length&&n!==0&&n<ns[a].priority;a++);ns.splice(a,0,t),a===0&&iy(t)}};var ay=i.version;if(ay!=="19.3.1")throw Error(s(527,ay,"19.3.1"));he.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=d(n),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var P3={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ue,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{Ma=zu.inject(P3),Un=zu}catch{}}return Tl.createRoot=function(t,n){if(!l(t))throw Error(s(299));var a=!1,f="",k=X1,E=Q1,B=Z1;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(f=n.identifierPrefix),n.onUncaughtError!==void 0&&(k=n.onUncaughtError),n.onCaughtError!==void 0&&(E=n.onCaughtError),n.onRecoverableError!==void 0&&(B=n.onRecoverableError)),n=Kx(t,1,!1,null,null,a,f,null,k,E,B,oy),t[ho]=n.current,dp(t),new Bp(n)},Tl.hydrateRoot=function(t,n,a){if(!l(t))throw Error(s(299));var f=!1,k="",E=X1,B=Q1,q=Z1,J=null;return a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(k=a.identifierPrefix),a.onUncaughtError!==void 0&&(E=a.onUncaughtError),a.onCaughtError!==void 0&&(B=a.onCaughtError),a.onRecoverableError!==void 0&&(q=a.onRecoverableError),a.formState!==void 0&&(J=a.formState)),n=Kx(t,1,!0,n,a??null,f,k,J,E,B,q,oy),n.context=Xx(null),a=n.current,f=Xn(),f=ud(f),k=Hr(f),k.callback=null,Fr(a,k,f),a=f,n.current.lanes=a,Oa(n,a),Hi(n),t[ho]=n.current,dp(t),new Pu(n)},Tl.version="19.3.1",Tl}var yy;function G3(){if(yy)return Hp.exports;yy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Hp.exports=W3(),Hp.exports}var Y3=G3();/**
51
+ * @license lucide-react v0.469.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const K3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pw=(...e)=>e.filter((i,r,s)=>!!i&&i.trim()!==""&&s.indexOf(i)===r).join(" ").trim();/**
56
+ * @license lucide-react v0.469.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */var X3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
61
+ * @license lucide-react v0.469.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Q3=N.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:l="",children:h,iconNode:p,...o},u)=>N.createElement("svg",{ref:u,...X3,width:i,height:i,stroke:e,strokeWidth:s?Number(r)*24/Number(i):r,className:Pw("lucide",l),...o},[...p.map(([d,v])=>N.createElement(d,v)),...Array.isArray(h)?h:[h]]));/**
66
+ * @license lucide-react v0.469.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const Ce=(e,i)=>{const r=N.forwardRef(({className:s,...l},h)=>N.createElement(Q3,{ref:h,iconNode:i,className:Pw(`lucide-${K3(e)}`,s),...l}));return r.displayName=`${e}`,r};/**
71
+ * @license lucide-react v0.469.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const Z3=Ce("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
76
+ * @license lucide-react v0.469.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Yl=Ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
81
+ * @license lucide-react v0.469.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const zw=Ce("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
86
+ * @license lucide-react v0.469.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const ga=Ce("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);/**
91
+ * @license lucide-react v0.469.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const ds=Ce("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
96
+ * @license lucide-react v0.469.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const J3=Ce("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
101
+ * @license lucide-react v0.469.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const e4=Ce("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);/**
106
+ * @license lucide-react v0.469.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Iw=Ce("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
111
+ * @license lucide-react v0.469.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const Kl=Ce("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
116
+ * @license lucide-react v0.469.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Xl=Ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
121
+ * @license lucide-react v0.469.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const ba=Ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
126
+ * @license lucide-react v0.469.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const t4=Ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
131
+ * @license lucide-react v0.469.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const wa=Ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
136
+ * @license lucide-react v0.469.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const n4=Ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
141
+ * @license lucide-react v0.469.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Hw=Ce("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
146
+ * @license lucide-react v0.469.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const Fw=Ce("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
151
+ * @license lucide-react v0.469.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const Uw=Ce("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
156
+ * @license lucide-react v0.469.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const $w=Ce("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
161
+ * @license lucide-react v0.469.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const Xs=Ce("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
166
+ * @license lucide-react v0.469.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Tm=Ce("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
171
+ * @license lucide-react v0.469.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const i4=Ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
176
+ * @license lucide-react v0.469.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const r4=Ce("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
181
+ * @license lucide-react v0.469.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const Ah=Ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
186
+ * @license lucide-react v0.469.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const s4=Ce("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
191
+ * @license lucide-react v0.469.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const qw=Ce("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
196
+ * @license lucide-react v0.469.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Sa=Ce("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
201
+ * @license lucide-react v0.469.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const bg=Ce("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
206
+ * @license lucide-react v0.469.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const Ql=Ce("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
211
+ * @license lucide-react v0.469.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const Rm=Ce("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
216
+ * @license lucide-react v0.469.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const o4=Ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
221
+ * @license lucide-react v0.469.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const Am=Ce("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
226
+ * @license lucide-react v0.469.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const wg=Ce("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
231
+ * @license lucide-react v0.469.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const Vw=Ce("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
236
+ * @license lucide-react v0.469.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const Zs=Ce("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
241
+ * @license lucide-react v0.469.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const Dm=Ce("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
246
+ * @license lucide-react v0.469.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const Sg=Ce("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
251
+ * @license lucide-react v0.469.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const a4=Ce("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
256
+ * @license lucide-react v0.469.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const l4=Ce("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
261
+ * @license lucide-react v0.469.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const c4=Ce("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
266
+ * @license lucide-react v0.469.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const u4=Ce("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
271
+ * @license lucide-react v0.469.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const h4=Ce("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
276
+ * @license lucide-react v0.469.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const d4=Ce("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
281
+ * @license lucide-react v0.469.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const Cg=Ce("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
286
+ * @license lucide-react v0.469.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const f4=Ce("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
291
+ * @license lucide-react v0.469.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const kg=Ce("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
296
+ * @license lucide-react v0.469.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const p4=Ce("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
301
+ * @license lucide-react v0.469.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const m4=Ce("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
306
+ * @license lucide-react v0.469.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const Ol=Ce("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
311
+ * @license lucide-react v0.469.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const g4=Ce("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
316
+ * @license lucide-react v0.469.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const Eg=Ce("ListX",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"m19 10-4 4",key:"1tz659"}],["path",{d:"m15 10 4 4",key:"1n7nei"}]]);/**
321
+ * @license lucide-react v0.469.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const v4=Ce("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
326
+ * @license lucide-react v0.469.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const Ww=Ce("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
331
+ * @license lucide-react v0.469.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const Gw=Ce("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
336
+ * @license lucide-react v0.469.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const _4=Ce("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
341
+ * @license lucide-react v0.469.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const x4=Ce("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
346
+ * @license lucide-react v0.469.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const Yw=Ce("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
351
+ * @license lucide-react v0.469.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const y4=Ce("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
356
+ * @license lucide-react v0.469.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const Xi=Ce("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
361
+ * @license lucide-react v0.469.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const va=Ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
366
+ * @license lucide-react v0.469.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const b4=Ce("PlugZap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);/**
371
+ * @license lucide-react v0.469.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const Zl=Ce("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
376
+ * @license lucide-react v0.469.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const Rn=Ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
381
+ * @license lucide-react v0.469.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const w4=Ce("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
386
+ * @license lucide-react v0.469.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const Jl=Ce("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
391
+ * @license lucide-react v0.469.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const so=Ce("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
396
+ * @license lucide-react v0.469.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const S4=Ce("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
401
+ * @license lucide-react v0.469.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const C4=Ce("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
406
+ * @license lucide-react v0.469.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const k4=Ce("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
411
+ * @license lucide-react v0.469.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const Dh=Ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
416
+ * @license lucide-react v0.469.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const Kw=Ce("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
421
+ * @license lucide-react v0.469.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const E4=Ce("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
426
+ * @license lucide-react v0.469.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const T4=Ce("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
431
+ * @license lucide-react v0.469.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const R4=Ce("ShieldQuestion",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
436
+ * @license lucide-react v0.469.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const A4=Ce("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
441
+ * @license lucide-react v0.469.0 - ISC
442
+ *
443
+ * This source code is licensed under the ISC license.
444
+ * See the LICENSE file in the root directory of this source tree.
445
+ */const Lh=Ce("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
446
+ * @license lucide-react v0.469.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */const Tg=Ce("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
451
+ * @license lucide-react v0.469.0 - ISC
452
+ *
453
+ * This source code is licensed under the ISC license.
454
+ * See the LICENSE file in the root directory of this source tree.
455
+ */const jh=Ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
456
+ * @license lucide-react v0.469.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */const Xw=Ce("StepForward",[["line",{x1:"6",x2:"6",y1:"4",y2:"20",key:"fy8qot"}],["polygon",{points:"10,4 20,12 10,20",key:"1mc1pf"}]]);/**
461
+ * @license lucide-react v0.469.0 - ISC
462
+ *
463
+ * This source code is licensed under the ISC license.
464
+ * See the LICENSE file in the root directory of this source tree.
465
+ */const Qw=Ce("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);/**
466
+ * @license lucide-react v0.469.0 - ISC
467
+ *
468
+ * This source code is licensed under the ISC license.
469
+ * See the LICENSE file in the root directory of this source tree.
470
+ */const Ri=Ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
471
+ * @license lucide-react v0.469.0 - ISC
472
+ *
473
+ * This source code is licensed under the ISC license.
474
+ * See the LICENSE file in the root directory of this source tree.
475
+ */const Zw=Ce("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
476
+ * @license lucide-react v0.469.0 - ISC
477
+ *
478
+ * This source code is licensed under the ISC license.
479
+ * See the LICENSE file in the root directory of this source tree.
480
+ */const D4=Ce("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
481
+ * @license lucide-react v0.469.0 - ISC
482
+ *
483
+ * This source code is licensed under the ISC license.
484
+ * See the LICENSE file in the root directory of this source tree.
485
+ */const Jw=Ce("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
486
+ * @license lucide-react v0.469.0 - ISC
487
+ *
488
+ * This source code is licensed under the ISC license.
489
+ * See the LICENSE file in the root directory of this source tree.
490
+ */const ec=Ce("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
491
+ * @license lucide-react v0.469.0 - ISC
492
+ *
493
+ * This source code is licensed under the ISC license.
494
+ * See the LICENSE file in the root directory of this source tree.
495
+ */const xn=Ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);let hh=null;const pi="global";function by(e){hh=e}function Iu(){return hh}function _i(){if(!hh)throw new Error("No project is open.");return`/api/p/${encodeURIComponent(hh)}`}function yt(e,i){return Ys(`${_i()}${e}`,i)}function bn(e,i){return Ys(`/api${e}`,i)}async function Ys(e,i){const r=await fetch(e,{...i,headers:{"Content-Type":"application/json",...(i==null?void 0:i.headers)??{}}}),s=await r.text();let l={};try{l=s?JSON.parse(s):{}}catch{throw r.ok?new Error("The server returned a response that was not JSON."):new Error(`${r.status} ${r.statusText}`)}if(!r.ok)throw new Error(l.error??r.statusText);return l}const Mt=(e,i)=>yt(e,{method:"POST",body:i===void 0?void 0:JSON.stringify(i)}),sn=(e,i)=>yt(e,{method:"PUT",body:JSON.stringify(i)}),ta=e=>yt(e,{method:"DELETE"}),ve={health:()=>yt("/health"),hub:()=>bn("/hub"),checkClaude:()=>bn("/claude/check",{method:"POST"}),projects:()=>bn("/projects"),addProject:e=>bn("/projects",{method:"POST",body:JSON.stringify({path:e})}),openedProject:e=>bn(`/projects/${encodeURIComponent(e)}/open`,{method:"POST"}),removeProject:e=>bn(`/projects/${encodeURIComponent(e)}`,{method:"DELETE"}),folders:e=>bn(`/folders${e?`?path=${encodeURIComponent(e)}`:""}`),globalOverview:()=>bn("/global/overview"),globalInbox:()=>bn("/global/inbox"),globalLive:()=>bn("/global/live"),closeOpenSessions:(e,i)=>Ys(`/api/p/${encodeURIComponent(e)}/open-sessions/close`,{method:"POST",body:JSON.stringify({ids:i})}),startSessionIn:(e,i)=>Ys(`/api/p/${encodeURIComponent(e)}/sessions`,{method:"POST",body:JSON.stringify(i)}),setMuted:(e,i)=>bn(`/global/muted/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({muted:i})}),answerIn:(e,i,r)=>bn(`/p/${encodeURIComponent(e)}/interactions/${i}/answer`,{method:"POST",body:JSON.stringify({answer:r})}),chooseIn:(e,i,r)=>bn(`/p/${encodeURIComponent(e)}/interactions/${i}/choose`,{method:"POST",body:JSON.stringify({ref:r})}),pauseNotificationsIn:(e,i)=>bn(`/p/${encodeURIComponent(e)}/notifications/paused`,{method:"PUT",body:JSON.stringify({paused:i})}),revealIn:e=>bn(`/p/${encodeURIComponent(e)}/files/reveal`,{method:"POST",body:JSON.stringify({path:""})}),dismissIn:(e,i)=>bn(`/p/${encodeURIComponent(e)}/interactions/${i}/dismiss`,{method:"POST"}),sessions:()=>yt("/sessions"),sessionsIn:e=>Ys(`/api/p/${encodeURIComponent(e)}/sessions`),session:e=>yt(`/sessions/${e}`),startSession:e=>Mt("/sessions",e),startPurpose:(e,i,r={},s)=>Mt("/purpose-sessions",{kind:e,targetId:i,draft:s,...r}),resumeSession:(e,i={})=>Mt(`/sessions/${e}/resume`,i),killSession:(e,i)=>i?Ys(`/api/p/${encodeURIComponent(i)}/sessions/${e}/kill`,{method:"POST"}):Mt(`/sessions/${e}/kill`),renameSession:(e,i,r)=>r?Ys(`/api/p/${encodeURIComponent(r)}/sessions/${e}/title`,{method:"PUT",body:JSON.stringify({title:i})}):sn(`/sessions/${e}/title`,{title:i}),deletionPlan:e=>yt(`/sessions/${e}/deletion`),deleteSession:(e,i=!0)=>ta(`/sessions/${e}?temp=${i?1:0}`),interactions:e=>yt(`/interactions${e?`?status=${e}`:""}`),answer:(e,i)=>Mt(`/interactions/${e}/answer`,{answer:i}),choose:(e,i)=>Mt(`/interactions/${e}/choose`,{ref:i}),dismiss:e=>Mt(`/interactions/${e}/dismiss`),inventory:()=>yt("/inventory"),stats:()=>yt("/stats"),categories:()=>yt("/categories"),saveCategory:e=>e.id?sn(`/categories/${e.id}`,e):Mt("/categories",e),deleteCategory:e=>ta(`/categories/${e}`),prompts:()=>yt("/prompts"),savePrompt:(e,i)=>sn(`/prompts/${e}`,{text:i}),previewSystemPrompt:e=>yt(`/prompts/preview?category=${encodeURIComponent(e)}`),memory:()=>yt("/memory"),memoryFile:e=>yt(`/memory/file?path=${encodeURIComponent(e)}`),saveMemoryFile:(e,i)=>sn("/memory/file",{path:e,content:i}),channels:()=>yt("/channels"),setNotificationsPaused:e=>sn("/notifications/paused",{paused:e}),setNotifyKinds:e=>sn("/notifications/kinds",{kinds:e}),setSessionQuiet:(e,i)=>sn(`/sessions/${e}/quiet`,{quiet:i}),dismissWaiting:e=>Mt(`/sessions/${e}/dismiss-waiting`),saveChannel:e=>e.id?sn(`/channels/${e.id}`,e):Mt("/channels",e),deleteChannel:e=>ta(`/channels/${e}`),testChannel:e=>Mt(`/channels/${e}/test`),jobs:()=>yt("/jobs"),saveJob:e=>e.id?sn(`/jobs/${e.id}`,e):Mt("/jobs",e),deleteJob:e=>ta(`/jobs/${e}`),rotateJobToken:e=>Mt(`/jobs/${e}/rotate`),runJob:(e,i)=>Mt(`/jobs/${e}/run`,{params:i}),runs:()=>yt("/runs"),queueSettings:()=>yt("/queue-settings"),saveQueueSettings:e=>sn("/queue-settings",{maxRuns:e}),queueRun:(e,i)=>Mt("/runs",{prompt:e,category:i}),cancelRun:e=>Mt(`/runs/${e}/cancel`),stopRun:e=>Mt(`/runs/${e}/stop`),resumeRun:e=>Mt(`/runs/${e}/resume`),toolsetCatalog:()=>yt("/toolset/catalog"),setSessionToolset:(e,i)=>sn(`/sessions/${e}/toolset`,{toolset:i}),setSessionSetup:(e,i)=>sn(`/sessions/${e}/setup`,i),variables:()=>yt("/variables"),variableValue:e=>yt(`/variables/${e}/value`),saveVariable:(e,i)=>sn(`/variables/${e}`,{value:i}),setVariableExpiry:(e,i)=>sn(`/variables/${e}/expiry`,{expiresAt:i}),checkVariable:e=>Mt(`/variables/${e}/check`),presets:()=>yt("/presets"),savePreset:e=>e.id?sn(`/presets/${e.id}`,e):Mt("/presets",e),deletePreset:e=>ta(`/presets/${e}`),setDefaultItem:(e,i,r)=>sn("/toolset/default",{kind:e,id:i,enabled:r}),claudeSettings:()=>yt("/claude-settings"),saveClaudeSettings:e=>sn("/claude-settings",e),mcpCatalog:()=>yt("/mcp/catalog"),suggestions:()=>yt("/mcp/suggestions"),mcpSuggestionsEnabled:()=>yt("/mcp-suggestions/enabled"),setMcpSuggestionsEnabled:e=>sn("/mcp-suggestions/enabled",{enabled:e}),installSuggestion:e=>Mt(`/mcp/suggestions/${e}/install`),skipSuggestion:(e,i="")=>Mt(`/mcp/suggestions/${e}/skip`,{note:i}),deleteSuggestion:e=>ta(`/mcp/suggestions/${e}`)};function eS(e){var i,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(i=0;i<l;i++)e[i]&&(r=eS(e[i]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function tS(){for(var e,i,r=0,s="",l=arguments.length;r<l;r++)(e=arguments[r])&&(i=eS(e))&&(s&&(s+=" "),s+=i);return s}const Rg="-",L4=e=>{const i=M4(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:p=>{const o=p.split(Rg);return o[0]===""&&o.length!==1&&o.shift(),nS(o,i)||j4(p)},getConflictingClassGroupIds:(p,o)=>{const u=r[p]||[];return o&&s[p]?[...u,...s[p]]:u}}},nS=(e,i)=>{var p;if(e.length===0)return i.classGroupId;const r=e[0],s=i.nextPart.get(r),l=s?nS(e.slice(1),s):void 0;if(l)return l;if(i.validators.length===0)return;const h=e.join(Rg);return(p=i.validators.find(({validator:o})=>o(h)))==null?void 0:p.classGroupId},wy=/^\[(.+)\]$/,j4=e=>{if(wy.test(e)){const i=wy.exec(e)[1],r=i==null?void 0:i.substring(0,i.indexOf(":"));if(r)return"arbitrary.."+r}},M4=e=>{const{theme:i,prefix:r}=e,s={nextPart:new Map,validators:[]};return O4(Object.entries(e.classGroups),r).forEach(([h,p])=>{Lm(p,s,h,i)}),s},Lm=(e,i,r,s)=>{e.forEach(l=>{if(typeof l=="string"){const h=l===""?i:Sy(i,l);h.classGroupId=r;return}if(typeof l=="function"){if(N4(l)){Lm(l(s),i,r,s);return}i.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([h,p])=>{Lm(p,Sy(i,h),r,s)})})},Sy=(e,i)=>{let r=e;return i.split(Rg).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},N4=e=>e.isThemeGetter,O4=(e,i)=>i?e.map(([r,s])=>{const l=s.map(h=>typeof h=="string"?i+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([p,o])=>[i+p,o])):h);return[r,l]}):e,B4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let i=0,r=new Map,s=new Map;const l=(h,p)=>{r.set(h,p),i++,i>e&&(i=0,s=r,r=new Map)};return{get(h){let p=r.get(h);if(p!==void 0)return p;if((p=s.get(h))!==void 0)return l(h,p),p},set(h,p){r.has(h)?r.set(h,p):l(h,p)}}},iS="!",P4=e=>{const{separator:i,experimentalParseClassName:r}=e,s=i.length===1,l=i[0],h=i.length,p=o=>{const u=[];let d=0,v=0,c;for(let g=0;g<o.length;g++){let b=o[g];if(d===0){if(b===l&&(s||o.slice(g,g+h)===i)){u.push(o.slice(v,g)),v=g+h;continue}if(b==="/"){c=g;continue}}b==="["?d++:b==="]"&&d--}const _=u.length===0?o:o.substring(v),x=_.startsWith(iS),C=x?_.substring(1):_,y=c&&c>v?c-v:void 0;return{modifiers:u,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:y}};return r?o=>r({className:o,parseClassName:p}):p},z4=e=>{if(e.length<=1)return e;const i=[];let r=[];return e.forEach(s=>{s[0]==="["?(i.push(...r.sort(),s),r=[]):r.push(s)}),i.push(...r.sort()),i},I4=e=>({cache:B4(e.cacheSize),parseClassName:P4(e),...L4(e)}),H4=/\s+/,F4=(e,i)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:l}=i,h=[],p=e.trim().split(H4);let o="";for(let u=p.length-1;u>=0;u-=1){const d=p[u],{modifiers:v,hasImportantModifier:c,baseClassName:_,maybePostfixModifierPosition:x}=r(d);let C=!!x,y=s(C?_.substring(0,x):_);if(!y){if(!C){o=d+(o.length>0?" "+o:o);continue}if(y=s(_),!y){o=d+(o.length>0?" "+o:o);continue}C=!1}const g=z4(v).join(":"),b=c?g+iS:g,S=b+y;if(h.includes(S))continue;h.push(S);const w=l(y,C);for(let T=0;T<w.length;++T){const D=w[T];h.push(b+D)}o=d+(o.length>0?" "+o:o)}return o};function U4(){let e=0,i,r,s="";for(;e<arguments.length;)(i=arguments[e++])&&(r=rS(i))&&(s&&(s+=" "),s+=r);return s}const rS=e=>{if(typeof e=="string")return e;let i,r="";for(let s=0;s<e.length;s++)e[s]&&(i=rS(e[s]))&&(r&&(r+=" "),r+=i);return r};function $4(e,...i){let r,s,l,h=p;function p(u){const d=i.reduce((v,c)=>c(v),e());return r=I4(d),s=r.cache.get,l=r.cache.set,h=o,o(u)}function o(u){const d=s(u);if(d)return d;const v=F4(u,r);return l(u,v),v}return function(){return h(U4.apply(null,arguments))}}const Tt=e=>{const i=r=>r[e]||[];return i.isThemeGetter=!0,i},sS=/^\[(?:([a-z-]+):)?(.+)\]$/i,q4=/^\d+\/\d+$/,V4=new Set(["px","full","screen"]),W4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,G4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Y4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,K4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pr=e=>da(e)||V4.has(e)||q4.test(e),rs=e=>Ca(e,"length",rT),da=e=>!!e&&!Number.isNaN(Number(e)),qp=e=>Ca(e,"number",da),Rl=e=>!!e&&Number.isInteger(Number(e)),Q4=e=>e.endsWith("%")&&da(e.slice(0,-1)),Ke=e=>sS.test(e),ss=e=>W4.test(e),Z4=new Set(["length","size","percentage"]),J4=e=>Ca(e,Z4,oS),eT=e=>Ca(e,"position",oS),tT=new Set(["image","url"]),nT=e=>Ca(e,tT,oT),iT=e=>Ca(e,"",sT),Al=()=>!0,Ca=(e,i,r)=>{const s=sS.exec(e);return s?s[1]?typeof i=="string"?s[1]===i:i.has(s[1]):r(s[2]):!1},rT=e=>G4.test(e)&&!Y4.test(e),oS=()=>!1,sT=e=>K4.test(e),oT=e=>X4.test(e),aT=()=>{const e=Tt("colors"),i=Tt("spacing"),r=Tt("blur"),s=Tt("brightness"),l=Tt("borderColor"),h=Tt("borderRadius"),p=Tt("borderSpacing"),o=Tt("borderWidth"),u=Tt("contrast"),d=Tt("grayscale"),v=Tt("hueRotate"),c=Tt("invert"),_=Tt("gap"),x=Tt("gradientColorStops"),C=Tt("gradientColorStopPositions"),y=Tt("inset"),g=Tt("margin"),b=Tt("opacity"),S=Tt("padding"),w=Tt("saturate"),T=Tt("scale"),D=Tt("sepia"),R=Tt("skew"),L=Tt("space"),A=Tt("translate"),M=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Ke,i],P=()=>[Ke,i],H=()=>["",pr,rs],F=()=>["auto",da,Ke],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Ke],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[da,Ke];return{cacheSize:500,separator:":",theme:{colors:[Al],spacing:[pr,rs],blur:["none","",ss,Ke],brightness:Y(),borderColor:[e],borderRadius:["none","","full",ss,Ke],borderSpacing:P(),borderWidth:H(),contrast:Y(),grayscale:I(),hueRotate:Y(),invert:I(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Q4,rs],inset:z(),margin:z(),opacity:Y(),padding:P(),saturate:Y(),scale:Y(),sepia:I(),skew:Y(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",Ke]}],container:["container"],columns:[{columns:[ss]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),Ke]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rl,Ke]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ke]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Rl,Ke]}],"grid-cols":[{"grid-cols":[Al]}],"col-start-end":[{col:["auto",{span:["full",Rl,Ke]},Ke]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Al]}],"row-start-end":[{row:["auto",{span:[Rl,Ke]},Ke]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ke]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ke,i]}],"min-w":[{"min-w":[Ke,i,"min","max","fit"]}],"max-w":[{"max-w":[Ke,i,"none","full","min","max","fit","prose",{screen:[ss]},ss]}],h:[{h:[Ke,i,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ke,i,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ke,i,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ke,i,"auto","min","max","fit"]}],"font-size":[{text:["base",ss,rs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qp]}],"font-family":[{font:[Al]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ke]}],"line-clamp":[{"line-clamp":["none",da,qp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pr,Ke]}],"list-image":[{"list-image":["none",Ke]}],"list-style-type":[{list:["none","disc","decimal",Ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pr,rs]}],"underline-offset":[{"underline-offset":["auto",pr,Ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),eT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",J4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:G()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[pr,Ke]}],"outline-w":[{outline:[pr,rs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[pr,rs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ss,iT]}],"shadow-color":[{shadow:[Al]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",ss,Ke]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[c]}],saturate:[{saturate:[w]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[p]}],"border-spacing-x":[{"border-spacing-x":[p]}],"border-spacing-y":[{"border-spacing-y":[p]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ke]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",Ke]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Rl,Ke]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ke]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pr,rs,qp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},lT=$4(aT);function ye(...e){return lT(tS(e))}function Pn(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Ag(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024**3).toFixed(1)} GB`}function us(e){return e?e.input+e.output+e.cacheRead+e.cacheCreation:0}function vs(e){if(!e)return"";const i=Math.max(0,(Date.now()-Date.parse(e))/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}function Wi(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function cT(e){return e==="Agent"||e==="Task"?"agents":e==="Skill"?"skills":e.startsWith("mcp__")?"mcp":"built-in"}function uT(e){const i=e.slice(5),r=i.indexOf("__");return r===-1?{server:i,tool:""}:{server:i.slice(0,r),tool:i.slice(r+2)}}function hT(e){const i={"built-in":[],agents:[],skills:[],mcp:[]};for(const[r,s]of Object.entries(e))i[cT(r)].push({name:r,...s});for(const r of Object.values(i))r.sort((s,l)=>l.count-s.count);return i}const Cy=e=>{let i;const r=new Set,s=(d,v)=>{const c=typeof d=="function"?d(i):d;if(!Object.is(c,i)){const _=i;i=v??(typeof c!="object"||c===null)?c:Object.assign({},i,c),r.forEach(x=>x(i,_))}},l=()=>i,o={setState:s,getState:l,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d))},u=i=e(s,l,o);return o},dT=(e=>e?Cy(e):Cy),fT=e=>e;function pT(e,i=fT){const r=Nl.useSyncExternalStore(e.subscribe,Nl.useCallback(()=>i(e.getState()),[e,i]),()=>i(e.getInitialState()));return Nl.useDebugValue(r),r}const ky=e=>{const i=dT(e),r=s=>pT(i,s);return Object.assign(r,i),r},oo=(e=>e?ky(e):ky),vr=oo(e=>({item:null,set:i=>e({item:i})})),on=oo(e=>({drafts:{},put:(i,r)=>e(s=>({drafts:{...s.drafts,[i]:r}})),drop:i=>e(r=>{const{[i]:s,...l}=r.drafts;return{drafts:l}}),move:(i,r)=>e(s=>({drafts:Object.fromEntries(Object.entries(s.drafts).map(([l,h])=>[l===i?r:l.startsWith(`${i}/`)?r+l.slice(i.length):l,h]))}))})),ls=e=>!!(e&&e.text!==e.base),th=new Map;let Hu=null;function mT(e){e!==Hu&&(Hu&&th.set(Hu,on.getState().drafts),on.setState({drafts:e&&th.get(e)||{}}),e&&th.delete(e),Hu=e)}window.addEventListener("beforeunload",e=>{[on.getState().drafts,...th.values()].some(r=>Object.values(r).some(ls))&&e.preventDefault()});const Ey="clauder-hub:auto-save",Ty=oo(e=>({on:(()=>{try{return localStorage.getItem(Ey)==="1"}catch{return!1}})(),set:i=>{try{localStorage.setItem(Ey,i?"1":"0")}catch{}e({on:i})}}));let Hl=null;function aS(){if(!Hl)return[];try{const e=JSON.parse(localStorage.getItem(Hl)??"[]");return Array.isArray(e)?e.filter(i=>typeof(i==null?void 0:i.path)=="string").map(i=>({path:i.path,preview:!!i.preview})):[]}catch{return[]}}function gT(e){if(Hl)try{localStorage.setItem(Hl,JSON.stringify(e))}catch{}}const lS=(e,i)=>e===i||e.startsWith(`${i}/`),In=oo((e,i)=>{const r=s=>{gT(s),e({tabs:s})};return{tabs:aS(),show:s=>{const l=i().tabs;if(l.some(p=>p.path===s))return;const h=l.findIndex(p=>p.preview);if(h===-1)return r([...l,{path:s,preview:!0}]);r(l.map((p,o)=>o===h?{path:s,preview:!0}:p))},pin:s=>{const l=i().tabs;if(!l.some(h=>h.path===s&&h.preview)){l.some(h=>h.path===s)||r([...l,{path:s,preview:!1}]);return}r(l.map(h=>h.path===s?{...h,preview:!1}:h))},close:(s,l)=>{var c;const h=i().tabs,p=new Set(s),o=h.filter(_=>!p.has(_.path));if(r(o),!l||!p.has(l))return l;const u=h.findIndex(_=>_.path===l),d=h.slice(u+1).find(_=>!p.has(_.path)),v=h.slice(0,u).reverse().find(_=>!p.has(_.path));return((c=d??v)==null?void 0:c.path)??null},reorder:(s,l)=>{const h=[...i().tabs],p=h.findIndex(d=>d.path===s),o=h.findIndex(d=>d.path===l);if(p===-1||o===-1||p===o)return;const[u]=h.splice(p,1);h.splice(o,0,u),r(h)},rename:(s,l)=>r(i().tabs.map(h=>lS(h.path,s)?{...h,path:l+h.path.slice(s.length)}:h))}}),dh=new Map;function vT(e,i){dh.set(e,i)}function _T(e){const i=dh.get(e)??null;return dh.delete(e),i}function xT(e){dh.clear(),Hl=e?`clauder-hub:open-files:${e}`:null,In.setState({tabs:aS()})}function yT(e){return In.getState().tabs.filter(i=>lS(i.path,e)).map(i=>i.path)}function Ry(e){mT(e),xT(e),vr.getState().set(null)}function bT(e){const i=r=>[...r].sort((s,l)=>(l.lastAt??l.startedAt??"").localeCompare(s.lastAt??s.startedAt??""))[0]??null;return i(e.filter(r=>r.live&&r.status==="waiting"))??i(e.filter(r=>r.live&&(r.status==="running"||r.status==="idle")))??i(e.filter(r=>r.status==="done"))??i(e.filter(r=>!r.purpose))}const wT=["overview","inbox","automation","instructions","agents","skills","commands","mcp-servers","variables","hooks","plugins","channels","hub-prompts","claude-settings","mcp-suggestions","presets","categories"];let na=null,Vp=null;function Ay(e){try{return decodeURIComponent(e)}catch{return e}}function Dy(){let e=window.location.hash.replace(/^#\/?/,"");const i=e.startsWith("w/");i&&(e=e.slice(2));const r=e.indexOf("/"),s=Ay(r===-1?e:e.slice(0,r))||pi;return e=r===-1?"":e.slice(r+1),e.startsWith("session/")?{projectId:s,view:{kind:"session",id:e.slice(8)},windowed:i}:e.startsWith("file/")?{projectId:s,view:{kind:"file",path:e.slice(5).split("/").map(Ay).join("/")},windowed:i}:{projectId:s,view:{kind:"page",page:wT.find(l=>l===e)??"overview"},windowed:i}}function ha(e,i,r){if(!e)return ha(pi,i,r);const s=i.kind==="session"?`session/${i.id}`:i.kind==="file"?`file/${i.path.split("/").map(encodeURIComponent).join("/")}`:i.page;return`#/${r?"w/":""}${encodeURIComponent(e)}/${s}`}function Dg(e){const i=_e.getState().projectId,r=e.kind==="session"?`clauder-${i}-${e.id}`:e.kind==="file"?`clauder-file-${i}-${e.path}`:`clauder-${i}-${e.page}`;window.open(`${location.origin}${location.pathname}${ha(i,e,!0)}`,r,"popup,width=1280,height=820")}const ST={sessions:0,transcript:0,interactions:0,runs:0,jobs:0,mcp:0,channels:0,files:0,projects:0},cS=1e4,Bl=new Map;function uS(e,i=!1){const r=Bl.get(e);if(r&&Date.now()-r.at<cS)return i&&Bl.delete(e),r.read;const s=l=>fetch(`/api/p/${encodeURIComponent(e)}${l}`).then(async h=>{const p=await h.json().catch(()=>({}));if(!h.ok)throw new Error(p.error??`${h.status} ${h.statusText}`);return p});return Promise.all([s("/health"),s("/sessions"),s("/interactions?status=open")])}function jm(e){if(e===_e.getState().projectId)return;const i=Bl.get(e);if(i&&Date.now()-i.at<cS)return;const r=uS(e);r.catch(()=>Bl.delete(e)),Bl.set(e,{at:Date.now(),read:r})}const _e=oo((e,i)=>{let r=null;const s=async(h,p)=>{r=h,e({switching:h});try{const[o,u,d]=await uS(h,!0);if(r!==h)return;r=null,by(h),Ry(h),e({projectId:h,health:o,sessions:u,open:d,transcriptTicks:{},view:p.view,windowed:p.windowed,switching:null}),h!==pi&&ve.openedProject(h).catch(()=>{})}catch(o){if(r!==h)return;if(r=null,e({switching:null}),/no such project/i.test(o.message)){i().notify(`The hub has no project '${h}'. Open its folder again from here.`,"error"),i().openProject(pi);return}i().notify(`Could not open the project: ${o.message}`,"error"),history.replaceState(null,"",ha(i().projectId,i().view,i().windowed))}},l=async h=>{if(r=null,by(h),Ry(h),e({projectId:h,health:null,sessions:[],open:[],transcriptTicks:{}}),!!h)try{const[p]=await Promise.all([ve.health(),i().refreshSessions(),i().refreshOpen()]);i().projectId===h&&e({health:p}),h!==pi&&ve.openedProject(h).catch(()=>{})}catch(p){if(i().projectId!==h)return;/no such project/i.test(p.message)?(i().notify(`The hub has no project '${h}'. Open its folder again from here.`,"error"),i().openProject(pi)):i().notify(`Could not open the project: ${p.message}`,"error")}};return{health:null,switching:null,sessions:[],open:[],...Dy(),ticks:{...ST},transcriptTicks:{},toast:null,boot:async()=>{window.addEventListener("hashchange",()=>{const u=Dy(),d=u.projectId!==i().projectId;if(d&&u.projectId&&i().health)return void s(u.projectId,u);r=null,e({view:u.view,windowed:u.windowed,switching:null}),d&&l(u.projectId)}),na==null||na.close(),na=new EventSource("/api/stream");const h=new Set;let p=null;const o=()=>{p=null;const u={...i().ticks},d={...i().transcriptTicks};for(const c of h)c.startsWith("transcript:")?d[c.slice(11)]=Date.now():u[c]+=1;const v=new Set(h);h.clear(),e({ticks:u,transcriptTicks:d}),i().projectId&&((v.has("sessions")||v.has("transcript")||v.has("interactions"))&&i().refreshSessions(),v.has("interactions")&&i().refreshOpen())};na.onmessage=u=>{const d=JSON.parse(u.data);d.project&&d.project!==i().projectId?h.add("projects"):(h.add(d.topic==="transcript"?`transcript:${d.payload.sessionId}`:d.topic),d.topic==="transcript"&&h.add("transcript")),p??(p=setTimeout(o,400))},na.onopen=()=>{i().projectId&&(i().refreshSessions(),i().refreshOpen())},await l(i().projectId)},go:h=>{window.location.hash=ha(i().projectId,h,i().windowed).slice(1),e({view:h})},openProject:h=>{const p=o=>{const u=ha(h,o,!1);window.location.hash===u&&h&&h!==i().projectId&&(i().health?s(h,{view:o,windowed:!1}):l(h)),window.location.hash=u.slice(1)};if(!h||h===pi||h===i().projectId)return p({kind:"page",page:"overview"});ve.sessionsIn(h).then(o=>{const u=bT(o);if(!u)return p({kind:"page",page:"overview"});p({kind:"session",id:u.id})},()=>p({kind:"page",page:"overview"}))},openSessionIn:(h,p)=>{if(h===i().projectId)return i().go({kind:"session",id:p});window.location.hash=ha(h,{kind:"session",id:p},!1).slice(1)},refreshSessions:async()=>{const h=i().projectId;if(!h)return;const p=await ve.sessions();i().projectId===h&&e({sessions:p})},refreshOpen:async()=>{const h=i().projectId;if(!h)return;const p=await ve.interactions("open");i().projectId===h&&e({open:p})},notify:(h,p="info")=>{Vp&&clearTimeout(Vp),e({toast:{text:h,tone:p}}),Vp=setTimeout(()=>e({toast:null}),p==="error"?6e3:3e3)}}});function rt(e,i,r=null){const s=_e(c=>i.map(_=>c.ticks[_]).join(",")),[l,h]=N.useState(null),[p,o]=N.useState(null),[u,d]=N.useState(0);N.useEffect(()=>{let c=!1;return e().then(_=>{c||(h(_),o(null))},_=>!c&&o(_.message)),()=>{c=!0}},[s,u,JSON.stringify(r)]);const v=N.useCallback(()=>d(c=>c+1),[]);return{data:l,error:p,reload:v}}async function qe(e,i){try{const r=await e();return i&&_e.getState().notify(i),r}catch(r){_e.getState().notify(r.message,"error");return}}const Ly=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jy=tS,CT=(e,i)=>r=>{var s;if((i==null?void 0:i.variants)==null)return jy(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:h}=i,p=Object.keys(l).map(d=>{const v=r==null?void 0:r[d],c=h==null?void 0:h[d];if(v===null)return null;const _=Ly(v)||Ly(c);return l[d][_]}),o=r&&Object.entries(r).reduce((d,v)=>{let[c,_]=v;return _===void 0||(d[c]=_),d},{}),u=i==null||(s=i.compoundVariants)===null||s===void 0?void 0:s.reduce((d,v)=>{let{class:c,className:_,...x}=v;return Object.entries(x).every(C=>{let[y,g]=C;return Array.isArray(g)?g.includes({...h,...o}[y]):{...h,...o}[y]===g})?[...d,c,_]:d},[]);return jy(e,p,u,r==null?void 0:r.class,r==null?void 0:r.className)},kT=CT("inline-flex items-center justify-center gap-1.5 font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed shrink-0",{variants:{variant:{foreground:"bg-foreground text-background hover:bg-foreground/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground",ghost:"text-muted-foreground hover:bg-muted hover:text-foreground",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",success:"bg-success text-success-foreground hover:bg-success/90"},size:{sm:"text-xs px-3 py-1.5 rounded",md:"text-sm px-4 py-2 rounded-md",lg:"text-base px-5 py-2.5 rounded-md",icon:"p-1.5 rounded-md"}},defaultVariants:{variant:"muted",size:"sm"}}),ge=N.forwardRef(({className:e,variant:i,size:r,...s},l)=>m.jsx("button",{ref:l,className:ye(kT({variant:i,size:r}),e),...s}));ge.displayName="Button";var ET=Object.defineProperty,ka=(e,i)=>ET(e,"name",{value:i,configurable:!0}),hS=!!(typeof window<"u"&&window.document&&window.document.createElement);function it(e,i,{checkForDefaultPrevented:r=!0}={}){return ka(function(l){if(e==null||e(l),r===!1||!l||!l.defaultPrevented)return i==null?void 0:i(l)},"handleEvent")}ka(it,"composeEventHandlers");function TT(e){var i;if(!hS)throw new Error("Cannot access window outside of the DOM");return((i=e==null?void 0:e.ownerDocument)==null?void 0:i.defaultView)??window}ka(TT,"getOwnerWindow");function Mm(e){if(!hS)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}ka(Mm,"getOwnerDocument");function dS(e,i=!1){const{activeElement:r}=Mm(e);if(!(r!=null&&r.nodeName))return null;if(fS(r)&&r.contentDocument)return dS(r.contentDocument.body,i);if(i){const s=r.getAttribute("aria-activedescendant");if(s){const l=Mm(r).getElementById(s);if(l)return l}}return r}ka(dS,"getActiveElement");function fS(e){return e.tagName==="IFRAME"}ka(fS,"isFrame");var RT=Object.defineProperty,Lg=(e,i)=>RT(e,"name",{value:i,configurable:!0});function Nm(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}Lg(Nm,"setRef");function pS(...e){return i=>{let r=!1;const s=e.map(l=>{const h=Nm(l,i);return!r&&typeof h=="function"&&(r=!0),h});if(r)return()=>{for(let l=0;l<s.length;l++){const h=s[l];typeof h=="function"?h():Nm(e[l],null)}}}}Lg(pS,"composeRefs");function ht(...e){return N.useCallback(pS(...e),e)}Lg(ht,"useComposedRefs");var AT=Object.defineProperty,mi=(e,i)=>AT(e,"name",{value:i,configurable:!0});function DT(e,i){const r=N.createContext(i);r.displayName=e+"Context";const s=mi(h=>{const{children:p,...o}=h,u=N.useMemo(()=>o,Object.values(o));return m.jsx(r.Provider,{value:u,children:p})},"Provider");s.displayName=e+"Provider";function l(h,p={}){const{optional:o=!1}=p,u=N.useContext(r);if(u)return u;if(i!==void 0)return i;if(!o)throw new Error(`\`${h}\` must be used within \`${e}\``)}return mi(l,"useContext"),[s,l]}mi(DT,"createContext");function Er(e,i=[]){let r=[];function s(h,p){const o=N.createContext(p);o.displayName=h+"Context";const u=r.length;r=[...r,p];const d=mi(c=>{var b;const{scope:_,children:x,...C}=c,y=((b=_==null?void 0:_[e])==null?void 0:b[u])||o,g=N.useMemo(()=>C,Object.values(C));return m.jsx(y.Provider,{value:g,children:x})},"Provider");d.displayName=h+"Provider";function v(c,_,x={}){var b;const{optional:C=!1}=x,y=((b=_==null?void 0:_[e])==null?void 0:b[u])||o,g=N.useContext(y);if(g)return g;if(p!==void 0)return p;if(!C)throw new Error(`\`${c}\` must be used within \`${h}\``)}return mi(v,"useContext"),[d,v]}mi(s,"createContext");const l=mi(()=>{const h=r.map(p=>N.createContext(p));return mi(function(o){const u=(o==null?void 0:o[e])||h;return N.useMemo(()=>({[`__scope${e}`]:{...o,[e]:u}}),[o,u])},"useScope")},"createScope");return l.scopeName=e,[s,mS(l,...i)]}mi(Er,"createContextScope");function mS(...e){const i=e[0];if(e.length===1)return i;const r=mi(()=>{const s=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return mi(function(h){const p=s.reduce((o,{useScope:u,scopeName:d})=>{const c=u(h)[`__scope${d}`];return{...o,...c}},{});return N.useMemo(()=>({[`__scope${i.scopeName}`]:p}),[p])},"useComposedScopes")},"createScope");return r.scopeName=i.scopeName,r}mi(mS,"composeContextScopes");var Wt=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},LT=Object.defineProperty,jT=(e,i)=>LT(e,"name",{value:i,configurable:!0}),MT=ya[" useId ".trim().toString()]||(()=>{}),NT=0;function Vi(e){const[i,r]=N.useState(MT());return Wt(()=>{e||r(s=>s??String(NT++))},[e]),e||(i?`radix-${i}`:"")}jT(Vi,"useId");var OT=Object.defineProperty,BT=(e,i)=>OT(e,"name",{value:i,configurable:!0}),My=ya[" useEffectEvent ".trim().toString()],Ny=ya[" useInsertionEffect ".trim().toString()];function gS(e){if(typeof My=="function")return My(e);const i=N.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ny=="function"?Ny(()=>{i.current=e}):Wt(()=>{i.current=e}),N.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}BT(gS,"useEffectEvent");var PT=Object.defineProperty,tc=(e,i)=>PT(e,"name",{value:i,configurable:!0}),zT=ya[" useInsertionEffect ".trim().toString()]||Wt;function Js({prop:e,defaultProp:i,onChange:r=tc(()=>{},"onChange"),caller:s}){const[l,h,p]=vS({defaultProp:i,onChange:r}),o=e!==void 0,u=o?e:l,d=N.useCallback(v=>{var c;if(o){const _=_S(v)?v(e):v;_!==e&&((c=p.current)==null||c.call(p,_))}else h(v)},[o,e,h,p]);return[u,d]}tc(Js,"useControllableState");function vS({defaultProp:e,onChange:i}){const[r,s]=N.useState(e),l=N.useRef(r),h=N.useRef(i);return zT(()=>{h.current=i},[i]),N.useEffect(()=>{var p;l.current!==r&&((p=h.current)==null||p.call(h,r),l.current=r)},[r,l]),[r,s,h]}tc(vS,"useUncontrolledState");function _S(e){return typeof e=="function"}tc(_S,"isFunction");var Oy=Symbol("RADIX:SYNC_STATE");function IT(e,i,r,s){const{prop:l,defaultProp:h,onChange:p,caller:o}=i,u=l!==void 0,d=gS(p),v=[{...r,state:h}];s&&v.push(s);const[c,_]=N.useReducer((g,b)=>{if(b.type===Oy)return{...g,state:b.state};const S=e(g,b);return u&&!Object.is(S.state,g.state)&&d(S.state),S},...v),x=c.state,C=N.useRef(x);N.useEffect(()=>{C.current!==x&&(C.current=x,u||d(x))},[x,C,u]);const y=N.useMemo(()=>l!==void 0?{...c,state:l}:c,[c,l]);return N.useEffect(()=>{u&&!Object.is(l,c.state)&&_({type:Oy,state:l})},[l,c.state,u]),[y,_]}tc(IT,"useControllableStateReducer");var nc=Bw(),HT=Object.defineProperty,ei=(e,i)=>HT(e,"name",{value:i,configurable:!0});function br(e){const i=N.forwardRef((r,s)=>{let{children:l,...h}=r,p=null,o=!1;const u=[];l=kS(l),N.Children.forEach(l,_=>{var x;if(SS(_)){o=!0;const C=_;let y="child"in C.props?C.props.child:C.props.children;for(;jg(y)&&typeof fh=="function";)y=fh(y._payload);p=FT(C,y),u.push((x=p==null?void 0:p.props)==null?void 0:x.children)}else u.push(_)}),p?p=N.cloneElement(p,void 0,u):!o&&N.Children.count(l)===1&&N.isValidElement(l)&&(p=l);const d=p?wS(p):void 0,v=ht(s,d);if(!p){if(l||l===0)throw new Error(o?qT(e):$T(e));return l}const c=bS(h,p.props??{});return p.type!==N.Fragment&&(c.ref=s?v:d),N.cloneElement(p,c)});return i.displayName=`${e}.Slot`,i}ei(br,"createSlot");var xS=Symbol.for("radix.slottable");function yS(e){const i=ei(r=>"child"in r?r.children(r.child):r.children,"Slottable");return i.displayName=`${e}.Slottable`,i.__radixId=xS,i}ei(yS,"createSlottable");var FT=ei((e,i)=>"child"in e.props?N.isValidElement(i)?N.cloneElement(i,void 0,e.props.children(i.props.children)):null:N.isValidElement(i)?i:null,"getSlottableElementFromSlottable");function bS(e,i){const r={...i};for(const s in i){const l=e[s],h=i[s];/^on[A-Z]/.test(s)?l&&h?r[s]=(...o)=>{const u=h(...o);return l(...o),u}:l&&(r[s]=l):s==="style"?r[s]={...l,...h}:s==="className"?r[s]=[l,h].filter(Boolean).join(" "):s==="aria-describedby"&&(r[s]=ES(h,l))}return{...e,...r}}ei(bS,"mergeProps");function wS(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}ei(wS,"getElementRef");function SS(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xS}ei(SS,"isSlottable");var UT=Symbol.for("react.lazy");function jg(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===UT&&"_payload"in e&&CS(e._payload)}ei(jg,"isLazyComponent");function CS(e){return typeof e=="object"&&e!==null&&"then"in e}ei(CS,"isPromiseLike");function kS(e){let i=e;for(;jg(i)&&typeof fh=="function";)i=fh(i._payload);return i}ei(kS,"useUnwrappedLazy");function ES(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}ei(ES,"concatAriaDescribedby");var $T=ei(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),qT=ei(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),fh=ya[" use ".trim().toString()],VT=Object.defineProperty,WT=(e,i)=>VT(e,"name",{value:i,configurable:!0}),GT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Et=GT.reduce((e,i)=>{const r=br(`Primitive.${i}`),s=N.forwardRef((l,h)=>{const{asChild:p,...o}=l,u=p?r:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...o,ref:h})});return s.displayName=`Primitive.${i}`,{...e,[i]:s}},{});function TS(e,i){e&&nc.flushSync(()=>e.dispatchEvent(i))}WT(TS,"dispatchDiscreteCustomEvent");var YT=Object.defineProperty,KT=(e,i)=>YT(e,"name",{value:i,configurable:!0}),By=ya[" useInsertionEffect ".trim().toString()];function Gi(e){const i=N.useRef(e);return typeof By=="function"?By(()=>{i.current=e}):Wt(()=>{i.current=e}),N.useMemo(()=>((...r)=>{var s;return(s=i.current)==null?void 0:s.call(i,...r)}),[])}KT(Gi,"useCallbackRef");var XT=Object.defineProperty,an=(e,i)=>XT(e,"name",{value:i,configurable:!0}),Om="dismissableLayer.update",QT="dismissableLayer.pointerDownOutside",ZT="dismissableLayer.focusOutside",Py,RS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Mh=N.forwardRef(an(function(i,r){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:o,onInteractOutside:u,onDismiss:d,...v}=i,c=N.useContext(RS),[_,x]=N.useState(null),C=(_==null?void 0:_.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=N.useState({}),g=ht(r,x),b=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=S?b.indexOf(S):-1,T=_?b.indexOf(_):-1,D=c.layersWithOutsidePointerEventsDisabled.size>0,R=T>=w,L=N.useRef(!1),A=DS(P=>{p==null||p(P),u==null||u(P),P.defaultPrevented||d==null||d()},{ownerDocument:C,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:c.dismissableSurfaces,shouldHandlePointerDownOutside:N.useCallback(P=>{if(!(P instanceof Node))return!1;const H=[...c.branches].some(F=>F.contains(P));return R&&!H},[c.branches,R])}),M=LS(P=>{if(l&&L.current)return;const H=P.target;[...c.branches].some(W=>W.contains(H))||(o==null||o(P),u==null||u(P),P.defaultPrevented||d==null||d())},C),j=_?T===b.length-1:!1,z=Gi(P=>{P.key==="Escape"&&(h==null||h(P),!P.defaultPrevented&&d&&(P.preventDefault(),d()))});return N.useEffect(()=>{if(j)return C.addEventListener("keydown",z,{capture:!0}),()=>C.removeEventListener("keydown",z,{capture:!0})},[C,j,z]),N.useEffect(()=>{if(_)return s&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Py=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(_)),c.layers.add(_),Bm(),()=>{s&&(c.layersWithOutsidePointerEventsDisabled.delete(_),c.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=Py))}},[_,C,s,c]),N.useEffect(()=>()=>{_&&(c.layers.delete(_),c.layersWithOutsidePointerEventsDisabled.delete(_),Bm())},[_,c]),N.useEffect(()=>{const P=an(()=>y({}),"handleUpdate");return document.addEventListener(Om,P),()=>document.removeEventListener(Om,P)},[]),m.jsx(Et.div,{...v,ref:g,style:{pointerEvents:D?R?"auto":"none":void 0,...i.style},onFocusCapture:it(i.onFocusCapture,M.onFocusCapture),onBlurCapture:it(i.onBlurCapture,M.onBlurCapture),onPointerDownCapture:it(i.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function AS(){const e=N.useContext(RS),[i,r]=N.useState(null);return N.useEffect(()=>{if(i)return e.dismissableSurfaces.add(i),()=>{e.dismissableSurfaces.delete(i)}},[i,e.dismissableSurfaces]),r}an(AS,"useDismissableLayerSurface");var JT=an(()=>!0,"IS_TRUE");function DS(e,i){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:h,shouldHandlePointerDownOutside:p=JT}=i,o=Gi(e),u=N.useRef(!1),d=N.useRef(!1),v=N.useRef(new Map),c=N.useRef(()=>{});return N.useEffect(()=>{function _(){d.current=!1,l.current=!1,v.current.clear()}an(_,"resetOutsideInteraction");function x(){return Array.from(v.current.values()).some(Boolean)}an(x,"isOutsideInteractionIntercepted");function C(w){if(!d.current)return;const T=w.target;T instanceof Node&&[...h].some(R=>R.contains(T))||v.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{d.current&&c.current()},0)}an(C,"handleInteractionCapture");function y(w){d.current&&v.current.set(w.type,!1)}an(y,"handleInteractionBubble");const g=an(w=>{if(w.target&&!u.current){let T=function(){r.removeEventListener("click",c.current);const R=x();_(),R||Mg(QT,o,D,{discrete:!0})};if(an(T,"handleAndDispatchPointerDownOutsideEvent"),!p(w.target)){r.removeEventListener("click",c.current),_(),u.current=!1;return}const D={originalEvent:w};d.current=!0,l.current=s&&w.button===0,v.current.clear(),!s||w.button!==0?T():(r.removeEventListener("click",c.current),c.current=T,r.addEventListener("click",c.current,{once:!0}))}else r.removeEventListener("click",c.current),_();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of b)r.addEventListener(w,C,!0),r.addEventListener(w,y);const S=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(S),r.removeEventListener("pointerdown",g),r.removeEventListener("click",c.current);for(const w of b)r.removeEventListener(w,C,!0),r.removeEventListener(w,y)}},[r,o,s,l,h,p]),{onPointerDownCapture:an(()=>u.current=!0,"onPointerDownCapture")}}an(DS,"usePointerDownOutside");function LS(e,i=globalThis==null?void 0:globalThis.document){const r=Gi(e),s=N.useRef(!1);return N.useEffect(()=>{const l=an(h=>{h.target&&!s.current&&Mg(ZT,r,{originalEvent:h},{discrete:!1})},"handleFocus");return i.addEventListener("focusin",l),()=>i.removeEventListener("focusin",l)},[i,r]),{onFocusCapture:an(()=>s.current=!0,"onFocusCapture"),onBlurCapture:an(()=>s.current=!1,"onBlurCapture")}}an(LS,"useFocusOutside");function Bm(){const e=new CustomEvent(Om);document.dispatchEvent(e)}an(Bm,"dispatchUpdate");function Mg(e,i,r,{discrete:s}){const l=r.originalEvent.target,h=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});i&&l.addEventListener(e,i,{once:!0}),s?TS(l,h):l.dispatchEvent(h)}an(Mg,"handleAndDispatchCustomEvent");var eR=Object.defineProperty,qt=(e,i)=>eR(e,"name",{value:i,configurable:!0}),Wp="focusScope.autoFocusOnMount",Gp="focusScope.autoFocusOnUnmount",zy={bubbles:!1,cancelable:!0},Ng=N.forwardRef(qt(function(i,r){const{loop:s=!1,trapped:l=!1,branches:h,onMountAutoFocus:p,onUnmountAutoFocus:o,...u}=i,[d,v]=N.useState(null),c=Gi(p),_=Gi(o),x=N.useRef(null),C=ht(r,v),y=N.useRef(h);N.useEffect(()=>{y.current=h});const g=N.useCallback(w=>{var T;return w?d!=null&&d.contains(w)?!0:!!((T=y.current)!=null&&T.some(D=>D.contains(w))):!1},[d]),b=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(l){let w=function(L){if(b.paused||!d)return;const A=L.target;g(A)?x.current=A:mr(x.current,{select:!0})},T=function(L){if(b.paused||!d)return;const A=L.relatedTarget;A!==null&&(g(A)||mr(x.current,{select:!0}))},D=function(L){if(document.activeElement===document.body)for(const M of L)M.removedNodes.length>0&&mr(d)};qt(w,"handleFocusIn"),qt(T,"handleFocusOut"),qt(D,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",T);const R=new MutationObserver(D);return d&&R.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",T),R.disconnect()}}},[l,d,b.paused,g]),N.useEffect(()=>{if(d){Iy.add(b);const w=document.activeElement;if(!d.contains(w)){const D=new CustomEvent(Wp,zy);d.addEventListener(Wp,c),d.dispatchEvent(D),D.defaultPrevented||(MS(zS(zg(d)),{select:!0}),document.activeElement===w&&mr(d))}return()=>{d.removeEventListener(Wp,c);const D=d.ownerDocument,R=CustomEvent;setTimeout(()=>{const L=new R(Gp,zy);d.addEventListener(Gp,_),d.dispatchEvent(L),L.defaultPrevented||mr(w??D.body,{select:!0}),d.removeEventListener(Gp,_),Iy.remove(b)},0)}}},[d,c,_,b]);const S=N.useCallback(w=>{if(!s&&!l||b.paused)return;const T=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,D=document.activeElement;if(T&&D){const R=w.currentTarget,[L,A]=NS(R);L&&A?!w.shiftKey&&D===A?(w.preventDefault(),s&&mr(L,{select:!0})):w.shiftKey&&D===L&&(w.preventDefault(),s&&mr(A,{select:!0})):D===R&&w.preventDefault()}},[s,l,b.paused]);return m.jsx(Et.div,{tabIndex:-1,...u,ref:C,onKeyDown:S})},"FocusScope")),jS=N.createContext(null);function Og({registry:e,children:i}){return e?m.jsx(jS.Provider,{value:e,children:i}):i}qt(Og,"FocusScopeBranchProvider");function Bg(){const[e,i]=N.useState([]),r=N.useMemo(()=>({add:qt(s=>i(l=>l.includes(s)?l:[...l,s]),"add"),remove:qt(s=>i(l=>l.filter(h=>h!==s)),"remove")}),[]);return{nodes:e,registry:r}}qt(Bg,"useFocusScopeBranchRegistry");function Pg(e){const i=N.useContext(jS);N.useEffect(()=>{if(!(!e||!i))return i.add(e),()=>i.remove(e)},[e,i])}qt(Pg,"useFocusScopeBranch");function MS(e,{select:i=!1}={}){const r=document.activeElement;for(const s of e)if(mr(s,{select:i}),document.activeElement!==r)return}qt(MS,"focusFirst");function NS(e){const i=zg(e),r=Pm(i,e),s=Pm(i.reverse(),e);return[r,s]}qt(NS,"getTabbableEdges");function zg(e){const i=[],s=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:qt(l=>{const h=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||h?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)i.push(s.currentNode);return i}qt(zg,"getTabbableCandidates");function Pm(e,i){const r=typeof i.checkVisibility=="function"&&i.checkVisibility({checkVisibilityCSS:!0});for(const s of e)if(!(r?!s.checkVisibility({checkVisibilityCSS:!0}):OS(s,{upTo:i})))return s}qt(Pm,"findVisible");function OS(e,{upTo:i}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(i!==void 0&&e===i)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}qt(OS,"isHidden");function BS(e){return e.tagName==="INPUT"&&typeof e.select=="function"}qt(BS,"isSelectableInput");function mr(e,{select:i=!1}={}){if(e&&e.focus){const s=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==s&&BS(e)&&i&&e.select()}}qt(mr,"focus");var Iy=PS();function PS(){let e=[];return{add(i){const r=e[0];i!==r&&(r==null||r.pause()),e=zm(e,i),e.unshift(i)},remove(i){var r;e=zm(e,i),(r=e[0])==null||r.resume()}}}qt(PS,"createFocusScopesStack");function zm(e,i){const r=[...e],s=r.indexOf(i);return s!==-1&&r.splice(s,1),r}qt(zm,"arrayRemove");function zS(e){return e.filter(i=>i.tagName!=="A")}qt(zS,"removeLinks");var tR=Object.defineProperty,nR=(e,i)=>tR(e,"name",{value:i,configurable:!0}),Nh=N.forwardRef(nR(function(i,r){var u;const{container:s,...l}=i,[h,p]=N.useState(!1);Wt(()=>p(!0),[]);const o=s||h&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return o?nc.createPortal(m.jsx(Et.div,{...l,ref:r}),o):null},"Portal")),iR=Object.defineProperty,wr=(e,i)=>iR(e,"name",{value:i,configurable:!0});function IS(e,i){return N.useReducer((r,s)=>i[r][s]??r,e)}wr(IS,"useStateMachine");var Tr=wr(e=>{const{present:i,children:r}=e,s=HS(i),l=typeof r=="function"?r({present:s.isPresent}):N.Children.only(r),h=FS(s.ref,US(l));return typeof r=="function"||s.isPresent?N.cloneElement(l,{ref:h}):null},"Presence");function HS(e){const[i,r]=N.useState(),s=N.useRef(null),l=N.useRef(e),h=N.useRef("none"),p=N.useRef(void 0),o=e?"mounted":"unmounted",[u,d]=IS(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{u==="mounted"?(h.current=p.current??la(s.current),p.current=void 0):h.current="none"},[u]),Wt(()=>{const v=s.current,c=l.current;if(c!==e){const x=h.current,C=la(v);e?(p.current=C,d("MOUNT")):C==="none"||(v==null?void 0:v.display)==="none"?d("UNMOUNT"):d(c&&x!==C?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,d]),Wt(()=>{if(i){let v;const c=i.ownerDocument.defaultView??window,_=wr(C=>{const g=la(s.current).includes(CSS.escape(C.animationName));if(C.target===i&&g&&(d("ANIMATION_END"),!l.current)){const b=i.style.animationFillMode;i.style.animationFillMode="forwards",v=c.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=b)})}},"handleAnimationEnd"),x=wr(C=>{C.target===i&&(h.current=la(s.current))},"handleAnimationStart");return i.addEventListener("animationstart",x),i.addEventListener("animationcancel",_),i.addEventListener("animationend",_),()=>{c.clearTimeout(v),i.removeEventListener("animationstart",x),i.removeEventListener("animationcancel",_),i.removeEventListener("animationend",_)}}else d("ANIMATION_END")},[i,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:N.useCallback(v=>{if(v){const c=getComputedStyle(v);s.current=c,p.current=la(c)}else s.current=null;r(v)},[])}}wr(HS,"usePresence");function Im(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}wr(Im,"setRef");function FS(...e){const i=N.useRef(e);return i.current=e,N.useCallback(r=>{const s=i.current;let l=!1;const h=s.map(p=>{const o=Im(p,r);return!l&&typeof o=="function"&&(l=!0),o});if(l)return()=>{for(let p=0;p<h.length;p++){const o=h[p];typeof o=="function"?o():Im(s[p],null)}}},[])}wr(FS,"useStableComposedRefs");function la(e){return(e==null?void 0:e.animationName)||"none"}wr(la,"getAnimationName");function US(e){var s,l;let i=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=i&&"isReactWarning"in i&&i.isReactWarning;return r?e.ref:(i=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=i&&"isReactWarning"in i&&i.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}wr(US,"getElementRef");var rR=Object.defineProperty,Ig=(e,i)=>rR(e,"name",{value:i,configurable:!0}),Fu=0,Fi=null;function sR(e){return ic(),e.children}Ig(sR,"FocusGuards");function ic(){N.useEffect(()=>{Fi||(Fi={start:Hm(),end:Hm()});const{start:e,end:i}=Fi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==i&&document.body.insertAdjacentElement("beforeend",i),Fu++,()=>{Fu===1&&(Fi==null||Fi.start.remove(),Fi==null||Fi.end.remove(),Fi=null),Fu=Math.max(0,Fu-1)}},[])}Ig(ic,"useFocusGuards");function Hm(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Ig(Hm,"createFocusGuard");var $i=function(){return $i=Object.assign||function(i){for(var r,s=1,l=arguments.length;s<l;s++){r=arguments[s];for(var h in r)Object.prototype.hasOwnProperty.call(r,h)&&(i[h]=r[h])}return i},$i.apply(this,arguments)};function $S(e,i){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,s=Object.getOwnPropertySymbols(e);l<s.length;l++)i.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(e,s[l])&&(r[s[l]]=e[s[l]]);return r}function oR(e,i,r){if(r||arguments.length===2)for(var s=0,l=i.length,h;s<l;s++)(h||!(s in i))&&(h||(h=Array.prototype.slice.call(i,0,s)),h[s]=i[s]);return e.concat(h||Array.prototype.slice.call(i))}var nh="right-scroll-bar-position",ih="width-before-scroll-bar",aR="with-scroll-bars-hidden",lR="--removed-body-scroll-bar-size";function Yp(e,i){return typeof e=="function"?e(i):e&&(e.current=i),e}function cR(e,i){var r=N.useState(function(){return{value:e,callback:i,facade:{get current(){return r.value},set current(s){var l=r.value;l!==s&&(r.value=s,r.callback(s,l))}}}})[0];return r.callback=i,r.facade}var uR=typeof window<"u"?N.useLayoutEffect:N.useEffect,Hy=new WeakMap;function hR(e,i){var r=cR(null,function(s){return e.forEach(function(l){return Yp(l,s)})});return uR(function(){var s=Hy.get(r);if(s){var l=new Set(s),h=new Set(e),p=r.current;l.forEach(function(o){h.has(o)||Yp(o,null)}),h.forEach(function(o){l.has(o)||Yp(o,p)})}Hy.set(r,e)},[e]),r}function dR(e){return e}function fR(e,i){i===void 0&&(i=dR);var r=[],s=!1,l={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(h){var p=i(h,s);return r.push(p),function(){r=r.filter(function(o){return o!==p})}},assignSyncMedium:function(h){for(s=!0;r.length;){var p=r;r=[],p.forEach(h)}r={push:function(o){return h(o)},filter:function(){return r}}},assignMedium:function(h){s=!0;var p=[];if(r.length){var o=r;r=[],o.forEach(h),p=r}var u=function(){var v=p;p=[],v.forEach(h)},d=function(){return Promise.resolve().then(u)};d(),r={push:function(v){p.push(v),d()},filter:function(v){return p=p.filter(v),r}}}};return l}function pR(e){e===void 0&&(e={});var i=fR(null);return i.options=$i({async:!0,ssr:!1},e),i}var qS=function(e){var i=e.sideCar,r=$S(e,["sideCar"]);if(!i)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=i.read();if(!s)throw new Error("Sidecar medium not found");return N.createElement(s,$i({},r))};qS.isSideCarExport=!0;function mR(e,i){return e.useMedium(i),qS}var VS=pR(),Kp=function(){},Oh=N.forwardRef(function(e,i){var r=N.useRef(null),s=N.useState({onScrollCapture:Kp,onWheelCapture:Kp,onTouchMoveCapture:Kp}),l=s[0],h=s[1],p=e.forwardProps,o=e.children,u=e.className,d=e.removeScrollBar,v=e.enabled,c=e.shards,_=e.sideCar,x=e.noRelative,C=e.noIsolation,y=e.inert,g=e.allowPinchZoom,b=e.as,S=b===void 0?"div":b,w=e.gapMode,T=$S(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=_,R=hR([r,i]),L=$i($i({},T),l);return N.createElement(N.Fragment,null,v&&N.createElement(D,{sideCar:VS,removeScrollBar:d,shards:c,noRelative:x,noIsolation:C,inert:y,setCallbacks:h,allowPinchZoom:!!g,lockRef:r,gapMode:w}),p?N.cloneElement(N.Children.only(o),$i($i({},L),{ref:R})):N.createElement(S,$i({},L,{className:u,ref:R}),o))});Oh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Oh.classNames={fullWidth:ih,zeroRight:nh};var gR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function vR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var i=gR();return i&&e.setAttribute("nonce",i),e}function _R(e,i){e.styleSheet?e.styleSheet.cssText=i:e.appendChild(document.createTextNode(i))}function xR(e){var i=document.head||document.getElementsByTagName("head")[0];i.appendChild(e)}var yR=function(){var e=0,i=null;return{add:function(r){e==0&&(i=vR())&&(_R(i,r),xR(i)),e++},remove:function(){e--,!e&&i&&(i.parentNode&&i.parentNode.removeChild(i),i=null)}}},bR=function(){var e=yR();return function(i,r){N.useEffect(function(){return e.add(i),function(){e.remove()}},[i&&r])}},WS=function(){var e=bR(),i=function(r){var s=r.styles,l=r.dynamic;return e(s,l),null};return i},wR={left:0,top:0,right:0,gap:0},Xp=function(e){return parseInt(e||"",10)||0},SR=function(e){var i=window.getComputedStyle(document.body),r=i[e==="padding"?"paddingLeft":"marginLeft"],s=i[e==="padding"?"paddingTop":"marginTop"],l=i[e==="padding"?"paddingRight":"marginRight"];return[Xp(r),Xp(s),Xp(l)]},CR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wR;var i=SR(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,s-r+i[2]-i[0])}},kR=WS(),fa="data-scroll-locked",ER=function(e,i,r,s){var l=e.left,h=e.top,p=e.right,o=e.gap;return r===void 0&&(r="margin"),`
496
+ .`.concat(aR,` {
497
+ overflow: hidden `).concat(s,`;
498
+ padding-right: `).concat(o,"px ").concat(s,`;
499
+ }
500
+ body[`).concat(fa,`] {
501
+ overflow: hidden `).concat(s,`;
502
+ overscroll-behavior: contain;
503
+ `).concat([i&&"position: relative ".concat(s,";"),r==="margin"&&`
504
+ padding-left: `.concat(l,`px;
505
+ padding-top: `).concat(h,`px;
506
+ padding-right: `).concat(p,`px;
507
+ margin-left:0;
508
+ margin-top:0;
509
+ margin-right: `).concat(o,"px ").concat(s,`;
510
+ `),r==="padding"&&"padding-right: ".concat(o,"px ").concat(s,";")].filter(Boolean).join(""),`
511
+ }
512
+
513
+ .`).concat(nh,` {
514
+ right: `).concat(o,"px ").concat(s,`;
515
+ }
516
+
517
+ .`).concat(ih,` {
518
+ margin-right: `).concat(o,"px ").concat(s,`;
519
+ }
520
+
521
+ .`).concat(nh," .").concat(nh,` {
522
+ right: 0 `).concat(s,`;
523
+ }
524
+
525
+ .`).concat(ih," .").concat(ih,` {
526
+ margin-right: 0 `).concat(s,`;
527
+ }
528
+
529
+ body[`).concat(fa,`] {
530
+ `).concat(lR,": ").concat(o,`px;
531
+ }
532
+ `)},Fy=function(){var e=parseInt(document.body.getAttribute(fa)||"0",10);return isFinite(e)?e:0},TR=function(){N.useEffect(function(){return document.body.setAttribute(fa,(Fy()+1).toString()),function(){var e=Fy()-1;e<=0?document.body.removeAttribute(fa):document.body.setAttribute(fa,e.toString())}},[])},RR=function(e){var i=e.noRelative,r=e.noImportant,s=e.gapMode,l=s===void 0?"margin":s;TR();var h=N.useMemo(function(){return CR(l)},[l]);return N.createElement(kR,{styles:ER(h,!i,l,r?"":"!important")})},Fm=!1;if(typeof window<"u")try{var Uu=Object.defineProperty({},"passive",{get:function(){return Fm=!0,!0}});window.addEventListener("test",Uu,Uu),window.removeEventListener("test",Uu,Uu)}catch{Fm=!1}var ia=Fm?{passive:!1}:!1,AR=function(e){return e.tagName==="TEXTAREA"},GS=function(e,i){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[i]!=="hidden"&&!(r.overflowY===r.overflowX&&!AR(e)&&r[i]==="visible")},DR=function(e){return GS(e,"overflowY")},LR=function(e){return GS(e,"overflowX")},Uy=function(e,i){var r=i.ownerDocument,s=i;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=YS(e,s);if(l){var h=KS(e,s),p=h[1],o=h[2];if(p>o)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},jR=function(e){var i=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[i,r,s]},MR=function(e){var i=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[i,r,s]},YS=function(e,i){return e==="v"?DR(i):LR(i)},KS=function(e,i){return e==="v"?jR(i):MR(i)},NR=function(e,i){return e==="h"&&i==="rtl"?-1:1},OR=function(e,i,r,s,l){var h=NR(e,window.getComputedStyle(i).direction),p=h*s,o=r.target,u=i.contains(o),d=!1,v=p>0,c=0,_=0;do{if(!o)break;var x=KS(e,o),C=x[0],y=x[1],g=x[2],b=y-g-h*C;(C||b)&&YS(e,o)&&(c+=b,_+=C);var S=o.parentNode;o=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!u&&o!==document.body||u&&(i.contains(o)||i===o));return(v&&Math.abs(c)<1||!v&&Math.abs(_)<1)&&(d=!0),d},$u=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$y=function(e){return[e.deltaX,e.deltaY]},qy=function(e){return e&&"current"in e?e.current:e},BR=function(e,i){return e[0]===i[0]&&e[1]===i[1]},PR=function(e){return`
533
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
534
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
535
+ `)},zR=0,ra=[];function IR(e){var i=N.useRef([]),r=N.useRef([0,0]),s=N.useRef(),l=N.useState(zR++)[0],h=N.useState(WS)[0],p=N.useRef(e);N.useEffect(function(){p.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var y=oR([e.lockRef.current],(e.shards||[]).map(qy),!0).filter(Boolean);return y.forEach(function(g){return g.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),y.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var o=N.useCallback(function(y,g){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!p.current.allowPinchZoom;var b=$u(y),S=r.current,w="deltaX"in y?y.deltaX:S[0]-b[0],T="deltaY"in y?y.deltaY:S[1]-b[1],D,R=y.target,L=Math.abs(w)>Math.abs(T)?"h":"v";if("touches"in y&&L==="h"&&R.type==="range")return!1;var A=window.getSelection(),M=A&&A.anchorNode,j=M?M===R||M.contains(R):!1;if(j)return!1;var z=Uy(L,R);if(!z)return!0;if(z?D=L:(D=L==="v"?"h":"v",z=Uy(L,R)),!z)return!1;if(!s.current&&"changedTouches"in y&&(w||T)&&(s.current=D),!D)return!0;var P=s.current||D;return OR(P,g,y,P==="h"?w:T)},[]),u=N.useCallback(function(y){var g=y;if(!(!ra.length||ra[ra.length-1]!==h)){var b="deltaY"in g?$y(g):$u(g),S=i.current.filter(function(D){return D.name===g.type&&(D.target===g.target||g.target===D.shadowParent)&&BR(D.delta,b)})[0];if(S&&S.should){g.cancelable&&g.preventDefault();return}if(!S){var w=(p.current.shards||[]).map(qy).filter(Boolean).filter(function(D){return D.contains(g.target)}),T=w.length>0?o(g,w[0]):!p.current.noIsolation;T&&g.cancelable&&g.preventDefault()}}},[]),d=N.useCallback(function(y,g,b,S){var w={name:y,delta:g,target:b,should:S,shadowParent:HR(b)};i.current.push(w),setTimeout(function(){i.current=i.current.filter(function(T){return T!==w})},1)},[]),v=N.useCallback(function(y){r.current=$u(y),s.current=void 0},[]),c=N.useCallback(function(y){d(y.type,$y(y),y.target,o(y,e.lockRef.current))},[]),_=N.useCallback(function(y){d(y.type,$u(y),y.target,o(y,e.lockRef.current))},[]);N.useEffect(function(){return ra.push(h),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:_}),document.addEventListener("wheel",u,ia),document.addEventListener("touchmove",u,ia),document.addEventListener("touchstart",v,ia),function(){ra=ra.filter(function(y){return y!==h}),document.removeEventListener("wheel",u,ia),document.removeEventListener("touchmove",u,ia),document.removeEventListener("touchstart",v,ia)}},[]);var x=e.removeScrollBar,C=e.inert;return N.createElement(N.Fragment,null,C?N.createElement(h,{styles:PR(l)}):null,x?N.createElement(RR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function HR(e){for(var i=null;e!==null;)e instanceof ShadowRoot&&(i=e.host,e=e.host),e=e.parentNode;return i}const FR=mR(VS,IR);var Bh=N.forwardRef(function(e,i){return N.createElement(Oh,$i({},e,{ref:i,sideCar:FR}))});Bh.classNames=Oh.classNames;var UR=function(e){if(typeof document>"u")return null;var i=Array.isArray(e)?e[0]:e;return i.ownerDocument.body},sa=new WeakMap,qu=new WeakMap,Vu={},Qp=0,XS=function(e){return e&&(e.host||XS(e.parentNode))},$R=function(e,i){return i.map(function(r){if(e.contains(r))return r;var s=XS(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},qR=function(e,i,r,s){var l=$R(i,Array.isArray(e)?e:[e]);Vu[r]||(Vu[r]=new WeakMap);var h=Vu[r],p=[],o=new Set,u=new Set(l),d=function(c){!c||o.has(c)||(o.add(c),d(c.parentNode))};l.forEach(d);var v=function(c){!c||u.has(c)||Array.prototype.forEach.call(c.children,function(_){if(o.has(_))v(_);else try{var x=_.getAttribute(s),C=x!==null&&x!=="false",y=(sa.get(_)||0)+1,g=(h.get(_)||0)+1;sa.set(_,y),h.set(_,g),p.push(_),y===1&&C&&qu.set(_,!0),g===1&&_.setAttribute(r,"true"),C||_.setAttribute(s,"true")}catch(b){console.error("aria-hidden: cannot operate on ",_,b)}})};return v(i),o.clear(),Qp++,function(){p.forEach(function(c){var _=sa.get(c)-1,x=h.get(c)-1;sa.set(c,_),h.set(c,x),_||(qu.has(c)||c.removeAttribute(s),qu.delete(c)),x||c.removeAttribute(r)}),Qp--,Qp||(sa=new WeakMap,sa=new WeakMap,qu=new WeakMap,Vu={})}},Hg=function(e,i,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),l=UR(e);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),qR(s,l,r,"aria-hidden")):function(){return null}},VR=Object.defineProperty,Hn=(e,i)=>VR(e,"name",{value:i,configurable:!0}),Fg="Dialog",[QS,cP]=Er(Fg),[WR,Ai]=QS(Fg),ZS=Hn(e=>{const{__scopeDialog:i,children:r,open:s,defaultOpen:l,onOpenChange:h,modal:p=!0}=e,o=N.useRef(null),u=N.useRef(null),{nodes:d,registry:v}=Bg(),[c,_]=Js({prop:s,defaultProp:l??!1,onChange:h,caller:Fg}),[x,C]=N.useState(0),[y,g]=N.useState(0);return m.jsx(WR,{scope:i,triggerRef:o,contentRef:u,contentId:Vi(),titleId:Vi(),descriptionId:Vi(),titlePresent:x>0,descriptionPresent:y>0,setTitleCount:C,setDescriptionCount:g,open:c,onOpenChange:_,onOpenToggle:N.useCallback(()=>_(b=>!b),[_]),modal:p,branchNodes:d,branchRegistry:v,children:r})},"Dialog"),GR="DialogTrigger",YR=N.forwardRef(Hn(function(i,r){const{__scopeDialog:s,...l}=i,h=Ai(GR,s),p=ht(r,h.triggerRef);return m.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":Ph(h.open),...l,ref:p,onClick:it(i.onClick,h.onOpenToggle)})},"DialogTrigger")),JS="DialogPortal",[KR,eC]=QS(JS,{forceMount:void 0}),tC=Hn(e=>{const{__scopeDialog:i,forceMount:r,children:s,container:l}=e,h=Ai(JS,i);return m.jsx(KR,{scope:i,forceMount:r,children:N.Children.map(s,p=>m.jsx(Tr,{present:r||h.open,children:m.jsx(Nh,{asChild:!0,container:l,children:p})}))})},"DialogPortal"),Um="DialogOverlay",nC=N.forwardRef(Hn(function(i,r){const s=eC(Um,i.__scopeDialog),{forceMount:l=s.forceMount,...h}=i,p=Ai(Um,i.__scopeDialog);return p.modal?m.jsx(Tr,{present:l||p.open,children:m.jsx(QR,{...h,ref:r})}):null},"DialogOverlay")),XR=br("DialogOverlay.RemoveScroll"),QR=N.forwardRef(Hn(function(i,r){const{__scopeDialog:s,...l}=i,h=Ai(Um,s),p=AS(),o=ht(r,p);return m.jsx(Bh,{as:XR,allowPinchZoom:!0,shards:N.useMemo(()=>[h.contentRef,...h.branchNodes.map(u=>({current:u}))],[h.contentRef,h.branchNodes]),children:m.jsx(Et.div,{"data-state":Ph(h.open),...l,ref:o,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),Fl="DialogContent",iC=N.forwardRef(Hn(function(i,r){const s=eC(Fl,i.__scopeDialog),{forceMount:l=s.forceMount,...h}=i,p=Ai(Fl,i.__scopeDialog);return m.jsx(Tr,{present:l||p.open,children:p.modal?m.jsx(ZR,{...h,ref:r}):m.jsx(JR,{...h,ref:r})})},"DialogContent")),ZR=N.forwardRef(Hn(function(i,r){const s=Ai(Fl,i.__scopeDialog),l=N.useRef(null),h=ht(r,s.contentRef,l);return N.useEffect(()=>{const p=l.current;if(p)return Hg(p)},[]),m.jsx(rC,{...i,ref:h,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:it(i.onCloseAutoFocus,p=>{var o;p.preventDefault(),(o=s.triggerRef.current)==null||o.focus()}),onPointerDownOutside:it(i.onPointerDownOutside,p=>{const o=p.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&p.preventDefault()}),onFocusOutside:it(i.onFocusOutside,p=>p.preventDefault())})},"DialogContentModal")),JR=N.forwardRef(Hn(function(i,r){const s=Ai(Fl,i.__scopeDialog),l=N.useRef(!1),h=N.useRef(!1);return m.jsx(rC,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var o,u;(o=i.onCloseAutoFocus)==null||o.call(i,p),p.defaultPrevented||(l.current||(u=s.triggerRef.current)==null||u.focus(),p.preventDefault()),l.current=!1,h.current=!1},onInteractOutside:p=>{var d,v;(d=i.onInteractOutside)==null||d.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(h.current=!0));const o=p.target;((v=s.triggerRef.current)==null?void 0:v.contains(o))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&h.current&&p.preventDefault()}})},"DialogContentNonModal")),rC=N.forwardRef(Hn(function(i,r){const{__scopeDialog:s,trapFocus:l,onOpenAutoFocus:h,onCloseAutoFocus:p,"aria-describedby":o,children:u,...d}=i,v=Ai(Fl,s);return ic(),m.jsx(Og,{registry:v.branchRegistry,children:m.jsx(Ng,{asChild:!0,loop:!0,trapped:l,branches:v.branchNodes,onMountAutoFocus:h,onUnmountAutoFocus:p,children:m.jsx(Mh,{role:"dialog",id:v.contentId,"aria-labelledby":v.titlePresent?v.titleId:void 0,"aria-describedby":v.descriptionPresent?lC(o,v.descriptionId):o,"data-state":Ph(v.open),...d,ref:r,deferPointerDownOutside:!0,onDismiss:()=>v.onOpenChange(!1),children:u})})})},"DialogContentImpl")),sC=N.forwardRef(Hn(function(i,r){const{__scopeDialog:s,...l}=i,h=Ai("DialogTitle",s),{setTitleCount:p}=h;return Wt(()=>(p(o=>o+1),()=>p(o=>o-1)),[p]),m.jsx(Et.h2,{id:h.titleId,...l,ref:r})},"DialogTitle")),oC=N.forwardRef(Hn(function(i,r){const{__scopeDialog:s,...l}=i,h=Ai("DialogDescription",s),{setDescriptionCount:p}=h;return Wt(()=>(p(o=>o+1),()=>p(o=>o-1)),[p]),m.jsx(Et.p,{id:h.descriptionId,...l,ref:r})},"DialogDescription")),eA="DialogClose",aC=N.forwardRef(Hn(function(i,r){const{__scopeDialog:s,...l}=i,h=Ai(eA,s);return m.jsx(Et.button,{type:"button",...l,ref:r,onClick:it(i.onClick,()=>h.onOpenChange(!1))})},"DialogClose"));function lC(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Hn(lC,"concatAriaDescribedby");function Ph(e){return e?"open":"closed"}Hn(Ph,"getState");function Ug({open:e,onOpenChange:i,title:r,description:s,children:l,footer:h,headerAction:p,maxWidth:o="max-w-md",height:u,disableOutsideClose:d}){return m.jsx(ZS,{open:e,onOpenChange:i,children:m.jsxs(tC,{children:[m.jsx(nC,{className:"fixed inset-0 z-50 bg-foreground/40 animate-in fade-in-0"}),m.jsxs(iC,{className:`fixed left-1/2 top-1/2 z-50 flex w-[calc(100%-1.5rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl bg-card shadow-xl focus:outline-none animate-in fade-in-0 zoom-in-95 sm:w-[calc(100%-2rem)] ${o} max-h-[calc(100dvh-1.5rem)] sm:max-h-[calc(100dvh-2rem)] ${u??""}`,onInteractOutside:d?v=>v.preventDefault():void 0,children:[m.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-3 px-4 py-4 sm:px-5",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx(sC,{className:"text-sm font-semibold text-foreground",children:r}),s&&m.jsx(oC,{className:"mt-0.5 truncate text-xs text-muted-foreground",title:s,children:s})]}),m.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-1",children:[p,m.jsx(aC,{asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon","aria-label":"Close",children:m.jsx(xn,{size:15})})})]})]}),m.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-4 pt-1 sm:px-5",children:l}),h&&m.jsx("div",{className:"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border px-4 pb-4 pt-3 sm:px-5",children:h})]})]})})}const cC=N.createContext(null);function Vy({children:e}){const[i,r]=N.useState(null),[s,l]=N.useState(!1),h=N.useRef(null),p=N.useCallback(d=>{var v;return(v=h.current)==null||v.call(h,!1),r(d),new Promise(c=>{h.current=c})},[]),o=d=>{var v;(v=h.current)==null||v.call(h,d),h.current=null,r(null),l(!1)},u=async()=>{if(!(i!=null&&i.run))return o(!0);l(!0);try{await i.run(),o(!0)}catch(d){_e.getState().notify(d.message,"error"),l(!1)}};return m.jsxs(cC.Provider,{value:p,children:[e,i&&m.jsx(Ug,{open:!0,onOpenChange:d=>!d&&!s&&o(!1),title:i.title,description:i.description,maxWidth:i.maxWidth??"max-w-md",disableOutsideClose:s,footer:m.jsxs(m.Fragment,{children:[m.jsx(ge,{disabled:s,onClick:()=>o(!1),children:"Cancel"}),m.jsx(ge,{variant:i.tone??"primary",disabled:s,onClick:()=>void u(),autoFocus:!0,children:s?"Working...":i.confirmLabel??"Confirm"})]}),children:i.body})]})}function ln(){const e=N.useContext(cC);if(!e)throw new Error("useConfirm needs a ConfirmProvider above it.");return e}function zh(){const e=_e(l=>l.go),[i,r]=N.useState(!1);return{starting:i,start:async(l,h,p)=>{if(i)return;r(!0);const o=Math.max(80,Math.floor((window.innerWidth-340)/7.8)),u=Math.max(24,Math.floor((window.innerHeight-220)/17)),d=await qe(()=>ve.startPurpose(l,h,{cols:o,rows:u},p));r(!1),d&&(await _e.getState().refreshSessions(),e({kind:"session",id:d.sessionId}))}}}var tA=Object.defineProperty,nA=(e,i)=>tA(e,"name",{value:i,configurable:!0});function $g(e){const[i,r]=N.useState(void 0);return Wt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let s=0;const l=new ResizeObserver(h=>{if(!Array.isArray(h)||!h.length)return;const p=h[0];window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{let o,u;if("borderBoxSize"in p){const d=p.borderBoxSize,v=Array.isArray(d)?d[0]:d;o=v.inlineSize,u=v.blockSize}else o=e.offsetWidth,u=e.offsetHeight;r({width:o,height:u})})});return l.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(s),l.unobserve(e)}}else r(void 0)},[e]),i}nA($g,"useSize");var iA=Object.defineProperty,Sr=(e,i)=>iA(e,"name",{value:i,configurable:!0}),qg="Checkbox",[rA,uP]=Er(qg),[sA,Vg]=rA(qg);function uC(e){const{__scopeCheckbox:i,checked:r,children:s,defaultChecked:l,disabled:h,form:p,name:o,onCheckedChange:u,required:d,value:v="on",internal_do_not_use_render:c}=e,[_,x]=Js({prop:r,defaultProp:l??!1,onChange:u,caller:qg}),[C,y]=N.useState(null),[g,b]=N.useState(null),[S,w]=N.useState(null),T=C?!!p||!!C.closest("form"):!0,D={checked:_,disabled:h,setChecked:x,control:C,setControl:y,name:o,form:p,value:v,userClick:S,onUserClick:w,required:d,defaultChecked:gi(l)?!1:l,isFormControl:T,bubbleInput:g,setBubbleInput:b};return m.jsx(sA,{scope:i,...D,children:hC(c)?c(D):s})}Sr(uC,"CheckboxProvider");var oA="CheckboxTrigger",aA=N.forwardRef(Sr(function({__scopeCheckbox:i,onKeyDown:r,onClick:s,...l},h){const{control:p,value:o,disabled:u,checked:d,required:v,setControl:c,setChecked:_,onUserClick:x,isFormControl:C,bubbleInput:y}=Vg(oA,i),g=ht(h,c),b=N.useRef(d);return N.useEffect(()=>{const S=p==null?void 0:p.form;if(S){const w=Sr(()=>_(b.current),"reset");return S.addEventListener("reset",w),()=>S.removeEventListener("reset",w)}},[p,_]),m.jsx(Et.button,{type:"button",role:"checkbox","aria-checked":gi(d)?"mixed":d,"aria-required":v,"data-state":Wg(d),"data-disabled":u?"":void 0,disabled:u,value:o,...l,ref:g,onKeyDown:it(r,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:it(s,S=>{const w=S.isPropagationStopped();x({requestedChecked:gi(d)?!0:!d,hasConsumerStoppedPropagation:w}),_(T=>gi(T)?!0:!T),y&&C&&(w||S.stopPropagation())})})},"CheckboxTrigger")),lA=N.forwardRef(Sr(function(i,r){const{__scopeCheckbox:s,name:l,checked:h,defaultChecked:p,required:o,disabled:u,value:d,onCheckedChange:v,form:c,..._}=i;return m.jsx(uC,{__scopeCheckbox:s,checked:h,defaultChecked:p,disabled:u,required:o,onCheckedChange:v,name:l,form:c,value:d,internal_do_not_use_render:({isFormControl:x})=>m.jsxs(m.Fragment,{children:[m.jsx(aA,{..._,ref:r,__scopeCheckbox:s}),x&&m.jsx(dA,{__scopeCheckbox:s})]})})},"Checkbox")),cA="CheckboxIndicator",uA=N.forwardRef(Sr(function(i,r){const{__scopeCheckbox:s,forceMount:l,...h}=i,p=Vg(cA,s);return m.jsx(Tr,{present:l||gi(p.checked)||p.checked===!0,children:m.jsx(Et.span,{"data-state":Wg(p.checked),"data-disabled":p.disabled?"":void 0,...h,ref:r,style:{pointerEvents:"none",...i.style}})})},"CheckboxIndicator")),hA="CheckboxBubbleInput",dA=N.forwardRef(Sr(function({__scopeCheckbox:i,onClick:r,...s},l){const{control:h,userClick:p,checked:o,defaultChecked:u,required:d,disabled:v,name:c,value:_,form:x,bubbleInput:C,setBubbleInput:y}=Vg(hA,i),g=ht(l,y),b=$g(h),S=N.useRef(!1),w=N.useRef(o),T=N.useRef(p),D=N.useRef(null);N.useEffect(()=>{const L=C;if(!L)return;const A=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(A,"checked").set;if(!j)return;const z=w.current!==o;w.current=o;const P=p!==null&&p!==T.current;if(T.current=p,P)D.current=z?null:p,z&&(L.indeterminate=gi(o),j.call(L,gi(o)?!1:o)),L.dispatchEvent(new Event("click",{bubbles:!p.hasConsumerStoppedPropagation}));else if(z){const H=D.current;D.current=null;const F=(H==null?void 0:H.requestedChecked)===o;S.current=!0,L.indeterminate=gi(o),j.call(L,gi(o)?!1:o),L.dispatchEvent(new Event("click",{bubbles:!(F&&H.hasConsumerStoppedPropagation)})),S.current=!1}},[C,o,p]);const R=N.useRef(gi(o)?!1:o);return m.jsx(Et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:v,name:c,value:_,form:x,...s,tabIndex:-1,ref:g,onClick:it(r,L=>{S.current&&L.stopPropagation()}),style:{...s.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function hC(e){return typeof e=="function"}Sr(hC,"isFunction");function gi(e){return e==="indeterminate"}Sr(gi,"isIndeterminate");function Wg(e){return gi(e)?"indeterminate":e?"checked":"unchecked"}Sr(Wg,"getState");function Cr({id:e,label:i,ariaLabel:r,checked:s,onCheckedChange:l,disabled:h,title:p,className:o}){const u=e??(i?`cb-${String(i).toLowerCase().replace(/\s+/g,"-")}`:void 0);return m.jsxs("div",{className:ye("flex items-center gap-2",o),title:p,children:[m.jsx(lA,{id:u,checked:s,onCheckedChange:d=>l(d===!0),"aria-label":r,disabled:h,className:"h-4 w-4 shrink-0 cursor-pointer rounded border border-border bg-transparent focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:m.jsx(uA,{className:"flex items-center justify-center",children:m.jsx(Xl,{className:"h-3 w-3 text-primary",strokeWidth:3})})}),i&&m.jsx("label",{htmlFor:u,className:"cursor-pointer select-none text-xs",children:i})]})}function zt({label:e,hint:i,children:r}){return m.jsxs("label",{className:"block space-y-1",children:[m.jsx("div",{className:"text-xs font-medium",children:e}),r,i&&m.jsx("div",{className:"text-[11px] text-muted-foreground",children:i})]})}const _t=N.forwardRef(({className:e,size:i="sm",...r},s)=>m.jsx("input",{ref:s,className:ye("w-full rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));_t.displayName="Input";var fA=Object.defineProperty,pA=(e,i)=>fA(e,"name",{value:i,configurable:!0});function $m(e,[i,r]){return Math.min(r,Math.max(i,e))}pA($m,"clamp");var mA=Object.defineProperty,Zt=(e,i)=>mA(e,"name",{value:i,configurable:!0});function dC(e){const i=e+"CollectionProvider",[r,s]=Er(i),[l,h]=r(i,{collectionRef:{current:null},itemMap:new Map}),p=Zt(y=>{const{scope:g,children:b}=y,S=N.useRef(null),w=N.useRef(new Map).current;return m.jsx(l,{scope:g,itemMap:w,collectionRef:S,children:b})},"CollectionProvider");p.displayName=i;const o=e+"CollectionSlot",u=br(o),d=N.forwardRef((y,g)=>{const{scope:b,children:S}=y,w=h(o,b),T=ht(g,w.collectionRef);return m.jsx(u,{ref:T,children:S})});d.displayName=o;const v=e+"CollectionItemSlot",c="data-radix-collection-item",_=br(v),x=N.forwardRef((y,g)=>{const{scope:b,children:S,...w}=y,T=N.useRef(null),D=ht(g,T),R=h(v,b);return N.useEffect(()=>(R.itemMap.set(T,{ref:T,...w}),()=>void R.itemMap.delete(T))),m.jsx(_,{[c]:"",ref:D,children:S})});x.displayName=v;function C(y){const g=h(e+"CollectionConsumer",y);return N.useCallback(()=>{const S=g.collectionRef.current;if(!S)return[];const w=Array.from(S.querySelectorAll(`[${c}]`));return Array.from(g.itemMap.values()).sort((R,L)=>w.indexOf(R.ref.current)-w.indexOf(L.ref.current))},[g.collectionRef,g.itemMap])}return Zt(C,"useCollection"),[{Provider:p,Slot:d,ItemSlot:x},C,s]}Zt(dC,"createCollection");var Wy=new WeakMap,Pt,Jn,Wu=(Jn=class extends Map{constructor(r){super(r);uy(this,Pt);Pp(this,Pt,[...super.keys()]),Wy.set(this,!0)}set(r,s){return Wy.get(this)&&!this.has(r)&&mn(this,Pt).push(r),super.set(r,s),this}insert(r,s,l){const h=this.has(s),p=h?this.size:this.size+1,o=Gg(r),u=o>=0?Math.min(o,p-1):Math.max(p+o,0);if(h?mn(this,Pt).indexOf(s)===u:u===this.size)return this.set(s,l),this;const d=mn(this,Pt).filter(c=>c!==s);d.splice(u,0,s);const v=d.map(c=>[c,c===s?l:this.get(c)]);this.clear();for(const[c,_]of v)this.set(c,_);return this}with(r,s,l){const h=new Jn(this);return h.insert(r,s,l),h}before(r){const s=mn(this,Pt).indexOf(r)-1;if(!(s<0))return this.entryAt(s)}setBefore(r,s,l){const h=mn(this,Pt).indexOf(r);if(h===-1)return this;const p=mn(this,Pt).indexOf(s),o=p!==-1&&p<h?h-1:h;return this.insert(o,s,l)}after(r){let s=mn(this,Pt).indexOf(r);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(r,s,l){const h=mn(this,Pt).indexOf(r);if(h===-1)return this;const p=mn(this,Pt).indexOf(s),o=p!==-1&&p<=h?h:h+1;return this.insert(o,s,l)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Pp(this,Pt,[]),super.clear()}delete(r){const s=super.delete(r);return s&&mn(this,Pt).splice(mn(this,Pt).indexOf(r),1),s}deleteAt(r){const s=this.keyAt(r);return s!==void 0?this.delete(s):!1}at(r){const s=rh(mn(this,Pt),r);if(s!==void 0)return this.get(s)}entryAt(r){const s=rh(mn(this,Pt),r);if(s!==void 0)return[s,this.get(s)]}indexOf(r){return mn(this,Pt).indexOf(r)}keyAt(r){return rh(mn(this,Pt),r)}from(r,s){const l=this.indexOf(r);if(l===-1)return;let h=l+s;return h<0&&(h=0),h>=this.size&&(h=this.size-1),this.at(h)}keyFrom(r,s){const l=this.indexOf(r);if(l===-1)return;let h=l+s;return h<0&&(h=0),h>=this.size&&(h=this.size-1),this.keyAt(h)}find(r,s){let l=0;for(const h of this){if(Reflect.apply(r,s,[h,l,this]))return h;l++}}findIndex(r,s){let l=0;for(const h of this){if(Reflect.apply(r,s,[h,l,this]))return l;l++}return-1}filter(r,s){const l=[];let h=0;for(const p of this)Reflect.apply(r,s,[p,h,this])&&l.push(p),h++;return new Jn(l)}map(r,s){const l=[];let h=0;for(const p of this)l.push([p[0],Reflect.apply(r,s,[p,h,this])]),h++;return new Jn(l)}reduce(...r){const[s,l]=r,h=r.length>1;if(!h&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=0,o=l;for(const u of this)p===0&&!h?o=u:o=Reflect.apply(s,this,[o,u,p,this]),p++;return o}reduceRight(...r){const[s,l]=r,h=r.length>1;if(!h&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let p=l;for(let o=this.size-1;o>=0;o--){const u=this.entryAt(o);o===this.size-1&&!h?p=u:p=Reflect.apply(s,this,[p,u,o,this])}return p}sort(r){if(typeof r!="function")throw new TypeError("OrderedDict.sort requires a compare function");const s=[...this.entries()].sort(r);this.clear();for(const[l,h]of s)this.set(l,h);return this}toSorted(r){if(typeof r!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const s=[...this.entries()].sort(r);return new Jn(s)}toReversed(){const r=new Jn;for(let s=this.size-1;s>=0;s--){const l=this.keyAt(s),h=this.get(l);r.set(l,h)}return r}toSpliced(...r){const s=[...this.entries()];return s.splice(...r),new Jn(s)}slice(r,s){const l=new Jn;for(const h of mn(this,Pt).slice(r,s))l.set(h,this.get(h));return l}every(r,s){let l=0;for(const h of this){if(!Reflect.apply(r,s,[h,l,this]))return!1;l++}return!0}some(r,s){let l=0;for(const h of this){if(Reflect.apply(r,s,[h,l,this]))return!0;l++}return!1}},Pt=new WeakMap,Zt(Jn,"OrderedDict"),Jn);function rh(e,i){if("at"in Array.prototype)return Array.prototype.at.call(e,i);const r=fC(e,i);return r===-1?void 0:e[r]}Zt(rh,"at");function fC(e,i){const r=e.length,s=Gg(i),l=s>=0?s:r+s;return l<0||l>=r?-1:l}Zt(fC,"toSafeIndex");function Gg(e){return e!==e||e===0?0:Math.trunc(e)}Zt(Gg,"toSafeInteger");function gA(e){const i=e+"CollectionProvider",[r,s]=Er(i),[l,h]=r(i);l.displayName=e+"CollectionStableContextProvider";const[p,o]=r(i);p.displayName=e+"CollectionStatefulContextProvider";const u=Zt(({state:R,...L})=>R?m.jsx(v,{...L,state:R}):m.jsx(d,{...L}),"CollectionProvider");u.displayName=i;const d=Zt(R=>{const L=S();return m.jsx(v,{...R,state:L})},"CollectionInit");d.displayName=e+"CollectionInit";const v=Zt(R=>{const{scope:L,children:A,state:M}=R,j=N.useRef(null),[z,P]=N.useState(null),H=ht(j,P),[F,W]=M,G=N.useRef(new Wu),Q=N.useCallback(()=>{const X=G.current;return gC(X)||X.sort(sh),X},[]);return N.useEffect(()=>{if(!z)return;const X=vC(()=>{W(I=>{const O=I.toSorted(sh);return O.some(([Z],U)=>I.keyAt(U)!==Z)?O:I})});return X.observe(z,{childList:!0,subtree:!0}),()=>{X.disconnect()}},[z,W]),m.jsx(l,{scope:L,collectionElementRef:H,collectionElementRefObject:j,getCollection:Q,setCollection:W,registryRef:G,children:m.jsx(p,{scope:L,collectionElement:z,collection:F,children:A})})},"CollectionProviderImpl");v.displayName=e+"CollectionProviderImpl";const c=e+"CollectionSlot",_=br(c),x=N.forwardRef((R,L)=>{const{scope:A,children:M}=R,j=h(c,A),z=ht(L,j.collectionElementRef);return m.jsx(_,{ref:z,children:M})});x.displayName=c;const C=e+"CollectionItemSlot",y="data-radix-collection-item",g=br(C),b=N.forwardRef((R,L)=>{const{scope:A,children:M,...j}=R,z=N.useRef(null),P=h(C,A),{setCollection:H,registryRef:F}=P,W=N.useRef(j);pC(W.current,j)||(W.current=j);const G=W.current,Q=N.useCallback(O=>{const Y=F.current;O?Y.set(O,{...W.current,element:O}):z.current&&Y.delete(z.current)},[F]),X=ht(L,Q,z);Wt(()=>{const O=z.current,Y=F.current;O&&Y.has(O)&&Y.set(O,{...G,element:O})},[G,F]);const I=N.useRef(null);return N.useEffect(()=>{const O=z.current,Y=I.current;((Y==null?void 0:Y.element)??null)===O&&(!O||(Y==null?void 0:Y.itemData)===G)||(I.current=O?{element:O,itemData:G}:null,H(Z=>{const U=new Wu(Z);return Y&&Y.element!==O&&U.delete(Y.element),O&&U.set(O,{...G,element:O}),U.sort(sh)}))}),N.useEffect(()=>()=>{const O=I.current;I.current=null,O&&H(Y=>{if(!Y.has(O.element))return Y;const Z=new Wu(Y);return Z.delete(O.element),Z})},[H]),m.jsx(g,{[y]:"",ref:X,children:M})});b.displayName=C;function S(){return N.useState(new Wu)}Zt(S,"useInitCollection");function w(R){const{collection:L}=o(e+"CollectionConsumer",R);return L}Zt(w,"useCollection");function T(R){const{getCollection:L}=h(e+"CollectionConsumer",R);return L}return Zt(T,"useGetCollection"),[{Provider:u,Slot:x,ItemSlot:b},{createCollectionScope:s,useCollection:w,useGetCollection:T,useInitCollection:S}]}Zt(gA,"createCollection");function pC(e,i){if(e===i)return!0;if(typeof e!="object"||typeof i!="object"||e==null||i==null)return!1;const r=Object.keys(e),s=Object.keys(i);if(r.length!==s.length)return!1;for(const l of r)if(!Object.prototype.hasOwnProperty.call(i,l)||e[l]!==i[l])return!1;return!0}Zt(pC,"shallowEqual");function mC(e,i){return!!(i.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Zt(mC,"isElementPreceding");function gC(e){let i;for(const r of e.keys()){if(i){const s=i.compareDocumentPosition(r);if(!(s&Node.DOCUMENT_POSITION_DISCONNECTED)&&s&Node.DOCUMENT_POSITION_PRECEDING)return!1}i=r}return!0}Zt(gC,"isInDocumentOrder");function sh(e,i){return!e[1].element||!i[1].element?0:mC(e[1].element,i[1].element)?-1:1}Zt(sh,"sortByDocumentPosition");function vC(e){return new MutationObserver(r=>{for(const s of r)if(s.type==="childList"){e();return}})}Zt(vC,"getChildListObserver");var vA=Object.defineProperty,_A=(e,i)=>vA(e,"name",{value:i,configurable:!0}),xA={LTR:"ltr"},yA=N.createContext(void 0);function _C(e){const i=N.useContext(yA);return e||i||xA.LTR}_A(_C,"useDirection");const bA=["top","right","bottom","left"],fs=Math.min,_r=Math.max,ph=Math.round,Gu=Math.floor,xr=e=>({x:e,y:e}),wA={left:"right",right:"left",bottom:"top",top:"bottom"};function xC(e,i,r){return _r(e,fs(i,r))}function kr(e,i){return typeof e=="function"?e(i):e}function ps(e){return e.split("-")[0]}function Ea(e){return e.split("-")[1]}function Yg(e){return e==="x"?"y":"x"}function Kg(e){return e==="y"?"height":"width"}function qi(e){const i=e[0];return i==="t"||i==="b"?"y":"x"}function Xg(e){return Yg(qi(e))}function SA(e,i,r){r===void 0&&(r=!1);const s=Ea(e),l=Xg(e),h=Kg(l);let p=l==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return i.reference[h]>i.floating[h]&&(p=mh(p)),[p,mh(p)]}function CA(e){const i=mh(e);return[qm(e),i,qm(i)]}function qm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Gy=["left","right"],Yy=["right","left"],kA=["top","bottom"],EA=["bottom","top"];function TA(e,i,r){switch(e){case"top":case"bottom":return r?i?Yy:Gy:i?Gy:Yy;case"left":case"right":return i?kA:EA;default:return[]}}function RA(e,i,r,s){const l=Ea(e);let h=TA(ps(e),r==="start",s);return l&&(h=h.map(p=>p+"-"+l),i&&(h=h.concat(h.map(qm)))),h}function mh(e){const i=ps(e);return wA[i]+e.slice(i.length)}function AA(e){var i,r,s,l;return{top:(i=e.top)!=null?i:0,right:(r=e.right)!=null?r:0,bottom:(s=e.bottom)!=null?s:0,left:(l=e.left)!=null?l:0}}function yC(e){return typeof e!="number"?AA(e):{top:e,right:e,bottom:e,left:e}}function gh(e){const{x:i,y:r,width:s,height:l}=e;return{width:s,height:l,top:r,left:i,right:i+s,bottom:r+l,x:i,y:r}}function Ky(e,i,r){let{reference:s,floating:l}=e;const h=qi(i),p=Xg(i),o=Kg(p),u=ps(i),d=h==="y",v=s.x+s.width/2-l.width/2,c=s.y+s.height/2-l.height/2,_=s[o]/2-l[o]/2;let x;switch(u){case"top":x={x:v,y:s.y-l.height};break;case"bottom":x={x:v,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:c};break;case"left":x={x:s.x-l.width,y:c};break;default:x={x:s.x,y:s.y}}const C=Ea(i);return C&&(x[p]+=_*(C==="end"?1:-1)*(r&&d?-1:1)),x}async function DA(e,i){var r;i===void 0&&(i={});const{x:s,y:l,platform:h,rects:p,elements:o,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:v="viewport",elementContext:c="floating",altBoundary:_=!1,padding:x=0}=kr(i,e),C=yC(x),g=o[_?c==="floating"?"reference":"floating":c],b=gh(await h.getClippingRect({element:(r=await(h.isElement==null?void 0:h.isElement(g)))==null||r?g:g.contextElement||await(h.getDocumentElement==null?void 0:h.getDocumentElement(o.floating)),boundary:d,rootBoundary:v,strategy:u})),S=c==="floating"?{x:s,y:l,width:p.floating.width,height:p.floating.height}:p.reference,w=await(h.getOffsetParent==null?void 0:h.getOffsetParent(o.floating)),T=await(h.isElement==null?void 0:h.isElement(w))&&await(h.getScale==null?void 0:h.getScale(w))||{x:1,y:1},D=gh(h.convertOffsetParentRelativeRectToViewportRelativeRect?await h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:S,offsetParent:w,strategy:u}):S);return{top:(b.top-D.top+C.top)/T.y,bottom:(D.bottom-b.bottom+C.bottom)/T.y,left:(b.left-D.left+C.left)/T.x,right:(D.right-b.right+C.right)/T.x}}const LA=50,jA=async(e,i,r)=>{const{placement:s="bottom",strategy:l="absolute",middleware:h=[],platform:p}=r,o=p.detectOverflow?p:{...p,detectOverflow:DA},u=await(p.isRTL==null?void 0:p.isRTL(i));let d=await p.getElementRects({reference:e,floating:i,strategy:l}),{x:v,y:c}=Ky(d,s,u),_=s,x=0;const C={};for(let y=0;y<h.length;y++){const g=h[y];if(!g)continue;const{name:b,fn:S}=g,{x:w,y:T,data:D,reset:R}=await S({x:v,y:c,initialPlacement:s,placement:_,strategy:l,middlewareData:C,rects:d,platform:o,elements:{reference:e,floating:i}});v=w??v,c=T??c,C[b]={...C[b],...D},R&&x<LA&&(x++,typeof R=="object"&&(R.placement&&(_=R.placement),R.rects&&(d=R.rects===!0?await p.getElementRects({reference:e,floating:i,strategy:l}):R.rects),{x:v,y:c}=Ky(d,_,u)),y=-1)}return{x:v,y:c,placement:_,strategy:l,middlewareData:C}},MA=e=>({name:"arrow",options:e,async fn(i){const{x:r,y:s,placement:l,rects:h,platform:p,elements:o,middlewareData:u}=i,{element:d,padding:v=0}=kr(e,i)||{};if(d==null)return{};const c=yC(v),_={x:r,y:s},x=Xg(l),C=Kg(x),y=await p.getDimensions(d),g=x==="y",b=g?"top":"left",S=g?"bottom":"right",w=g?"clientHeight":"clientWidth",T=h.reference[C]+h.reference[x]-_[x]-h.floating[C],D=_[x]-h.reference[x],R=await(p.getOffsetParent==null?void 0:p.getOffsetParent(d));let L=R?R[w]:0;(!L||!await(p.isElement==null?void 0:p.isElement(R)))&&(L=o.floating[w]||h.floating[C]);const A=T/2-D/2,M=L/2-y[C]/2-1,j=fs(c[b],M),z=fs(c[S],M),P=L-y[C]-z,H=L/2-y[C]/2+A,F=xC(j,H,P),W=!u.arrow&&Ea(l)!=null&&H!==F&&h.reference[C]/2-(H<j?j:z)-y[C]/2<0,G=W?H<j?H-j:H-P:0;return{[x]:_[x]+G,data:{[x]:F,centerOffset:H-F-G,...W&&{alignmentOffset:G}},reset:W}}}),NA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(i){var r,s;const{placement:l,middlewareData:h,rects:p,initialPlacement:o,platform:u,elements:d}=i,{mainAxis:v=!0,crossAxis:c=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:y=!0,...g}=kr(e,i);if((r=h.arrow)!=null&&r.alignmentOffset)return{};const b=ps(l),S=qi(o),w=ps(o)===o,T=await(u.isRTL==null?void 0:u.isRTL(d.floating)),D=_||(w||!y?[mh(o)]:CA(o)),R=C!=="none";!_&&R&&D.push(...RA(o,y,C,T));const L=[o,...D],A=await u.detectOverflow(i,g),M=[];let j=((s=h.flip)==null?void 0:s.overflows)||[];if(v&&M.push(A[b]),c){const F=SA(l,p,T);M.push(A[F[0]],A[F[1]])}if(j=[...j,{placement:l,overflows:M}],!M.every(F=>F<=0)){var z,P;const F=(((z=h.flip)==null?void 0:z.index)||0)+1,W=L[F];if(W&&(!(c==="alignment"?S!==qi(W):!1)||j.every(X=>qi(X.placement)===S?X.overflows[0]>0:!0)))return{data:{index:F,overflows:j},reset:{placement:W}};let G=(P=j.filter(Q=>Q.overflows[0]<=0).sort((Q,X)=>Q.overflows[1]-X.overflows[1])[0])==null?void 0:P.placement;if(!G)switch(x){case"bestFit":{var H;const Q=(H=j.filter(X=>{if(R){const I=qi(X.placement);return I===S||I==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(I=>I>0).reduce((I,O)=>I+O,0)]).sort((X,I)=>X[1]-I[1])[0])==null?void 0:H[0];Q&&(G=Q);break}case"initialPlacement":G=o;break}if(l!==G)return{reset:{placement:G}}}return{}}}};function Xy(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function Qy(e){return bA.some(i=>e[i]>=0)}const OA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(i){const{rects:r,platform:s}=i,{strategy:l="referenceHidden",...h}=kr(e,i);switch(l){case"referenceHidden":{const p=await s.detectOverflow(i,{...h,elementContext:"reference"}),o=Xy(p,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Qy(o)}}}case"escaped":{const p=await s.detectOverflow(i,{...h,altBoundary:!0}),o=Xy(p,r.floating);return{data:{escapedOffsets:o,escaped:Qy(o)}}}default:return{}}}}},bC=new Set(["left","top"]);async function BA(e,i){const{placement:r,platform:s,elements:l}=e,h=await(s.isRTL==null?void 0:s.isRTL(l.floating)),p=ps(r),o=Ea(r),u=qi(r)==="y",d=bC.has(p)?-1:1,v=h&&u?-1:1,c=kr(i,e);let{mainAxis:_,crossAxis:x,alignmentAxis:C}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return o&&typeof C=="number"&&(x=o==="end"?C*-1:C),u?{x:x*v,y:_*d}:{x:_*d,y:x*v}}const PA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(i){var r,s;const{x:l,y:h,placement:p,middlewareData:o}=i,u=await BA(i,e);return p===((r=o.offset)==null?void 0:r.placement)&&(s=o.arrow)!=null&&s.alignmentOffset?{}:{x:l+u.x,y:h+u.y,data:{...u,placement:p}}}}},zA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(i){const{x:r,y:s,placement:l,platform:h}=i,{mainAxis:p=!0,crossAxis:o=!1,limiter:u={fn:S=>{let{x:w,y:T}=S;return{x:w,y:T}}},...d}=kr(e,i),v={x:r,y:s},c=await h.detectOverflow(i,d),_=qi(l),x=Yg(_);let C=v[x],y=v[_];const g=(S,w)=>xC(w+c[S==="y"?"top":"left"],w,w-c[S==="y"?"bottom":"right"]);p&&(C=g(x,C)),o&&(y=g(_,y));const b=u.fn({...i,[x]:C,[_]:y});return{...b,data:{x:b.x-r,y:b.y-s,enabled:{[x]:p,[_]:o}}}}}},IA=function(e){return e===void 0&&(e={}),{options:e,fn(i){var r,s;const{x:l,y:h,placement:p,rects:o,middlewareData:u}=i,{offset:d=0,mainAxis:v=!0,crossAxis:c=!0}=kr(e,i),_={x:l,y:h},x=qi(p),C=Yg(x);let y=_[C],g=_[x];const b=kr(d,i),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(r=b.mainAxis)!=null?r:0,crossAxis:(s=b.crossAxis)!=null?s:0};if(v){const D=C==="y"?"height":"width",R=o.reference[C]-o.floating[D]+S.mainAxis,L=o.reference[C]+o.reference[D]-S.mainAxis;y<R?y=R:y>L&&(y=L)}if(c){var w,T;const D=C==="y"?"width":"height",R=bC.has(ps(p)),L=o.reference[x]-o.floating[D]+(R&&((w=u.offset)==null?void 0:w[x])||0)+(R?0:S.crossAxis),A=o.reference[x]+o.reference[D]+(R?0:((T=u.offset)==null?void 0:T[x])||0)-(R?S.crossAxis:0);g<L?g=L:g>A&&(g=A)}return{[C]:y,[x]:g}}}},HA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(i){const{placement:r,rects:s,platform:l,elements:h}=i,{apply:p=()=>{},...o}=kr(e,i),u=await l.detectOverflow(i,o),d=ps(r),v=Ea(r),c=qi(r)==="y",{width:_,height:x}=s.floating;let C,y;d==="top"||d==="bottom"?(C=d,y=v===(await(l.isRTL==null?void 0:l.isRTL(h.floating))?"start":"end")?"left":"right"):(y=d,C=v==="end"?"top":"bottom");const g=x-u.top-u.bottom,b=_-u.left-u.right,S=fs(x-u[C],g),w=fs(_-u[y],b),T=i.middlewareData.shift,D=!T;let R=S,L=w;T!=null&&T.enabled.x&&(L=b),T!=null&&T.enabled.y&&(R=g),D&&!v&&(c?L=_-2*_r(u.left,u.right):R=x-2*_r(u.top,u.bottom)),await p({...i,availableWidth:L,availableHeight:R});const A=await l.getDimensions(h.floating);return _!==A.width||x!==A.height?{reset:{rects:!0}}:{}}}};function Ih(){return typeof window<"u"}function Ta(e){return wC(e)?(e.nodeName||"").toLowerCase():"#document"}function zn(e){var i;return(e==null||(i=e.ownerDocument)==null?void 0:i.defaultView)||window}function Rr(e){var i;return(i=(wC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:i.documentElement}function wC(e){return Ih()?e instanceof Node||e instanceof zn(e).Node:!1}function Yi(e){return Ih()?e instanceof Element||e instanceof zn(e).Element:!1}function _s(e){return Ih()?e instanceof HTMLElement||e instanceof zn(e).HTMLElement:!1}function Zy(e){return!Ih()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zn(e).ShadowRoot}function Hh(e){const{overflow:i,overflowX:r,overflowY:s,display:l}=Ki(e);return/auto|scroll|overlay|hidden|clip/.test(i+s+r)&&l!=="inline"&&l!=="contents"}function FA(e){return/^(table|td|th)$/.test(Ta(e))}function Fh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const UA=/transform|translate|scale|rotate|perspective|filter/,$A=/paint|layout|strict|content/,qs=e=>!!e&&e!=="none";let Zp;function Qg(e){const i=Yi(e)?Ki(e):e;return qs(i.transform)||qs(i.translate)||qs(i.scale)||qs(i.rotate)||qs(i.perspective)||!Zg()&&(qs(i.backdropFilter)||qs(i.filter))||UA.test(i.willChange||"")||$A.test(i.contain||"")}function qA(e){let i=eo(e);for(;_s(i)&&!Ul(i);){if(Qg(i))return i;if(Fh(i))return null;i=eo(i)}return null}function Zg(){return Zp==null&&(Zp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Zp}function Ul(e){return/^(html|body|#document)$/.test(Ta(e))}function Ki(e){return zn(e).getComputedStyle(e)}function Uh(e){return Yi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eo(e){if(Ta(e)==="html")return e;const i=e.assignedSlot||e.parentNode||Zy(e)&&e.host||Rr(e);return Zy(i)?i.host:i}function SC(e){const i=eo(e);return Ul(i)?(e.ownerDocument||e).body:_s(i)&&Hh(i)?i:SC(i)}function $l(e,i,r){var s;i===void 0&&(i=[]),r===void 0&&(r=!0);const l=SC(e),h=l===((s=e.ownerDocument)==null?void 0:s.body),p=zn(l);if(h){const o=Vm(p);return i.concat(p,p.visualViewport||[],Hh(l)?l:[],o&&r?$l(o):[])}else return i.concat(l,$l(l,[],r))}function Vm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function CC(e){const i=Ki(e);let r=parseFloat(i.width)||0,s=parseFloat(i.height)||0;const l=_s(e),h=l?e.offsetWidth:r,p=l?e.offsetHeight:s,o=ph(r)!==h||ph(s)!==p;return o&&(r=h,s=p),{width:r,height:s,$:o}}function Jg(e){return Yi(e)?e:e.contextElement}function pa(e){const i=Jg(e);if(!_s(i))return xr(1);const r=i.getBoundingClientRect(),{width:s,height:l,$:h}=CC(i);let p=(h?ph(r.width):r.width)/s,o=(h?ph(r.height):r.height)/l;return(!p||!Number.isFinite(p))&&(p=1),(!o||!Number.isFinite(o))&&(o=1),{x:p,y:o}}const VA=xr(0);function kC(e){const i=zn(e);return!Zg()||!i.visualViewport?VA:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function WA(e,i,r){return i===void 0&&(i=!1),!!r&&i&&r===zn(e)}function to(e,i,r,s){i===void 0&&(i=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),h=Jg(e);let p=xr(1);i&&(s?Yi(s)&&(p=pa(s)):p=pa(e));const o=WA(h,r,s)?kC(h):xr(0);let u=(l.left+o.x)/p.x,d=(l.top+o.y)/p.y,v=l.width/p.x,c=l.height/p.y;if(h&&s){const _=zn(h),x=Yi(s)?zn(s):s;let C=_,y=Vm(C);for(;y&&x!==C;){const g=pa(y),b=y.getBoundingClientRect(),S=Ki(y),w=b.left+(y.clientLeft+parseFloat(S.paddingLeft))*g.x,T=b.top+(y.clientTop+parseFloat(S.paddingTop))*g.y;u*=g.x,d*=g.y,v*=g.x,c*=g.y,u+=w,d+=T,C=zn(y),y=Vm(C)}}return gh({width:v,height:c,x:u,y:d})}function $h(e,i){const r=Uh(e).scrollLeft;return i?i.left+r:to(Rr(e)).left+r}function EC(e,i){const r=e.getBoundingClientRect(),s=r.left+i.scrollLeft-$h(e,r),l=r.top+i.scrollTop;return{x:s,y:l}}function GA(e){let{elements:i,rect:r,offsetParent:s,strategy:l}=e;const h=l==="fixed",p=Rr(s),o=i?Fh(i.floating):!1;if(s===p||o&&h)return r;let u={scrollLeft:0,scrollTop:0},d=xr(1);const v=xr(0),c=_s(s);if((c||!h)&&((Ta(s)!=="body"||Hh(p))&&(u=Uh(s)),c)){const x=to(s);d=pa(s),v.x=x.x+s.clientLeft,v.y=x.y+s.clientTop}const _=p&&!c&&!h?EC(p,u):xr(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+v.x+_.x,y:r.y*d.y-u.scrollTop*d.y+v.y+_.y}}function YA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function KA(e){const i=Uh(e),r=e.ownerDocument.body,s=_r(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=_r(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let h=-i.scrollLeft+$h(e);const p=-i.scrollTop;return Ki(r).direction==="rtl"&&(h+=_r(e.clientWidth,r.clientWidth)-s),{width:s,height:l,x:h,y:p}}const XA=25;function QA(e,i,r){r===void 0&&(r="viewport");const s=r==="layoutViewport",l=zn(e),h=Rr(e),p=l.visualViewport;let o=h.clientWidth,u=h.clientHeight,d=0,v=0;if(p){const _=!Zg()||i==="fixed";s?_||(d=-p.offsetLeft,v=-p.offsetTop):(o=p.width,u=p.height,_&&(d=p.offsetLeft,v=p.offsetTop))}if($h(h)<=0){const _=h.ownerDocument,x=_.body,C=getComputedStyle(x),y=_.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,g=Math.abs(h.clientWidth-x.clientWidth-y),b=getComputedStyle(h).scrollbarGutter==="stable both-edges"?g/2:g;b<=XA&&(o-=b)}return{width:o,height:u,x:d,y:v}}function ZA(e,i){const r=to(e,!0,i==="fixed"),s=r.top+e.clientTop,l=r.left+e.clientLeft,h=pa(e),p=e.clientWidth*h.x,o=e.clientHeight*h.y,u=l*h.x,d=s*h.y;return{width:p,height:o,x:u,y:d}}function Jy(e,i,r){let s;if(i==="viewport"||i==="layoutViewport")s=QA(e,r,i);else if(i==="document")s=KA(Rr(e));else if(Yi(i))s=ZA(i,r);else{const l=kC(e);s={x:i.x-l.x,y:i.y-l.y,width:i.width,height:i.height}}return gh(s)}function JA(e,i){const r=i.get(e);if(r)return r;let s=$l(e,[],!1).filter(o=>Yi(o)&&Ta(o)!=="body"),l=null;const h=Ki(e).position==="fixed";let p=h?eo(e):e;for(;Yi(p)&&!Ul(p);){const o=Ki(p),u=Qg(p),d=l?l.position:h?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&o.position==="static")?s=s.filter(c=>c!==p):l=o,p=eo(p)}return i.set(e,s),s}function e6(e){let{element:i,boundary:r,rootBoundary:s,strategy:l}=e;const p=[...r==="clippingAncestors"?Fh(i)?[]:JA(i,this._c):[].concat(r),s],o=Jy(i,p[0],l);let u=o.top,d=o.right,v=o.bottom,c=o.left;for(let _=1;_<p.length;_++){const x=Jy(i,p[_],l);u=_r(x.top,u),d=fs(x.right,d),v=fs(x.bottom,v),c=_r(x.left,c)}return{width:d-c,height:v-u,x:c,y:u}}function t6(e){const{width:i,height:r}=CC(e);return{width:i,height:r}}function n6(e,i,r){const s=_s(i),l=Rr(i),h=r==="fixed",p=to(e,!0,h,i);let o={scrollLeft:0,scrollTop:0};const u=xr(0);if((s||!h)&&((Ta(i)!=="body"||Hh(l))&&(o=Uh(i)),s)){const _=to(i,!0,h,i);u.x=_.x+i.clientLeft,u.y=_.y+i.clientTop}!s&&l&&(u.x=$h(l));const d=l&&!s&&!h?EC(l,o):xr(0),v=p.left+o.scrollLeft-u.x-d.x,c=p.top+o.scrollTop-u.y-d.y;return{x:v,y:c,width:p.width,height:p.height}}function Jp(e){return Ki(e).position==="static"}function eb(e,i){if(!_s(e)||Ki(e).position==="fixed")return null;if(i)return i(e);let r=e.offsetParent;return Rr(e)===r&&(r=r.ownerDocument.body),r}function TC(e,i){const r=zn(e);if(Fh(e))return r;if(!_s(e)){let l=eo(e);for(;l&&!Ul(l);){if(Yi(l)&&!Jp(l))return l;l=eo(l)}return r}let s=eb(e,i);for(;s&&FA(s)&&Jp(s);)s=eb(s,i);return s&&Ul(s)&&Jp(s)&&!Qg(s)?r:s||qA(e)||r}const i6=async function(e){const i=this.getOffsetParent||TC,r=this.getDimensions,s=await r(e.floating);return{reference:n6(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function r6(e){return Ki(e).direction==="rtl"}const s6={convertOffsetParentRelativeRectToViewportRelativeRect:GA,getDocumentElement:Rr,getClippingRect:e6,getOffsetParent:TC,getElementRects:i6,getClientRects:YA,getDimensions:t6,getScale:pa,isElement:Yi,isRTL:r6};function RC(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function o6(e,i,r){let s=null,l;const h=Rr(e);function p(){var v;clearTimeout(l),(v=s)==null||v.disconnect(),s=null}function o(v,c){v===void 0&&(v=!1),c===void 0&&(c=1),p();const _=e.getBoundingClientRect(),{left:x,top:C,width:y,height:g}=_;if(v||i(),!y||!g)return;const b=Gu(C),S=Gu(h.clientWidth-(x+y)),w=Gu(h.clientHeight-(C+g)),T=Gu(x),R={rootMargin:-b+"px "+-S+"px "+-w+"px "+-T+"px",threshold:_r(0,fs(1,c))||1};let L=!0;function A(M){const j=M[0].intersectionRatio;if(!RC(_,e.getBoundingClientRect()))return o();if(j!==c){if(!L)return o();j?o(!1,j):l=setTimeout(()=>{o(!1,1e-7)},1e3)}L=!1}try{s=new IntersectionObserver(A,{...R,root:h.ownerDocument})}catch{s=new IntersectionObserver(A,R)}s.observe(e)}const u=zn(e),d=()=>o(r);return u.addEventListener("resize",d),o(!0),()=>{u.removeEventListener("resize",d),p()}}function a6(e,i,r,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:h=!0,elementResize:p=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:u=!1}=s,d=Jg(e),v=l||h?[...d?$l(d):[],...i?$l(i):[]]:[];v.forEach(b=>{l&&b.addEventListener("scroll",r),h&&b.addEventListener("resize",r)});const c=d&&o?o6(d,r,h):null;let _=-1,x=null;p&&(x=new ResizeObserver(b=>{let[S]=b;S&&S.target===d&&x&&i&&(x.unobserve(i),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var w;(w=x)==null||w.observe(i)})),r()}),d&&!u&&x.observe(d),i&&x.observe(i));let C,y=u?to(e):null;u&&g();function g(){const b=to(e);y&&!RC(y,b)&&r(),y=b,C=requestAnimationFrame(g)}return r(),()=>{var b;v.forEach(S=>{l&&S.removeEventListener("scroll",r),h&&S.removeEventListener("resize",r)}),c==null||c(),(b=x)==null||b.disconnect(),x=null,u&&cancelAnimationFrame(C)}}const l6=PA,c6=zA,u6=NA,h6=HA,d6=OA,tb=MA,f6=IA,p6=(e,i,r)=>{const s=new Map,l=r??{},h={...s6,...l.platform,_c:s};return jA(e,i,{...l,platform:h})};var m6=typeof document<"u",g6=function(){},oh=m6?N.useLayoutEffect:g6;function vh(e,i){if(e===i)return!0;if(typeof e!=typeof i)return!1;if(typeof e=="function"&&e.toString()===i.toString())return!0;let r,s,l;if(e&&i&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==i.length)return!1;for(s=r;s--!==0;)if(!vh(e[s],i[s]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(i).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(i,l[s]))return!1;for(s=r;s--!==0;){const h=l[s];if(!(h==="_owner"&&e.$$typeof)&&!vh(e[h],i[h]))return!1}return!0}return e!==e&&i!==i}function AC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nb(e,i){const r=AC(e);return Math.round(i*r)/r}function em(e){const i=N.useRef(e);return oh(()=>{i.current=e}),i}function v6(e){e===void 0&&(e={});const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l,elements:{reference:h,floating:p}={},transform:o=!0,whileElementsMounted:u,open:d}=e,[v,c]=N.useState({x:0,y:0,strategy:r,placement:i,middlewareData:{},isPositioned:!1}),[_,x]=N.useState(s);vh(_,s)||x(s);const[C,y]=N.useState(null),[g,b]=N.useState(null),S=N.useCallback(X=>{X!==R.current&&(R.current=X,y(X))},[]),w=N.useCallback(X=>{X!==L.current&&(L.current=X,b(X))},[]),T=h||C,D=p||g,R=N.useRef(null),L=N.useRef(null),A=N.useRef(v),M=u!=null,j=em(u),z=em(l),P=em(d),H=N.useCallback(()=>{if(!R.current||!L.current)return;const X={placement:i,strategy:r,middleware:_};z.current&&(X.platform=z.current),p6(R.current,L.current,X).then(I=>{const O={...I,isPositioned:P.current!==!1};F.current&&!vh(A.current,O)&&(A.current=O,nc.flushSync(()=>{c(O)}))})},[_,i,r,z,P]);oh(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,c(X=>({...X,isPositioned:!1})))},[d]);const F=N.useRef(!1);oh(()=>(F.current=!0,()=>{F.current=!1}),[]),oh(()=>{if(T&&(R.current=T),D&&(L.current=D),T&&D){if(j.current)return j.current(T,D,H);H()}},[T,D,H,j,M]);const W=N.useMemo(()=>({reference:R,floating:L,setReference:S,setFloating:w}),[S,w]),G=N.useMemo(()=>({reference:T,floating:D}),[T,D]),Q=N.useMemo(()=>{const X={position:r,left:0,top:0};if(!G.floating)return X;const I=nb(G.floating,v.x),O=nb(G.floating,v.y);return o?{...X,transform:"translate("+I+"px, "+O+"px)",...AC(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:I,top:O}},[r,o,G.floating,v.x,v.y]);return N.useMemo(()=>({...v,update:H,refs:W,elements:G,floatingStyles:Q}),[v,H,W,G,Q])}const _6=e=>{function i(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:l}=typeof e=="function"?e(r):e;return s&&i(s)?s.current!=null?tb({element:s.current,padding:l}).fn(r):{}:s?tb({element:s,padding:l}).fn(r):{}}}},x6=(e,i)=>{const r=l6(e);return{name:r.name,fn:r.fn,options:[e,i]}},y6=(e,i)=>{const r=c6(e);return{name:r.name,fn:r.fn,options:[e,i]}},b6=(e,i)=>({fn:f6(e).fn,options:[e,i]}),w6=(e,i)=>{const r=u6(e);return{name:r.name,fn:r.fn,options:[e,i]}},S6=(e,i)=>{const r=h6(e);return{name:r.name,fn:r.fn,options:[e,i]}},C6=(e,i)=>{const r=d6(e);return{name:r.name,fn:r.fn,options:[e,i]}},k6=(e,i)=>{const r=_6(e);return{name:r.name,fn:r.fn,options:[e,i]}};var E6=Object.defineProperty,T6=(e,i)=>E6(e,"name",{value:i,configurable:!0}),R6=N.forwardRef(T6(function(i,r){const{children:s,width:l=10,height:h=5,...p}=i;return m.jsx(Et.svg,{...p,ref:r,width:l,height:h,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:i.asChild?s:m.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),A6=Object.defineProperty,yr=(e,i)=>A6(e,"name",{value:i,configurable:!0}),ib={Partial:"partial"},rb={Optimized:"optimized",Always:"always"},DC="Popper",[LC,Ra]=Er(DC),[D6,jC]=LC(DC),ev=yr(e=>{const{__scopePopper:i,children:r}=e,[s,l]=N.useState(null),[h,p]=N.useState(void 0);return m.jsx(D6,{scope:i,anchor:s,onAnchorChange:l,placementState:h,setPlacementState:p,children:r})},"Popper"),L6="PopperAnchor",tv=N.forwardRef(yr(function(i,r){const{__scopePopper:s,virtualRef:l,...h}=i,p=jC(L6,s),o=N.useRef(null),u=p.onAnchorChange,d=N.useCallback(y=>{o.current=y,y&&u(y)},[u]),v=ht(r,d),c=N.useRef(null);N.useEffect(()=>{if(!l)return;const y=c.current;c.current=l.current,y!==c.current&&u(c.current)});const _=p.placementState&&qh(p.placementState),x=_==null?void 0:_[0],C=_==null?void 0:_[1];return l?null:m.jsx(Et.div,{"data-radix-popper-side":x,"data-radix-popper-align":C,...h,ref:v})},"PopperAnchor")),MC="PopperContent",[j6,M6]=LC(MC),nv=N.forwardRef(yr(function(i,r){var oe,ee,ue,he,Se,we,Re;const{__scopePopper:s,side:l="bottom",sideOffset:h=0,align:p="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:v=[],collisionPadding:c=0,sticky:_=ib.Partial,hideWhenDetached:x=!1,updatePositionStrategy:C=rb.Optimized,onPlaced:y,...g}=i,b=jC(MC,s),[S,w]=N.useState(null),T=ht(r,w),[D,R]=N.useState(null),L=$g(D),A=(L==null?void 0:L.width)??0,M=(L==null?void 0:L.height)??0,j=l+(p!=="center"?"-"+p:""),z=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},P=Array.isArray(v)?v:[v],H=P.length>0,F={padding:z,boundary:P.filter(NC),altBoundary:H},{refs:W,floatingStyles:G,placement:Q,isPositioned:X,middlewareData:I}=v6({strategy:"fixed",placement:j,whileElementsMounted:yr((...Ve)=>a6(...Ve,{animationFrame:C===rb.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[x6({mainAxis:h+M,alignmentAxis:o}),d&&y6({mainAxis:!0,crossAxis:!1,..._===ib.Partial?{limiter:b6()}:{},...F}),d&&w6({...F}),S6({...F,apply:yr(({elements:Ve,rects:Ee,availableWidth:Ie,availableHeight:Ot})=>{const{width:$e,height:Be}=Ee.reference,ze=Ve.floating.style;ze.setProperty("--radix-popper-available-width",`${Ie}px`),ze.setProperty("--radix-popper-available-height",`${Ot}px`),ze.setProperty("--radix-popper-anchor-width",`${$e}px`),ze.setProperty("--radix-popper-anchor-height",`${Be}px`)},"apply")}),D&&k6({element:D,padding:u}),P6({arrowWidth:A,arrowHeight:M}),x&&C6(H?{strategy:"referenceHidden",...F}:{strategy:"referenceHidden",padding:F.padding,altBoundary:F.altBoundary})]}),O=b.setPlacementState;Wt(()=>(O(Q),()=>{O(void 0)}),[Q,O]);const[Y,Z]=qh(Q),U=Gi(y);Wt(()=>{X&&(U==null||U())},[X,U]);const V=(oe=I.arrow)==null?void 0:oe.x,ne=(ee=I.arrow)==null?void 0:ee.y,le=((ue=I.arrow)==null?void 0:ue.centerOffset)!==0,[K,$]=N.useState();return Wt(()=>{S&&$(window.getComputedStyle(S).zIndex)},[S]),m.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(he=I.transformOrigin)==null?void 0:he.x,(Se=I.transformOrigin)==null?void 0:Se.y].join(" "),...((we=I.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:i.dir,children:m.jsx(j6,{scope:s,placedSide:Y,placedAlign:Z,onArrowChange:R,arrowX:V,arrowY:ne,shouldHideArrow:le,children:m.jsx(Et.div,{"data-side":Y,"data-align":Z,...g,ref:T,style:{...g.style,animation:X?(Re=g.style)==null?void 0:Re.animation:"none"}})})})},"PopperContent")),N6="PopperArrow",O6={top:"bottom",right:"left",bottom:"top",left:"right"},B6=N.forwardRef(yr(function(i,r){const{__scopePopper:s,...l}=i,h=M6(N6,s),p=O6[h.placedSide];return m.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[p]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[h.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[h.placedSide],visibility:h.shouldHideArrow?"hidden":void 0},children:m.jsx(R6,{...l,ref:r,style:{...l.style,display:"block"}})})},"PopperArrow"));function NC(e){return e!==null}yr(NC,"isNotNull");var P6=yr(e=>({name:"transformOrigin",options:e,fn(i){var g,b,S;const{placement:r,rects:s,middlewareData:l}=i,p=((g=l.arrow)==null?void 0:g.centerOffset)!==0,o=p?0:e.arrowWidth,u=p?0:e.arrowHeight,[d,v]=qh(r),c={start:"0%",center:"50%",end:"100%"}[v],_=(((b=l.arrow)==null?void 0:b.x)??0)+o/2,x=(((S=l.arrow)==null?void 0:S.y)??0)+u/2;let C="",y="";return d==="bottom"?(C=p?c:`${_}px`,y=`${-u}px`):d==="top"?(C=p?c:`${_}px`,y=`${s.floating.height+u}px`):d==="right"?(C=`${-u}px`,y=p?c:`${x}px`):d==="left"&&(C=`${s.floating.width+u}px`,y=p?c:`${x}px`),{data:{x:C,y}}}}),"transformOrigin");function qh(e){const[i,r="center"]=e.split("-");return[i,r]}yr(qh,"getSideAndAlignFromPlacement");var z6=Object.defineProperty,I6=(e,i)=>z6(e,"name",{value:i,configurable:!0}),OC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),H6=N.forwardRef(I6(function(i,r){return m.jsx(Et.span,{...i,ref:r,style:{...OC,...i.style}})},"VisuallyHidden")),F6=Object.defineProperty,mt=(e,i)=>F6(e,"name",{value:i,configurable:!0}),sb={ItemAligned:"item-aligned",Popper:"popper"},U6={RTL:"rtl"},$6=[" ","Enter","ArrowUp","ArrowDown"],q6=[" ","Enter"],_a="Select",[Vh,iv,V6]=dC(_a),[ao,hP]=Er(_a,[V6,Ra]),rv=Ra(),[W6,xs]=ao(_a),[G6,Y6]=ao(_a);function BC(e){const{__scopeSelect:i,children:r,open:s,defaultOpen:l,onOpenChange:h,value:p,defaultValue:o,onValueChange:u,dir:d,name:v,autoComplete:c,disabled:_,required:x,form:C,internal_do_not_use_render:y}=e,g=rv(i),[b,S]=N.useState(null),[w,T]=N.useState(null),[D,R]=N.useState(!1),L=_C(d),[A,M]=Js({prop:s,defaultProp:l??!1,onChange:h,caller:_a}),[j,z]=Js({prop:p,defaultProp:o,onChange:u,caller:_a}),P=N.useRef(null),H=N.useRef(!1),[F,W]=N.useState(null),G=mt(le=>{W({value:le,hasConsumerStoppedPropagation:H.current}),z(le)},"handleUserSelect"),Q=N.useRef(j);N.useEffect(()=>{const le=C?b==null?void 0:b.ownerDocument.getElementById(C):b==null?void 0:b.form;if(le instanceof HTMLFormElement){const K=mt(()=>z(Q.current),"reset");return le.addEventListener("reset",K),()=>le.removeEventListener("reset",K)}},[C,b,z]);const X=b?!!C||!!b.closest("form"):!0,[I,O]=N.useState(new Set),Y=Vi(),Z=Array.from(I).map(le=>le.props.value).join(";"),U=N.useCallback(le=>{O(K=>new Set(K).add(le))},[]),V=N.useCallback(le=>{O(K=>{const $=new Set(K);return $.delete(le),$})},[]),ne={required:x,trigger:b,onTriggerChange:S,valueNode:w,onValueNodeChange:T,valueNodeHasChildren:D,onValueNodeHasChildrenChange:R,contentId:Y,value:j,onValueChange:z,hasConsumerStoppedPropagationRef:H,userSelection:F,onUserSelect:G,open:A,onOpenChange:M,dir:L,triggerPointerDownPosRef:P,disabled:_,name:v,autoComplete:c,form:C,nativeOptions:I,nativeSelectKey:Z,isFormControl:X};return m.jsx(ev,{...g,children:m.jsx(W6,{scope:i,...ne,children:m.jsx(Vh.Provider,{scope:i,children:m.jsx(G6,{scope:i,onNativeOptionAdd:U,onNativeOptionRemove:V,children:IC(y)?y(ne):r})})})})}mt(BC,"SelectProvider");var K6=mt(e=>{const{__scopeSelect:i,children:r,...s}=e;return m.jsx(BC,{__scopeSelect:i,...s,internal_do_not_use_render:({isFormControl:l})=>m.jsxs(m.Fragment,{children:[r,l?m.jsx(yD,{__scopeSelect:i}):null]})})},"Select"),X6="SelectTrigger",Q6=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,disabled:l=!1,...h}=i,p=rv(s),o=xs(X6,s),u=o.disabled||l,d=ht(r,o.onTriggerChange),v=iv(s),c=N.useRef("touch"),[_,x,C]=sv(g=>{const b=v().filter(T=>!T.disabled),S=b.find(T=>T.value===o.value),w=ov(b,g,S);w!==void 0&&o.onUserSelect(w.value)}),y=mt(g=>{u||(o.onOpenChange(!0),C()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})},"handleOpen");return m.jsx(tv,{asChild:!0,...p,children:m.jsx(Et.button,{type:"button",role:"combobox","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":rc(o.value)?"":void 0,...h,ref:d,onClick:it(h.onClick,g=>{g.currentTarget.focus(),c.current!=="mouse"&&y(g)}),onPointerDown:it(h.onPointerDown,g=>{c.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:it(h.onKeyDown,g=>{const b=_.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=g.isPropagationStopped(),x(g.key)),!(b&&g.key===" ")&&$6.includes(g.key)&&(y(),g.preventDefault())})})})},"SelectTrigger")),Z6="SelectValue",J6=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:h,children:p,placeholder:o="",...u}=i,d=xs(Z6,s),{onValueNodeHasChildrenChange:v}=d,c=p!==void 0,_=ht(r,d.onValueNodeChange);Wt(()=>{v(c)},[v,c]);const x=rc(d.value);return m.jsx(Et.span,{...u,asChild:x?!1:u.asChild,ref:_,style:{pointerEvents:"none"},children:m.jsx(N.Fragment,{children:x?o:p},x?"placeholder":"value")})},"SelectValue")),eD=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,...h}=i;return m.jsx(Et.span,{"aria-hidden":!0,...h,ref:r,children:l||"▼"})},"SelectIcon")),tD="SelectPortal",[nD,iD]=ao(tD,{forceMount:void 0}),rD=mt(e=>{const{__scopeSelect:i,forceMount:r,...s}=e;return m.jsx(nD,{scope:e.__scopeSelect,forceMount:r,children:m.jsx(Nh,{asChild:!0,...s})})},"SelectPortal"),no="SelectContent",sD=N.forwardRef(mt(function(i,r){const s=iD(no,i.__scopeSelect),{forceMount:l=s.forceMount,...h}=i,p=xs(no,i.__scopeSelect),[o,u]=N.useState();return Wt(()=>{u(new DocumentFragment)},[]),m.jsx(Tr,{present:l||p.open,children:({present:d})=>d?m.jsx(lD,{...h,ref:r}):m.jsx(oD,{...h,fragment:o})})},"SelectContent")),oD=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,children:l,fragment:h}=i;return h?nc.createPortal(m.jsx(PC,{scope:s,children:m.jsx(Vh.Slot,{scope:s,children:m.jsx("div",{ref:r,children:l})})}),h):null},"SelectContentFragment")),ki=10,[PC,Wh]=ao(no),aD=br("SelectContent.RemoveScroll"),lD=N.forwardRef(mt(function(i,r){const{__scopeSelect:s}=i,{position:l=sb.ItemAligned,onCloseAutoFocus:h,onEscapeKeyDown:p,onPointerDownOutside:o,side:u,sideOffset:d,align:v,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:C,sticky:y,hideWhenDetached:g,avoidCollisions:b,...S}=i,w=xs(no,s),[T,D]=N.useState(null),[R,L]=N.useState(null),A=ht(r,D),[M,j]=N.useState(null),[z,P]=N.useState(null),H=iv(s),[F,W]=N.useState(!1),G=N.useRef(!1),Q=N.useRef(!1),X=N.useRef(!1);N.useEffect(()=>{if(T)return Hg(T)},[T]),ic();const I=N.useCallback(ee=>{const[ue,...he]=H().map(Re=>Re.ref.current),[Se]=he.slice(-1),we=document.activeElement;for(const Re of ee)if(Re===we||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===ue&&R&&(R.scrollTop=0),Re===Se&&R&&(R.scrollTop=R.scrollHeight),Re==null||Re.focus(),document.activeElement!==we))return},[H,R]),O=N.useCallback(()=>I([M,T]),[I,M,T]);N.useEffect(()=>{F&&O()},[F,O]);const{onOpenChange:Y,triggerPointerDownPosRef:Z}=w;N.useEffect(()=>{if(T){let ee={x:0,y:0};const ue=mt(Se=>{var we,Re;ee={x:Math.abs(Math.round(Se.pageX)-(((we=Z.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((Re=Z.current)==null?void 0:Re.y)??0))}},"handlePointerMove"),he=mt(Se=>{ee.x<=10&&ee.y<=10?Se.preventDefault():Se.composedPath().includes(T)||Y(!1),document.removeEventListener("pointermove",ue),Z.current=null},"handlePointerUp");return Z.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",he,{capture:!0})}}},[T,Y,Z]),N.useEffect(()=>{const ee=mt(()=>Y(!1),"close");return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[Y]);const[U,V]=sv(ee=>{const ue=H().filter(we=>!we.disabled),he=ue.find(we=>we.ref.current===document.activeElement),Se=ov(ue,ee,he);Se&&setTimeout(()=>{var we;return(we=Se.ref.current)==null?void 0:we.focus()})}),ne=N.useCallback((ee,ue,he)=>{const Se=!Q.current;Se&&(Q.current=!0);const we=!G.current&&!he;w.value!==void 0&&w.value===ue||we?(j(ee),we&&(G.current=!0)):Se&&j(ee)},[w.value]),le=N.useCallback(()=>T==null?void 0:T.focus(),[T]),K=N.useCallback((ee,ue,he)=>{if(!ee)return;const Se=!X.current;Se&&(X.current=!0);const we=!G.current&&!he;(w.value!==void 0&&w.value===ue||we||Se)&&P(ee)},[w.value]),$=l===sb.Popper?ob:cD,oe=$===ob?{side:u,sideOffset:d,align:v,alignOffset:c,arrowPadding:_,collisionBoundary:x,collisionPadding:C,sticky:y,hideWhenDetached:g,avoidCollisions:b}:{};return m.jsx(PC,{scope:s,content:T,viewport:R,onViewportChange:L,itemRefCallback:ne,selectedItem:M,onItemLeave:le,itemTextRefCallback:K,focusSelectedItem:O,selectedItemText:z,position:l,isPositioned:F,searchRef:U,children:m.jsx(Bh,{as:aD,allowPinchZoom:!0,children:m.jsx(Ng,{asChild:!0,trapped:w.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:it(h,ee=>{var ue;(ue=w.trigger)==null||ue.focus({preventScroll:!0}),ee.preventDefault()}),children:m.jsx(Mh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:o,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m.jsx($,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:ee=>ee.preventDefault(),...S,...oe,onPlaced:()=>W(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:it(S.onKeyDown,ee=>{const ue=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ue&&ee.key.length===1&&V(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let Se=H().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const we=ee.target,Re=Se.indexOf(we);Se=Se.slice(Re+1)}setTimeout(()=>I(Se)),ee.preventDefault()}})})})})})})},"SelectContentImpl")),cD=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,onPlaced:l,...h}=i,p=xs(no,s),o=Wh(no,s),[u,d]=N.useState(null),[v,c]=N.useState(null),_=ht(r,c),x=iv(s),C=N.useRef(!1),y=N.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:S,focusSelectedItem:w}=o,T=N.useCallback(()=>{if(p.trigger&&p.valueNode&&u&&v&&g&&b&&S){const A=p.trigger.getBoundingClientRect(),M=v.getBoundingClientRect(),j=p.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(p.dir!==U6.RTL){const he=z.left-M.left,Se=j.left-he,we=A.left-Se,Re=A.width+we,Ve=Math.max(Re,M.width),Ee=window.innerWidth-ki,Ie=$m(Se,[ki,Math.max(ki,Ee-Ve)]);u.style.minWidth=Re+"px",u.style.left=Ie+"px"}else{const he=M.right-z.right,Se=window.innerWidth-j.right-he,we=window.innerWidth-A.right-Se,Re=A.width+we,Ve=Math.max(Re,M.width),Ee=window.innerWidth-ki,Ie=$m(Se,[ki,Math.max(ki,Ee-Ve)]);u.style.minWidth=Re+"px",u.style.right=Ie+"px"}const P=x(),H=window.innerHeight-ki*2,F=g.scrollHeight,W=window.getComputedStyle(v),G=parseInt(W.borderTopWidth,10),Q=parseInt(W.paddingTop,10),X=parseInt(W.borderBottomWidth,10),I=parseInt(W.paddingBottom,10),O=G+Q+F+I+X,Y=Math.min(b.offsetHeight*5,O),Z=window.getComputedStyle(g),U=parseInt(Z.paddingTop,10),V=parseInt(Z.paddingBottom,10),ne=A.top+A.height/2-ki,le=H-ne,K=b.offsetHeight/2,$=b.offsetTop+K,oe=G+Q+$,ee=O-oe;if(oe<=ne){const he=P.length>0&&b===P[P.length-1].ref.current;u.style.bottom="0px";const Se=v.clientHeight-g.offsetTop-g.offsetHeight,we=Math.max(le,K+(he?V:0)+Se+X),Re=oe+we;u.style.height=Re+"px"}else{const he=P.length>0&&b===P[0].ref.current;u.style.top="0px";const we=Math.max(ne,G+g.offsetTop+(he?U:0)+K)+ee;u.style.height=we+"px",g.scrollTop=oe-ne+g.offsetTop}u.style.margin=`${ki}px 0`,u.style.minHeight=Y+"px",u.style.maxHeight=H+"px",l==null||l(),requestAnimationFrame(()=>C.current=!0)}},[x,p.trigger,p.valueNode,u,v,g,b,S,p.dir,l]);Wt(()=>T(),[T]);const[D,R]=N.useState();Wt(()=>{v&&R(window.getComputedStyle(v).zIndex)},[v]);const L=N.useCallback(A=>{A&&y.current===!0&&(T(),w==null||w(),y.current=!1)},[T,w]);return m.jsx(uD,{scope:s,contentWrapper:u,shouldExpandOnScrollRef:C,onScrollButtonChange:L,children:m.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:m.jsx(Et.div,{...h,ref:_,style:{boxSizing:"border-box",maxHeight:"100%",...h.style}})})})},"SelectItemAlignedPosition")),ob=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,align:l="start",collisionPadding:h=ki,...p}=i,o=rv(s);return m.jsx(nv,{...o,...p,ref:r,align:l,collisionPadding:h,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[uD,hD]=ao(no,{}),ab="SelectViewport",dD=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,nonce:l,...h}=i,p=Wh(ab,s),o=hD(ab,s),u=ht(r,p.onViewportChange),d=N.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),m.jsx(Vh.Slot,{scope:s,children:m.jsx(Et.div,{"data-radix-select-viewport":"",role:"presentation",...h,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...h.style},onScroll:it(h.onScroll,v=>{const c=v.currentTarget,{contentWrapper:_,shouldExpandOnScrollRef:x}=o;if(x!=null&&x.current&&_){const C=Math.abs(d.current-c.scrollTop);if(C>0){const y=window.innerHeight-ki*2,g=parseFloat(_.style.minHeight),b=parseFloat(_.style.height),S=Math.max(g,b);if(S<y){const w=S+C,T=Math.min(y,w),D=w-T;_.style.height=T+"px",_.style.bottom==="0px"&&(c.scrollTop=D>0?D:0,_.style.justifyContent="flex-end")}}}d.current=c.scrollTop})})})]})},"SelectViewport")),fD="SelectGroup",[dP,fP]=ao(fD),Wm="SelectItem",[pD,zC]=ao(Wm),mD=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,value:l,disabled:h=!1,textValue:p,...o}=i,u=xs(Wm,s),d=Wh(Wm,s),v=u.value===l,[c,_]=N.useState(p??""),[x,C]=N.useState(!1),y=Gi(T=>{var D;return(D=d.itemRefCallback)==null?void 0:D.call(d,T,l,h)}),g=ht(r,y),b=Vi(),S=N.useRef("touch");function w(T){u.hasConsumerStoppedPropagationRef.current=T.isPropagationStopped(),u.onUserSelect(l),u.onOpenChange(!1)}return mt(w,"handleSelect"),m.jsx(pD,{scope:s,value:l,disabled:h,textId:b,isSelected:v,onItemTextChange:N.useCallback(T=>{_(D=>D||((T==null?void 0:T.textContent)??"").trim())},[]),children:m.jsx(Vh.ItemSlot,{scope:s,value:l,disabled:h,textValue:c,children:m.jsx(Et.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":v&&x,"data-state":v?"checked":"unchecked","aria-disabled":h||void 0,"data-disabled":h?"":void 0,tabIndex:h?void 0:-1,...o,ref:g,onFocus:it(o.onFocus,()=>C(!0)),onBlur:it(o.onBlur,()=>C(!1)),onClick:it(o.onClick,T=>{h||S.current!=="mouse"&&w(T)}),onPointerUp:it(o.onPointerUp,T=>{h||S.current==="mouse"&&w(T)}),onPointerDown:it(o.onPointerDown,T=>{S.current=T.pointerType}),onPointerMove:it(o.onPointerMove,T=>{var D;S.current=T.pointerType,h?(D=d.onItemLeave)==null||D.call(d):S.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:it(o.onPointerLeave,T=>{var D;T.currentTarget===document.activeElement&&((D=d.onItemLeave)==null||D.call(d))}),onKeyDown:it(o.onKeyDown,T=>{var R;h||T.target!==T.currentTarget||((R=d.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(q6.includes(T.key)&&w(T),T.key===" "&&T.preventDefault())})})})})},"SelectItem")),Yu="SelectItemText",gD=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,className:l,style:h,...p}=i,o=xs(Yu,s),u=Wh(Yu,s),d=zC(Yu,s),v=Y6(Yu,s),[c,_]=N.useState(null),x=Gi(w=>{var T;return(T=u.itemTextRefCallback)==null?void 0:T.call(u,w,d.value,d.disabled)}),C=ht(r,_,d.onItemTextChange,x),y=c==null?void 0:c.textContent,g=N.useMemo(()=>m.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=v;return Wt(()=>(b(g),()=>S(g)),[b,S,g]),m.jsxs(m.Fragment,{children:[m.jsx(Et.span,{id:d.textId,...p,ref:C}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!rc(o.value)?nc.createPortal(p.children,o.valueNode):null]})},"SelectItemText")),vD="SelectItemIndicator",_D=N.forwardRef(mt(function(i,r){const{__scopeSelect:s,...l}=i;return zC(vD,s).isSelected?m.jsx(Et.span,{"aria-hidden":!0,...l,ref:r}):null},"SelectItemIndicator")),xD="SelectBubbleInput",yD=N.forwardRef(mt(function({__scopeSelect:i,...r},s){const l=xs(xD,i),{value:h,onValueChange:p,required:o,disabled:u,name:d,autoComplete:v,form:c,userSelection:_}=l,{nativeOptions:x,nativeSelectKey:C}=l,y=N.useRef(null),g=ht(s,y),b=h??"",S=N.useRef(b),w=N.useRef(_),T=N.useRef(!1),D=Array.from(x).some(R=>(R.props.value??"")==="");return N.useEffect(()=>{const R=y.current;if(!R)return;const L=window.HTMLSelectElement.prototype,M=Object.getOwnPropertyDescriptor(L,"value").set,j=_!==null&&_!==w.current;w.current=_;const z=S.current!==b;S.current=b;const P=j&&z;if(j&&!z&&_.value!==b&&!_.hasConsumerStoppedPropagation&&M){T.current=!0;try{M.call(R,_.value),R.dispatchEvent(new Event("change",{bubbles:!0}))}finally{T.current=!1,M.call(R,b)}return}const H=P&&!_.hasConsumerStoppedPropagation;if(z&&M){const F=new Event("change",{bubbles:H});M.call(R,b),R.dispatchEvent(F)}},[b,_]),m.jsxs(Et.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:d,autoComplete:v,disabled:u,form:c,onChange:R=>{T.current||p(R.target.value)},...r,style:{...OC,...r.style},ref:g,defaultValue:b,children:[rc(h)&&!D?m.jsx("option",{value:""}):null,Array.from(x)]},C)},"SelectBubbleInput"));function IC(e){return typeof e=="function"}mt(IC,"isFunction");function rc(e){return e===""||e===void 0}mt(rc,"shouldShowPlaceholder");function sv(e){const i=Gi(e),r=N.useRef(""),s=N.useRef(0),l=N.useCallback(p=>{const o=r.current+p;i(o);function u(d){r.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>u(""),1e3))}mt(u,"updateSearch"),u(o)},[i]),h=N.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,l,h]}mt(sv,"useTypeaheadSearch");function ov(e,i,r){const l=i.length>1&&Array.from(i).every(d=>d===i[0])?i[0]:i,h=r?e.indexOf(r):-1;let p=HC(e,Math.max(h,0));l.length===1&&(p=p.filter(d=>d!==r));const u=p.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return u!==r?u:void 0}mt(ov,"findNextItem");function HC(e,i){return e.map((r,s)=>e[(i+s)%e.length])}mt(HC,"wrapArray");const FC="__empty__",UC=e=>e===""?FC:e,bD=e=>e===FC?"":e;function vi({value:e,onValueChange:i,placeholder:r,size:s="sm",disabled:l,className:h,children:p}){return m.jsxs(K6,{value:UC(e),onValueChange:o=>i(bD(o)),disabled:l,children:[m.jsxs(Q6,{className:ye("flex w-full select-none items-center justify-between rounded border bg-transparent font-sans","focus:outline-none focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","data-[placeholder]:text-muted-foreground/60",s==="sm"?"gap-1 px-2 py-1.5 text-xs":"gap-2 px-3 py-2 text-sm",h),children:[m.jsx(J6,{placeholder:r}),m.jsx(eD,{asChild:!0,children:m.jsx(ba,{className:ye("shrink-0 text-muted-foreground",s==="sm"?"h-3 w-3":"h-4 w-4")})})]}),m.jsx(rD,{children:m.jsx(sD,{position:"popper",sideOffset:4,className:ye("z-50 min-w-[var(--radix-select-trigger-width)] overflow-hidden","rounded-lg border bg-card shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:m.jsx(dD,{className:"p-1",children:p})})})]})}const wt=N.forwardRef(({value:e,children:i,className:r},s)=>m.jsxs(mD,{ref:s,value:UC(e),className:ye("relative flex w-full cursor-pointer select-none items-center rounded","px-2 py-1.5 pr-7 text-xs outline-none","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),children:[m.jsx(gD,{children:i}),m.jsx(_D,{className:"absolute right-2 flex items-center justify-center",children:m.jsx(Xl,{className:"h-3 w-3 text-foreground"})})]}));wt.displayName="SelectItem";const sc=N.forwardRef(({className:e,size:i="sm",...r},s)=>m.jsx("textarea",{ref:s,className:ye("w-full resize-y rounded border bg-transparent font-serif leading-relaxed","focus:outline-none focus:ring-1 focus:ring-ring","placeholder:text-muted-foreground disabled:opacity-50",i==="sm"?"px-2 py-1.5 text-xs":"px-3 py-2 text-sm",e),...r}));sc.displayName="Textarea";function Gh({title:e,description:i,purpose:r,targetId:s,draft:l,canSave:h,onSave:p,onClose:o,children:u,maxWidth:d="max-w-lg"}){const{starting:v,start:c}=zh(),[_,x]=N.useState(!1),C=async()=>{if(_||!h)return;x(!0);const g=await p();x(!1),g&&o()},y=async()=>{await c(r,s,l()),o()};return m.jsx(Ug,{open:!0,onOpenChange:g=>!g&&o(),title:e,description:i,maxWidth:d,disableOutsideClose:!0,footer:m.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2",children:[m.jsxs(ge,{type:"button",variant:"ghost",disabled:v||_,onClick:()=>void y(),title:"Opens a Claude session with what is filled in here; Claude asks for the rest and saves it",children:[m.jsx(Lh,{size:12})," ",v?"Opening...":"Set up with Claude"]}),m.jsx("span",{className:"flex-1"}),m.jsx(ge,{onClick:o,children:"Cancel"}),m.jsx(ge,{variant:"primary",disabled:!h||_||v,onClick:()=>void C(),children:_?"Saving...":"Save"})]}),children:m.jsxs("form",{className:"space-y-3",onSubmit:g=>{g.preventDefault(),C()},children:[u,m.jsx("button",{type:"submit",hidden:!0})]})})}function $C({value:e,onChange:i}){const r=rt(()=>ve.categories(),[]);return m.jsxs(vi,{value:e,onValueChange:i,children:[m.jsx(wt,{value:"auto",children:"auto (Claude picks)"}),(r.data??[]).map(s=>m.jsx(wt,{value:s.name,children:s.name},s.id)),e!=="auto"&&r.data&&!r.data.some(s=>s.name===e)&&m.jsx(wt,{value:e,children:e})]})}const tm="__default__",wD=e=>({name:e.name,label:e.label??"",type:e.type,default:String(e.default),description:e.description??""}),SD=e=>({name:e.name.trim(),...e.label.trim()?{label:e.label.trim()}:{},type:e.type,default:e.type==="number"?Number(e.default):e.type==="boolean"?e.default==="true":e.default,...e.description.trim()?{description:e.description.trim()}:{}});function CD({job:e,onClose:i}){const r=rt(()=>ve.presets(),[]),[s,l]=N.useState((e==null?void 0:e.name)??""),[h,p]=N.useState((e==null?void 0:e.kind)??"cron"),[o,u]=N.useState((e==null?void 0:e.schedule)??"0 9 * * 1-5"),[d,v]=N.useState((e==null?void 0:e.prompt)??""),[c,_]=N.useState((e==null?void 0:e.category)??"auto"),[x,C]=N.useState((e==null?void 0:e.presetId)??null),[y,g]=N.useState((e==null?void 0:e.enabled)??!0),[b,S]=N.useState(((e==null?void 0:e.params)??[]).map(wD)),w=()=>({name:s.trim(),kind:h,schedule:h==="cron"?o.trim():"",prompt:d,category:c,presetId:x,params:b.filter(R=>R.name.trim()).map(SD),enabled:y}),T=!!(s.trim()&&d.trim()&&(h!=="cron"||o.trim())),D=(R,L)=>S(b.map((A,M)=>M===R?{...A,...L}:A));return m.jsxs(Gh,{title:e?`Edit ${e.name}`:"New job",description:"A prompt run as an unattended session, on a schedule or when its webhook is called.",purpose:e?"edit-job":"create-job",targetId:e==null?void 0:e.id,draft:w,canSave:T,onSave:async()=>!!await qe(()=>ve.saveJob({...e?{id:e.id}:{},...w()}),"Saved."),onClose:i,maxWidth:"max-w-2xl",children:[m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(zt,{label:"Name",children:m.jsx(_t,{autoFocus:!0,value:s,onChange:R=>l(R.target.value),placeholder:"Triage Jira bugs"})}),m.jsx(zt,{label:"Runs",children:m.jsxs(vi,{value:h,onValueChange:R=>p(R),children:[m.jsx(wt,{value:"cron",children:"On a schedule (cron)"}),m.jsx(wt,{value:"webhook",children:"On demand (Run, /job, webhook)"})]})})]}),h==="cron"&&m.jsx(zt,{label:"Schedule",hint:"Cron, 5 fields (or 6 with seconds), this machine's time zone. 0 9 * * 1-5 is 9:00 on weekdays.",children:m.jsx(_t,{value:o,onChange:R=>u(R.target.value),className:"font-mono",placeholder:"0 9 * * 1-5"})}),m.jsx(zt,{label:"Prompt",hint:"{{now}} is when it fired; {{payload}} / {{payload.field}} the webhook body; {{name}} a parameter below.",children:m.jsx(sc,{value:d,onChange:R=>v(R.target.value),rows:6,placeholder:"What each run is asked to do, complete enough to work without anyone at the keyboard."})}),m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(zt,{label:"Category",children:m.jsx($C,{value:c,onChange:_})}),m.jsx(zt,{label:"Toolset preset",children:m.jsxs(vi,{value:x??tm,onValueChange:R=>C(R===tm?null:R),children:[m.jsx(wt,{value:tm,children:"The default preset"}),(r.data??[]).map(R=>m.jsx(wt,{value:R.id,children:R.name},R.id))]})})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("div",{className:"text-xs font-medium",children:"Parameters"}),m.jsxs(ge,{type:"button",variant:"ghost",onClick:()=>S([...b,{name:"",label:"",type:"string",default:"",description:""}]),children:[m.jsx(Rn,{size:12})," Add"]})]}),b.length?b.map((R,L)=>m.jsxs("div",{className:"grid grid-cols-[1fr_1fr_auto_1fr_auto] items-center gap-1.5",children:[m.jsx(_t,{value:R.name,onChange:A=>D(L,{name:A.target.value}),placeholder:"name",className:"font-mono","aria-label":"Name"}),m.jsx(_t,{value:R.label,onChange:A=>D(L,{label:A.target.value}),placeholder:"Label","aria-label":"Label"}),m.jsxs(vi,{value:R.type,onValueChange:A=>D(L,{type:A,default:A==="boolean"?"false":A==="number"?"0":""}),className:"w-24",children:[m.jsx(wt,{value:"string",children:"string"}),m.jsx(wt,{value:"number",children:"number"}),m.jsx(wt,{value:"boolean",children:"boolean"})]}),R.type==="boolean"?m.jsx(Cr,{label:"default on",checked:R.default==="true",onCheckedChange:A=>D(L,{default:A?"true":"false"})}):m.jsx(_t,{value:R.default,type:R.type==="number"?"number":"text",onChange:A=>D(L,{default:A.target.value}),placeholder:"default","aria-label":"Default"}),m.jsx(ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove",onClick:()=>S(b.filter((A,M)=>M!==L)),children:m.jsx(Ri,{size:12})})]},L)):m.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["None. A parameter is a ","{{name}}"," in the prompt that Run now asks for and cron runs take the default of."]})]}),m.jsx(Cr,{label:"Enabled",checked:y,onCheckedChange:g})]})}function kD({onClose:e}){const[i,r]=N.useState(""),[s,l]=N.useState("auto");return m.jsxs(Gh,{title:"Queue a run",description:"One unattended session, started after whatever is already queued.",purpose:"queue-run",draft:()=>({prompt:i,category:s}),canSave:!!i.trim(),onSave:async()=>await qe(()=>ve.queueRun(i,s),"Queued.")!==void 0,onClose:e,children:[m.jsx(zt,{label:"Prompt",children:m.jsx(sc,{autoFocus:!0,value:i,onChange:h=>r(h.target.value),rows:6,placeholder:"What the session is asked to do, complete enough to work without anyone at the keyboard."})}),m.jsx(zt,{label:"Category",hint:"What the run must report before it closes.",children:m.jsx($C,{value:s,onChange:l})})]})}function ED({category:e,prefill:i,onClose:r,onSaved:s}){const l=e??i,[h,p]=N.useState((l==null?void 0:l.name)??""),[o,u]=N.useState((l==null?void 0:l.description)??""),[d,v]=N.useState((l==null?void 0:l.deliverables)??[{name:"",description:"",required:!0}]),c=()=>({name:h.trim(),description:o.trim(),deliverables:d.filter(x=>x.name.trim())}),_=(x,C)=>v(d.map((y,g)=>g===x?{...y,...C}:y));return m.jsxs(Gh,{title:e?`Edit ${e.name}`:"New category",description:"What a session must report before the hub closes it.",purpose:e?"edit-category":"create-category",targetId:e==null?void 0:e.id,draft:c,canSave:!!h.trim()&&h.trim()!=="auto",onSave:async()=>{const x=await qe(()=>ve.saveCategory({...e?{id:e.id}:{},...c()}),"Saved.");return x&&s(),!!x},onClose:r,maxWidth:"max-w-xl",children:[m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(zt,{label:"Name",hint:'Unique; "auto" is reserved.',children:m.jsx(_t,{autoFocus:!0,value:h,onChange:x=>p(x.target.value),placeholder:"bugfix"})}),m.jsx(zt,{label:"Description",children:m.jsx(_t,{value:o,onChange:x=>u(x.target.value),placeholder:"A defect fixed"})})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("div",{className:"text-xs font-medium",children:"Deliverables"}),m.jsxs(ge,{type:"button",variant:"ghost",onClick:()=>v([...d,{name:"",description:"",required:!0}]),children:[m.jsx(Rn,{size:12})," Add"]})]}),d.map((x,C)=>m.jsxs("div",{className:"grid grid-cols-[1fr_2fr_auto_auto] items-center gap-1.5",children:[m.jsx(_t,{value:x.name,onChange:y=>_(C,{name:y.target.value}),placeholder:"PR","aria-label":"Deliverable"}),m.jsx(_t,{value:x.description,onChange:y=>_(C,{description:y.target.value}),placeholder:"link to the pull request","aria-label":"What it is"}),m.jsx(Cr,{label:"required",checked:x.required,onCheckedChange:y=>_(C,{required:y})}),m.jsx(ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove",onClick:()=>v(d.filter((y,g)=>g!==C)),children:m.jsx(Ri,{size:12})})]},C)),!d.length&&m.jsx("div",{className:"text-[11px] text-muted-foreground",children:"None: a session reports a summary and evidence of its own choosing."})]})]})}const TD="********";function RD({channel:e,kinds:i,onClose:r}){var y;const[s,l]=N.useState((e==null?void 0:e.kind)??((y=i[0])==null?void 0:y.kind)??""),[h,p]=N.useState((e==null?void 0:e.name)??""),[o,u]=N.useState((e==null?void 0:e.enabled)??!0),[d,v]=N.useState((e==null?void 0:e.config)??{}),c=i.find(g=>g.kind===s),_=(c==null?void 0:c.fields)??[],x=()=>({kind:s,name:h.trim(),enabled:o,config:Object.fromEntries(_.map(g=>[g.key,d[g.key]??""]))}),C=()=>{const g=x();return{...g,config:Object.fromEntries(Object.entries(g.config).map(([b,S])=>{var w;return[b,(w=_.find(T=>T.key===b))!=null&&w.secret?S?"(filled in on the form, not passed on)":"":S]}))}};return m.jsxs(Gh,{title:e?`Edit ${e.name}`:"Add a channel",description:"Where sessions reach you: questions, permissions, ends of turns, finished tasks.",purpose:e?"edit-channel":"create-channel",targetId:e==null?void 0:e.id,draft:C,canSave:!!(s&&h.trim()),onSave:async()=>!!await qe(()=>ve.saveChannel({...e?{id:e.id}:{},...x()}),"Saved."),onClose:r,children:[m.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[m.jsx(zt,{label:"Platform",hint:e?"Cannot change after creation.":void 0,children:m.jsx(vi,{value:s,onValueChange:l,disabled:!!e,children:i.map(g=>m.jsx(wt,{value:g.kind,children:g.label},g.kind))})}),m.jsx(zt,{label:"Name",children:m.jsx(_t,{autoFocus:!0,value:h,onChange:g=>p(g.target.value),placeholder:c?`My ${c.label}`:"Team Slack"})})]}),_.map(g=>g.options?m.jsx(zt,{label:g.label,hint:g.hint,children:m.jsx(vi,{value:d[g.key]??"",onValueChange:b=>v({...d,[g.key]:b}),placeholder:g.placeholder,children:g.options.map(b=>m.jsx(wt,{value:b,children:b},b))})},g.key):m.jsx(zt,{label:g.label,hint:g.hint,children:m.jsx(_t,{value:d[g.key]??"",type:g.secret?"password":"text",autoComplete:"off",onChange:b=>v({...d,[g.key]:b.target.value}),onFocus:b=>g.secret&&b.target.value===TD&&b.target.select(),placeholder:g.placeholder,className:"font-mono"})},g.key)),m.jsx(Cr,{label:"Enabled",checked:o,onCheckedChange:u})]})}function io({text:e,className:i}){const[r,s]=N.useState(!1),l=async h=>{h.stopPropagation();try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return m.jsx("button",{onClick:l,title:`Copy: ${e}`,className:ye("shrink-0 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",i),children:r?m.jsx(Xl,{size:11,className:"text-severity-suggestion"}):m.jsx(Ah,{size:11})})}function Gt({icon:e,title:i,hint:r,variant:s="card",className:l}){return s==="inline"?m.jsx("div",{className:ye("px-2 py-3 text-xs text-muted-foreground",l),children:i}):m.jsxs("div",{className:ye("card flex flex-col items-center gap-1.5 p-8 text-center",l),children:[e&&m.jsx(e,{size:20,className:"text-muted-foreground/60"}),m.jsx("div",{className:"text-sm text-muted-foreground",children:i}),r&&m.jsx("div",{className:"max-w-sm text-xs text-muted-foreground/70",children:r})]})}var AD=Object.defineProperty,Ar=(e,i)=>AD(e,"name",{value:i,configurable:!0}),av="Popover",[qC,pP]=Er(av,[Ra]),lv=Ra(),[DD,Aa]=qC(av),LD=Ar(e=>{const{__scopePopover:i,children:r,open:s,defaultOpen:l,onOpenChange:h,modal:p=!1}=e,o=lv(i),u=N.useRef(null),[d,v]=N.useState(!1),[c,_]=N.useState(0),[x,C]=N.useState(0),[y,g]=Js({prop:s,defaultProp:l??!1,onChange:h,caller:av});return m.jsx(ev,{...o,children:m.jsx(DD,{scope:i,contentId:Vi(),titleId:Vi(),descriptionId:Vi(),titlePresent:c>0,descriptionPresent:x>0,setTitleCount:_,setDescriptionCount:C,triggerRef:u,open:y,onOpenChange:g,onOpenToggle:N.useCallback(()=>g(b=>!b),[g]),hasCustomAnchor:d,onCustomAnchorAdd:N.useCallback(()=>v(!0),[]),onCustomAnchorRemove:N.useCallback(()=>v(!1),[]),modal:p,children:r})})},"Popover"),jD="PopoverTrigger",MD=N.forwardRef(Ar(function(i,r){const{__scopePopover:s,...l}=i,h=Aa(jD,s),p=lv(s),o=ht(r,h.triggerRef),u=m.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":cv(h.open),...l,ref:o,onClick:it(i.onClick,h.onOpenToggle)});return h.hasCustomAnchor?u:m.jsx(tv,{asChild:!0,...p,children:u})},"PopoverTrigger")),VC="PopoverPortal",[ND,OD]=qC(VC,{forceMount:void 0}),BD=Ar(e=>{const{__scopePopover:i,forceMount:r,children:s,container:l}=e,h=Aa(VC,i);return m.jsx(ND,{scope:i,forceMount:r,children:m.jsx(Tr,{present:r||h.open,children:m.jsx(Nh,{asChild:!0,container:l,children:s})})})},"PopoverPortal"),ql="PopoverContent",PD=N.forwardRef(Ar(function(i,r){const s=OD(ql,i.__scopePopover),{forceMount:l=s.forceMount,...h}=i,p=Aa(ql,i.__scopePopover);return m.jsx(Tr,{present:l||p.open,children:p.modal?m.jsx(ID,{...h,ref:r}):m.jsx(HD,{...h,ref:r})})},"PopoverContent")),zD=br("PopoverContent.RemoveScroll"),ID=N.forwardRef(Ar(function(i,r){const s=Aa(ql,i.__scopePopover),l=N.useRef(null),h=ht(r,l),p=N.useRef(!1),{nodes:o,registry:u}=Bg();return N.useEffect(()=>{const d=l.current;if(d)return Hg(d)},[]),m.jsx(Bh,{as:zD,allowPinchZoom:!0,shards:N.useMemo(()=>[l,...o.map(d=>({current:d}))],[l,o]),children:m.jsx(WC,{...i,ref:h,branchNodes:o,branchRegistry:u,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:it(i.onCloseAutoFocus,d=>{var v;d.preventDefault(),p.current||(v=s.triggerRef.current)==null||v.focus()}),onPointerDownOutside:it(i.onPointerDownOutside,d=>{const v=d.detail.originalEvent,c=v.button===0&&v.ctrlKey===!0,_=v.button===2||c;p.current=_},{checkForDefaultPrevented:!1}),onFocusOutside:it(i.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),HD=N.forwardRef(Ar(function(i,r){const s=Aa(ql,i.__scopePopover),l=N.useRef(!1),h=N.useRef(!1);return m.jsx(WC,{...i,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var o,u;(o=i.onCloseAutoFocus)==null||o.call(i,p),p.defaultPrevented||(l.current||(u=s.triggerRef.current)==null||u.focus(),p.preventDefault()),l.current=!1,h.current=!1},onInteractOutside:p=>{var d,v;(d=i.onInteractOutside)==null||d.call(i,p),p.defaultPrevented||(l.current=!0,p.detail.originalEvent.type==="pointerdown"&&(h.current=!0));const o=p.target;((v=s.triggerRef.current)==null?void 0:v.contains(o))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&h.current&&p.preventDefault()}})},"PopoverContentNonModal")),WC=N.forwardRef(Ar(function(i,r){const{__scopePopover:s,trapFocus:l,onOpenAutoFocus:h,onCloseAutoFocus:p,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:v,onInteractOutside:c,"aria-describedby":_,branchNodes:x,branchRegistry:C,...y}=i,g=Aa(ql,s),b=lv(s),[S,w]=N.useState(null),T=ht(r,w);return Pg(S),ic(),m.jsx(Og,{registry:C,children:m.jsx(Ng,{asChild:!0,loop:!0,trapped:l,branches:x,onMountAutoFocus:h,onUnmountAutoFocus:p,children:m.jsx(Mh,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:v,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:m.jsx(nv,{"data-state":cv(g.open),role:"dialog",id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?GC(_,g.descriptionId):_,...b,...y,ref:T,style:{...y.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function cv(e){return e?"open":"closed"}Ar(cv,"getState");function GC(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Ar(GC,"concatAriaDescribedby");function Da({trigger:e,children:i,side:r="bottom",align:s="start",className:l,open:h,onOpenChange:p}){return m.jsxs(LD,{open:h,onOpenChange:p,children:[m.jsx(MD,{asChild:!0,children:e}),m.jsx(BD,{children:m.jsx(PD,{side:r,align:s,sideOffset:6,collisionPadding:8,className:ye("z-50 rounded-lg border bg-card p-3 shadow-lg focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",l),children:i})})]})}const FD={on:"bg-foreground text-background",off:"bg-muted text-muted-foreground",critical:"bg-severity-critical text-primary-foreground",warning:"bg-severity-warning text-background",suggestion:"bg-severity-suggestion text-background",success:"bg-success text-success-foreground"};function Xe({tone:e="on",icon:i,children:r,className:s,title:l}){return m.jsxs("span",{title:l,className:ye("inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium",FD[e],s),children:[i&&m.jsx(i,{className:"h-2.5 w-2.5"}),r]})}const lb="clauder-hub:automation-tab";function UD(){var c,_,x,C,y,g;const e=rt(()=>ve.jobs(),["jobs"]),i=rt(()=>ve.runs(),["runs"]),r=rt(()=>ve.queueSettings(),["runs"]),s=((c=r.data)==null?void 0:c.maxRuns)??1,l=`Cron and webhook runs, ${s===1?"one session at a time":`up to ${s} sessions at a time`}, while the hub runs.`,[h,p]=N.useState(null),[o,u]=N.useState(()=>{try{return localStorage.getItem(lb)==="queue"?"queue":"jobs"}catch{return"jobs"}}),d=b=>{u(b);try{localStorage.setItem(lb,b)}catch{}},v=(i.data??[]).filter(b=>b.status==="queued"||b.status==="running").length;return m.jsxs("div",{className:"h-full overflow-y-auto",children:[(h==null?void 0:h.kind)==="job"&&m.jsx(CD,{job:h.job,onClose:()=>p(null)}),(h==null?void 0:h.kind)==="run"&&m.jsx(kD,{onClose:()=>p(null)}),m.jsxs("div",{className:"space-y-4 p-5",children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),m.jsx("h1",{className:"text-base font-semibold",children:"Automation"}),m.jsx("p",{className:"truncate text-xs text-muted-foreground",title:l,children:l})]}),m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[m.jsxs(ge,{onClick:()=>p({kind:"run"}),children:[m.jsx(va,{size:12})," Queue a run"]}),m.jsxs(ge,{variant:"primary",onClick:()=>p({kind:"job"}),children:[m.jsx(Rn,{size:12})," New job"]})]})]}),m.jsxs("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b",children:[[["jobs","Jobs",((_=e.data)==null?void 0:_.length)??0,"Every job of this project"],["queue","Queue",((x=i.data)==null?void 0:x.length)??0,v?`${v} waiting or running now`:"Nothing waiting or running now"]].map(([b,S,w,T])=>m.jsxs("button",{onClick:()=>d(b),title:T,className:ye("flex shrink-0 items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",o===b?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:[S,m.jsx("span",{className:ye("grid h-4 min-w-[1rem] place-items-center rounded-full px-1 text-[10px] font-semibold leading-none tabular-nums",b==="queue"&&v>0?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:w})]},b)),m.jsx($D,{maxRuns:s,limit:((C=r.data)==null?void 0:C.limit)??10})]}),o==="jobs"?(y=e.data)!=null&&y.length?m.jsx("div",{className:"divide-y rounded-md border",children:e.data.map(b=>m.jsx(qD,{job:b,onEdit:()=>p({kind:"job",job:b})},b.id))}):m.jsx(Gt,{variant:"inline",title:"No jobs yet. A cron job runs a prompt on a schedule; a manual / webhook job runs when you press Run, type /job in a channel, or something calls its URL."}):(g=i.data)!=null&&g.length?m.jsx(YD,{runs:i.data}):m.jsx(Gt,{variant:"inline",title:"Nothing has run yet."})]})]})}function $D({maxRuns:e,limit:i}){const[r,s]=N.useState(!1),[l,h]=N.useState(String(e)),p=Number(l),o=Number.isInteger(p)&&p>=1&&p<=i;return m.jsxs(Da,{align:"start",open:r,onOpenChange:u=>{s(u),u&&h(String(e))},className:"w-64 space-y-2 text-[11px]",trigger:m.jsx("button",{className:"flex shrink-0 items-center self-center rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground",title:`Runs at a time: ${e}`,"aria-label":"Queue settings",children:m.jsx(E4,{size:13})}),children:[m.jsx("div",{className:"text-xs font-semibold",children:"Runs at a time"}),m.jsx("p",{className:"text-muted-foreground",children:"How many queued runs of this project may run side by side. The rest wait in the queue."}),m.jsxs("form",{className:"flex items-center gap-1.5",onSubmit:u=>{u.preventDefault(),o&&qe(()=>ve.saveQueueSettings(p),`Up to ${p} run${p===1?"":"s"} at a time`).then(d=>{d&&s(!1)})},children:[m.jsx(_t,{type:"number",min:1,max:i,value:l,onChange:u=>h(u.target.value),className:"h-7 w-20",autoFocus:!0}),m.jsx(ge,{type:"submit",variant:"primary",disabled:!o||p===e,children:"Save"})]}),!o&&m.jsxs("p",{className:"text-destructive",children:["A whole number from 1 to ",i,"."]})]})}function qD({job:e,onEdit:i}){var h;const r=ln(),l=`curl -X POST "${`${location.origin}${_i()}/trigger/${e.id}`}" -H "x-clauder-token: ${e.token}" -H "content-type: application/json" -d "{\\"issue\\":\\"ABC-123\\"}"`;return m.jsxs("div",{className:"px-3 py-2.5",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[e.kind==="cron"?m.jsx(Kl,{size:14,className:"shrink-0 text-muted-foreground"}):m.jsx(Jw,{size:14,className:"shrink-0 text-muted-foreground"}),m.jsx("span",{className:"min-w-0 truncate text-xs font-medium",children:e.name}),!e.enabled&&m.jsx(Xe,{tone:"off",children:"disabled"}),m.jsx(Xe,{tone:"off",title:e.kind==="cron"?"Runs on its schedule while the hub runs, and whenever it is run by hand":"No schedule: runs when you press Run, type /job in a channel, or something calls its URL",children:e.kind==="cron"?"cron":"manual / webhook"}),m.jsx(Xe,{tone:"off",children:e.category||"no category"}),m.jsx(VD,{job:e,curl:l}),m.jsxs("span",{className:"ml-auto flex gap-1",children:[m.jsx(ge,{variant:"ghost",size:"icon",title:"Run now",onClick:()=>{var o;const p=Object.fromEntries((e.params??[]).map(u=>[u.name,u.default]));r({title:`Run '${e.name}' now?`,description:"Joins the queue as an unattended session.",body:m.jsxs("div",{className:"space-y-3",children:[(o=e.params)!=null&&o.length?m.jsx(WD,{params:e.params,values:p}):null,m.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-[11px]",children:e.prompt})]}),confirmLabel:"Queue it",run:async()=>{var u;await ve.runJob(e.id,(u=e.params)!=null&&u.length?p:void 0),_e.getState().notify("Queued.")}})},children:m.jsx(va,{size:13})}),m.jsx(ge,{variant:"ghost",size:"icon",title:"Edit",onClick:i,children:m.jsx(Xi,{size:13})}),m.jsx(ge,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void r({title:`Delete the job '${e.name}'?`,description:"Its schedule or webhook stops. Past runs stay.",confirmLabel:"Delete",tone:"destructive",run:()=>ve.deleteJob(e.id)}),children:m.jsx(Ri,{size:13})})]})]}),m.jsx("div",{className:"mt-1 line-clamp-2 break-words pl-6 text-[11px] text-muted-foreground",children:e.prompt}),(h=e.params)!=null&&h.length?m.jsx("div",{className:"mt-1 flex flex-wrap gap-1 pl-6",children:e.params.map(p=>m.jsxs("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",title:p.description??p.label??p.name,children:[p.name,": ",p.type," = ",String(p.default)]},p.name))}):null,m.jsxs("div",{className:"mt-1 flex flex-wrap gap-3 pl-6 text-[11px] text-muted-foreground",children:[e.kind==="cron"?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"font-mono",children:e.schedule}),m.jsxs("span",{children:["next: ",e.nextRunAt?Wi(e.nextRunAt):"-"]})]}):m.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[m.jsxs("span",{className:"break-all font-mono",children:["POST ",_i(),"/trigger/",e.id]}),m.jsx(io,{text:l}),m.jsx("span",{children:"copy curl"}),m.jsx(ge,{variant:"ghost",size:"icon",title:"New token",onClick:()=>void r({title:"Issue a new token?",description:"Callers using the old token stop working.",confirmLabel:"Issue new token",tone:"destructive",run:()=>ve.rotateJobToken(e.id)}),children:m.jsx(so,{size:11})})]}),m.jsxs("span",{children:["last run: ",e.lastRunAt?vs(e.lastRunAt):"never"]})]})]})}function VD({job:e,curl:i}){var s;const r=`curl -X POST "http://127.0.0.1:${location.port||80}${_i()}/jobs/${e.id}/run" -H "content-type: application/json" -d "{}"`;return m.jsxs(Da,{align:"start",className:"w-[30rem] max-w-[calc(100vw-1rem)] space-y-2.5 text-[11px]",trigger:m.jsxs("button",{className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Every way to start this job",children:[m.jsx($w,{size:11})," How to run"]}),children:[m.jsxs("div",{className:"text-xs font-semibold",children:["How to run ‘",e.name,"’"]}),e.kind==="cron"?m.jsxs(oa,{title:"On its schedule",children:[m.jsx("span",{className:"font-mono",children:e.schedule}),", next ",e.nextRunAt?Wi(e.nextRunAt):"-",", while the hub runs",e.enabled?"":" (disabled now)","."]}):m.jsx(oa,{title:"No schedule",children:"It runs only when started one of the ways below."}),m.jsxs(oa,{title:"From this page",children:["Press ",m.jsx(va,{size:11,className:"inline"})," Run. It asks first, then joins the project’s queue (one run at a time). In the queue below, ",m.jsx(jh,{size:10,className:"inline"})," stops a running run and ",m.jsx(Xw,{size:10,className:"inline"})," resumes a stopped one where it left off."]}),m.jsxs(oa,{title:"From a channel",children:[m.jsxs("span",{className:"font-mono",children:["/job ",e.name]})," on Telegram (",m.jsx("span",{className:"font-mono",children:"!job"})," on Slack), or ",m.jsx("span",{className:"font-mono",children:"/jobs"})," and pick it. It asks before it queues. ",m.jsx("span",{className:"font-mono",children:"/stop"})," stops it, ",m.jsx("span",{className:"font-mono",children:"/resume"})," carries it on."]}),e.kind==="webhook"&&m.jsxs(oa,{title:"From another tool (webhook)",children:[m.jsxs("span",{className:"flex items-center gap-1",children:[m.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",_i(),"/trigger/",e.id]}),m.jsx(io,{text:i})]}),"With the header ",m.jsx("span",{className:"font-mono",children:"x-clauder-token"})," (the job’s token, in the copied curl; renew it with ",m.jsx(so,{size:10,className:"inline"})," on the row). The JSON body reaches the prompt as ",m.jsx("span",{className:"font-mono",children:"{{payload}}"})," or ",m.jsx("span",{className:"font-mono",children:"{{payload.field}}"}),"."]}),m.jsxs(oa,{title:"From an app on this machine",children:[m.jsxs("span",{className:"flex items-center gap-1",children:[m.jsxs("span",{className:"min-w-0 break-all font-mono",children:["POST ",_i(),"/jobs/",e.id,"/run"]}),m.jsx(io,{text:r})]}),"No token: the hub only listens on 127.0.0.1. An optional ",m.jsx("span",{className:"font-mono",children:'{"payload": {...}}'})," body fills the prompt as above",(s=e.params)!=null&&s.length?m.jsxs(m.Fragment,{children:[", and ",m.jsx("span",{className:"font-mono",children:'{"params": {...}}'})," sets its parameters (left out: their defaults)"]}):null,"."]})]})}function WD({params:e,values:i}){const[r,s]=N.useState(()=>Object.fromEntries(e.map(h=>[h.name,h.type==="boolean"?!!h.default:String(h.default)]))),l=(h,p)=>{s(o=>({...o,[h.name]:p})),i[h.name]=h.type==="number"&&typeof p=="string"&&p.trim()!==""&&Number.isFinite(Number(p))?Number(p):p};return m.jsx("div",{className:"space-y-2",children:e.map(h=>m.jsxs("div",{className:"space-y-1",children:[h.type==="boolean"?m.jsx(Cr,{id:`param-${h.name}`,label:h.label||h.name,checked:r[h.name]===!0,onCheckedChange:p=>l(h,p)}):m.jsxs("label",{className:"block space-y-1",children:[m.jsxs("div",{className:"text-xs font-medium",children:[h.label||h.name," ",m.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:`{{${h.name}}}`})]}),m.jsx(_t,{type:h.type==="number"?"number":"text",value:String(r[h.name]??""),onChange:p=>l(h,p.target.value)})]}),h.description&&m.jsx("div",{className:"text-[11px] text-muted-foreground",children:h.description})]},h.name))})}function oa({title:e,children:i}){return m.jsxs("div",{children:[m.jsx("div",{className:"font-medium text-foreground",children:e}),m.jsx("div",{className:"text-muted-foreground",children:i})]})}const GD={queued:"off",running:"warning",done:"success",exited:"off",cancelled:"off"};function YD({runs:e}){const i=_e(l=>l.go),r=ln(),s=l=>l.jobName??l.prompt.slice(0,60);return m.jsx("div",{className:"divide-y rounded-md border",children:e.map(l=>m.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs",children:[m.jsx(Xe,{tone:GD[l.status],children:l.status}),l.resume&&m.jsx(Xe,{tone:"off",title:"Queued again to carry on its own session",children:"resumed"}),m.jsx("span",{className:"hidden w-16 shrink-0 text-[11px] text-muted-foreground sm:block",children:l.source}),m.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l.jobName&&m.jsxs("span",{className:"font-medium",children:[l.jobName,": "]}),m.jsx("span",{className:"text-muted-foreground",children:l.prompt})]}),l.params&&Object.keys(l.params).length>0&&m.jsx("span",{className:"hidden max-w-[40%] shrink-0 truncate font-mono text-[10px] text-muted-foreground md:block",title:JSON.stringify(l.params,null,2),children:Object.entries(l.params).map(([h,p])=>`${h}=${p}`).join(" ")}),m.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:vs(l.createdAt)}),l.sessionId&&m.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>i({kind:"session",id:l.sessionId}),children:"Open"}),l.status==="running"&&l.sessionId&&m.jsx(ge,{variant:"ghost",size:"icon",title:"Stop",onClick:()=>void r({title:`Stop '${s(l)}'?`,description:"Its terminal closes and the queue moves on. The conversation is kept: Resume carries on from where it stopped.",confirmLabel:"Stop",tone:"destructive",run:()=>ve.stopRun(l.id)}),children:m.jsx(jh,{size:13})}),l.status==="exited"&&l.sessionId&&m.jsx(ge,{variant:"ghost",size:"icon",title:"Resume",onClick:()=>void r({title:`Resume '${s(l)}'?`,description:"Joins the back of the queue as an unattended run and carries on its own conversation from where it stopped.",confirmLabel:"Queue it",run:async()=>{const{position:h}=await ve.resumeRun(l.id);_e.getState().notify(`Queued, number ${h} in line.`)}}),children:m.jsx(Xw,{size:13})}),l.status==="queued"&&m.jsx(ge,{variant:"ghost",size:"icon",title:"Cancel",onClick:()=>void qe(()=>ve.cancelRun(l.id)),children:m.jsx(xn,{size:13})})]},l.id))})}function cs({label:e,value:i,hint:r}){return m.jsxs("div",{className:"card px-3 py-2.5",title:r,children:[m.jsx("div",{className:"text-[11px] text-muted-foreground",children:e}),m.jsx("div",{className:"mt-0.5 text-lg font-semibold tabular-nums",children:i})]})}function YC({tokens:e}){return m.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[m.jsx(cs,{label:"Input",value:Pn(e.input),hint:`${e.input.toLocaleString()} uncached input tokens`}),m.jsx(cs,{label:"Output",value:Pn(e.output),hint:`${e.output.toLocaleString()} output tokens`}),m.jsx(cs,{label:"Cache read",value:Pn(e.cacheRead),hint:`${e.cacheRead.toLocaleString()} tokens read from the prompt cache`}),m.jsx(cs,{label:"Cache write",value:Pn(e.cacheCreation),hint:`${e.cacheCreation.toLocaleString()} tokens written to the prompt cache`})]})}function hs({rows:e,empty:i="Nothing yet.",limit:r=12,format:s=Pn}){const[l,h]=N.useState(!1);if(!e.length)return m.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:i});const p=[...e].sort((d,v)=>v.value-d.value),o=l?p:p.slice(0,r),u=Math.max(...p.map(d=>d.value),1);return m.jsxs("div",{className:"space-y-1.5",children:[o.map(d=>m.jsxs("div",{className:"group",title:`${d.label}: ${d.value.toLocaleString()}${d.note?` (${d.note})`:""}`,children:[m.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[m.jsxs("span",{className:"min-w-0 truncate font-mono text-[11px]",children:[d.label,d.sublabel&&m.jsx("span",{className:"ml-1.5 font-sans text-muted-foreground",children:d.sublabel})]}),m.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[s(d.value),d.note&&m.jsx("span",{className:"ml-1 text-severity-critical",children:d.note})]})]}),m.jsx("div",{className:"mt-0.5 h-1.5 rounded-full bg-foreground/10",children:m.jsx("div",{className:"h-1.5 rounded-full bg-series transition-all group-hover:opacity-80",style:{width:`${Math.max(2,d.value/u*100)}%`}})})]},d.key)),p.length>r&&m.jsx("button",{className:"text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>h(!l),children:l?"Show fewer":`Show all ${p.length}`})]})}function KD({days:e,valueOf:i,label:r}){const[s,l]=N.useState(null),h=Object.entries(e).sort(([d],[v])=>d.localeCompare(v)).slice(-30);if(!h.length)return m.jsx("div",{className:"px-1 py-2 text-xs text-muted-foreground",children:"No sessions yet."});const p=Math.max(...h.map(([,d])=>i(d)),1),o=s??h[h.length-1][0],u=i(e[o]);return m.jsxs("div",{children:[m.jsxs("div",{className:"mb-2 flex items-baseline gap-2 text-xs",children:[m.jsx("span",{className:"font-medium tabular-nums",children:Pn(u)}),m.jsxs("span",{className:"text-muted-foreground",children:[r," on ",o]})]}),m.jsx("div",{className:"flex h-28 items-end gap-[2px]",onMouseLeave:()=>l(null),children:h.map(([d,v])=>{const c=i(v);return m.jsx("div",{className:"flex h-full max-w-8 flex-1 cursor-default items-end",onMouseEnter:()=>l(d),children:m.jsx("div",{className:ye("w-full rounded-t bg-series transition-opacity",s&&s!==d&&"opacity-50"),style:{height:`${Math.max(2,c/p*100)}%`}})},d)})}),m.jsxs("div",{className:"mt-1 flex justify-between text-[10px] text-muted-foreground",children:[m.jsx("span",{children:h[0][0]}),m.jsx("span",{children:h[h.length-1][0]})]})]})}function Nt({title:e,description:i,children:r,action:s,className:l}){return m.jsxs("section",{className:ye("card p-4",l),children:[m.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),i&&m.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:i})]}),s]}),r]})}const XD=[{name:"feature",description:"New behaviour",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"Documentation",description:"path or link to the docs written or updated",required:!0},{name:"Test evidence",description:"how it was tested and the result",required:!0}]},{name:"bugfix",description:"A defect fixed",deliverables:[{name:"PR",description:"link to the pull request",required:!0},{name:"RCA",description:"root cause analysis, a few sentences or a file path",required:!0},{name:"Test evidence",description:"the failing case now passing",required:!0}]}];function QD(){var s;const e=rt(()=>ve.categories(),[]),[i,r]=N.useState(null);return m.jsxs("div",{className:"h-full overflow-y-auto",children:[i&&m.jsx(ED,{category:i.category,onClose:()=>r(null),onSaved:e.reload}),m.jsxs("div",{className:"space-y-4 p-5",children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Settings"}),m.jsx("h1",{className:"text-base font-semibold",children:"Task categories"}),m.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What counts as done for each kind of task.",children:"What counts as done for each kind of task."})]}),m.jsxs(ge,{variant:"primary",className:"shrink-0",onClick:()=>r({}),children:[m.jsx(Rn,{size:12})," New category"]})]}),(s=e.data)==null?void 0:s.map(l=>m.jsx(ZD,{category:l,onEdit:()=>r({category:l}),onDeleted:e.reload},l.id)),e.data&&!e.data.length&&m.jsx(Gt,{title:"No categories yet.",hint:"Without any, a triggered session reports a summary and evidence of its own choosing. Start from the examples, or describe your own to Claude."}),e.data&&!e.data.length&&m.jsx("div",{className:"flex justify-center",children:m.jsx(ge,{onClick:()=>void Promise.all(XD.map(l=>ve.saveCategory(l))).then(e.reload),children:"Add the feature and bugfix examples"})})]})]})}function ZD({category:e,onEdit:i,onDeleted:r}){const s=ln();return m.jsx(Nt,{title:e.name,description:e.description||void 0,action:m.jsxs("div",{className:"flex gap-1",children:[m.jsx(ge,{variant:"ghost",size:"icon",title:"Edit",onClick:i,children:m.jsx(Xi,{size:13})}),m.jsx(ge,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void s({title:`Delete the category '${e.name}'?`,description:"Sessions using it can no longer close against it.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deleteCategory(e.id),r()}}),children:m.jsx(Ri,{size:13})})]}),children:e.deliverables.length?m.jsx("div",{className:"divide-y rounded-md border",children:e.deliverables.map(l=>m.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-xs font-medium",children:l.name}),l.description&&m.jsx("div",{className:"break-words text-[11px] text-muted-foreground",children:l.description})]}),m.jsx(Xe,{tone:l.required?"on":"off",children:l.required?"required":"optional"})]},l.name))}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"No fixed deliverables."})})}const JD={permission:"Permission requests",question:"Questions",turn:"End of each turn",mcp:"MCP suggestions",done:"Task done"},Gm="clauder:highlight-notifications";let Ym=!1;function eL(){Ym=!0,_e.getState().go({kind:"page",page:"channels"}),window.dispatchEvent(new Event(Gm))}function KC({on:e,label:i,onToggle:r,className:s}){return m.jsx("button",{role:"switch","aria-checked":e,"aria-label":i,title:i,onClick:r,className:ye("relative h-5 w-9 shrink-0 rounded-full transition-colors",e?"bg-primary":"bg-foreground/20",s),children:m.jsx("span",{className:ye("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",e?"left-[18px]":"left-0.5")})})}function XC({global:e=!1}){var C,y,g,b,S;const i=rt(()=>ve.channels(),["channels"]),[r,s]=N.useState(null),l=ln(),h=((C=i.data)==null?void 0:C.kinds)??[],p=((y=i.data)==null?void 0:y.paused)??!1,o=new Set(((g=i.data)==null?void 0:g.notifyKinds)??[]),u=(b=i.data)==null?void 0:b.channels.find(w=>w.kind==="device"),d=(((S=i.data)==null?void 0:S.channels)??[]).filter(w=>w.kind!=="device"),v=N.useRef(null),[c,_]=N.useState(!1);N.useEffect(()=>{const w=()=>{!Ym||!v.current||(Ym=!1,v.current.scrollIntoView({block:"center",behavior:"smooth"}),_(!0),window.setTimeout(()=>_(!1),2200))};return w(),window.addEventListener(Gm,w),()=>window.removeEventListener(Gm,w)},[i.data!==null]);const x=w=>void qe(()=>ve.setNotifyKinds(o.has(w)?[...o].filter(T=>T!==w):[...o,w]));return m.jsxs("div",{className:e?"":"h-full overflow-y-auto",children:[r&&m.jsx(RD,{channel:r.channel,kinds:r.channel?h:h.filter(w=>w.kind!=="device"),onClose:()=>s(null)}),m.jsxs("div",{className:ye("space-y-4",!e&&"p-5"),children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e?"Every project":"Settings"}),m.jsx("h1",{className:"text-base font-semibold",children:e?"Global channels":"Channels"}),e?m.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"One bot for every project: their questions arrive here, named after the project, and /projects, /use pick one.",children:"One bot for every project: their questions arrive here, named after the project."}):m.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"Where sessions reach you. A reply goes back into the session.",children:"Where sessions reach you. A reply goes back into the session."})]}),m.jsxs(ge,{variant:"primary",className:"shrink-0",onClick:()=>s({}),children:[m.jsx(Rn,{size:12})," Add channel"]})]}),i.data&&m.jsx(Nt,{title:"Notifications",description:p?"Paused: no channel hears of anything; questions still wait in the inbox.":"For every channel below, this computer included.",action:m.jsxs("div",{ref:v,className:ye("flex items-center gap-2 rounded-full py-0.5 pl-2.5 pr-0.5 transition-shadow",c&&"ring-2 ring-primary ring-offset-2 ring-offset-background animate-pulse"),children:[m.jsx("span",{className:ye("text-[11px] font-medium",p?"text-severity-warning":"text-muted-foreground"),children:p?"Paused on every channel":"On for every channel"}),m.jsx(KC,{on:!p,label:p?"Turn notifications back on":"Pause notifications on every channel",onToggle:()=>void qe(()=>ve.setNotificationsPaused(!p))})]}),children:m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"mr-1 text-[11px] text-muted-foreground",children:"Notify for"}),(i.data.interactionKinds??[]).map(w=>m.jsx("button",{disabled:p,onClick:()=>x(w),className:ye("rounded-full border px-2.5 py-0.5 text-[11px] transition-colors disabled:cursor-not-allowed disabled:opacity-40",o.has(w)?"border-primary bg-primary/15 text-foreground":"text-muted-foreground hover:bg-muted"),children:JD[w]??w},w))]})}),m.jsx(Nt,{title:"Channels",description:"Send /help to the Telegram bot, or !help in the Slack channel, for the commands: new session, run, sessions, summary, stop, queue.",children:i.data&&(!e||d.length)?m.jsxs("div",{className:"divide-y rounded-md border",children:[!e&&m.jsx(tL,{channel:u}),d.map(w=>{var T;return m.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[m.jsx(Jl,{size:14,className:"shrink-0 text-muted-foreground"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[m.jsx("span",{className:"min-w-0 truncate font-medium",children:w.name}),m.jsx(Xe,{tone:"off",children:((T=h.find(D=>D.kind===w.kind))==null?void 0:T.label)??w.kind}),m.jsx(Xe,{tone:w.status.ok?"success":w.enabled?"warning":"off",children:w.status.ok?"connected":w.enabled?"not connected":"off"})]}),m.jsx("div",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:w.status.detail}),w.kind==="http"&&m.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground",children:[m.jsxs("span",{className:"truncate font-mono",children:["POST ",`${location.origin}${_i()}/channels/${w.id}/reply`]}),m.jsx(io,{text:`${location.origin}${_i()}/channels/${w.id}/reply`})]})]}),m.jsx(ge,{variant:"ghost",size:"icon",title:"Send a test message",onClick:()=>void qe(()=>ve.testChannel(w.id),"Test message sent."),children:m.jsx(Kw,{size:13})}),m.jsx(ge,{variant:"ghost",size:"icon",title:"Edit",onClick:()=>s({channel:w}),children:m.jsx(Xi,{size:13})}),m.jsx(ge,{variant:"ghost",size:"icon",title:"Delete",onClick:()=>void l({title:`Remove '${w.name}'?`,description:"Sessions stop reaching you there.",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteChannel(w.id)}),children:m.jsx(Ri,{size:13})})]},w.id)})]}):i.data&&m.jsx(Gt,{variant:"inline",title:"No channels yet. Without one, questions wait in the dashboard's inbox and the terminal."})})]})]})}function tL({channel:e}){const i=!!(e!=null&&e.enabled),r=()=>qe(()=>ve.saveChannel({id:e==null?void 0:e.id,kind:"device",name:"This computer",config:{},enabled:!i,kinds:e==null?void 0:e.kinds}));return m.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[m.jsx(x4,{size:14,className:"shrink-0 text-muted-foreground"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[m.jsx("span",{className:"min-w-0 truncate font-medium",children:"This computer"}),m.jsx(Xe,{tone:"off",children:"System notifications"}),m.jsx(Xe,{tone:i&&(e!=null&&e.status.ok)?"success":i?"warning":"off",children:i?e!=null&&e.status.ok?"on":"not working":"off"})]}),m.jsx("div",{className:ye("mt-0.5 truncate text-[11px]",i&&e&&!e.status.ok?"text-severity-critical":"text-muted-foreground"),children:i&&e&&!e.status.ok?e.status.detail:"From the hub itself; they arrive even with the browser closed."})]}),i&&e&&m.jsx(ge,{variant:"ghost",size:"icon",title:"Send a test notification",onClick:()=>void qe(()=>ve.testChannel(e.id),"Test notification sent."),children:m.jsx(Kw,{size:13})}),m.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:i?"On":"Off"}),m.jsx(KC,{on:i,label:i?"Stop notifying on this computer":"Notify on this computer",onToggle:()=>void r()})]})}function Qi({group:e,title:i,description:r,action:s}){return m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),m.jsx("h1",{className:"text-base font-semibold",children:i}),r&&m.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",title:r,children:r})]}),s&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:s})]})}function uv({onClick:e}){return m.jsxs(ge,{variant:"ghost",className:"-ml-2 mb-3 md:hidden",onClick:e,children:[m.jsx(t4,{size:13})," Back"]})}const cb={manual:"Manual: ask before edits and commands",default:"Default (older name of Manual)",acceptEdits:"Accept edits: ask only for commands",plan:"Plan: read and plan, change nothing",auto:"Auto: a classifier decides what to ask",dontAsk:"Don't ask: deny what is not allowed",bypassPermissions:"Bypass: never ask"},nL=["default","fable","opus","sonnet","haiku","opus[1m]","sonnet[1m]","claude-fable-5-1","claude-opus-5-5","claude-sonnet-5-5","claude-haiku-5-5"],Ku="";function iL(){var _,x;const e=rt(()=>ve.claudeSettings(),[]),[i,r]=N.useState(null),[s,l]=N.useState(""),[h,p]=N.useState(""),[o,u]=N.useState("");N.useEffect(()=>{if(!e.data)return;const C=e.data.settings;r(C),l(C.model),p(C.fallbackModel),u(C.addDirs.join(`
536
+ `))},[e.data]);const d=async C=>{const y=await qe(()=>ve.saveClaudeSettings(C),"Saved. New sessions use it.");y&&r(y)},v=((_=e.data)==null?void 0:_.permissionModes)??[],c=((x=e.data)==null?void 0:x.efforts)??[];return m.jsx("div",{className:"h-full overflow-y-auto",children:m.jsxs("div",{className:"space-y-4 p-5",children:[m.jsx(Qi,{group:"Settings",title:"Claude settings",description:"How the hub starts claude. Applies to sessions started from now on; empty keeps your own Claude Code setting."}),i&&m.jsxs(m.Fragment,{children:[m.jsx(Nt,{title:"Permissions",description:"Which mode a session starts in.",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(zt,{label:"Sessions you open",hint:"New session, resumes and hub tasks.",children:m.jsxs(vi,{value:i.permissionMode,onValueChange:C=>void d({permissionMode:C}),children:[m.jsx(wt,{value:Ku,children:"Your Claude Code setting"}),v.map(C=>m.jsx(wt,{value:C,children:cb[C]??C},C))]})}),m.jsx(zt,{label:"Unattended runs",hint:"Cron, webhook and queued runs. Their questions go to the channels.",children:m.jsxs(vi,{value:i.runPermissionMode,onValueChange:C=>void d({runPermissionMode:C}),children:[m.jsx(wt,{value:Ku,children:"Your Claude Code setting"}),v.map(C=>m.jsx(wt,{value:C,children:cb[C]??C},C))]})})]})}),m.jsxs(Nt,{title:"Model",description:"An alias or a full model id.",children:[m.jsx("datalist",{id:"claude-models",children:nL.map(C=>m.jsx("option",{value:C},C))}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsx(zt,{label:"Model",children:m.jsx(_t,{list:"claude-models",value:s,placeholder:"Your Claude Code setting",onChange:C=>l(C.target.value),onBlur:()=>s!==i.model&&void d({model:s.trim()})})}),m.jsx(zt,{label:"Fallback model",hint:"Used when the model is overloaded.",children:m.jsx(_t,{list:"claude-models",value:h,placeholder:"None",onChange:C=>p(C.target.value),onBlur:()=>h!==i.fallbackModel&&void d({fallbackModel:h.trim()})})}),m.jsx(zt,{label:"Effort",children:m.jsxs(vi,{value:i.effort,onValueChange:C=>void d({effort:C}),children:[m.jsx(wt,{value:Ku,children:"Your Claude Code setting"}),c.map(C=>m.jsx(wt,{value:C,children:C},C))]})})]})]}),m.jsx(Nt,{title:"Access",description:"What else a session can reach.",children:m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsx(zt,{label:"Extra directories",hint:"One path per line, passed as --add-dir.",children:m.jsx(sc,{rows:3,className:"font-mono",value:o,placeholder:"C:\\Source code\\shared-lib",onChange:C=>u(C.target.value),onBlur:()=>o!==i.addDirs.join(`
537
+ `)&&void d({addDirs:o.split(`
538
+ `)})})}),m.jsx(zt,{label:"Claude in Chrome",children:m.jsxs(vi,{value:i.chrome,onValueChange:C=>void d({chrome:C}),children:[m.jsx(wt,{value:Ku,children:"Your Claude Code setting"}),m.jsx(wt,{value:"on",children:"On"}),m.jsx(wt,{value:"off",children:"Off"})]})})]})})]})]})})}class QC extends Error{constructor(i,r){super(i),this.status=r}}async function ca(e,i){const r=await fetch(`${_i()}/files${e}`,{...i,headers:{"Content-Type":"application/json"}}),s=await r.json().catch(()=>({}));if(!r.ok)throw new QC(s.error??r.statusText,r.status);return s}const os=(e,i,r)=>ca(i,{method:e,body:JSON.stringify(r)}),Jt={list:(e,i)=>ca(`/list?path=${encodeURIComponent(e)}${i?"&ignored=1":""}`),read:e=>ca(`/read?path=${encodeURIComponent(e)}`),blame:e=>ca(`/blame?path=${encodeURIComponent(e)}`),commit:e=>ca(`/commit?sha=${encodeURIComponent(e)}`),stat:e=>ca(`/stat?path=${encodeURIComponent(e)}`),write:(e,i,r)=>os("PUT","/write",{path:e,content:i,expectedMtimeMs:r}),create:e=>os("POST","/create",{path:e}),mkdir:e=>os("POST","/mkdir",{path:e}),rename:(e,i)=>os("POST","/rename",{from:e,to:i}),remove:e=>os("POST","/delete",{path:e}),reveal:e=>os("POST","/reveal",{path:e}),copyToClipboard:e=>os("POST","/clipboard",{path:e}),copy:(e,i)=>os("POST","/copy",{from:e,folder:i})},rL=e=>/\.(md|markdown|mdx)$/i.test(e),sL=e=>/\.(html?|xhtml)$/i.test(e);function ub(e){var r;const i=((r=e.split(".").pop())==null?void 0:r.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif","svg"].includes(i)?"image":["mp3","wav","ogg","oga","m4a","aac","flac","opus","weba"].includes(i)?"audio":["mp4","webm","ogv","mov","m4v","mkv"].includes(i)?"video":null}const Km=e=>`${_i()}/files/raw/${e.split("/").map(encodeURIComponent).join("/")}`,oL="modulepreload",aL=function(e){return"/"+e},hb={},lL=function(i,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(d){return Promise.all(d.map(v=>Promise.resolve(v).then(c=>({status:"fulfilled",value:c}),c=>({status:"rejected",reason:c}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));l=p(r.map(d=>{if(d=aL(d),d in hb)return;hb[d]=!0;const v=d.endsWith(".css"),c=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${c}`))return;const _=document.createElement("link");if(_.rel=v?"stylesheet":oL,v||(_.as="script"),_.crossOrigin="",_.href=d,u&&_.setAttribute("nonce",u),document.head.appendChild(_),v)return new Promise((x,C)=>{_.addEventListener("load",x),_.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${d}`)))})}))}function h(p){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=p,window.dispatchEvent(o),!o.defaultPrevented)throw p}return l.then(p=>{for(const o of p||[])o.status==="rejected"&&h(o.reason);return i().catch(h)})},cL=N.lazy(()=>lL(()=>import("./MonacoEditor-BTVIBYvB.js").then(e=>e.b),__vite__mapDeps([0,1])));function ZC(e){return m.jsx(N.Suspense,{fallback:m.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading editor..."}),children:m.jsx(cL,{...e})})}function uL(e,i){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const hL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fL={};function db(e,i){return(fL.jsx?dL:hL).test(e)}const pL=/[ \t\n\f\r]/g;function mL(e){return typeof e=="object"?e.type==="text"?fb(e.value):!1:fb(e)}function fb(e){return e.replace(pL,"")===""}class oc{constructor(i,r,s){this.normal=r,this.property=i,s&&(this.space=s)}}oc.prototype.normal={};oc.prototype.property={};oc.prototype.space=void 0;function JC(e,i){const r={},s={};for(const l of e)Object.assign(r,l.property),Object.assign(s,l.normal);return new oc(r,s,i)}function Xm(e){return e.toLowerCase()}class Fn{constructor(i,r){this.attribute=r,this.property=i}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let gL=0;const Ue=lo(),$t=lo(),Qm=lo(),be=lo(),bt=lo(),Qs=lo(),Zn=lo();function lo(){return 2**++gL}const Zm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:$t,commaOrSpaceSeparated:Zn,commaSeparated:Qs,number:be,overloadedBoolean:Qm,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),nm=Object.keys(Zm);class hv extends Fn{constructor(i,r,s,l){let h=-1;if(super(i,r),pb(this,"space",l),typeof s=="number")for(;++h<nm.length;){const p=nm[h];pb(this,nm[h],(s&Zm[p])===Zm[p])}}}hv.prototype.defined=!0;function pb(e,i,r){r&&(e[i]=r)}function La(e){const i={},r={};for(const[s,l]of Object.entries(e.properties)){const h=new hv(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(h.mustUseProperty=!0),i[s]=h,r[Xm(s)]=s,r[Xm(h.attribute)]=s}return new oc(i,r,e.space)}const e2=La({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:bt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:be,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:bt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:$t,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function t2(e,i){return i in e?e[i]:i}function n2(e,i){return t2(e,i.toLowerCase())}const vL=La({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qs,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alpha:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:bt,autoFocus:Ue,autoPlay:Ue,blocking:bt,capture:null,charSet:null,checked:Ue,cite:null,className:bt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:$t,controls:Ue,controlsList:bt,coords:be|Qs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Qm,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:bt,height:be,hidden:Qm,high:be,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:bt,itemRef:bt,itemScope:Ue,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ue,optimum:be,pattern:null,ping:bt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:bt,required:Ue,reversed:Ue,rows:be,rowSpan:be,sandbox:bt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootCustomElementRegistry:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shadowRootSerializable:Ue,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:$t,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ue,disablePictureInPicture:Ue,disableRemotePlayback:Ue,exportParts:Qs,part:bt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:n2}),_L=La({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Zn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Qs,g2:Qs,glyphName:Qs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zn,rev:Zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zn,requiredFeatures:Zn,requiredFonts:Zn,requiredFormats:Zn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:t2}),i2=La({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),r2=La({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:n2}),s2=La({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),xL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},yL=/[A-Z]/g,mb=/-[a-z]/g,bL=/^data[-\w.:]+$/i;function wL(e,i){const r=Xm(i);let s=i,l=Fn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&bL.test(i)){if(i.charAt(4)==="-"){const h=i.slice(5).replace(mb,CL);s="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=i.slice(4);if(!mb.test(h)){let p=h.replace(yL,SL);p.charAt(0)!=="-"&&(p="-"+p),i="data"+p}}l=hv}return new l(s,i)}function SL(e){return"-"+e.toLowerCase()}function CL(e){return e.charAt(1).toUpperCase()}const kL=JC([e2,vL,i2,r2,s2],"html"),dv=JC([e2,_L,i2,r2,s2],"svg");function EL(e){return e.join(" ").trim()}var aa={},im,gb;function TL(){if(gb)return im;gb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,h=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
539
+ `,d="/",v="*",c="",_="comment",x="declaration";function C(g,b){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];b=b||{};var S=1,w=1;function T(F){var W=F.match(i);W&&(S+=W.length);var G=F.lastIndexOf(u);w=~G?F.length-G:w+F.length}function D(){var F={line:S,column:w};return function(W){return W.position=new R(F),M(),W}}function R(F){this.start=F,this.end={line:S,column:w},this.source=b.source}R.prototype.content=g;function L(F){var W=new Error(b.source+":"+S+":"+w+": "+F);if(W.reason=F,W.filename=b.source,W.line=S,W.column=w,W.source=g,!b.silent)throw W}function A(F){var W=F.exec(g);if(W){var G=W[0];return T(G),g=g.slice(G.length),W}}function M(){A(r)}function j(F){var W;for(F=F||[];W=z();)W!==!1&&F.push(W);return F}function z(){var F=D();if(!(d!=g.charAt(0)||v!=g.charAt(1))){for(var W=2;c!=g.charAt(W)&&(v!=g.charAt(W)||d!=g.charAt(W+1));)++W;if(W+=2,c===g.charAt(W-1))return L("End of comment missing");var G=g.slice(2,W-2);return w+=2,T(G),g=g.slice(W),w+=2,F({type:_,comment:G})}}function P(){var F=D(),W=A(s);if(W){if(z(),!A(l))return L("property missing ':'");var G=A(h),Q=F({type:x,property:y(W[0].replace(e,c)),value:G?y(G[0].replace(e,c)):c});return A(p),Q}}function H(){var F=[];j(F);for(var W;W=P();)W!==!1&&(F.push(W),j(F));return F}return M(),H()}function y(g){return g?g.replace(o,c):c}return im=C,im}var vb;function RL(){if(vb)return aa;vb=1;var e=aa&&aa.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(aa,"__esModule",{value:!0}),aa.default=r;const i=e(TL());function r(s,l){let h=null;if(!s||typeof s!="string")return h;const p=(0,i.default)(s),o=typeof l=="function";return p.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:v}=u;o?l(d,v,u):v&&(h=h||{},h[d]=v)}),h}return aa}var Dl={},_b;function AL(){if(_b)return Dl;_b=1,Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,h=function(d){return!d||r.test(d)||e.test(d)},p=function(d,v){return v.toUpperCase()},o=function(d,v){return"".concat(v,"-")},u=function(d,v){return v===void 0&&(v={}),h(d)?d:(d=d.toLowerCase(),v.reactCompat?d=d.replace(l,o):d=d.replace(s,o),d.replace(i,p))};return Dl.camelCase=u,Dl}var Ll,xb;function DL(){if(xb)return Ll;xb=1;var e=Ll&&Ll.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},i=e(RL()),r=AL();function s(l,h){var p={};return!l||typeof l!="string"||(0,i.default)(l,function(o,u){o&&u&&(p[(0,r.camelCase)(o,h)]=u)}),p}return s.default=s,Ll=s,Ll}var LL=DL();const jL=xg(LL),o2=a2("end"),fv=a2("start");function a2(e){return i;function i(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function ML(e){const i=fv(e),r=o2(e);if(i&&r)return{start:i,end:r}}function Pl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yb(e.position):"start"in e||"end"in e?yb(e):"line"in e||"column"in e?Jm(e):""}function Jm(e){return bb(e&&e.line)+":"+bb(e&&e.column)}function yb(e){return Jm(e&&e.start)+"-"+Jm(e&&e.end)}function bb(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(i,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let l="",h={},p=!1;if(r&&("line"in r&&"column"in r?h={place:r}:"start"in r&&"end"in r?h={place:r}:"type"in r?h={ancestors:[r],place:r.position}:h={...r}),typeof i=="string"?l=i:!h.cause&&i&&(p=!0,l=i.message,h.cause=i),!h.ruleId&&!h.source&&typeof s=="string"){const u=s.indexOf(":");u===-1?h.ruleId=s:(h.source=s.slice(0,u),h.ruleId=s.slice(u+1))}if(!h.place&&h.ancestors&&h.ancestors){const u=h.ancestors[h.ancestors.length-1];u&&(h.place=u.position)}const o=h.place&&"start"in h.place?h.place.start:h.place;this.ancestors=h.ancestors||void 0,this.cause=h.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=o?o.line:void 0,this.name=Pl(h.place)||"1:1",this.place=h.place||void 0,this.reason=this.message,this.ruleId=h.ruleId||void 0,this.source=h.source||void 0,this.stack=p&&h.cause&&typeof h.cause.stack=="string"?h.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const pv={}.hasOwnProperty,NL=new Map,OL=/[A-Z]/g,BL=new Set(["table","tbody","thead","tfoot","tr"]),PL=new Set(["td","th"]),l2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zL(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=i.filePath||void 0;let s;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=WL(r,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=VL(r,i.jsx,i.jsxs)}const l={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:s,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?dv:kL,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},h=c2(l,e,void 0);return h&&typeof h!="string"?h:l.create(e,l.Fragment,{children:h||void 0},void 0)}function c2(e,i,r){if(i.type==="element")return IL(e,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return HL(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return UL(e,i,r);if(i.type==="mdxjsEsm")return FL(e,i);if(i.type==="root")return $L(e,i,r);if(i.type==="text")return qL(e,i)}function IL(e,i,r){const s=e.schema;let l=s;i.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=dv,e.schema=l),e.ancestors.push(i);const h=h2(e,i.tagName,!1),p=GL(e,i);let o=gv(e,i);return BL.has(i.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!mL(u):!0})),u2(e,p,h,i),mv(p,o),e.ancestors.pop(),e.schema=s,e.create(i,h,p,r)}function HL(e,i){if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Vl(e,i.position)}function FL(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Vl(e,i.position)}function UL(e,i,r){const s=e.schema;let l=s;i.name==="svg"&&s.space==="html"&&(l=dv,e.schema=l),e.ancestors.push(i);const h=i.name===null?e.Fragment:h2(e,i.name,!0),p=YL(e,i),o=gv(e,i);return u2(e,p,h,i),mv(p,o),e.ancestors.pop(),e.schema=s,e.create(i,h,p,r)}function $L(e,i,r){const s={};return mv(s,gv(e,i)),e.create(i,e.Fragment,s,r)}function qL(e,i){return i.value}function u2(e,i,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(i.node=s)}function mv(e,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(e.children=r)}}function VL(e,i,r){return s;function s(l,h,p,o){const d=Array.isArray(p.children)?r:i;return o?d(h,p,o):d(h,p)}}function WL(e,i){return r;function r(s,l,h,p){const o=Array.isArray(h.children),u=fv(s);return i(l,h,p,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function GL(e,i){const r={};let s,l;for(l in i.properties)if(l!=="children"&&pv.call(i.properties,l)){const h=KL(e,l,i.properties[l]);if(h){const[p,o]=h;e.tableCellAlignToStyle&&p==="align"&&typeof o=="string"&&PL.has(i.tagName)?s=o:r[p]=o}}if(s){const h=r.style||(r.style={});h[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function YL(e,i){const r={};for(const s of i.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const h=s.data.estree.body[0];h.type;const p=h.expression;p.type;const o=p.properties[0];o.type,Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else Vl(e,i.position);else{const l=s.name;let h;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const o=s.value.data.estree.body[0];o.type,h=e.evaluater.evaluateExpression(o.expression)}else Vl(e,i.position);else h=s.value===null?!0:s.value;r[l]=h}return r}function gv(e,i){const r=[];let s=-1;const l=e.passKeys?new Map:NL;for(;++s<i.children.length;){const h=i.children[s];let p;if(e.passKeys){const u=h.type==="element"?h.tagName:h.type==="mdxJsxFlowElement"||h.type==="mdxJsxTextElement"?h.name:void 0;if(u){const d=l.get(u)||0;p=u+"-"+d,l.set(u,d+1)}}const o=c2(e,h,p);o!==void 0&&r.push(o)}return r}function KL(e,i,r){const s=wL(e.schema,i);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?uL(r):EL(r)),s.property==="style"){let l=typeof r=="object"?r:XL(e,String(r));return e.stylePropertyNameCase==="css"&&(l=QL(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?xL[s.property]||s.property:s.attribute,r]}}function XL(e,i){try{return jL(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,l=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=l2+"#cannot-parse-style-attribute",l}}function h2(e,i,r){let s;if(!r)s={type:"Literal",value:i};else if(i.includes(".")){const l=i.split(".");let h=-1,p;for(;++h<l.length;){const o=db(l[h])?{type:"Identifier",name:l[h]}:{type:"Literal",value:l[h]};p=p?{type:"MemberExpression",object:p,property:o,computed:!!(h&&o.type==="Literal"),optional:!1}:o}s=p}else s=db(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(s.type==="Literal"){const l=s.value;return pv.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);Vl(e)}function Vl(e,i){const r=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=l2+"#cannot-handle-mdx-estrees-without-createevaluater",r}function QL(e){const i={};let r;for(r in e)pv.call(e,r)&&(i[ZL(r)]=e[r]);return i}function ZL(e){let i=e.replace(OL,JL);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function JL(e){return"-"+e.toLowerCase()}const rm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ej={};function vv(e,i){const r=ej,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return d2(e,s,l)}function d2(e,i,r){if(tj(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return wb(e.children,i,r)}return Array.isArray(e)?wb(e,i,r):""}function wb(e,i,r){const s=[];let l=-1;for(;++l<e.length;)s[l]=d2(e[l],i,r);return s.join("")}function tj(e){return!!(e&&typeof e=="object")}const Sb=document.createElement("i");function _v(e){const i="&"+e+";";Sb.innerHTML=i;const r=Sb.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===i?!1:r}function Ei(e,i,r,s){const l=e.length;let h=0,p;if(i<0?i=-i>l?0:l+i:i=i>l?l:i,r=r>0?r:0,s.length<1e4)p=Array.from(s),p.unshift(i,r),e.splice(...p);else for(r&&e.splice(i,r);h<s.length;)p=s.slice(h,h+1e4),p.unshift(i,0),e.splice(...p),h+=1e4,i+=1e4}function fi(e,i){return e.length>0?(Ei(e,e.length,0,i),e):i}const Cb={}.hasOwnProperty;function f2(e){const i={};let r=-1;for(;++r<e.length;)nj(i,e[r]);return i}function nj(e,i){let r;for(r in i){const l=(Cb.call(e,r)?e[r]:void 0)||(e[r]={}),h=i[r];let p;if(h)for(p in h){Cb.call(l,p)||(l[p]=[]);const o=h[p];ij(l[p],Array.isArray(o)?o:o?[o]:[])}}}function ij(e,i){let r=-1;const s=[];for(;++r<i.length;)(i[r].add==="after"?e:s).push(i[r]);Ei(e,0,0,s)}function p2(e,i){const r=Number.parseInt(e,i);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ti(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=ys(/[A-Za-z]/),_n=ys(/[\dA-Za-z]/),rj=ys(/[#-'*+\--9=?A-Z^-~]/);function _h(e){return e!==null&&(e<32||e===127)}const eg=ys(/\d/),sj=ys(/[\dA-Fa-f]/),m2=ys(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function St(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const Yh=ys(new RegExp("\\p{P}|\\p{S}","u")),ro=ys(/\s/);function ys(e){return i;function i(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ja(e){const i=[];let r=-1,s=0,l=0;for(;++r<e.length;){const h=e.charCodeAt(r);let p="";if(h===37&&_n(e.charCodeAt(r+1))&&_n(e.charCodeAt(r+2)))l=2;else if(h<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(h))||(p=String.fromCharCode(h));else if(h>55295&&h<57344){const o=e.charCodeAt(r+1);h<56320&&o>56319&&o<57344?(p=String.fromCharCode(h,o),l=1):p="�"}else p=String.fromCharCode(h);p&&(i.push(e.slice(s,r),encodeURIComponent(p)),s=r+l+1,p=""),l&&(r+=l,l=0)}return i.join("")+e.slice(s)}function lt(e,i,r,s){const l=s?s-1:1/0;let h=0;return p;function p(u){return Ze(u)?(e.enter(r),o(u)):i(u)}function o(u){return Ze(u)&&h++<l?(e.consume(u),o):(e.exit(r),i(u))}}function g2(e,i,r,s,l,h){let p=0;return o;function o(v){return Ze(v)?(e.enter(s),u(v)):d(v)}function u(v){return Ze(v)&&p<h?(e.consume(v),p++,u):(e.exit(s),d(v))}function d(v){return p>=l?i(v):r(v)}}const oj={tokenize:aj};function aj(e){const i=e.attempt(this.parser.constructs.contentInitial,s,l);let r;return i;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),lt(e,i,"linePrefix")}function l(o){return e.enter("paragraph"),h(o)}function h(o){const u=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,p(o)}function p(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Oe(o)?(e.consume(o),e.exit("chunkText"),h):(e.consume(o),p)}}let xh=class{constructor(){this.index=new Map,this.map=[]}add(i,r,s){kb(this,i,r,s,!1)}addBefore(i,r,s){kb(this,i,r,s,!0)}consume(i){if(this.map.sort(function(h,p){return h[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const h of l)i.push(h);l=s.pop()}this.map.length=0,this.index.clear()}};function kb(e,i,r,s,l){if(r===0&&s.length===0)return;const h=e.index.get(i);if(h){h[1]+=r,l?(s.push(...h[2]),h[2]=s):h[2].push(...s);return}const p=[i,r,s];e.map.push(p),e.index.set(i,p)}const lj={tokenize:cj},Eb={tokenize:uj};function cj(e){const i=this,r=[];let s=0,l,h,p;return o;function o(w){if(s<r.length){const T=r[s];return i.containerState=T[1],e.attempt(T[0].continuation,u,d)(w)}return d(w)}function u(w){if(s++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,l&&S();const T=i.events.length;let D=T,R;for(;D--;)if(i.events[D][0]==="exit"&&i.events[D][1].type==="chunkFlow"){R=i.events[D][1].end;break}b(s);let L=T;for(;L<i.events.length;)i.events[L][1].end={...R},L++;const A=new xh;return A.add(D+1,0,i.events.slice(T)),A.add(T,L-T,[]),A.consume(i.events),d(w)}return o(w)}function d(w){if(s===r.length){if(!l)return _(w);if(l.currentConstruct&&l.currentConstruct.concrete)return C(w);i.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Eb,v,c)(w)}function v(w){return l&&S(),b(s),_(w)}function c(w){return i.parser.lazy[i.now().line]=s!==r.length,p=i.now().offset,C(w)}function _(w){return i.containerState={},e.attempt(Eb,x,C)(w)}function x(w){return s++,r.push([i.currentConstruct,i.containerState]),_(w)}function C(w){if(w===null){l&&S(),b(0),e.consume(w);return}return l=l||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:h}),y(w)}function y(w){if(w===null){g(e.exit("chunkFlow"),!0),b(0),e.consume(w);return}return Oe(w)?(e.consume(w),g(e.exit("chunkFlow")),s=0,i.interrupt=void 0,o):(e.consume(w),y)}function g(w,T){const D=i.sliceStream(w);if(T&&D.push(null),w.previous=h,h&&(h.next=w),h=w,l.defineSkip(w.start),l.write(D),i.parser.lazy[w.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<p&&(!l.events[R][1].end||l.events[R][1].end.offset>p))return;const L=i.events.length;let A=L,M,j;for(;A--;)if(i.events[A][0]==="exit"&&i.events[A][1].type==="chunkFlow"){if(M){j=i.events[A][1].end;break}M=!0}for(b(s),R=L;R<i.events.length;)i.events[R][1].end={...j},R++;const z=new xh;z.add(A+1,0,i.events.slice(L)),z.add(L,R-L,[]),z.consume(i.events)}}function b(w){let T=r.length;for(;T-- >w;){const D=r[T];i.containerState=D[1],D[0].exit.call(i,e)}r.length=w}function S(){l.write([null]),h=void 0,l=void 0,i.containerState._closeFlow=void 0}}function uj(e,i,r){return lt(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ms(e){if(e===null||St(e)||ro(e))return 1;if(Yh(e))return 2}function Kh(e,i,r){const s=[];let l=-1;for(;++l<e.length;){const h=e[l].resolveAll;h&&!s.includes(h)&&(i=h(i,r),s.push(h))}return i}const tg={name:"attention",resolveAll:hj,tokenize:dj};function hj(e,i){let r=-1,s;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){let l=r;for(;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&i.sliceSerialize(e[l][1]).charCodeAt(0)===i.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;const h=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1,p={...e[l][1].end},o={...e[r][1].start};Tb(p,-h),Tb(o,h);const u={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[l][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:o},v={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},c={type:h>1?"strong":"emphasis",start:{...u.start},end:{...d.end}};e[l][1].end={...u.start},e[r][1].start={...d.end},s=[],e[l][1].end.offset-e[l][1].start.offset&&(s=fi(s,[["enter",e[l][1],i],["exit",e[l][1],i]])),s=fi(s,[["enter",c,i],["enter",u,i],["exit",u,i],["enter",v,i]]),s=fi(s,Kh(i.parser.constructs.insideSpan.null,e.slice(l+1,r),i)),s=fi(s,[["exit",v,i],["enter",d,i],["exit",d,i],["exit",c,i]]);let _=0;e[r][1].end.offset-e[r][1].start.offset&&(_=2,s=fi(s,[["enter",e[r][1],i],["exit",e[r][1],i]])),Ei(e,l-1,r-l+3,s),r=l+s.length-_-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function dj(e,i){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,l=ms(s);let h;return p;function p(u){return h=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===h)return e.consume(u),o;const d=e.exit("attentionSequence"),v=ms(u),c=!v||v===2&&l||r.includes(u)&&u!==42&&u!==95,_=!l||l===2&&v||r.includes(s)&&s!==42&&s!==95;return d._open=!!(h===42?c:c&&(l||!_)),d._close=!!(h===42?_:_&&(v||!c)),i(u)}}function Tb(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const fj={name:"autolink",tokenize:pj};function pj(e,i,r){let s=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),h}function h(x){return vn(x)?(e.consume(x),p):x===64?r(x):d(x)}function p(x){return x===43||x===45||x===46||_n(x)?(s=1,o(x)):d(x)}function o(x){return x===58?(e.consume(x),s=0,u):(x===43||x===45||x===46||_n(x))&&s++<32?(e.consume(x),o):(s=0,d(x))}function u(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):x===null||x===32||x===60||_h(x)?r(x):(e.consume(x),u)}function d(x){return x===64?(e.consume(x),v):rj(x)?(e.consume(x),d):r(x)}function v(x){return _n(x)?c(x):r(x)}function c(x){return x===46?(e.consume(x),s=0,v):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):_(x)}function _(x){if((x===45||_n(x))&&s++<63){const C=x===45?_:c;return e.consume(x),C}return r(x)}}const ac={partial:!0,tokenize:mj};function mj(e,i,r){return s;function s(h){return Ze(h)?lt(e,l,"linePrefix")(h):l(h)}function l(h){return h===null||Oe(h)?i(h):r(h)}}const v2={continuation:{tokenize:vj},exit:_j,name:"blockQuote",tokenize:gj};function gj(e,i,r){const s=this;return l;function l(p){if(p===62){const o=s.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(p),e.exit("blockQuoteMarker"),h}return r(p)}function h(p){return Ze(p)?(e.enter("blockQuotePrefixWhitespace"),e.consume(p),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(p))}}function vj(e,i,r){const s=this;return l;function l(p){return Ze(p)?lt(e,h,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p):h(p)}function h(p){return e.attempt(v2,i,r)(p)}}function _j(e){e.exit("blockQuote")}const _2={name:"characterEscape",tokenize:xj};function xj(e,i,r){return s;function s(h){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(h),e.exit("escapeMarker"),l}function l(h){return m2(h)?(e.enter("characterEscapeValue"),e.consume(h),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(h)}}const x2={name:"characterReference",tokenize:yj};function yj(e,i,r){const s=this;let l=0,h,p;return o;function o(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),h=31,p=_n,v(c))}function d(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),h=6,p=sj,v):(e.enter("characterReferenceValue"),h=7,p=eg,v(c))}function v(c){if(c===59&&l){const _=e.exit("characterReferenceValue");return p===_n&&!_v(s.sliceSerialize(_))?r(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return p(c)&&l++<h?(e.consume(c),v):r(c)}}const ng={partial:!0,tokenize:bj};function bj(e,i,r){const s=this;return l;function l(p){return p===null?r(p):(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h)}function h(p){return s.parser.lazy[s.now().line]?r(p):i(p)}}const Rb={concrete:!0,name:"codeFenced",tokenize:wj};function wj(e,i,r){const s=this,l={partial:!0,tokenize:D};let h=0,p=0,o;return u;function u(R){return d(R)}function d(R){const L=s.events[s.events.length-1];return h=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,o=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),v(R)}function v(R){return R===o?(p++,e.consume(R),v):p<3?r(R):(e.exit("codeFencedFenceSequence"),Ze(R)?lt(e,c,"whitespace")(R):c(R))}function c(R){return R===null||Oe(R)?(e.exit("codeFencedFence"),s.interrupt?i(R):e.check(ng,y,T)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(R))}function _(R){return R===null||Oe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(R)):Ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lt(e,x,"whitespace")(R)):R===96&&R===o?r(R):(e.consume(R),_)}function x(R){return R===null||Oe(R)?c(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(R))}function C(R){return R===null||Oe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(R)):R===96&&R===o?r(R):(e.consume(R),C)}function y(R){return e.attempt(l,T,g)(R)}function g(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),b}function b(R){return h>0&&Ze(R)?lt(e,S,"linePrefix",h+1)(R):S(R)}function S(R){return R===null||Oe(R)?e.check(ng,y,T)(R):(e.enter("codeFlowValue"),w(R))}function w(R){return R===null||Oe(R)?(e.exit("codeFlowValue"),S(R)):(e.consume(R),w)}function T(R){return e.exit("codeFenced"),i(R)}function D(R,L,A){let M=0;return j;function j(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),z}function z(W){return R.enter("codeFencedFence"),Ze(W)?lt(R,P,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):P(W)}function P(W){return W===o?(R.enter("codeFencedFenceSequence"),H(W)):A(W)}function H(W){return W===o?(M++,R.consume(W),H):M>=p?(R.exit("codeFencedFenceSequence"),Ze(W)?lt(R,F,"whitespace")(W):F(W)):A(W)}function F(W){return W===null||Oe(W)?(R.exit("codeFencedFence"),L(W)):A(W)}}}const sm={name:"codeIndented",tokenize:Cj},Sj={partial:!0,tokenize:kj};function Cj(e,i,r){return s;function s(o){return e.enter("codeIndented"),g2(e,l,r,"linePrefix",4,4)(o)}function l(o){return o===null?p(o):Oe(o)?e.attempt(Sj,l,p)(o):(e.enter("codeFlowValue"),h(o))}function h(o){return o===null||Oe(o)?(e.exit("codeFlowValue"),l(o)):(e.consume(o),h)}function p(o){return e.exit("codeIndented"),i(o)}}function kj(e,i,r){const s=this;return l;function l(p){return s.parser.lazy[s.now().line]?r(p):Oe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):g2(e,i,h,"linePrefix",4,4)(p)}function h(p){return Oe(p)?l(p):r(p)}}const Ej={name:"codeText",previous:Rj,resolve:Tj,tokenize:Aj};function Tj(e){let i=e.length-4,r=3,s,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(s=r;++s<i;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[i][1].type="codeTextPadding",r+=2,i-=2;break}}for(s=r-1,i++;++s<=i;)l===void 0?s!==i&&e[s][1].type!=="lineEnding"&&(l=s):(s===i||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),i-=s-l-2,s=l+2),l=void 0);return e}function Rj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Aj(e,i,r){let s=0,l,h;return p;function p(c){return e.enter("codeText"),e.enter("codeTextSequence"),o(c)}function o(c){return c===96?(e.consume(c),s++,o):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?r(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(h=e.enter("codeTextSequence"),l=0,v(c)):Oe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(c))}function d(c){return c===null||c===32||c===96||Oe(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),d)}function v(c){return c===96?(e.consume(c),l++,v):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),i(c)):(h.type="codeTextData",d(c))}}class Dj{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(i,s):i>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(i,r,s){const l=r||0;this.setCursor(Math.trunc(i));const h=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&jl(this.left,s),h.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),jl(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),jl(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const r=this.left.splice(i,Number.POSITIVE_INFINITY);jl(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);jl(this.left,r.reverse())}}}function jl(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function y2(e){const i={};let r=-1,s,l,h,p,o,u,d;const v=new Dj(e);for(;++r<v.length;){for(;r in i;)r=i[r];if(s=v.get(r),r&&s[1].type==="chunkFlow"&&v.get(r-1)[1].type==="listItemPrefix"&&(u=s[1]._tokenizer.events,h=0,h<u.length&&u[h][1].type==="lineEndingBlank"&&(h+=2),h<u.length&&u[h][1].type==="content"))for(;++h<u.length&&u[h][1].type!=="content";)u[h][1].type==="chunkText"&&(u[h][1]._isInFirstContentOfListItem=!0,h++);if(s[0]==="enter")s[1].contentType&&(Object.assign(i,Lj(v,r)),r=i[r],d=!0);else if(s[1]._container){for(h=r,l=void 0;h--;)if(p=v.get(h),p[1].type==="lineEnding"||p[1].type==="lineEndingBlank")p[0]==="enter"&&(l&&(v.get(l)[1].type="lineEndingBlank"),p[1].type="lineEnding",l=h);else if(!(p[1].type==="linePrefix"||p[1].type==="listItemIndent"))break;l&&(s[1].end={...v.get(l)[1].start},o=v.slice(l,r),o.unshift(s),v.splice(l,r-l+1,o))}}return Ei(e,0,Number.POSITIVE_INFINITY,v.slice(0)),!d}function Lj(e,i){const r=e.get(i)[1],s=e.get(i)[2];let l=i-1;const h=[];let p=r._tokenizer;p||(p=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(p._contentTypeTextTrailing=!0));const o=p.events,u=[],d={};let v,c,_=-1,x=r,C=0,y=0;const g=[y];for(;x;){for(;e.get(++l)[1]!==x;);h.push(l),x._tokenizer||(v=s.sliceStream(x),x.next||v.push(null),c&&p.defineSkip(x.start),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=!0),p.write(v),x._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=void 0)),c=x,x=x.next}for(x=r;++_<o.length;)o[_][0]==="exit"&&o[_-1][0]==="enter"&&o[_][1].type===o[_-1][1].type&&o[_][1].start.line!==o[_][1].end.line&&(y=_+1,g.push(y),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(p.events=[],x?(x._tokenizer=void 0,x.previous=void 0):g.pop(),_=g.length;_--;){const b=o.slice(g[_],g[_+1]),S=h.pop();u.push([S,S+b.length-1]),e.splice(S,2,b)}for(u.reverse(),_=-1;++_<u.length;)d[C+u[_][0]]=C+u[_][1],C+=u[_][1]-u[_][0]-1;return d}const jj={resolve:Nj,tokenize:Oj},Mj={partial:!0,tokenize:Bj};function Nj(e){return y2(e),e}function Oj(e,i){let r;return s;function s(o){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(o)}function l(o){return o===null?h(o):Oe(o)?e.check(Mj,p,h)(o):(e.consume(o),l)}function h(o){return e.exit("chunkContent"),e.exit("content"),i(o)}function p(o){return e.consume(o),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function Bj(e,i,r){const s=this;return l;function l(p){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),lt(e,h,"linePrefix")}function h(p){if(p===null||Oe(p))return r(p);const o=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?i(p):e.interrupt(s.parser.constructs.flow,r,i)(p)}}function b2(e,i,r,s,l,h,p,o,u){const d=u||Number.POSITIVE_INFINITY;let v=0;return c;function c(b){return b===60?(e.enter(s),e.enter(l),e.enter(h),e.consume(b),e.exit(h),_):b===null||b===32||b===41||_h(b)?r(b):(e.enter(s),e.enter(p),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(b))}function _(b){return b===62?(e.enter(h),e.consume(b),e.exit(h),e.exit(l),e.exit(s),i):(e.enter(o),e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===62?(e.exit("chunkString"),e.exit(o),_(b)):b===null||b===60||Oe(b)?r(b):(e.consume(b),b===92?C:x)}function C(b){return b===60||b===62||b===92?(e.consume(b),x):x(b)}function y(b){return!v&&(b===null||b===41||St(b))?(e.exit("chunkString"),e.exit(o),e.exit(p),e.exit(s),i(b)):v<d&&b===40?(e.consume(b),v++,y):b===41?(e.consume(b),v--,y):b===null||b===32||b===40||_h(b)?r(b):(e.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function w2(e,i,r,s,l,h){const p=this;let o=0,u;return d;function d(x){return e.enter(s),e.enter(l),e.consume(x),e.exit(l),e.enter(h),v}function v(x){return o>999||x===null||x===91||x===93&&!u||x===94&&!o&&"_hiddenFootnoteSupport"in p.parser.constructs?r(x):x===93?(e.exit(h),e.enter(l),e.consume(x),e.exit(l),e.exit(s),i):Oe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),v):(e.enter("chunkString",{contentType:"string"}),c(x))}function c(x){return x===null||x===91||x===93||Oe(x)||o++>999?(e.exit("chunkString"),v(x)):(e.consume(x),u||(u=!Ze(x)),x===92?_:c)}function _(x){return x===91||x===92||x===93?(e.consume(x),o++,c):c(x)}}function S2(e,i,r,s,l,h){let p;return o;function o(_){return _===34||_===39||_===40?(e.enter(s),e.enter(l),e.consume(_),e.exit(l),p=_===40?41:_,u):r(_)}function u(_){return _===p?(e.enter(l),e.consume(_),e.exit(l),e.exit(s),i):(e.enter(h),d(_))}function d(_){return _===p?(e.exit(h),u(p)):_===null?r(_):Oe(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===p||_===null||Oe(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?c:v)}function c(_){return _===p||_===92?(e.consume(_),v):v(_)}}function zl(e,i){let r;return s;function s(l){return Oe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,s):Ze(l)?lt(e,s,r?"linePrefix":"lineSuffix")(l):i(l)}}const Pj={name:"definition",tokenize:Ij},zj={partial:!0,tokenize:Hj};function Ij(e,i,r){const s=this;let l;return h;function h(x){return e.enter("definition"),p(x)}function p(x){return w2.call(s,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function o(x){return l=Ti(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),u):r(x)}function u(x){return St(x)?zl(e,d)(x):d(x)}function d(x){return b2(e,v,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function v(x){return e.attempt(zj,c,c)(x)}function c(x){return Ze(x)?lt(e,_,"whitespace")(x):_(x)}function _(x){return x===null||Oe(x)?(e.exit("definition"),s.parser.defined.push(l),i(x)):r(x)}}function Hj(e,i,r){return s;function s(o){return St(o)?zl(e,l)(o):r(o)}function l(o){return S2(e,h,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function h(o){return Ze(o)?lt(e,p,"whitespace")(o):p(o)}function p(o){return o===null||Oe(o)?i(o):r(o)}}const Fj={name:"hardBreakEscape",tokenize:Uj};function Uj(e,i,r){return s;function s(h){return e.enter("hardBreakEscape"),e.consume(h),l}function l(h){return Oe(h)?(e.exit("hardBreakEscape"),i(h)):r(h)}}const $j={name:"headingAtx",resolve:qj,tokenize:Vj};function qj(e,i){let r=e.length-2,s=3;if(e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s){const l={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},h={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"};Ei(e,s,r-s+1,[["enter",l,i],["enter",h,i],["exit",h,i],["exit",l,i]])}return e}function Vj(e,i,r){let s=0;return l;function l(v){return e.enter("atxHeading"),h(v)}function h(v){return e.enter("atxHeadingSequence"),p(v)}function p(v){return v===35&&s++<6?(e.consume(v),p):v===null||St(v)?(e.exit("atxHeadingSequence"),o(v)):r(v)}function o(v){return v===35?(e.enter("atxHeadingSequence"),u(v)):v===null||Oe(v)?(e.exit("atxHeading"),i(v)):Ze(v)?lt(e,o,"whitespace")(v):(e.enter("atxHeadingText"),d(v))}function u(v){return v===35?(e.consume(v),u):(e.exit("atxHeadingSequence"),o(v))}function d(v){return v===null||v===35||St(v)?(e.exit("atxHeadingText"),o(v)):(e.consume(v),d)}}const C2=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ig=["pre","script","style","textarea"],Wj={concrete:!0,name:"htmlFlow",resolveTo:Yj,tokenize:Kj},Gj={partial:!0,tokenize:Xj};function Yj(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function Kj(e,i,r){const s=this;let l,h,p,o,u;return d;function d(U){return v(U)}function v(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),c}function c(U){return U===33?(e.consume(U),_):U===47?(e.consume(U),h=!0,y):U===63?(e.consume(U),l=3,s.interrupt?i:O):vn(U)?(e.consume(U),p=String.fromCharCode(U),g):r(U)}function _(U){return U===45?(e.consume(U),l=2,x):U===91?(e.consume(U),l=5,o=0,C):vn(U)?(e.consume(U),l=4,s.interrupt?i:O):r(U)}function x(U){return U===45?(e.consume(U),s.interrupt?i:O):r(U)}function C(U){const V="CDATA[";return U===V.charCodeAt(o++)?(e.consume(U),o===V.length?s.interrupt?i:P:C):r(U)}function y(U){return vn(U)?(e.consume(U),p=String.fromCharCode(U),g):r(U)}function g(U){if(U===null||U===47||U===62||St(U)){const V=U===47,ne=p.toLowerCase();return!V&&!h&&ig.includes(ne)?(l=1,s.interrupt?i(U):P(U)):C2.includes(p.toLowerCase())?(l=6,V?(e.consume(U),b):s.interrupt?i(U):P(U)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(U):h?S(U):w(U))}return U===45||_n(U)?(e.consume(U),p+=String.fromCharCode(U),g):r(U)}function b(U){return U===62?(e.consume(U),s.interrupt?i:P):r(U)}function S(U){return Ze(U)?(e.consume(U),S):j(U)}function w(U){return U===47?(e.consume(U),j):U===58||U===95||vn(U)?(e.consume(U),T):Ze(U)?(e.consume(U),w):j(U)}function T(U){return U===45||U===46||U===58||U===95||_n(U)?(e.consume(U),T):D(U)}function D(U){return U===61?(e.consume(U),R):Ze(U)?(e.consume(U),D):w(U)}function R(U){return U===null||U===60||U===61||U===62||U===96?r(U):U===34||U===39?(e.consume(U),u=U,L):Ze(U)?(e.consume(U),R):A(U)}function L(U){return U===u?(e.consume(U),u=null,M):U===null||Oe(U)?r(U):(e.consume(U),L)}function A(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||St(U)?D(U):(e.consume(U),A)}function M(U){return U===47||U===62||Ze(U)?w(U):r(U)}function j(U){return U===62?(e.consume(U),z):r(U)}function z(U){return U===null||Oe(U)?P(U):Ze(U)?(e.consume(U),z):r(U)}function P(U){return U===45&&l===2?(e.consume(U),G):U===60&&l===1?(e.consume(U),Q):U===62&&l===4?(e.consume(U),Y):U===63&&l===3?(e.consume(U),O):U===93&&l===5?(e.consume(U),I):Oe(U)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(Gj,Z,H)(U)):U===null||Oe(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),P)}function H(U){return e.check(ng,F,Z)(U)}function F(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),W}function W(U){return U===null||Oe(U)?H(U):(e.enter("htmlFlowData"),P(U))}function G(U){return U===45?(e.consume(U),O):P(U)}function Q(U){return U===47?(e.consume(U),p="",X):P(U)}function X(U){if(U===62){const V=p.toLowerCase();return ig.includes(V)?(e.consume(U),Y):P(U)}return vn(U)&&p.length<8?(e.consume(U),p+=String.fromCharCode(U),X):P(U)}function I(U){return U===93?(e.consume(U),O):P(U)}function O(U){return U===62?(e.consume(U),Y):U===45&&l===2?(e.consume(U),O):P(U)}function Y(U){return U===null||Oe(U)?(e.exit("htmlFlowData"),Z(U)):(e.consume(U),Y)}function Z(U){return e.exit("htmlFlow"),i(U)}}function Xj(e,i,r){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(ac,i,r)}}const Qj={name:"htmlText",tokenize:Zj};function Zj(e,i,r){const s=this;let l,h,p;return o;function o(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),u}function u(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),D):O===63?(e.consume(O),w):vn(O)?(e.consume(O),A):r(O)}function d(O){return O===45?(e.consume(O),v):O===91?(e.consume(O),h=0,C):vn(O)?(e.consume(O),S):r(O)}function v(O){return O===45?(e.consume(O),x):r(O)}function c(O){return O===null?r(O):O===45?(e.consume(O),_):Oe(O)?(p=c,Q(O)):(e.consume(O),c)}function _(O){return O===45?(e.consume(O),x):c(O)}function x(O){return O===62?G(O):O===45?_(O):c(O)}function C(O){const Y="CDATA[";return O===Y.charCodeAt(h++)?(e.consume(O),h===Y.length?y:C):r(O)}function y(O){return O===null?r(O):O===93?(e.consume(O),g):Oe(O)?(p=y,Q(O)):(e.consume(O),y)}function g(O){return O===93?(e.consume(O),b):y(O)}function b(O){return O===62?G(O):O===93?(e.consume(O),b):y(O)}function S(O){return O===null||O===62?G(O):Oe(O)?(p=S,Q(O)):(e.consume(O),S)}function w(O){return O===null?r(O):O===63?(e.consume(O),T):Oe(O)?(p=w,Q(O)):(e.consume(O),w)}function T(O){return O===62?G(O):w(O)}function D(O){return vn(O)?(e.consume(O),R):r(O)}function R(O){return O===45||_n(O)?(e.consume(O),R):L(O)}function L(O){return Oe(O)?(p=L,Q(O)):Ze(O)?(e.consume(O),L):G(O)}function A(O){return O===45||_n(O)?(e.consume(O),A):O===47||O===62||St(O)?M(O):r(O)}function M(O){return O===47?(e.consume(O),G):O===58||O===95||vn(O)?(e.consume(O),j):Oe(O)?(p=M,Q(O)):Ze(O)?(e.consume(O),M):G(O)}function j(O){return O===45||O===46||O===58||O===95||_n(O)?(e.consume(O),j):z(O)}function z(O){return O===61?(e.consume(O),P):Oe(O)?(p=z,Q(O)):Ze(O)?(e.consume(O),z):M(O)}function P(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),l=O,H):Oe(O)?(p=P,Q(O)):Ze(O)?(e.consume(O),P):(e.consume(O),F)}function H(O){return O===l?(e.consume(O),l=void 0,W):O===null?r(O):Oe(O)?(p=H,Q(O)):(e.consume(O),H)}function F(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||St(O)?M(O):(e.consume(O),F)}function W(O){return O===47||O===62||St(O)?M(O):r(O)}function G(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):r(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),X}function X(O){return Ze(O)?lt(e,I,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):I(O)}function I(O){return e.enter("htmlTextData"),p(O)}}const xv={name:"labelEnd",resolveAll:nM,resolveTo:iM,tokenize:rM},Jj={tokenize:sM},eM={tokenize:oM},tM={tokenize:aM};function nM(e){let i=-1;const r=[];for(;++i<e.length;){const s=e[i][1];if(r.push(e[i]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",i+=l}}return e.length!==r.length&&Ei(e,0,e.length,r),e}function iM(e,i){let r=e.length,s=0,l,h,p;for(;r--;){const v=e[r][1];if(l){if(v.type==="link"||v.type==="labelLink"&&v._inactive)break;e[r][0]==="enter"&&v.type==="labelLink"&&(v._inactive=!0)}else if(h){if(e[r][0]==="enter"&&(v.type==="labelImage"||v.type==="labelLink")&&!v._balanced&&(l=r,v.type!=="labelLink")){s=2;break}}else v.type==="labelEnd"&&(h=r)}const o={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[h][1].end}},d={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[h-2][1].start}};return p=[["enter",o,i],["enter",u,i]],p=fi(p,e.slice(l+1,l+s+3)),p=fi(p,[["enter",d,i]]),p=fi(p,Kh(i.parser.constructs.insideSpan.null,e.slice(l+s+4,h-3),i)),p=fi(p,[["exit",d,i],e[h-2],e[h-1],["exit",u,i]]),p=fi(p,e.slice(h+1)),p=fi(p,[["exit",o,i]]),Ei(e,l,e.length,p),e}function rM(e,i,r){const s=this,l=s._labelStarts;let h,p;if(l){for(;l.length>0&&l[l.length-1]._balanced;)l.pop();h=l[l.length-1]}return o;function o(_){return h?h._inactive?c(_):(p=s.parser.defined.includes(Ti(s.sliceSerialize({start:h.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),u):r(_)}function u(_){return _===40?e.attempt(Jj,v,p?v:c)(_):_===91?e.attempt(eM,v,p?d:c)(_):p?v(_):c(_)}function d(_){return e.attempt(tM,v,c)(_)}function v(_){return l.pop(),i(_)}function c(_){return h._balanced=!0,r(_)}}function sM(e,i,r){return s;function s(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),l}function l(c){return St(c)?zl(e,h)(c):h(c)}function h(c){return c===41?v(c):b2(e,p,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function p(c){return St(c)?zl(e,u)(c):v(c)}function o(c){return r(c)}function u(c){return c===34||c===39||c===40?S2(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):v(c)}function d(c){return St(c)?zl(e,v)(c):v(c)}function v(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),i):r(c)}}function oM(e,i,r){const s=this;return l;function l(o){return w2.call(s,e,h,p,"reference","referenceMarker","referenceString")(o)}function h(o){return s.parser.defined.includes(Ti(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?i(o):r(o)}function p(o){return r(o)}}function aM(e,i,r){return s;function s(h){return e.enter("reference"),e.enter("referenceMarker"),e.consume(h),e.exit("referenceMarker"),l}function l(h){return h===93?(e.enter("referenceMarker"),e.consume(h),e.exit("referenceMarker"),e.exit("reference"),i):r(h)}}const lM={name:"labelStartImage",resolveAll:xv.resolveAll,tokenize:cM};function cM(e,i,r){const s=this;let l;return h;function h(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),p}function p(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),l=e.exit("labelImage"),o):r(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(u):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(u))}}const uM={name:"labelStartLink",resolveAll:xv.resolveAll,tokenize:hM};function hM(e,i,r){const s=this;let l;return h;function h(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),l=e.exit("labelLink"),p}function p(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(o):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),i(o))}}const om={name:"lineEnding",tokenize:dM};function dM(e,i){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),lt(e,i,"linePrefix")}}const ah={name:"thematicBreak",tokenize:fM};function fM(e,i,r){let s=0,l;return h;function h(d){return e.enter("thematicBreak"),p(d)}function p(d){return l=d,o(d)}function o(d){return d===l?(e.enter("thematicBreakSequence"),u(d)):s>=3&&(d===null||Oe(d))?(e.exit("thematicBreak"),i(d)):r(d)}function u(d){return d===l?(e.consume(d),s++,u):(e.exit("thematicBreakSequence"),Ze(d)?lt(e,o,"whitespace")(d):o(d))}}const Bn={continuation:{tokenize:vM},exit:xM,name:"list",tokenize:gM},pM={partial:!0,tokenize:yM},mM={partial:!0,tokenize:_M};function gM(e,i,r){const s=this,l=s.events[s.events.length-1];let h=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,p=0;return o;function o(x){const C=s.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!s.containerState.marker||x===s.containerState.marker:eg(x)){if(s.containerState.type||(s.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(ah,r,d)(x):d(x);if(!s.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(x)}return r(x)}function u(x){return eg(x)&&++p<10?(e.consume(x),u):(!s.interrupt||p<2)&&(s.containerState.marker?x===s.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),d(x)):r(x)}function d(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||x,e.check(ac,s.interrupt?r:v,e.attempt(pM,_,c))}function v(x){return s.containerState.initialBlankLine=!0,h++,_(x)}function c(x){return Ze(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),_):r(x)}function _(x){return s.containerState.size=h+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(x)}}function vM(e,i,r){const s=this;return s.containerState._closeFlow=void 0,e.check(ac,l,h);function l(o){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,lt(e,i,"listItemIndent",s.containerState.size+1)(o)}function h(o){return s.containerState.furtherBlankLines||!Ze(o)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,p(o)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(mM,i,p)(o))}function p(o){return s.containerState._closeFlow=!0,s.interrupt=void 0,lt(e,e.attempt(Bn,i,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function _M(e,i,r){const s=this;return lt(e,l,"listItemIndent",s.containerState.size+1);function l(h){const p=s.events[s.events.length-1];return p&&p[1].type==="listItemIndent"&&p[2].sliceSerialize(p[1],!0).length===s.containerState.size?i(h):r(h)}}function xM(e){e.exit(this.containerState.type)}function yM(e,i,r){const s=this;return lt(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(h){const p=s.events[s.events.length-1];return!Ze(h)&&p&&p[1].type==="listItemPrefixWhitespace"?i(h):r(h)}}const Ab={name:"setextUnderline",resolveTo:bM,tokenize:wM};function bM(e,i){const r=new xh;let s=e.length,l,h,p;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){l=s;break}e[s][1].type==="paragraph"&&(h=s)}else e[s][1].type==="content"&&r.add(s,1,[]),!p&&e[s][1].type==="definition"&&(p=s);const o={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[h][1].type="setextHeadingText",p?(r.add(h,0,[["enter",o,i]]),r.add(p+1,0,[["exit",e[l][1],i]]),e[l][1].end={...e[p][1].end}):e[l][1]=o,r.add(e.length,0,[["exit",o,i]]),r.consume(e),e}function wM(e,i,r){const s=this;let l;return h;function h(d){let v=s.events.length,c;for(;v--;)if(s.events[v][1].type!=="lineEnding"&&s.events[v][1].type!=="linePrefix"&&s.events[v][1].type!=="content"){c=s.events[v][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||c)?(e.enter("setextHeadingLine"),l=d,p(d)):r(d)}function p(d){return e.enter("setextHeadingLineSequence"),o(d)}function o(d){return d===l?(e.consume(d),o):(e.exit("setextHeadingLineSequence"),Ze(d)?lt(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||Oe(d)?(e.exit("setextHeadingLine"),i(d)):r(d)}}const SM={tokenize:CM};function CM(e){const i=this,r=e.attempt(ac,s,e.attempt(this.parser.constructs.flowInitial,l,lt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(jj,l)),"linePrefix")));return r;function s(h){if(h===null){e.consume(h);return}return e.enter("lineEndingBlank"),e.consume(h),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r}function l(h){if(h===null){e.consume(h);return}return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),i.currentConstruct=void 0,r}}const kM={resolveAll:E2()},EM=k2("string"),TM=k2("text");function k2(e){return{resolveAll:E2(e==="text"?RM:void 0),tokenize:i};function i(r){const s=this,l=this.parser.constructs[e],h=r.attempt(l,p,o);return p;function p(v){return d(v)?h(v):o(v)}function o(v){if(v===null){r.consume(v);return}return r.enter("data"),r.consume(v),u}function u(v){return d(v)?(r.exit("data"),h(v)):(r.consume(v),u)}function d(v){if(v===null)return!0;const c=l[v];let _=-1;if(c)for(;++_<c.length;){const x=c[_];if(!x.previous||x.previous.call(s,s.previous))return!0}return!1}}}function E2(e){return i;function i(r,s){let l=-1,h;for(;++l<=r.length;)h===void 0?r[l]&&r[l][1].type==="data"&&(h=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==h+2&&(r[h][1].end=r[l-1][1].end,r.splice(h+2,l-h-2),l=h+2),h=void 0);return e?e(r,s):r}}function RM(e,i){const r=new xh;let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const l=e[s-1][1],h=i.sliceStream(l);let p=h.length,o=-1,u=0,d;for(;p--;){const v=h[p];if(typeof v=="string"){for(o=v.length;v.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(v===-2)d=!0,u++;else if(v!==-1){p++;break}}if(i._contentTypeTextTrailing&&s===e.length&&(u=0),u){const v={type:s===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:p?o:l.start._bufferIndex+o,_index:l.start._index+p,line:l.end.line,column:l.end.column-u,offset:l.end.offset-u},end:{...l.end}};l.end={...v.start},l.start.offset===l.end.offset?Object.assign(l,v):r.add(s,0,[["enter",v,i],["exit",v,i]])}s++}return r.consume(e),e}const AM={42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:v2},DM={91:Pj},LM={[-2]:sm,[-1]:sm,32:sm},jM={35:$j,42:ah,45:[Ab,ah],60:Wj,61:Ab,95:ah,96:Rb,126:Rb},MM={38:x2,92:_2},NM={[-5]:om,[-4]:om,[-3]:om,33:lM,38:x2,42:tg,60:[fj,Qj],91:uM,92:[Fj,_2],93:xv,95:tg,96:Ej},OM={null:[tg,kM]},BM={null:[42,95]},PM={null:[]},zM=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:BM,contentInitial:DM,disable:PM,document:AM,flow:jM,flowInitial:LM,insideSpan:OM,string:MM,text:NM},Symbol.toStringTag,{value:"Module"}));function IM(e,i,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},h=[];let p=[],o=[];const u={attempt:L(D),check:L(R),consume:S,enter:w,exit:T,interrupt:L(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:y,events:[],now:C,parser:e,previous:null,sliceSerialize:_,sliceStream:x,write:c};let v=i.tokenize.call(d,u);return i.resolveAll&&h.push(i),d;function c(z){return p=fi(p,z),g(),p[p.length-1]!==null?[]:(A(i,0),d.events=Kh(h,d.events,d),d.events)}function _(z,P){return FM(x(z),P)}function x(z){return HM(p,z)}function C(){const{_bufferIndex:z,_index:P,line:H,column:F,offset:W}=s;return{_bufferIndex:z,_index:P,line:H,column:F,offset:W}}function y(z){l[z.line]=z.column,j()}function g(){for(;s._index<p.length;){const z=p[s._index];if(typeof z=="string"){const P=s._index;for(s._bufferIndex<0&&(s._bufferIndex=0);s._index===P&&s._bufferIndex<z.length;)b(z.charCodeAt(s._bufferIndex))}else b(z)}}function b(z){v=v(z)}function S(z){Oe(z)?(s.line++,s.column=1,s.offset+=z===-3?2:1,j()):z!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===p[s._index].length&&(s._bufferIndex=-1,s._index++)),d.previous=z}function w(z,P){const H=P||{};return H.type=z,H.start=C(),d.events.push(["enter",H,d]),o.push(H),H}function T(z){const P=o.pop();return P.end=C(),d.events.push(["exit",P,d]),P}function D(z,P){A(z,P.from)}function R(z,P){P.restore()}function L(z,P){return H;function H(F,W,G){let Q,X,I,O;return Array.isArray(F)?Z(F):"tokenize"in F?Z([F]):Y(F);function Y(le){return K;function K($){const oe=$!==null&&le[$],ee=$!==null&&le.null,ue=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return Z(ue)($)}}function Z(le){return Q=le,X=0,le.length===0?G:U(le[X])}function U(le){return K;function K($){return O=M(),I=le,le.partial||(d.currentConstruct=le),le.name&&d.parser.constructs.disable.null.includes(le.name)?ne():le.tokenize.call(P?Object.assign(Object.create(d),P):d,u,V,ne)($)}}function V(le){return z(I,O),W}function ne(le){return O.restore(),++X<Q.length?U(Q[X]):G}}}function A(z,P){z.resolveAll&&!h.includes(z)&&h.push(z),z.resolve&&Ei(d.events,P,d.events.length-P,z.resolve(d.events.slice(P),d)),z.resolveTo&&(d.events=z.resolveTo(d.events,d))}function M(){const z=C(),P=d.previous,H=d.currentConstruct,F=d.events.length,W=Array.from(o);return{from:F,restore:G};function G(){s=z,d.previous=P,d.currentConstruct=H,d.events.length=F,o=W,j()}}function j(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function HM(e,i){const r=i.start._index,s=i.start._bufferIndex,l=i.end._index,h=i.end._bufferIndex;let p;if(r===l)p=[e[r].slice(s,h)];else{if(p=e.slice(r,l),s>-1){const o=p[0];typeof o=="string"?p[0]=o.slice(s):p.shift()}h>0&&p.push(e[l].slice(0,h))}return p}function FM(e,i){let r=-1;const s=[];let l;for(;++r<e.length;){const h=e[r];let p;if(typeof h=="string")p=h;else switch(h){case-5:{p="\r";break}case-4:{p=`
540
+ `;break}case-3:{p=`\r
541
+ `;break}case-2:{p=i?" ":" ";break}case-1:{if(!i&&l)continue;p=" ";break}default:p=String.fromCharCode(h)}l=h===-2,s.push(p)}return s.join("")}function UM(e){const s={constructs:f2([zM,...(e||{}).extensions||[]]),content:l(oj),defined:[],document:l(lj),flow:l(SM),lazy:{},string:l(EM),text:l(TM)};return s;function l(h){return p;function p(o){return IM(s,h,o)}}}function $M(e){for(;!y2(e););return e}const Db=/[\0\t\n\r]/g;function qM(){let e=1,i="",r=!0,s;return l;function l(h,p,o){h=i+(typeof h=="string"?h.toString():new TextDecoder(p||void 0).decode(h));const u=[];let d=0;for(i="",r&&(h.charCodeAt(0)===65279&&d++,r=void 0);d<h.length;){Db.lastIndex=d;const v=Db.exec(h),c=v&&v.index!==void 0?v.index:h.length,_=h.charCodeAt(c);if(!v){i=h.slice(d);break}if(_===10&&d===c&&s)u.push(-3),s=void 0;else switch(s&&(u.push(-5),s=void 0),d<c&&(u.push(h.slice(d,c)),e+=c-d),_){case 0:{u.push(65533),e++;break}case 9:{const x=Math.ceil(e/4)*4;for(u.push(-2);e++<x;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:s=!0,e=1}d=c+1}return o&&(s&&u.push(-5),i&&u.push(i),u.push(null)),u}}const VM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function WM(e){return e.replace(VM,GM)}function GM(e,i,r){if(i)return i;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),h=l===120||l===88;return p2(r.slice(h?2:1),h?16:10)}return _v(r)||e}const T2={}.hasOwnProperty;function YM(e,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),KM(r)($M(UM(r).document().write(qM()(e,i,!0))))}function KM(e){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p($e),autolinkProtocol:j,autolinkEmail:j,atxHeading:p(Ve),blockQuote:p(ue),characterEscape:j,characterReference:j,codeFenced:p(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:p(he,o),codeText:p(Se,o),codeTextData:j,data:j,codeFlowValue:j,definition:p(we),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:p(Re),hardBreakEscape:p(Ee),hardBreakTrailing:p(Ee),htmlFlow:p(Ie,o),htmlFlowData:j,htmlText:p(Ie,o),htmlTextData:j,image:p(Ot),label:o,link:p($e),listItem:p(ze),listItemValue:x,listOrdered:p(Be,_),listUnordered:p(Be),paragraph:p(Te),reference:V,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:p(Ve),strong:p(We),thematicBreak:p(ot)},exit:{atxHeading:d(),atxHeadingSequence:R,autolink:d(),autolinkEmail:ee,autolinkProtocol:oe,blockQuote:d(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:K,characterReference:$,codeFenced:d(b),codeFencedFence:g,codeFencedFenceInfo:C,codeFencedFenceMeta:y,codeFlowValue:z,codeIndented:d(S),codeText:d(G),codeTextData:z,data:z,definition:d(),definitionDestinationString:D,definitionLabelString:w,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d(F),htmlFlowData:z,htmlText:d(W),htmlTextData:z,image:d(X),label:O,labelText:I,lineEnding:P,link:d(Q),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ne,resourceDestinationString:Y,resourceTitleString:Z,resource:U,setextHeading:d(M),setextHeadingLineSequence:A,setextHeadingText:L,strong:d(),thematicBreak:d()}};R2(i,(e||{}).mdastExtensions||[]);const r={};return s;function s(fe){let xe={type:"root",children:[],position:void 0};const De={stack:[xe],tokenStack:[],config:i,enter:u,exit:v,buffer:o,resume:c,data:r},Le=[],Fe=[];let je=-1;for(;++je<fe.length;)if(Fe.push(fe[je]),fe[je][1].type==="listOrdered"||fe[je][1].type==="listUnordered")if(fe[je][0]==="enter")Le.push(Fe.length-1);else{const At=Le.pop();h(Fe,At)}for(fe=Fe,je=-1;++je<fe.length;){const At=i[fe[je][0]];fe[je][0]==="enter"&&i.beforeEnter.length>0&&l(i.beforeEnter,{...De,sliceSerialize:fe[je][2].sliceSerialize},fe[je][1]),T2.call(At,fe[je][1].type)&&At[fe[je][1].type].call({...De,sliceSerialize:fe[je][2].sliceSerialize},fe[je][1]),fe[je][0]==="exit"&&i.afterExit.length>0&&l(i.afterExit,{...De,sliceSerialize:fe[je][2].sliceSerialize},fe[je][1])}if(De.tokenStack.length>0){const At=De.tokenStack[De.tokenStack.length-1];(At[1]||Lb).call(De,void 0,At[0])}for(xe.position={start:as(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:as(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<i.transforms.length;)xe=i.transforms[je](xe)||xe;return xe}function l(fe,xe,De){let Le=-1;for(;++Le<fe.length;)fe[Le].call(xe,De)}function h(fe,xe){const De=fe.length-1;let Le=xe-1,Fe=-1,je=!1,At,Yt,An,ti;const ni=[];for(;++Le<=De;){const Xt=fe[Le];switch(Xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xt[0]==="enter"?Fe++:Fe--,ti=void 0;break}case"lineEndingBlank":{Xt[0]==="enter"&&(At&&!ti&&!Fe&&!An&&(An=Le),ti=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ti=void 0}if(!Fe&&Xt[0]==="enter"&&Xt[1].type==="listItemPrefix"||Fe===-1&&Xt[0]==="exit"&&(Xt[1].type==="listUnordered"||Xt[1].type==="listOrdered")){if(At){let ii=Le;for(Yt=void 0;ii--;){const Sn=fe[ii];if(Sn[1].type==="lineEnding"||Sn[1].type==="lineEndingBlank"){if(Sn[0]==="exit")continue;Yt&&(fe[Yt][1].type="lineEndingBlank",je=!0),Sn[1].type="lineEnding",Yt=ii}else if(!(Sn[1].type==="linePrefix"||Sn[1].type==="blockQuotePrefix"||Sn[1].type==="blockQuotePrefixWhitespace"||Sn[1].type==="blockQuoteMarker"||Sn[1].type==="listItemIndent"))break}An&&(!Yt||An<Yt)&&(At._spread=!0),At.end=Object.assign({},Yt?fe[Yt][1].start:Xt[1].end),ni.push({at:Yt||Le,event:["exit",At,Xt[2]]})}if(Xt[1].type==="listItemPrefix"){const ii={type:"listItem",_spread:!1,start:Object.assign({},Xt[1].start),end:void 0};At=ii,ni.push({at:Le,event:["enter",ii,Xt[2]]}),An=void 0,ti=!0}}}const co=fe.splice(xe);let Kt=0;for(Le=-1;++Le<co.length;){for(;Kt<ni.length&&ni[Kt].at===xe+Le;)fe.push(ni[Kt++].event);fe.push(co[Le])}fe[xe][1]._spread=je}function p(fe,xe){return De;function De(Le){u.call(this,fe(Le),Le),xe&&xe.call(this,Le)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(fe,xe,De){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([xe,De||void 0]),fe.position={start:as(xe.start),end:void 0}}function d(fe){return xe;function xe(De){fe&&fe.call(this,De),v.call(this,De)}}function v(fe,xe){const De=this.stack.pop(),Le=this.tokenStack.pop();if(!Le)throw new Error("Cannot close `"+fe.type+"` ("+Pl({start:fe.start,end:fe.end})+"): it’s not open");Le[0].type!==fe.type&&(xe?xe.call(this,fe,Le[0]):(Le[1]||Lb).call(this,fe,Le[0])),De.position.end=as(fe.end)}function c(){return vv(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function x(fe){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function C(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=fe}function y(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=fe}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.value=fe.replace(/(\r?\n|\r)$/g,"")}function w(fe){const xe=this.resume(),De=this.stack[this.stack.length-1];De.label=xe,De.identifier=Ti(this.sliceSerialize(fe)).toLowerCase()}function T(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.title=fe}function D(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.url=fe}function R(fe){const xe=this.stack[this.stack.length-1];if(!xe.depth){const De=this.sliceSerialize(fe).length;xe.depth=De}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function j(fe){const De=this.stack[this.stack.length-1].children;let Le=De[De.length-1];(!Le||Le.type!=="text")&&(Le=gt(),Le.position={start:as(fe.start),end:void 0},De.push(Le)),this.stack.push(Le)}function z(fe){const xe=this.stack.pop();xe.value+=this.sliceSerialize(fe),xe.position.end=as(fe.end)}function P(fe){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=xe.children[xe.children.length-1];De.position.end=as(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(xe.type)&&(j.call(this,fe),z.call(this,fe))}function H(){this.data.atHardBreak=!0}function F(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.value=fe}function W(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.value=fe}function G(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.value=fe}function Q(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=xe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function X(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=xe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function I(fe){const xe=this.sliceSerialize(fe),De=this.stack[this.stack.length-2];De.label=WM(xe),De.identifier=Ti(xe).toLowerCase()}function O(){const fe=this.stack[this.stack.length-1],xe=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Le=fe.children;De.children=Le}else De.alt=xe}function Y(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.url=fe}function Z(){const fe=this.resume(),xe=this.stack[this.stack.length-1];xe.title=fe}function U(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function ne(fe){const xe=this.resume(),De=this.stack[this.stack.length-1];De.label=xe,De.identifier=Ti(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function le(fe){this.data.characterReferenceType=fe.type}function K(fe){const xe=this.sliceSerialize(fe),De=this.data.characterReferenceType;let Le;De?(Le=p2(xe,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=_v(xe);const Fe=this.stack[this.stack.length-1];Fe.value+=Le}function $(fe){const xe=this.stack.pop();xe.position.end=as(fe.end)}function oe(fe){z.call(this,fe);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(fe)}function ee(fe){z.call(this,fe);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(fe)}function ue(){return{type:"blockquote",children:[],position:void 0}}function he(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Se(){return{type:"inlineCode",value:"",position:void 0}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Re(){return{type:"emphasis",children:[],position:void 0}}function Ve(){return{type:"heading",depth:0,children:[],position:void 0}}function Ee(){return{type:"break",position:void 0}}function Ie(){return{type:"html",value:"",position:void 0}}function Ot(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function $e(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Be(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[],position:void 0}}function ze(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[],position:void 0}}function Te(){return{type:"paragraph",children:[],position:void 0}}function We(){return{type:"strong",children:[],position:void 0}}function gt(){return{type:"text",value:"",position:void 0}}function ot(){return{type:"thematicBreak",position:void 0}}}function as(e){return{line:e.line,column:e.column,offset:e.offset}}function R2(e,i){let r=-1;for(;++r<i.length;){const s=i[r];Array.isArray(s)?R2(e,s):XM(e,s)}}function XM(e,i){let r;for(r in i)if(T2.call(i,r))switch(r){case"canContainEols":{const s=i[r];s&&e[r].push(...s);break}case"transforms":{const s=i[r];s&&e[r].push(...s);break}case"afterExit":case"beforeEnter":{const s=i[r];s&&e[r].push(s);break}case"enter":case"exit":{const s=i[r];s&&Object.assign(e[r],s);break}}}function Lb(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Pl({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Pl({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Pl({start:i.start,end:i.end})+") is still open")}function QM(e){const i=this;i.parser=r;function r(s){return YM(s,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function ZM(e,i){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)}function JM(e,i){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:`
542
+ `}]}function eN(e,i){const r=i.value?i.value+`
543
+ `:"",s={},l=i.lang?i.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let h={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return i.meta&&(h.data={meta:i.meta}),e.patch(i,h),h=e.applyData(i,h),h={type:"element",tagName:"pre",properties:{},children:[h]},e.patch(i,h),h}function tN(e,i){const r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function nN(e,i){const r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function iN(e,i){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(i.identifier).toUpperCase(),l=ja(s.toLowerCase()),h=e.footnoteOrder.indexOf(s);let p,o=e.footnoteCounts.get(s);o===void 0?(o=0,e.footnoteOrder.push(s),p=e.footnoteOrder.length):p=h+1,o+=1,e.footnoteCounts.set(s,o);const u={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(p)}]};e.patch(i,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(i,d),e.applyData(i,d)}function rN(e,i){const r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function sN(e,i){if(e.options.allowDangerousHtml){const r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}}function A2(e,i){const r=i.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+s}];const l=e.all(i),h=l[0];h&&h.type==="text"?h.value="["+h.value:l.unshift({type:"text",value:"["});const p=l[l.length-1];return p&&p.type==="text"?p.value+=s:l.push({type:"text",value:s}),l}function oN(e,i){const r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return A2(e,i);const l={src:ja(s.url||""),alt:i.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const h={type:"element",tagName:"img",properties:l,children:[]};return e.patch(i,h),e.applyData(i,h)}function aN(e,i){const r={src:ja(i.url)};i.alt!==null&&i.alt!==void 0&&(r.alt=i.alt),i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,s),e.applyData(i,s)}function lN(e,i){const r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,s),e.applyData(i,s)}function cN(e,i){const r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return A2(e,i);const l={href:ja(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const h={type:"element",tagName:"a",properties:l,children:e.all(i)};return e.patch(i,h),e.applyData(i,h)}function uN(e,i){const r={href:ja(i.url)};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,s),e.applyData(i,s)}function hN(e,i,r){const s=e.all(i),l=r?dN(r):D2(i),h={},p=[];if(typeof i.checked=="boolean"){const v=s[0];let c;v&&v.type==="element"&&v.tagName==="p"?c=v:(c={type:"element",tagName:"p",properties:{},children:[]},s.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),h.className=["task-list-item"]}let o=-1;for(;++o<s.length;){const v=s[o];(l||o!==0||v.type!=="element"||v.tagName!=="p")&&p.push({type:"text",value:`
544
+ `}),v.type==="element"&&v.tagName==="p"&&!l?p.push(...v.children):p.push(v)}const u=s[s.length-1];u&&(l||u.type!=="element"||u.tagName!=="p")&&p.push({type:"text",value:`
545
+ `});const d={type:"element",tagName:"li",properties:h,children:p};return e.patch(i,d),e.applyData(i,d)}function dN(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const r=e.children;let s=-1;for(;!i&&++s<r.length;)i=D2(r[s])}return i}function D2(e){const i=e.spread;return i??e.children.length>1}function fN(e,i){const r={},s=e.all(i);let l=-1;for(typeof i.start=="number"&&i.start!==1&&(r.start=i.start);++l<s.length;){const p=s[l];if(p.type==="element"&&p.tagName==="li"&&p.properties&&Array.isArray(p.properties.className)&&p.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const h={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(i,h),e.applyData(i,h)}function pN(e,i){const r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function mN(e,i){const r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)}function gN(e,i){const r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function vN(e,i){const r=e.all(i),s=r.shift(),l=[];if(s){const p={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(i.children[0],p),l.push(p)}if(r.length>0){const p={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=fv(i.children[1]),u=o2(i.children[i.children.length-1]);o&&u&&(p.position={start:o,end:u}),l.push(p)}const h={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(i,h),e.applyData(i,h)}function _N(e,i,r){const s=r?r.children:void 0,h=(s?s.indexOf(i):1)===0?"th":"td",p=r&&r.type==="table"?r.align:void 0,o=p?p.length:i.children.length;let u=-1;const d=[];for(;++u<o;){const c=i.children[u],_={},x=p?p[u]:void 0;x&&(_.align=x);let C={type:"element",tagName:h,properties:_,children:[]};c&&(C.children=e.all(c),e.patch(c,C),C=e.applyData(c,C)),d.push(C)}const v={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(i,v),e.applyData(i,v)}function xN(e,i){const r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}const jb=9,Mb=32;function yN(e){const i=String(e),r=/\r?\n|\r/g;let s=r.exec(i),l=0;const h=[];for(;s;)h.push(Nb(i.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=r.exec(i);return h.push(Nb(i.slice(l),l>0,!1)),h.join("")}function Nb(e,i,r){let s=0,l=e.length;if(i){let h=e.codePointAt(s);for(;h===jb||h===Mb;)s++,h=e.codePointAt(s)}if(r){let h=e.codePointAt(l-1);for(;h===jb||h===Mb;)l--,h=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function bN(e,i){const r={type:"text",value:yN(String(i.value))};return e.patch(i,r),e.applyData(i,r)}function wN(e,i){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)}const SN={blockquote:ZM,break:JM,code:eN,delete:tN,emphasis:nN,footnoteReference:iN,heading:rN,html:sN,imageReference:oN,image:aN,inlineCode:lN,linkReference:cN,link:uN,listItem:hN,list:fN,paragraph:pN,root:mN,strong:gN,table:vN,tableCell:xN,tableRow:_N,text:bN,thematicBreak:wN,toml:Xu,yaml:Xu,definition:Xu,footnoteDefinition:Xu};function Xu(){}const L2=-1,Xh=0,Il=1,yh=2,yv=3,bv=4,wv=5,Sv=6,j2=7,M2=8,{defineProperty:CN}=Object,N2=typeof self=="object"?self:globalThis,Ob=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new N2[e](i)},kN=(e,i)=>{const r=(l,h)=>(e.set(h,l),l),s=l=>{if(e.has(l))return e.get(l);const[h,p]=i[l];switch(h){case Xh:case L2:return r(p,l);case Il:{const o=r([],l);for(const u of p)o.push(s(u));return o}case yh:{const o=r({},l);for(const[u,d]of p){const v=s(u),c=s(d);v==="__proto__"?CN(o,v,{value:c,configurable:!0,enumerable:!0,writable:!0}):o[v]=c}return o}case yv:return r(new Date(p),l);case bv:{const{source:o,flags:u}=p;return r(new RegExp(o,u),l)}case wv:{const o=r(new Map,l);for(const[u,d]of p)o.set(s(u),s(d));return o}case Sv:{const o=r(new Set,l);for(const u of p)o.add(s(u));return o}case j2:{const{name:o,message:u}=p;return r(typeof N2[o]=="function"?Ob(o,u):new Error(u),l)}case M2:return r(BigInt(p),l);case"BigInt":return r(Object(BigInt(p)),l);case"ArrayBuffer":return r(new Uint8Array(p).buffer,p);case"DataView":{const{buffer:o}=new Uint8Array(p);return r(new DataView(o),p)}case"-0":return-0}return r(Ob(h,p),l)};return s},Bb=e=>kN(new Map,e)(0),Gs="",{toString:EN}={},{keys:TN,is:RN}=Object,Ml=e=>{const i=typeof e;if(i!=="object"||!e)return[Xh,i];const r=EN.call(e).slice(8,-1);switch(r){case"Array":return[Il,Gs];case"Object":return[yh,Gs];case"Date":return[yv,Gs];case"RegExp":return[bv,Gs];case"Map":return[wv,Gs];case"Set":return[Sv,Gs];case"DataView":return[Il,r]}return r.includes("Array")?[Il,r]:e instanceof Error?[j2,e.name||"Error"]:[yh,r]},Qu=([e,i])=>e===Xh&&(i==="function"||i==="symbol"),AN=(e,i,r,s)=>{const l=(p,o)=>{const u=s.push(p)-1;return r.set(o,u),u},h=p=>{if(r.has(p))return r.get(p);let[o,u]=Ml(p);switch(o){case Xh:{let v=p;switch(u){case"bigint":o=M2,v=p.toString();break;case"number":if(!p&&RN(p,-0))return s.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);v=null;break;case"undefined":return l([L2],p)}return l([o,v],p)}case Il:{if(u){let _=p;return u==="DataView"?_=new Uint8Array(p.buffer):u==="ArrayBuffer"&&(_=new Uint8Array(p)),l([u,[..._]],p)}const v=[],c=l([o,v],p);for(const _ of p)v.push(h(_));return c}case yh:{if(u)switch(u){case"BigInt":return l([u,p.toString()],p);case"Boolean":case"Number":case"String":return l([u,p.valueOf()],p)}if(i&&"toJSON"in p)return h(p.toJSON());const v=[],c=l([o,v],p);for(const _ of TN(p))(e||!Qu(Ml(p[_])))&&v.push([h(_),h(p[_])]);return c}case yv:return l([o,isNaN(p.getTime())?Gs:p.toISOString()],p);case bv:{const{source:v,flags:c}=p;return l([o,{source:v,flags:c}],p)}case wv:{const v=[],c=l([o,v],p);for(const[_,x]of p)(e||!(Qu(Ml(_))||Qu(Ml(x))))&&v.push([h(_),h(x)]);return c}case Sv:{const v=[],c=l([o,v],p);for(const _ of p)(e||!Qu(Ml(_)))&&v.push(h(_));return c}}const{message:d}=p;return l([o,{name:u,message:d}],p)};return h},Pb=(e,{json:i,lossy:r}={})=>{const s=[];return AN(!(i||r),!!i,new Map,s)(e),s},bh=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?Bb(Pb(e,i)):structuredClone(e):(e,i)=>Bb(Pb(e,i));function DN(e,i){const r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function LN(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function jN(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||DN,s=e.options.footnoteBackLabel||LN,l=e.options.footnoteLabel||"Footnotes",h=e.options.footnoteLabelTagName||"h2",p=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const v=e.all(d),c=String(d.identifier).toUpperCase(),_=ja(c.toLowerCase());let x=0;const C=[],y=e.footnoteCounts.get(c);for(;y!==void 0&&++x<=y;){C.length>0&&C.push({type:"text",value:" "});let S=typeof r=="string"?r:r(u,x);typeof S=="string"&&(S={type:"text",value:S}),C.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+_+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(u,x),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const g=v[v.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const S=g.children[g.children.length-1];S&&S.type==="text"?S.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...C)}else v.push(...C);const b={type:"element",tagName:"li",properties:{id:i+"fn-"+_},children:e.wrap(v,!0)};e.patch(d,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:h,properties:{...bh(p),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
546
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
547
+ `}]}}const Qh=(function(e){if(e==null)return BN;if(typeof e=="function")return Zh(e);if(typeof e=="object")return Array.isArray(e)?MN(e):NN(e);if(typeof e=="string")return ON(e);throw new Error("Expected function, string, or object as test")});function MN(e){const i=[];let r=-1;for(;++r<e.length;)i[r]=Qh(e[r]);return Zh(s);function s(...l){let h=-1;for(;++h<i.length;)if(i[h].apply(this,l))return!0;return!1}}function NN(e){const i=e;return Zh(r);function r(s){const l=s;let h;for(h in e)if(l[h]!==i[h])return!1;return!0}}function ON(e){return Zh(i);function i(r){return r&&r.type===e}}function Zh(e){return i;function i(r,s,l){return!!(PN(r)&&e.call(this,r,typeof s=="number"?s:void 0,l||void 0))}}function BN(){return!0}function PN(e){return e!==null&&typeof e=="object"&&"type"in e}const O2=[],zN=!0,lh=!1,rg="skip";function sg(e,i,r,s){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let l=!0,h,p,o,u;if(typeof r=="function"||r&&typeof r=="object"?(h=i,p=r,s&&(l=!1)):(p=i,r&&(l=!1)),typeof p=="function")o=p;else if(p&&typeof p=="object"){if(!(p.enter===null||p.enter===void 0))if(typeof p.enter=="function")o=p.enter;else throw new Error("Unexpected value `"+p.enter+"` for `visitors.enter`, expected optional visitor");if(typeof p.exit=="function")u=p.exit;else throw new Error("Unexpected value `"+p.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+p+"` for `enter` or `visitors`, expected visitor or object with visitors");const d=Qh(h),v=l?1:-1;c(e,void 0,[])();function c(_,x,C){const y=_&&typeof _=="object"?_:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(_.type+(b?"<"+b+">":""))+")"})}return g;function g(){const b=!h||d(_,x,C[C.length-1]||void 0);let S=O2;if(o&&b&&(S=zb(o(_,C,x)),S[0]===lh))return S;if("children"in _&&_.children){const w=_;if(w.children&&S[0]!==rg){let T=(l?-1:w.children.length)+v;const D=[...C,w];for(;T>-1&&T<w.children.length;){const R=w.children[T],L=c(R,T,D)();if(L[0]===lh)return L;T=typeof L[1]=="number"?L[1]:T+v}}}if(u&&b){const w=zb(u(_,C,x));if(w[0]===rg)throw new Error("Unexpected value `"+w[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(w[0]===lh||typeof w[1]=="number")return w}return S}}}function zb(e){return Array.isArray(e)?e:typeof e=="number"?[zN,e]:e==null?O2:[e]}function Cv(e,i,r,s){let l,h,p;h=i,p=r,typeof h=="function"?sg(e,l,og(h),p):sg(e,l,IN(h),p)}function IN(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?og(e.enter):e.enter,exit:typeof e.exit=="function"?og(e.exit):e.exit}}function og(e){return i;function i(r,s,l){return e(r,l,s[s.length-1])}}const ag={}.hasOwnProperty,HN={};function FN(e,i){const r=i||HN,s=new Map,l=new Map,h=new Map,p={...SN,...r.handlers},o={all:d,applyData:$N,definitionById:s,footnoteById:l,footnoteCounts:h,footnoteOrder:[],handlers:p,one:u,options:r,patch:UN,wrap:VN};return Cv(e,function(v){if(v.type==="definition"||v.type==="footnoteDefinition"){const c=v.type==="definition"?s:l,_=String(v.identifier).toUpperCase();c.has(_)||c.set(_,v)}}),o;function u(v,c){const _=v.type,x=o.handlers[_];if(ag.call(o.handlers,_)&&x)return x(o,v,c);if(o.options.passThrough&&o.options.passThrough.includes(_)){if("children"in v){const{children:y,...g}=v,b=bh(g);return b.children=o.all(v),b}return bh(v)}return(o.options.unknownHandler||qN)(o,v,c)}function d(v){const c=[];if("children"in v){const _=v.children;let x=-1;for(;++x<_.length;){const C=o.one(_[x],v);if(C){if(x&&_[x-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=Ib(C.value)),!Array.isArray(C)&&C.type==="element")){const y=C.children[0];y&&y.type==="text"&&(y.value=Ib(y.value))}Array.isArray(C)?c.push(...C):c.push(C)}}}return c}}function UN(e,i){e.position&&(i.position=ML(e))}function $N(e,i){let r=i;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,h=e.data.hProperties;if(typeof s=="string")if(r.type==="element")r.tagName=s;else{const p="children"in r?r.children:[r];r={type:"element",tagName:s,properties:{},children:p}}r.type==="element"&&h&&Object.assign(r.properties,bh(h)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function qN(e,i){const r=i.data||{},s="value"in i&&!(ag.call(r,"hProperties")||ag.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,s),e.applyData(i,s)}function VN(e,i){const r=[];let s=-1;for(i&&r.push({type:"text",value:`
548
+ `});++s<e.length;)s&&r.push({type:"text",value:`
549
+ `}),r.push(e[s]);return i&&e.length>0&&r.push({type:"text",value:`
550
+ `}),r}function Ib(e){let i=0,r=e.charCodeAt(i);for(;r===9||r===32;)i++,r=e.charCodeAt(i);return e.slice(i)}function Hb(e,i){const r=FN(e,i),s=r.one(e,void 0),l=jN(r),h=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&h.children.push({type:"text",value:`
551
+ `},l),h}function WN(e,i){return e&&"run"in e?async function(r,s){const l=Hb(r,{file:s,...i});await e.run(l,s)}:function(r,s){return Hb(r,{file:s,...e||i})}}function Fb(e){if(e)throw e}var am,Ub;function GN(){if(Ub)return am;Ub=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):i.call(d)==="[object Array]"},h=function(d){if(!d||i.call(d)!=="[object Object]")return!1;var v=e.call(d,"constructor"),c=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!v&&!c)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},p=function(d,v){r&&v.name==="__proto__"?r(d,v.name,{enumerable:!0,configurable:!0,value:v.newValue,writable:!0}):d[v.name]=v.newValue},o=function(d,v){if(v==="__proto__")if(e.call(d,v)){if(s)return s(d,v).value}else return;return d[v]};return am=function u(){var d,v,c,_,x,C,y=arguments[0],g=1,b=arguments.length,S=!1;for(typeof y=="boolean"&&(S=y,y=arguments[1]||{},g=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});g<b;++g)if(d=arguments[g],d!=null)for(v in d)c=o(y,v),_=o(d,v),y!==_&&(S&&_&&(h(_)||(x=l(_)))?(x?(x=!1,C=c&&l(c)?c:[]):C=c&&h(c)?c:{},p(y,{name:v,newValue:u(S,C,_)})):typeof _<"u"&&p(y,{name:v,newValue:_}));return y},am}var YN=GN();const lm=xg(YN);function lg(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function KN(){const e=[],i={run:r,use:s};return i;function r(...l){let h=-1;const p=l.pop();if(typeof p!="function")throw new TypeError("Expected function as last argument, not "+p);o(null,...l);function o(u,...d){const v=e[++h];let c=-1;if(u){p(u);return}for(;++c<l.length;)(d[c]===null||d[c]===void 0)&&(d[c]=l[c]);l=d,v?XN(v,o)(...d):p(null,...d)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),i}}function XN(e,i){let r;return s;function s(...p){const o=e.length>p.length;let u;o&&p.push(l);try{u=e.apply(this,p)}catch(d){const v=d;if(o&&r)throw v;return l(v)}o||(u&&u.then&&typeof u.then=="function"?u.then(h,l):u instanceof Error?l(u):h(u))}function l(p,...o){r||(r=!0,i(p,...o))}function h(p){l(null,p)}}const Ui={basename:QN,dirname:ZN,extname:JN,join:eO,sep:"/"};function QN(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');lc(e);let r=0,s=-1,l=e.length,h;if(i===void 0||i.length===0||i.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(h){r=l+1;break}}else s<0&&(h=!0,s=l+1);return s<0?"":e.slice(r,s)}if(i===e)return"";let p=-1,o=i.length-1;for(;l--;)if(e.codePointAt(l)===47){if(h){r=l+1;break}}else p<0&&(h=!0,p=l+1),o>-1&&(e.codePointAt(l)===i.codePointAt(o--)?o<0&&(s=l):(o=-1,s=p));return r===s?s=p:s<0&&(s=e.length),e.slice(r,s)}function ZN(e){if(lc(e),e.length===0)return".";let i=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){i=r;break}}else s||(s=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function JN(e){lc(e);let i=e.length,r=-1,s=0,l=-1,h=0,p;for(;i--;){const o=e.codePointAt(i);if(o===47){if(p){s=i+1;break}continue}r<0&&(p=!0,r=i+1),o===46?l<0?l=i:h!==1&&(h=1):l>-1&&(h=-1)}return l<0||r<0||h===0||h===1&&l===r-1&&l===s+1?"":e.slice(l,r)}function eO(...e){let i=-1,r;for(;++i<e.length;)lc(e[i]),e[i]&&(r=r===void 0?e[i]:r+"/"+e[i]);return r===void 0?".":tO(r)}function tO(e){lc(e);const i=e.codePointAt(0)===47;let r=nO(e,!i);return r.length===0&&!i&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),i?"/"+r:r}function nO(e,i){let r="",s=0,l=-1,h=0,p=-1,o,u;for(;++p<=e.length;){if(p<e.length)o=e.codePointAt(p);else{if(o===47)break;o=47}if(o===47){if(!(l===p-1||h===1))if(l!==p-1&&h===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(u=r.lastIndexOf("/"),u!==r.length-1){u<0?(r="",s=0):(r=r.slice(0,u),s=r.length-1-r.lastIndexOf("/")),l=p,h=0;continue}}else if(r.length>0){r="",s=0,l=p,h=0;continue}}i&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(l+1,p):r=e.slice(l+1,p),s=p-l-1;l=p,h=0}else o===46&&h>-1?h++:h=-1}return r}function lc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iO={cwd:rO};function rO(){return"/"}function cg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function sO(e){if(typeof e=="string")e=new URL(e);else if(!cg(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return oO(e)}function oO(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const i=e.pathname;let r=-1;for(;++r<i.length;)if(i.codePointAt(r)===37&&i.codePointAt(r+1)===50){const s=i.codePointAt(r+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(i)}const cm=["history","path","basename","stem","extname","dirname"];class B2{constructor(i){let r;i?cg(i)?r={path:i}:typeof i=="string"||aO(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":iO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<cm.length;){const h=cm[s];h in r&&r[h]!==void 0&&r[h]!==null&&(this[h]=h==="history"?[...r[h]]:r[h])}let l;for(l in r)cm.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?Ui.basename(this.path):void 0}set basename(i){hm(i,"basename"),um(i,"basename"),this.path=Ui.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ui.dirname(this.path):void 0}set dirname(i){$b(this.basename,"dirname"),this.path=Ui.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ui.extname(this.path):void 0}set extname(i){if(um(i,"extname"),$b(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ui.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){cg(i)&&(i=sO(i)),hm(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ui.basename(this.path,this.extname):void 0}set stem(i){hm(i,"stem"),um(i,"stem"),this.path=Ui.join(this.dirname||"",i+(this.extname||""))}fail(i,r,s){const l=this.message(i,r,s);throw l.fatal=!0,l}info(i,r,s){const l=this.message(i,r,s);return l.fatal=void 0,l}message(i,r,s){const l=new wn(i,r,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function um(e,i){if(e&&e.includes(Ui.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ui.sep+"`")}function hm(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function $b(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function aO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lO=(function(e){const s=this.constructor.prototype,l=s[e],h=function(){return l.apply(h,arguments)};return Object.setPrototypeOf(h,s),h}),cO={}.hasOwnProperty;class kv extends lO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=KN()}copy(){const i=new kv;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];i.use(...s)}return i.data(lm(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(pm("data",this.frozen),this.namespace[i]=r,this):cO.call(this.namespace,i)&&this.namespace[i]||void 0:i?(pm("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=r.call(i,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const r=Zu(i),s=this.parser||this.Parser;return dm("parse",s),s(String(r),r)}process(i,r){const s=this;return this.freeze(),dm("process",this.parser||this.Parser),fm("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(h,p){const o=Zu(i),u=s.parse(o);s.run(u,o,function(v,c,_){if(v||!c||!_)return d(v);const x=c,C=s.stringify(x,_);dO(C)?_.value=C:_.result=C,d(v,_)});function d(v,c){v||!c?p(v):h?h(c):r(void 0,c)}}}processSync(i){let r=!1,s;return this.freeze(),dm("processSync",this.parser||this.Parser),fm("processSync",this.compiler||this.Compiler),this.process(i,l),Vb("processSync","process",r),s;function l(h,p){r=!0,Fb(h),s=p}}run(i,r,s){qb(i),this.freeze();const l=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?h(void 0,s):new Promise(h);function h(p,o){const u=Zu(r);l.run(i,u,d);function d(v,c,_){const x=c||i;v?o(v):p?p(x):s(void 0,x,_)}}}runSync(i,r){let s=!1,l;return this.run(i,r,h),Vb("runSync","run",s),l;function h(p,o){Fb(p),l=o,s=!0}}stringify(i,r){this.freeze();const s=Zu(r),l=this.compiler||this.Compiler;return fm("stringify",l),qb(i),l(i,s)}use(i,...r){const s=this.attachers,l=this.namespace;if(pm("use",this.frozen),i!=null)if(typeof i=="function")u(i,r);else if(typeof i=="object")Array.isArray(i)?o(i):p(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function h(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[v,...c]=d;u(v,c)}else p(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function p(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(d.plugins),d.settings&&(l.settings=lm(!0,l.settings,d.settings))}function o(d){let v=-1;if(d!=null)if(Array.isArray(d))for(;++v<d.length;){const c=d[v];h(c)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,v){let c=-1,_=-1;for(;++c<s.length;)if(s[c][0]===d){_=c;break}if(_===-1)s.push([d,...v]);else if(v.length>0){let[x,...C]=v;const y=s[_][1];lg(y)&&lg(x)&&(x=lm(!0,y,x)),s[_]=[d,x,...C]}}}}const uO=new kv().freeze();function dm(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fm(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pm(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qb(e){if(!lg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Vb(e,i,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Zu(e){return hO(e)?e:new B2(e)}function hO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dO(e){return typeof e=="string"||fO(e)}function fO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wb=[],Gb={allowDangerousHtml:!0},mO=/^(https?|ircs?|mailto|xmpp)$/i,gO=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function vO(e){const i=_O(e),r=xO(e);return yO(i.runSync(i.parse(r),r),e)}function _O(e){const i=e.rehypePlugins||Wb,r=e.remarkPlugins||Wb,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gb}:Gb;return uO().use(QM).use(r).use(WN,s).use(i)}function xO(e){const i=e.children||"",r=new B2;return typeof i=="string"&&(r.value=i),r}function yO(e,i){const r=i.allowedElements,s=i.allowElement,l=i.components,h=i.disallowedElements,p=i.skipHtml,o=i.unwrapDisallowed,u=i.urlTransform||bO;for(const v of gO)Object.hasOwn(i,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+pO+v.id,void 0);return Cv(e,d),zL(e,{Fragment:m.Fragment,components:l,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function d(v,c,_){if(v.type==="raw"&&_&&typeof c=="number")return p?_.children.splice(c,1):_.children[c]={type:"text",value:v.value},c;if(v.type==="element"){let x;for(x in rm)if(Object.hasOwn(rm,x)&&Object.hasOwn(v.properties,x)){const C=v.properties[x],y=rm[x];(y===null||y.includes(v.tagName))&&(v.properties[x]=u(String(C||""),x,v))}}if(v.type==="element"){let x=r?!r.includes(v.tagName):h?h.includes(v.tagName):!1;if(!x&&s&&typeof c=="number"&&(x=!s(v,c,_)),x&&_&&typeof c=="number")return o&&v.children?_.children.splice(c,1,...v.children):_.children.splice(c,1),c}}}function bO(e){const i=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return i===-1||l!==-1&&i>l||r!==-1&&i>r||s!==-1&&i>s||mO.test(e.slice(0,i))?e:""}function Yb(e,i){const r=String(e);if(typeof i!="string")throw new TypeError("Expected character");let s=0,l=r.indexOf(i);for(;l!==-1;)s++,l=r.indexOf(i,l+i.length);return s}function wO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function SO(e,i,r){const l=Qh((r||{}).ignore||[]),h=CO(i);let p=-1;for(;++p<h.length;)sg(e,o);function o(d,v,c){if(d.type==="text"&&typeof c=="number")return u(d,v,c);if(l(d,c,v[v.length-1]))return rg}function u(d,v,c){const _=v[v.length-1],x=h[p][0],C=h[p][1];let y=0,g=!1,b=[];x.lastIndex=0;let S=x.exec(d.value);for(;S;){const T=S.index,D={index:S.index,input:S.input,stack:[...v,d]};let R=C(...S,D);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1)x.lastIndex=T+1;else{if(y!==T&&w({type:"text",value:d.value.slice(y,T)}),Array.isArray(R))for(const L of R)w(L);else R&&w(R);y=T+S[0].length,g=!0}if(!x.global)break;S=x.exec(d.value)}return g?(y<d.value.length&&w({type:"text",value:d.value.slice(y)}),_.children.splice(c,1,...b)):b=[d],c+b.length;function w(T){const D=b[b.length-1];D&&D.type==="text"&&T.type==="text"?D.value+=T.value:b.push(T)}}}function CO(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],r=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<r.length;){const l=r[s];i.push([kO(l[0]),EO(l[1])])}return i}function kO(e){return typeof e=="string"?new RegExp(wO(e),"g"):e}function EO(e){return typeof e=="function"?e:function(){return e}}const mm="phrasing",gm=["autolink","link","image","label"];function TO(){return{transforms:[NO],enter:{literalAutolink:AO,literalAutolinkEmail:vm,literalAutolinkHttp:vm,literalAutolinkWww:vm},exit:{literalAutolink:MO,literalAutolinkEmail:jO,literalAutolinkHttp:DO,literalAutolinkWww:LO}}}function RO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mm,notInConstruct:gm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mm,notInConstruct:gm},{character:":",before:"[ps]",after:"\\/",inConstruct:mm,notInConstruct:gm}]}}function AO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vm(e){this.config.enter.autolinkProtocol.call(this,e)}function DO(e){this.config.exit.autolinkProtocol.call(this,e)}function LO(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function jO(e){this.config.exit.autolinkEmail.call(this,e)}function MO(e){this.exit(e)}function NO(e){SO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),BO]],{ignore:["link","linkReference"]})}function OO(e,i,r,s,l){let h="";if(!P2(l)||(/^w/i.test(i)&&(r=i+r,i="",h="http://"),!PO(r)))return!1;const p=zO(r+s);if(!p[0])return!1;const o={type:"link",title:null,url:h+i+p[0],children:[{type:"text",value:i+p[0]}]};return p[1]?[o,{type:"text",value:p[1]}]:o}function BO(e,i,r,s){return!P2(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function PO(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function zO(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],s=r.indexOf(")");const l=Yb(e,"(");let h=Yb(e,")");for(;s!==-1&&l>h;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),h++;return[e,r]}function P2(e,i){const r=e.input.charCodeAt(e.index-1);return(e.index===0||ro(r)||Yh(r))&&(!i||r!==47)}z2.peek=GO;function IO(){this.buffer()}function HO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function FO(){this.buffer()}function UO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $O(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ti(this.sliceSerialize(e)).toLowerCase(),r.label=i}function qO(e){this.exit(e)}function VO(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ti(this.sliceSerialize(e)).toLowerCase(),r.label=i}function WO(e){this.exit(e)}function GO(){return"["}function z2(e,i,r,s){const l=r.createTracker(s);let h=l.move("[^");const p=r.enter("footnoteReference"),o=r.enter("reference");return h+=l.move(r.safe(r.associationId(e),{after:"]",before:h})),o(),p(),h+=l.move("]"),h}function YO(){return{enter:{gfmFootnoteCallString:IO,gfmFootnoteCall:HO,gfmFootnoteDefinitionLabelString:FO,gfmFootnoteDefinition:UO},exit:{gfmFootnoteCallString:$O,gfmFootnoteCall:qO,gfmFootnoteDefinitionLabelString:VO,gfmFootnoteDefinition:WO}}}function KO(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:z2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,l,h,p){const o=h.createTracker(p);let u=o.move("[^");const d=h.enter("footnoteDefinition"),v=h.enter("label");return u+=o.move(h.safe(h.associationId(s),{before:u,after:"]"})),v(),u+=o.move("]:"),s.children&&s.children.length>0&&(o.shift(4),u+=o.move((i?`
552
+ `:" ")+h.indentLines(h.containerFlow(s,o.current()),i?I2:XO))),d(),u}}function XO(e,i,r){return i===0?e:I2(e,i,r)}function I2(e,i,r){return(r?"":" ")+e}const QO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ev.attention=n7;Ev.peek=i7;function ZO(){return{canContainEols:["delete"],enter:{strikethrough:e7},exit:{strikethrough:t7}}}function JO(){return{handlers:{delete:Ev},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:QO}]}}function e7(e){this.enter({type:"delete",children:[],position:void 0},e)}function t7(e){this.exit(e)}function Ev(e,i,r,s){const l=r.createTracker(s),h=r.stack.includes("strikethrough")?"~":"~~",p=r.enter("strikethrough");let o=l.move(h);return o+=r.containerPhrasing(e,{...l.current(),before:o,after:"~"}),o+=l.move(h),p(),o}function n7(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function i7(){return"~"}function r7(e){return e.length}function s7(e,i){const r=i||{},s=(r.align||[]).concat(),l=r.stringLength||r7,h=[],p=[],o=[],u=[];let d=0,v=-1;for(;++v<e.length;){const y=[],g=[];let b=-1;for(e[v].length>d&&(d=e[v].length);++b<e[v].length;){const S=o7(e[v][b]);if(r.alignDelimiters!==!1){const w=l(S);g[b]=w,(u[b]===void 0||w>u[b])&&(u[b]=w)}y.push(S)}p[v]=y,o[v]=g}let c=-1;if(typeof s=="object"&&"length"in s)for(;++c<d;)h[c]=Kb(s[c]);else{const y=Kb(s);for(;++c<d;)h[c]=y}c=-1;const _=[],x=[];for(;++c<d;){const y=h[c];let g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let S=r.alignDelimiters===!1?1:Math.max(1,u[c]-g.length-b.length);const w=g+"-".repeat(S)+b;r.alignDelimiters!==!1&&(S=g.length+S+b.length,S>u[c]&&(u[c]=S),x[c]=S),_[c]=w}p.splice(1,0,_),o.splice(1,0,x),v=-1;const C=[];for(;++v<p.length;){const y=p[v],g=o[v];c=-1;const b=[];for(;++c<d;){const S=y[c]||"";let w="",T="";if(r.alignDelimiters!==!1){const D=u[c]-(g[c]||0),R=h[c];R===114?w=" ".repeat(D):R===99?D%2?(w=" ".repeat(D/2+.5),T=" ".repeat(D/2-.5)):(w=" ".repeat(D/2),T=w):T=" ".repeat(D)}r.delimiterStart!==!1&&!c&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&S==="")&&(r.delimiterStart!==!1||c)&&b.push(" "),r.alignDelimiters!==!1&&b.push(w),b.push(S),r.alignDelimiters!==!1&&b.push(T),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||c!==d-1)&&b.push("|")}C.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return C.join(`
553
+ `)}function o7(e){return e==null?"":String(e)}function Kb(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}const a7=Qh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function l7(e,i,r,s){const l=r.enter("blockquote"),h=r.createTracker(s);h.move("> "),h.shift(2);const p=r.indentLines(r.containerFlow(e,h.current()),c7);return l(),p}function c7(e,i,r){return">"+(r?"":" ")+e}function u7(e,i){return Xb(e,i.inConstruct,!0)&&!Xb(e,i.notInConstruct,!1)}function Xb(e,i,r){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return r;let s=-1;for(;++s<i.length;)if(e.includes(i[s]))return!0;return!1}function Qb(e,i,r,s){let l=-1;for(;++l<r.unsafe.length;){const h=r.unsafe[l];if(h.character===`
554
+ `&&!h.before&&!h.after&&u7(r.stack,h))return/[\t ]/.test(s.before)?"":" "}return`\\
555
+ `}function h7(e,i){const r=String(e);let s=r.indexOf(i),l=s,h=0,p=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++h>p&&(p=h):h=1,l=s+i.length,s=r.indexOf(i,l);return p}function d7(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function f7(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function p7(e,i,r,s){const l=f7(r),h=e.value||"";if(d7(e,r)){const c=r.enter("codeIndented"),_=r.indentLines(h,m7);return c(),_}const p=r.createTracker(s),o=l.repeat(Math.max(h7(h,l)+1,3)),u=r.enter("codeFenced"),d=l==="`"?"GraveAccent":"Tilde";let v=p.move(o);if(e.lang){const c=r.enter(`codeFencedLang${d}`);v+=p.move(r.safe(e.lang,{before:v,after:" ",encode:["`"],...p.current()})),c()}if(e.lang&&e.meta){const c=r.enter(`codeFencedMeta${d}`);v+=p.move(" "),v+=p.move(r.safe(e.meta,{before:v,after:`
556
+ `,encode:["`"],...p.current()})),c()}return v+=p.move(`
557
+ `),h&&(v+=p.move(h+`
558
+ `)),v+=p.move(o),u(),v}function m7(e,i,r){return(r?"":" ")+e}function Tv(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function g7(e,i,r,s){const l=Tv(r),h=l==='"'?"Quote":"Apostrophe",p=r.enter("definition");let o=r.enter("label");const u=r.createTracker(s);let d=u.move("[");return d+=u.move(r.safe(r.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(r.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(o=r.enter("destinationRaw"),d+=u.move(r.safe(e.url,{before:d,after:e.title?" ":`
559
+ `,...u.current()}))),o(),e.title&&(o=r.enter(`title${h}`),d+=u.move(" "+l),d+=u.move(r.safe(e.title,{before:d,after:l,...u.current()})),d+=u.move(l),o()),p(),d}function v7(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function wh(e){const i=e.codePointAt(0);return i===void 0?"":String.fromCodePoint(i)}function ma(e){const i=e.codePointAt(e.length-2);return i!==void 0&&i>65535?e.slice(-2):e.slice(-1)}function H2(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Zb(e,i,r){const s=ms(e),l=ms(i);return s===void 0?l===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function _7(e){if(e.charCodeAt(0)!==60)return;const i=e.charCodeAt(1);if(i===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:vn(o)?4:void 0}if(i===63)return 3;const r=i===47,s=r?2:1;let l=s,h=e.charCodeAt(l);if(!vn(h))return;for(;h===45||_n(h);)h=e.charCodeAt(++l);const p=e.slice(s,l).toLowerCase();return!r&&h!==47&&ig.includes(p)?1:C2.includes(p)?6:7}const x7=new Map([["*",!1],["_",!0]]);function y7(e,i,r){const s=new Set;for(const h of e){const p=r.get(h);if(p&&h.attention&&i.some(o=>o.attention===h.attention))for(const o of p.tokens)s.add(o.attention)}const l=[];for(const h of e)h.attention&&s.delete(h.attention)&&l.push(h.attention);return l.reverse(),l}function F2(e,i,r){const s=[],l=new Map,h=new Map;let p=0;for(;p<e.length;){if(!e[p].attention){p++;continue}const o=e[p].value.charAt(0),u=x7.get(o);let d=p+1;for(;d<e.length&&e[d].attention&&e[d].value.charAt(0)===o;)d++;const v=p?e[p-1].value:i,c=ms(v.charCodeAt(v.length-1)),_=ms((d<e.length?e[d].value:r).charCodeAt(0)),x=!_||_===2&&!!c,C=!c||c===2&&!!_,y={tokens:e.slice(p,d),markers:[],start:0,end:0,open:u?x&&(!!c||!C):x,close:u?C&&(!!_||!x):C,split:u!==void 0};for(const g of y.tokens){l.set(g,[...y.tokens]),h.set(g,y);let b=g.value.length;for(;b--;)y.markers.push(g)}y.end=y.markers.length,s.push(y),p=d}for(w7(s,l),p=-1;++p<e.length;){const o=l.get(e[p]);if(o)return{attention:y7(e,o,h),index:p}}}function Ju(e,i){const r=e[i?0:e.length-1];if(!r||r.attention)return;const s=i?wh(r.value):ma(r.value),l=H2(s.codePointAt(0));if(i)r.value=l+r.value.slice(s.length);else{let h=r.value.slice(0,r.value.length-s.length),p=0;for(;h.charCodeAt(h.length-1-p)===92;)p++;p%2&&(h+="\\"),r.value=h+l}}function b7(e,i,r,s,l){for(const h of r.attention){const p=i.get(h)||h.sequences[0];for(const o of h.sequences){if(o===p)continue;const u=new Map(i);u.set(h,o);const d=Av(e,u,s,l),v=F2(d,s,l);if(!v||v.index>r.index)return{chosen:u,mistake:v,tokens:d}}}}function w7(e,i){const r=new Map;for(const s of e){const l=s.tokens[0].value.charAt(0);let h=r.get(l);h||(h=[],r.set(l,h));let p=s.close?h.length:0;for(;p--&&s.start<s.end;){const o=h[p],u=o.end-o.start,d=s.end-s.start;if(s.split?(o.close||s.open)&&d%3&&!((u+d)%3):u!==o.markers.length||u!==d)continue;const v=s.split?u>1&&d>1?2:1:d,c=o.markers.slice(o.end-v,o.end),_=s.markers.slice(s.start,s.start+v),x=c[0],C=_[0];if(x===c[v-1]&&x.value.length===v&&C===_[v-1]&&C.value.length===v&&x.attention===C.attention)i.delete(x),i.delete(C);else{const y=[...new Set([...c,..._])];for(const g of y){const b=i.get(g);b&&b.push(...y)}}o.end-=v,s.start+=v,o.start===o.end&&h.splice(p,1),p=h.length}s.open&&s.start<s.end&&h.push(s)}}function S7(e,i,r){if(i.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(r.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const l of r)if(!Number.isSafeInteger(l)||l<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as size, expected positive integer");const s=[];for(const l of i){if(l.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as marker, expected a single ascii character");if(!m2(l.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as marker, expected ascii punctuation");for(const h of r)s.push(l.repeat(h))}return s}function C7(e,i,r){const s=i.indexStack,l=e.children||[],h=[];let p=-1,o=r.before;s.push(-1);let u=i.createTracker(r);for(;++p<l.length;){const d=l[p];let v;if(s[s.length-1]=p,p+1<l.length){let x=i.handle.handlers[l[p+1].type];x&&x.peek&&(x=x.peek),v=x?wh(x(l[p+1],e,i,{before:"",after:"",...u.current()})):""}else v=r.after;const c=h[h.length-1];typeof c=="string"&&(o==="\r"||o===`
560
+ `)&&d.type==="html"&&_7(d.value)!==7&&(h[h.length-1]=c.replace(/(\r?\n|\r)$/," "),o=" ",u=i.createTracker(r),u.move(Jh(h,r.before,r.after)));const _=i.handle.handlers[d.type];if(_&&_.attention){const x=Rv(d,_.attention,i,u);h.push(x),o=ma(x.sequences[0])}else{const x=i.handle(d,e,i,{...u.current(),after:v,before:o});if(!x)continue;u.move(x),h.push(x),o=ma(x)}}return s.pop(),h}function Rv(e,i,r,s){const{construct:l,markers:h,sizes:p}=i(e,r),o=S7(e.type,h,p),u=o[0],d=r.enter(l);s.move(u);const v=C7(e,r,{...s.current(),before:u,after:u});return s.move(Jh(v,u,u)),s.move(u),d(),{children:v,sequences:o}}function Av(e,i,r,s){const l=[];let h,p=ma(r),o=-1;for(;++o<e.length;){const u=e[o];if(typeof u=="string"){const w={value:u,attention:void 0};h&&h===wh(u)&&Ju([w],!0),h=void 0,l.push(w),w.value&&(p=ma(w.value));continue}const d=i.get(u)||u.sequences[0],v=d.charAt(0),c=e[o+1],_=p,x=wh(c===void 0?s:typeof c=="string"?c:i.get(c)||c.sequences[0]),C=Av(u.children,i,d,d),y=C.length>0?C[0].value:"",g=Zb(_.charCodeAt(_.length-1),y.charCodeAt(0),v);g.inside&&Ju(C,!0);const b=C.length>0?ma(C[C.length-1].value):"",S=Zb(x.charCodeAt(0),b.charCodeAt(b.length-1),v);S.inside&&Ju(C,!1),g.outside&&_!==`
561
+ `&&_!=="\r"&&Ju(l,!1),S.outside&&(h=x),l.push({value:d,attention:u},...C,{value:d,attention:u}),p=d.charAt(d.length-1)}return l}function Jh(e,i,r){let s=new Map;const l=Av(e,s,i,r);let h=l,p=F2(h,i,r);for(;p;){const u=b7(e,s,p,i,r);if(!u){h=l;break}s=u.chosen,h=u.tokens,p=u.mistake}let o="";for(const u of h)o+=u.value;return o}Dv.attention=U2;Dv.peek=k7;function Dv(e,i,r,s){const l=r.enter("phrasing"),h=Rv(e,U2,r,r.createTracker(s)),p=Jh([h],s.before,s.after);return l(),p}function U2(e,i){return{construct:"emphasis",markers:v7(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function k7(e,i,r){return r.options.emphasis||"*"}function E7(e,i){let r=!1;return Cv(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return r=!0,lh}),!!((!e.depth||e.depth<3)&&vv(e)&&(i.options.setext||r))}function T7(e,i,r,s){const l=Math.max(Math.min(6,e.depth||1),1),h=r.createTracker(s);if(E7(e,r)){const c=r.enter("headingSetext"),_=r.enter("phrasing"),x=r.containerPhrasing(e,{...h.current(),before:`
562
+ `,after:`
563
+ `});return _(),c(),x+`
564
+ `+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
565
+ `))+1))}const p="#".repeat(l),o=r.enter("headingAtx"),u=r.enter("phrasing");h.move(p+" ");let d=r.containerPhrasing(e,{before:"# ",after:`
566
+ `,...h.current()});const v=d.charCodeAt(0);return(v===9||v===32)&&(d=H2(v)+d.slice(1)),d=d?p+" "+d:p,r.options.closeAtx&&(d+=" "+p),u(),o(),d}$2.peek=R7;function $2(e){return e.value||""}function R7(){return"<"}q2.peek=A7;function q2(e,i,r,s){const l=Tv(r),h=l==='"'?"Quote":"Apostrophe",p=r.enter("image");let o=r.enter("label");const u=r.createTracker(s);let d=u.move("![");return d+=u.move(r.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(r.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(o=r.enter("destinationRaw"),d+=u.move(r.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=r.enter(`title${h}`),d+=u.move(" "+l),d+=u.move(r.safe(e.title,{before:d,after:l,...u.current()})),d+=u.move(l),o()),d+=u.move(")"),p(),d}function A7(){return"!"}V2.peek=D7;function V2(e,i,r,s){const l=e.referenceType,h=r.enter("imageReference");let p=r.enter("label");const o=r.createTracker(s);let u=o.move("![");const d=r.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(d+"]["),p();const v=r.stack;r.stack=v.filter(function(_){return _!=="phrasing"}),p=r.enter("reference");const c=r.safe(r.associationId(e),{before:u,after:"]",...o.current()});return p(),r.stack=v,h(),l==="full"||!d||d!==c?u+=o.move(c+"]"):l==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function D7(){return"!"}W2.peek=L7;function W2(e,i,r){let s=e.value||"",l="`",h=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^\n\r ]/.test(s)&&(/^[\n\r ]/.test(s)&&/[\n\r ]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++h<r.unsafe.length;){const p=r.unsafe[h],o=r.compilePattern(p);if(!p.atBreak)continue;let u;for(;u=o.exec(s);){let d=u.index;s.charCodeAt(d)===10&&s.charCodeAt(d-1)===13&&d--,s=s.slice(0,d)+" "+s.slice(u.index+1)}}return l+s+l}function L7(){return"`"}function G2(e,i){const r=vv(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Y2.peek=j7;function Y2(e,i,r,s){const l=Tv(r),h=l==='"'?"Quote":"Apostrophe",p=r.createTracker(s);if(G2(e,r)){const C=r.stack;r.stack=C.filter(function(b){return b!=="phrasing"});const y=r.enter("autolink");let g=p.move("<");return g+=p.move(r.containerPhrasing(e,{before:g,after:">",...p.current()})),g+=p.move(">"),y(),r.stack=C,g}const o=r.enter("link");let u=r.enter("label"),d=p.move("[");const v=r.containerPhrasing(e,{before:d,after:"](",...p.current()});d+=p.move(v),u(),d+=p.move("](");const c=/[\0- \u007F]/.test(e.url),_=s.before.charAt(s.before.length-1);let x=e.title||void 0;if(!x&&!c&&(_===`
567
+ `||_==="\r")){let C=0;for(;C<v.length&&v.charCodeAt(C)!==93;)C+=v.charCodeAt(C)===92?2:1;v.charCodeAt(C+1)===58&&(x="")}return!e.url&&typeof x=="string"||c?(u=r.enter("destinationLiteral"),d+=p.move("<"),d+=p.move(r.safe(e.url,{before:d,after:">",...p.current()})),d+=p.move(">")):(u=r.enter("destinationRaw"),d+=p.move(r.safe(e.url,{before:d,after:typeof x=="string"?" ":")",...p.current()}))),u(),typeof x=="string"&&(u=r.enter(`title${h}`),d+=p.move(" "+l),d+=p.move(r.safe(x,{before:d,after:l,...p.current()})),d+=p.move(l),u()),d+=p.move(")"),o(),d}function j7(e,i,r){return G2(e,r)?"<":"["}K2.peek=M7;function K2(e,i,r,s){const l=e.referenceType,h=r.enter("linkReference");let p=r.enter("label");const o=r.createTracker(s);let u=o.move("[");const d=r.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(d+"]["),p();const v=r.stack;r.stack=v.filter(function(_){return _!=="phrasing"}),p=r.enter("reference");const c=r.safe(r.associationId(e),{before:u,after:"]",...o.current()});return p(),r.stack=v,h(),l==="full"||!d||d!==c?u+=o.move(c+"]"):l==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function M7(){return"["}function Lv(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function N7(e){const i=Lv(e),r=e.options.bulletOther;if(!r)return i==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+r+"`) to be different");return r}function O7(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function X2(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function B7(e,i,r,s){const l=r.enter("list"),h=r.bulletCurrent;let p=e.ordered?O7(r):Lv(r);const o=e.ordered?p==="."?")":".":N7(r);let u=i&&r.bulletLastUsed?p===r.bulletLastUsed:!1;if(!e.ordered){const v=e.children?e.children[0]:void 0;if((p==="*"||p==="-")&&v&&(!v.children||!v.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),X2(r)===p&&v){let c=-1;for(;++c<e.children.length;){const _=e.children[c];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(p=o),r.bulletCurrent=p;const d=r.containerFlow(e,s);return r.bulletLastUsed=p,r.bulletCurrent=h,l(),d}function P7(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function z7(e,i,r,s){const l=P7(r);let h=r.bulletCurrent||Lv(r);i&&i.type==="list"&&i.ordered&&(h=(typeof i.start=="number"&&i.start>-1?i.start:1)+(r.options.incrementListMarker===!1?0:i.children.indexOf(e))+h);let p=h.length+1;(l==="tab"||l==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(p=Math.ceil(p/4)*4);const o=r.createTracker(s);o.move(h+" ".repeat(p-h.length)),o.shift(p);const u=r.enter("listItem"),d=r.indentLines(r.containerFlow(e,o.current()),v);return u(),d;function v(c,_,x){return _?(x?"":" ".repeat(p))+c:(x?h:h+" ".repeat(p-h.length))+c}}function I7(e,i,r,s){const l=r.enter("paragraph"),h=r.enter("phrasing"),p=r.containerPhrasing(e,s);return h(),l(),p}function H7(e,i,r,s){if(!e.children.some(function(o){return a7(o)}))return r.containerFlow(e,s);const h=r.enter("phrasing"),p=r.containerPhrasing(e,s);return h(),p}function F7(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}jv.attention=Q2;jv.peek=U7;function jv(e,i,r,s){const l=r.enter("phrasing"),h=Rv(e,Q2,r,r.createTracker(s)),p=Jh([h],s.before,s.after);return l(),p}function Q2(e,i){return{construct:"strong",markers:F7(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function U7(e,i,r){return r.options.strong||"*"}function $7(e,i,r,s){const l=i?i.children:[],h=r.indexStack[r.indexStack.length-1];return r.safe(e.value,{...s,afterNode:l[h+1],beforeNode:l[h-1]})}function q7(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function V7(e,i,r){const s=(X2(r)+(r.options.ruleSpaces?" ":"")).repeat(q7(r));return r.options.ruleSpaces?s.slice(0,-1):s}const Z2={blockquote:l7,break:Qb,code:p7,definition:g7,emphasis:Dv,hardBreak:Qb,heading:T7,html:$2,image:q2,imageReference:V2,inlineCode:W2,link:Y2,linkReference:K2,list:B7,listItem:z7,paragraph:I7,root:H7,strong:jv,text:$7,thematicBreak:V7};function W7(){return{enter:{table:G7,tableData:Jb,tableHeader:Jb,tableRow:K7},exit:{codeText:X7,table:Y7,tableData:_m,tableHeader:_m,tableRow:_m}}}function G7(e){const i=e._align;this.enter({type:"table",align:i.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function Y7(e){this.exit(e),this.data.inTable=void 0}function K7(e){this.enter({type:"tableRow",children:[]},e)}function _m(e){this.exit(e)}function Jb(e){this.enter({type:"tableCell",children:[]},e)}function X7(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,Q7));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(e)}function Q7(e,i){return i==="|"?i:e}function Z7(e){const i=e||{},r=i.tableCellPadding,s=i.tablePipeAlign,l=i.stringLength,h=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
568
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:p,tableCell:u,tableRow:o}};function p(x,C,y,g){return d(v(x,y,g),x.align)}function o(x,C,y,g){const b=c(x,y,g),S=d([b]);return S.slice(0,S.indexOf(`
569
+ `))}function u(x,C,y,g){const b=y.enter("tableCell"),S=y.enter("phrasing"),w=y.containerPhrasing(x,{...g,before:h,after:h});return S(),b(),w}function d(x,C){return s7(x,{align:C,alignDelimiters:s,padding:r,stringLength:l})}function v(x,C,y){const g=x.children;let b=-1;const S=[],w=C.enter("table");for(;++b<g.length;)S[b]=c(g[b],C,y);return w(),S}function c(x,C,y){const g=x.children;let b=-1;const S=[],w=C.enter("tableRow");for(;++b<g.length;)S[b]=u(g[b],x,C,y);return w(),S}function _(x,C,y){let g=Z2.inlineCode(x,C,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function J7(){return{exit:{taskListCheckValueChecked:ew,taskListCheckValueUnchecked:ew,paragraph:t8}}}function e8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:n8}}}function ew(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function t8(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const l=i.children;let h=-1,p;for(;++h<l.length;){const o=l[h];if(o.type==="paragraph"){p=o;break}}p===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function n8(e,i,r,s){const l=e.children[0],h=typeof e.checked=="boolean"&&l&&l.type==="paragraph",p="["+(e.checked?"x":" ")+"] ",o=r.createTracker(s);h&&o.move(p);let u=Z2.listItem(e,i,r,{...s,...o.current()});return h&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(v){return v+p}}function i8(){return[TO(),YO(),ZO(),W7(),J7()]}function r8(e){return{extensions:[RO(),KO(e),JO(),Z7(e),e8()]}}const s8={tokenize:h8,partial:!0},J2={tokenize:d8,partial:!0},e5={tokenize:f8,partial:!0},t5={tokenize:p8,partial:!0},o8={tokenize:m8,partial:!0},n5={name:"wwwAutolink",tokenize:c8,previous:r5},i5={name:"protocolAutolink",tokenize:u8,previous:s5},Dr={name:"emailAutolink",tokenize:l8,previous:o5},Zi={};function a8(){return{text:Zi}}let Vs=48;for(;Vs<123;)Zi[Vs]=Dr,Vs++,Vs===58?Vs=65:Vs===91&&(Vs=97);Zi[43]=Dr;Zi[45]=Dr;Zi[46]=Dr;Zi[95]=Dr;Zi[72]=[Dr,i5];Zi[104]=[Dr,i5];Zi[87]=[Dr,n5];Zi[119]=[Dr,n5];function l8(e,i,r){const s=this;let l,h;return p;function p(c){return!ug(c)||!o5.call(s,s.previous)||Mv(s.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return ug(c)?(e.consume(c),o):c===64?(e.consume(c),u):r(c)}function u(c){return c===46?e.check(o8,v,d)(c):c===45||c===95||_n(c)?(h=!0,e.consume(c),u):v(c)}function d(c){return e.consume(c),l=!0,u}function v(c){return h&&l&&vn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(c)):r(c)}}function c8(e,i,r){const s=this;return l;function l(p){return p!==87&&p!==119||!r5.call(s,s.previous)||Mv(s.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(s8,e.attempt(J2,e.attempt(e5,h),r),r)(p))}function h(p){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(p)}}function u8(e,i,r){const s=this;let l="",h=!1;return p;function p(c){return(c===72||c===104)&&s5.call(s,s.previous)&&!Mv(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),o):r(c)}function o(c){if(vn(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const _=l.toLowerCase();if(_==="http"||_==="https")return e.consume(c),u}return r(c)}function u(c){return c===47?(e.consume(c),h?d:(h=!0,u)):r(c)}function d(c){return c===null||_h(c)||St(c)||ro(c)||Yh(c)?r(c):e.attempt(J2,e.attempt(e5,v),r)(c)}function v(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(c)}}function h8(e,i,r){let s=0;return l;function l(p){return(p===87||p===119)&&s<3?(s++,e.consume(p),l):p===46&&s===3?(e.consume(p),h):r(p)}function h(p){return p===null?r(p):i(p)}}function d8(e,i,r){let s,l,h;return p;function p(d){return d===46||d===95?e.check(t5,u,o)(d):d===null||St(d)||ro(d)||d!==45&&Yh(d)?u(d):(h=!0,e.consume(d),p)}function o(d){return d===95?s=!0:(l=s,s=void 0),e.consume(d),p}function u(d){return l||s||!h?r(d):i(d)}}function f8(e,i){let r=0,s=0;return l;function l(p){return p===40?(r++,e.consume(p),l):p===41&&s<r?h(p):p===33||p===34||p===38||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===60||p===63||p===93||p===95||p===126?e.check(t5,i,h)(p):p===null||St(p)||ro(p)?i(p):(e.consume(p),l)}function h(p){return p===41&&s++,e.consume(p),l}}function p8(e,i,r){return s;function s(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),s):o===38?(e.consume(o),h):o===93?(e.consume(o),l):o===60||o===null||St(o)||ro(o)?i(o):r(o)}function l(o){return o===null||o===40||o===91||St(o)||ro(o)?i(o):s(o)}function h(o){return vn(o)?p(o):r(o)}function p(o){return o===59?(e.consume(o),s):vn(o)?(e.consume(o),p):r(o)}}function m8(e,i,r){return s;function s(h){return e.consume(h),l}function l(h){return _n(h)?r(h):i(h)}}function r5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||St(e)}function s5(e){return!vn(e)}function o5(e){return!(e===47||ug(e))}function ug(e){return e===43||e===45||e===46||e===95||_n(e)}function Mv(e){let i=e.length,r=!1;for(;i--;){const s=e[i][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const g8={tokenize:C8,partial:!0};function v8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:b8,continuation:{tokenize:w8},exit:S8}},text:{91:{name:"gfmFootnoteCall",tokenize:y8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_8,resolveTo:x8}}}}function _8(e,i,r){const s=this;let l=s.events.length;const h=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let p;for(;l--;){const u=s.events[l][1];if(u.type==="labelImage"){p=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!p||!p._balanced)return r(u);const d=Ti(s.sliceSerialize({start:p.end,end:s.now()}));return d.codePointAt(0)!==94||!h.includes(d.slice(1))?r(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),i(u))}}function x8(e,i){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const h={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},p={type:"chunkString",contentType:"string",start:Object.assign({},h.start),end:Object.assign({},h.end)},o=[e[r+1],e[r+2],["enter",s,i],e[r+3],e[r+4],["enter",l,i],["exit",l,i],["enter",h,i],["enter",p,i],["exit",p,i],["exit",h,i],e[e.length-2],e[e.length-1],["exit",s,i]];return e.splice(r,e.length-r+1,...o),e}function y8(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h=0,p;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?r(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(c){if(h>999||c===93&&!p||c===null||c===91||St(c))return r(c);if(c===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return l.includes(Ti(s.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(c)}return St(c)||(p=!0),h++,e.consume(c),c===92?v:d}function v(c){return c===91||c===92||c===93?(e.consume(c),h++,d):d(c)}}function b8(e,i,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h,p=0,o;return u;function u(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",v):r(C)}function v(C){if(p>999||C===93&&!o||C===null||C===91||St(C))return r(C);if(C===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return h=Ti(s.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return St(C)||(o=!0),p++,e.consume(C),C===92?c:v}function c(C){return C===91||C===92||C===93?(e.consume(C),p++,v):v(C)}function _(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),l.includes(h)||l.push(h),lt(e,x,"gfmFootnoteDefinitionWhitespace")):r(C)}function x(C){return i(C)}}function w8(e,i,r){return e.check(ac,i,e.attempt(g8,i,r))}function S8(e){e.exit("gfmFootnoteDefinition")}function C8(e,i,r){const s=this;return lt(e,l,"gfmFootnoteDefinitionIndent",5);function l(h){const p=s.events[s.events.length-1];return p&&p[1].type==="gfmFootnoteDefinitionIndent"&&p[2].sliceSerialize(p[1],!0).length===4?i(h):r(h)}}function k8(e){let r=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:h,resolveAll:l};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(p,o){let u=-1;for(;++u<p.length;)if(p[u][0]==="enter"&&p[u][1].type==="strikethroughSequenceTemporary"&&p[u][1]._close){let d=u;for(;d--;)if(p[d][0]==="exit"&&p[d][1].type==="strikethroughSequenceTemporary"&&p[d][1]._open&&p[u][1].end.offset-p[u][1].start.offset===p[d][1].end.offset-p[d][1].start.offset){p[u][1].type="strikethroughSequence",p[d][1].type="strikethroughSequence";const v={type:"strikethrough",start:Object.assign({},p[d][1].start),end:Object.assign({},p[u][1].end)},c={type:"strikethroughText",start:Object.assign({},p[d][1].end),end:Object.assign({},p[u][1].start)},_=[["enter",v,o],["enter",p[d][1],o],["exit",p[d][1],o],["enter",c,o]],x=o.parser.constructs.insideSpan.null;x&&Ei(_,_.length,0,Kh(x,p.slice(d+1,u),o)),Ei(_,_.length,0,[["exit",c,o],["enter",p[u][1],o],["exit",p[u][1],o],["exit",v,o]]),Ei(p,d-1,u-d+3,_),u=d+_.length-2;break}}for(u=-1;++u<p.length;)p[u][1].type==="strikethroughSequenceTemporary"&&(p[u][1].type="data");return p}function h(p,o,u){const d=this.previous,v=this.events;let c=0;return _;function _(C){return d===126&&v[v.length-1][1].type!=="characterEscape"?u(C):(p.enter("strikethroughSequenceTemporary"),x(C))}function x(C){const y=ms(d);if(C===126)return c>1?u(C):(p.consume(C),c++,x);if(c<2&&!r)return u(C);const g=p.exit("strikethroughSequenceTemporary"),b=ms(C);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,o(C)}}}class E8{constructor(){this.map=[],this.index=new Map}add(i,r,s){T8(this,i,r,s)}consume(i){if(this.map.sort(function(h,p){return h[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let l=s.pop();for(;l;){for(const h of l)i.push(h);l=s.pop()}this.map.length=0,this.index.clear()}}function T8(e,i,r,s){if(r===0&&s.length===0)return;const l=e.index.get(i);if(l){l[1]+=r,l[2].push(...s);return}const h=[i,r,s];e.map.push(h),e.index.set(i,h)}function R8(e,i){let r=!1;const s=[];for(;i<e.length;){const l=e[i];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const h=s.length-1;s[h]=s[h]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return s}function A8(){return{flow:{null:{name:"table",tokenize:D8,resolveAll:L8}}}}function D8(e,i,r){const s=this;let l=0,h=0,p;return o;function o(j){let z=s.events.length-1;for(;z>-1;){const{type:F}=s.events[z][1];if(F==="lineEnding"||F==="linePrefix")z--;else break}const P=z>-1?s.events[z][1].type:null,H=P==="tableHead"||P==="tableRow"?R:u;return H===R&&s.parser.lazy[s.now().line]?r(j):H(j)}function u(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(p=!0,h+=1),v(j)}function v(j){return j===null?r(j):Oe(j)?h>1?(h=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),x):r(j):Ze(j)?lt(e,v,"whitespace")(j):(h+=1,p&&(p=!1,l+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),p=!0,v):(e.enter("data"),c(j)))}function c(j){return j===null||j===124||St(j)?(e.exit("data"),v(j)):(e.consume(j),j===92?_:c)}function _(j){return j===92||j===124?(e.consume(j),c):c(j)}function x(j){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(j):(e.enter("tableDelimiterRow"),p=!1,Ze(j)?lt(e,C,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):C(j))}function C(j){return j===45||j===58?g(j):j===124?(p=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),y):D(j)}function y(j){return Ze(j)?lt(e,g,"whitespace")(j):g(j)}function g(j){return j===58?(h+=1,p=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),b):j===45?(h+=1,b(j)):j===null||Oe(j)?T(j):D(j)}function b(j){return j===45?(e.enter("tableDelimiterFiller"),S(j)):D(j)}function S(j){return j===45?(e.consume(j),S):j===58?(p=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(j))}function w(j){return Ze(j)?lt(e,T,"whitespace")(j):T(j)}function T(j){return j===124?C(j):j===null||Oe(j)?!p||l!==h?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(j)):D(j)}function D(j){return r(j)}function R(j){return e.enter("tableRow"),L(j)}function L(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),L):j===null||Oe(j)?(e.exit("tableRow"),i(j)):Ze(j)?lt(e,L,"whitespace")(j):(e.enter("data"),A(j))}function A(j){return j===null||j===124||St(j)?(e.exit("data"),L(j)):(e.consume(j),j===92?M:A)}function M(j){return j===92||j===124?(e.consume(j),A):A(j)}}function L8(e,i){let r=-1,s=!0,l=0,h=[0,0,0,0],p=[0,0,0,0],o=!1,u=0,d,v,c;const _=new E8;for(;++r<e.length;){const x=e[r],C=x[1];x[0]==="enter"?C.type==="tableHead"?(o=!1,u!==0&&(tw(_,i,u,d,v),v=void 0,u=0),d={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},_.add(r,0,[["enter",d,i]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(s=!0,c=void 0,h=[0,0,0,0],p=[0,r+1,0,0],o&&(o=!1,v={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},_.add(r,0,[["enter",v,i]])),l=C.type==="tableDelimiterRow"?2:v?3:1):l&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(s=!1,p[2]===0&&(h[1]!==0&&(p[0]=p[1],c=eh(_,i,h,l,void 0,c),h=[0,0,0,0]),p[2]=r)):C.type==="tableCellDivider"&&(s?s=!1:(h[1]!==0&&(p[0]=p[1],c=eh(_,i,h,l,void 0,c)),h=p,p=[h[1],r,0,0])):C.type==="tableHead"?(o=!0,u=r):C.type==="tableRow"||C.type==="tableDelimiterRow"?(u=r,h[1]!==0?(p[0]=p[1],c=eh(_,i,h,l,r,c)):p[1]!==0&&(c=eh(_,i,p,l,r,c)),l=0):l&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(p[3]=r)}for(u!==0&&tw(_,i,u,d,v),_.consume(i.events),r=-1;++r<i.events.length;){const x=i.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=R8(i.events,r))}return e}function eh(e,i,r,s,l,h){const p=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",o="tableContent";r[0]!==0&&(h.end=Object.assign({},ua(i.events,r[0])),e.add(r[0],0,[["exit",h,i]]));const u=ua(i.events,r[1]);if(h={type:p,start:Object.assign({},u),end:Object.assign({},u)},e.add(r[1],0,[["enter",h,i]]),r[2]!==0){const d=ua(i.events,r[2]),v=ua(i.events,r[3]),c={type:o,start:Object.assign({},d),end:Object.assign({},v)};if(e.add(r[2],0,[["enter",c,i]]),s!==2){const _=i.events[r[2]],x=i.events[r[3]];if(_[1].end=Object.assign({},x[1].end),_[1].type="chunkText",_[1].contentType="text",r[3]>r[2]+1){const C=r[2]+1,y=r[3]-r[2]-1;e.add(C,y,[])}}e.add(r[3]+1,0,[["exit",c,i]])}return l!==void 0&&(h.end=Object.assign({},ua(i.events,l)),e.add(l,0,[["exit",h,i]]),h=void 0),h}function tw(e,i,r,s,l){const h=[],p=ua(i.events,r);l&&(l.end=Object.assign({},p),h.push(["exit",l,i])),s.end=Object.assign({},p),h.push(["exit",s,i]),e.add(r+1,0,h)}function ua(e,i){const r=e[i],s=r[0]==="enter"?"start":"end";return r[1][s]}const j8={name:"tasklistCheck",tokenize:N8};function M8(){return{text:{91:j8}}}function N8(e,i,r){const s=this;return l;function l(u){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),h)}function h(u){return St(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),p):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),p):r(u)}function p(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):r(u)}function o(u){return Oe(u)?i(u):Ze(u)?e.check({tokenize:O8},i,r)(u):r(u)}}function O8(e,i,r){return lt(e,s,"whitespace");function s(l){return l===null?r(l):i(l)}}function B8(e){return f2([a8(),v8(),k8(e),A8(),M8()])}const P8={};function z8(e){const i=this,r=e||P8,s=i.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),h=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),p=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(B8(r)),h.push(i8()),p.push(r8(r))}function Nv({children:e,className:i}){return m.jsx("div",{className:ye("space-y-2 font-serif leading-relaxed",i),children:m.jsx(vO,{remarkPlugins:[z8],components:{p:({children:r})=>m.jsx("p",{className:"whitespace-pre-wrap",children:r}),h1:({children:r})=>m.jsx("h1",{className:"font-sans text-sm font-semibold",children:r}),h2:({children:r})=>m.jsx("h2",{className:"font-sans text-sm font-semibold",children:r}),h3:({children:r})=>m.jsx("h3",{className:"font-sans text-xs font-semibold uppercase tracking-wide",children:r}),ul:({children:r})=>m.jsx("ul",{className:"list-disc space-y-1 pl-4",children:r}),ol:({children:r})=>m.jsx("ol",{className:"list-decimal space-y-1 pl-4",children:r}),li:({children:r})=>m.jsx("li",{className:"marker:text-muted-foreground",children:r}),a:({children:r,href:s})=>m.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2",children:r}),blockquote:({children:r})=>m.jsx("blockquote",{className:"border-l-2 border-border pl-3 italic text-foreground/80",children:r}),code:({className:r,children:s})=>!!r?m.jsx("code",{className:"block overflow-x-auto font-mono text-xs",children:s}):m.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]",children:s}),pre:({children:r})=>m.jsx("pre",{className:"overflow-x-auto rounded-md bg-muted p-2 font-mono text-xs",children:r}),table:({children:r})=>m.jsx("div",{className:"overflow-x-auto",children:m.jsx("table",{className:"w-full border-collapse text-xs",children:r})}),th:({children:r})=>m.jsx("th",{className:"border-b px-2 py-1 text-left font-sans font-medium",children:r}),td:({children:r})=>m.jsx("td",{className:"border-b border-border/50 px-2 py-1 align-top",children:r}),hr:()=>m.jsx("hr",{className:"border-border"})},children:e})})}function I8(e){const i=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(e);if(!i)return{fields:[],body:e};const r=[];for(const s of i[1].split(/\r?\n/)){const l=/^([A-Za-z0-9_-]+):\s*(.*)$/.exec(s);l?r.push([l[1],l[2]]):r.length&&s.trim()&&(r[r.length-1][1]+=` ${s.trim()}`)}return{fields:r,body:e.slice(i[0].length)}}function H8({mode:e,onChange:i,editable:r}){const s=[["view",Ql,"View mode"],["edit",Xi,r?"Edit mode":"Edit mode (read-only)"]];return m.jsx("div",{className:"flex rounded-md border bg-card p-0.5",children:s.map(([l,h,p])=>m.jsx("button",{title:p,"aria-label":p,"aria-pressed":e===l,onClick:()=>i(l),className:ye("rounded p-1 transition-colors",e===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:m.jsx(h,{size:13})},l))})}function cc({value:e,onChange:i,rows:r=24,fill:s=!1,blame:l,fileBlame:h,defaultMode:p="view",className:o}){const[u,d]=N.useState(p),{fields:v,body:c}=I8(e),_={height:s?"100%":`${r*1.6+1}rem`};return m.jsxs("div",{className:ye("flex flex-col overflow-hidden rounded border bg-transparent",s&&"h-full",o),children:[m.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b px-2 py-1",children:[m.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:u==="view"?"View":i?"Edit":"Raw (read-only)"}),m.jsx(H8,{mode:u,onChange:d,editable:!!i})]}),u==="view"?m.jsxs("div",{className:ye("overflow-y-auto px-4 py-3",s&&"min-h-0 flex-1"),style:s?void 0:_,children:[v.length>0&&m.jsx("table",{className:"mb-3 w-full border-collapse text-[11px]",children:m.jsx("tbody",{children:v.map(([x,C])=>m.jsxs("tr",{className:"border-b border-border/60",children:[m.jsx("td",{className:"w-32 py-1 pr-3 align-top font-mono text-muted-foreground",children:x}),m.jsx("td",{className:"py-1 align-top [overflow-wrap:anywhere]",children:C})]},x))})}),c.trim()?m.jsx(Nv,{className:"text-xs",children:c}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"Empty."})]}):m.jsx("div",{className:ye(s&&"min-h-0 flex-1"),style:s?void 0:_,children:m.jsx(ZC,{value:e,onChange:i,language:"markdown",wrap:!0,blame:l,fileBlame:h})})]})}function F8(e,i){const r=e.split(`
570
+ `),s=i.split(`
571
+ `),l=Array.from({length:r.length+1},()=>new Uint32Array(s.length+1));for(let u=r.length-1;u>=0;u-=1)for(let d=s.length-1;d>=0;d-=1)l[u][d]=r[u]===s[d]?l[u+1][d+1]+1:Math.max(l[u+1][d],l[u][d+1]);const h=[];let p=0,o=0;for(;p<r.length&&o<s.length;)r[p]===s[o]?(h.push({type:" ",line:r[p]}),p+=1,o+=1):l[p+1][o]>=l[p][o+1]?h.push({type:"-",line:r[p++]}):h.push({type:"+",line:s[o++]});for(;p<r.length;)h.push({type:"-",line:r[p++]});for(;o<s.length;)h.push({type:"+",line:s[o++]});return h}function Sh({before:e,after:i}){const r=F8(e,i);return m.jsx("pre",{className:"max-h-[60vh] overflow-auto rounded border font-mono text-[11px]",children:r.filter((s,l)=>s.type!==" "||r.slice(Math.max(0,l-2),l+3).some(h=>h.type!==" ")).map((s,l)=>m.jsxs("div",{className:ye("px-2",s.type==="+"&&"bg-success/20",s.type==="-"&&"bg-destructive/20"),children:[s.type," ",s.line]},l))})}function a5({path:e,title:i,badge:r,subtitle:s,onSaved:l}){const h=ln(),[p,o]=N.useState(null),[u,d]=N.useState(!1),[v,c]=N.useState(""),[_,x]=N.useState(null);if(N.useEffect(()=>{o(null),x(null),ve.memoryFile(e).then(g=>{o(g.content),c(g.content),d(g.writable)},g=>x(g.message))},[e]),_)return m.jsx("div",{className:"text-xs text-severity-critical",children:_});if(p===null)return m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."});const C=v!==p,y=()=>h({title:`Write ${i}?`,description:"Writes the real file on disk.",body:m.jsx(Sh,{before:p,after:v}),confirmLabel:"Write file",maxWidth:"max-w-3xl",run:async()=>{const g=await ve.saveMemoryFile(e,v);o(g.content),_e.getState().notify("Written."),l==null||l()}});return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsxs("h2",{className:"flex items-center gap-2 font-mono text-sm font-semibold",children:[m.jsx("span",{className:"min-w-0 truncate",children:i}),r]}),m.jsxs("p",{className:"break-all text-[11px] text-muted-foreground",children:[s??e,!u&&" · read-only (managed by a plugin)",u&&!p&&" · does not exist yet; saving creates it"]})]}),u&&m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[C&&m.jsx(ge,{onClick:()=>c(p),children:"Discard"}),m.jsx(ge,{variant:"primary",disabled:!C,onClick:()=>void y(),children:"Review & save"})]})]}),m.jsx(cc,{rows:26,value:v,onChange:u?c:void 0})]})}function U8({path:e,kind:i,tick:r}){const[s,l]=N.useState(!1),[h,p]=N.useState(0);N.useEffect(()=>{let u=!1;return Jt.stat(e).then(d=>!u&&p(d.mtimeMs),()=>{}),()=>{u=!0}},[e,r]),N.useEffect(()=>l(!1),[e,h]);const o=`${Km(e)}?v=${h}`;return s?m.jsx(Gt,{icon:Am,title:"The browser cannot show this file.",hint:"Its format is not one this browser plays or displays."}):m.jsxs("div",{className:"flex h-full items-center justify-center overflow-auto rounded border bg-muted/20 p-3",children:[i==="image"&&m.jsx("img",{src:o,alt:e,onError:()=>l(!0),className:"max-h-full max-w-full object-contain"}),i==="audio"&&m.jsx("audio",{controls:!0,src:o,onError:()=>l(!0),className:"w-full max-w-xl"},o),i==="video"&&m.jsx("video",{controls:!0,src:o,onError:()=>l(!0),className:"max-h-full max-w-full"},o)]})}function nw(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const $8=1500,q8=1e3,iw="clauder-hub:file-blame";function V8(e){const i=Math.floor((Date.now()/1e3-e)/86400);if(i<1){const r=Math.floor((Date.now()/1e3-e)/3600);return r<1?"just now":`${r} hour${r>1?"s":""} ago`}return i<30?`${i} day${i>1?"s":""} ago`:new Date(e*1e3).toLocaleDateString()}const W8=e=>Jt.commit(e).then(i=>i.message);function G8({path:e}){const i=on(U=>U.drafts[e]),{put:r,drop:s}=on.getState(),l=_e(U=>U.ticks.files),[h,p]=N.useState(null),[o,u]=N.useState(null),[d,v]=N.useState(!1),[c,_]=N.useState(!1),[x,C]=N.useState(null),y=N.useRef(!1),g=N.useRef(null),b=N.useRef(0),S=N.useRef(0),w=ls(i),T=ub(e),D=sL(e),[R,L]=N.useState("preview"),[A,M]=N.useState(null),[j,z]=N.useState(()=>{try{return localStorage.getItem(iw)==="1"}catch{return!1}}),P=()=>{const U=!j;z(U);try{localStorage.setItem(iw,U?"1":"0")}catch{}},H=i==null?void 0:i.mtimeMs;N.useEffect(()=>{if(H===void 0)return;let U=!1;return Jt.blame(e).then(V=>!U&&M(V),()=>!U&&M(null)),()=>{U=!0}},[e,H]);const F=N.useMemo(()=>A!=null&&A.available&&!w?{you:A.you,commits:A.commits,lines:A.lines,details:W8}:void 0,[A,w]),W=(()=>{if(!(A!=null&&A.available))return null;const U=Object.values(A.commits).filter(K=>!K.uncommitted),V=U.sort((K,$)=>$.time-K.time)[0],ne=new Set(U.map(K=>K.author)).size,le=Object.values(A.commits).some(K=>K.uncommitted);return{latest:V,authors:ne,uncommitted:le,you:A.you}})(),G=N.useCallback((U=!1)=>{if(!U&&ls(on.getState().drafts[e])||ub(e))return;const V=Iu();Jt.read(e).then(ne=>{if(Iu()===V){if(u(null),_(!1),C(null),ne.kind!=="text"){p({kind:ne.kind,size:ne.size}),s(e);return}p(null),r(e,{text:ne.content,base:ne.content,mtimeMs:ne.mtimeMs})}},ne=>u(ne.message))},[e,r,s]);N.useEffect(()=>G(),[G,l]);const Q=N.useCallback(async(U=!1,V=!1)=>{var K;const ne=on.getState().drafts[e];if(!ne||y.current)return;const le=Iu();v(!0),y.current=!0;try{const $=await Jt.write(e,ne.text,U?void 0:ne.mtimeMs);if(g.current=null,Iu()!==le)return;const oe=((K=on.getState().drafts[e])==null?void 0:K.text)??ne.text;r(e,{text:oe,base:ne.text,mtimeMs:$.mtimeMs}),_(!1),C(null),V||_e.getState().notify("Saved.")}catch($){$ instanceof QC&&$.status===409?_(!0):(g.current=ne.text,_e.getState().notify($.message,"error"))}finally{v(!1),y.current=!1}},[e,r]);N.useEffect(()=>{let U=!1;const V=async()=>{const le=on.getState().drafts[e];if(U||!le||y.current||document.hidden)return;const K=await Jt.stat(e).catch(()=>null);if(!K||U||y.current)return;const $=on.getState().drafts[e];if($){if(!K.exists){if(S.current===-1)return;C(oe=>(oe==null?void 0:oe.state)==="deleted"?oe:{state:"deleted",comparing:!1});return}if(K.mtimeMs!==$.mtimeMs){if(!ls($))return G(!0);b.current=K.mtimeMs,K.mtimeMs!==S.current&&C(oe=>(oe==null?void 0:oe.state)==="changed"?oe:{state:"changed",comparing:!1})}}},ne=setInterval(()=>void V(),$8);return()=>{U=!0,clearInterval(ne)}},[e,G]);const X=Ty(U=>U.on);N.useEffect(()=>{if(!X||!w||c||x||(i==null?void 0:i.text)===g.current)return;const U=window.setTimeout(()=>void Q(!1,!0),q8);return()=>window.clearTimeout(U)},[X,w,c,x,i==null?void 0:i.text,Q]);const I=async()=>{const U=await Jt.read(e).catch(()=>null);(U==null?void 0:U.kind)==="text"&&C({state:"changed",content:U.content,comparing:!0})};N.useEffect(()=>{const U=V=>{(V.ctrlKey||V.metaKey)&&V.key.toLowerCase()==="s"&&(V.preventDefault(),ls(on.getState().drafts[e])&&Q())};return window.addEventListener("keydown",U,!0),()=>window.removeEventListener("keydown",U,!0)},[e,Q]),N.useEffect(()=>In.getState().show(e),[e]);const O=U=>{const V=on.getState().drafts[e];V&&r(e,{...V,text:U}),In.getState().pin(e)},Y=e.split("/").pop()??e,Z=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"project root";return m.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[m.jsxs("div",{className:"space-y-3 px-5 pb-3 pt-4",children:[m.jsx(Qi,{group:"Files",title:Y,description:Z,action:(T||i)&&m.jsxs(m.Fragment,{children:[D&&i&&m.jsxs(ge,{onClick:()=>L(R==="preview"?"code":"preview"),title:R==="preview"?"Edit the HTML":"Show the page",children:[R==="preview"?m.jsx(i4,{size:13}):m.jsx(Ql,{size:13})," ",R==="preview"?"Code":"Preview"]}),(T||D)&&m.jsx("a",{href:Km(e),target:"_blank",rel:"noreferrer",title:"Open in a new browser tab",className:"inline-flex items-center rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:m.jsx(Sa,{size:13})}),i&&m.jsxs(m.Fragment,{children:[w&&!X&&m.jsx("span",{className:"self-center text-[11px] text-severity-warning",children:"Unsaved, kept while this page is open"}),m.jsx(Cr,{label:"Auto save",title:"For every file: saves 1 second after you stop typing",checked:X,onCheckedChange:U=>{Ty.getState().set(U),_e.getState().notify(U?"Auto save on: every file saves itself 1 second after you stop typing.":"Auto save off: save with the Save button or Ctrl+S.")},className:"mr-1"}),w&&m.jsx(ge,{onClick:()=>r(e,{...i,text:i.base}),children:"Discard"}),m.jsxs(ge,{variant:"primary",disabled:!w||d,onClick:()=>void Q(),title:"Save (Ctrl+S)",children:[m.jsx(C4,{size:13})," ",d?"Saving...":"Save"]})]})]})}),A&&m.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[m.jsx(l4,{size:13,className:"shrink-0"}),A.available?m.jsxs(m.Fragment,{children:[(W==null?void 0:W.latest)&&m.jsxs("span",{className:"min-w-0 truncate",title:W.latest.summary,children:["Last change: ",m.jsx("span",{className:"text-foreground",children:W.latest.author===W.you?"You":W.latest.author}),", ",V8(W.latest.time)," · ",W.latest.summary]}),m.jsxs("span",{children:[(W==null?void 0:W.authors)??0," author",(W==null?void 0:W.authors)===1?"":"s"]}),(W==null?void 0:W.uncommitted)&&m.jsx("span",{className:"text-severity-warning",children:"uncommitted changes"}),w&&m.jsx("span",{children:"blame hidden while editing"}),m.jsxs("button",{className:ye("ml-auto rounded px-1.5 py-0.5 transition-colors",j?"bg-primary/15 text-primary":"hover:bg-muted hover:text-foreground"),onClick:P,title:"Show who last changed every line",children:["File blame ",j?"on":"off"]})]}):m.jsx("span",{children:A.reason})]}),x&&!c&&m.jsxs("div",{className:"space-y-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.jsx("span",{className:"flex-1",children:x.state==="deleted"?"This file was deleted on disk. Your unsaved edits are still here.":"This file changed on disk while you were editing it. Your edits are kept; saving will ask before overwriting."}),x.state==="changed"&&m.jsx(ge,{onClick:()=>x.comparing?C({...x,comparing:!1}):void I(),children:x.comparing?"Hide changes":"Compare"}),x.state==="changed"&&m.jsx(ge,{onClick:()=>G(!0),children:"Reload from disk"}),m.jsx(ge,{variant:"ghost",onClick:()=>{S.current=x.state==="deleted"?-1:b.current,C(null)},children:"Keep editing"})]}),x.comparing&&x.content!==void 0&&i&&m.jsx(Sh,{before:x.content,after:i.text})]}),c&&m.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-severity-warning/50 bg-severity-warning/10 px-3 py-2 text-xs",children:[m.jsx("span",{className:"flex-1",children:"This file changed on disk since it was opened. Overwrite it with your version, or reload it and lose your edits."}),m.jsx(ge,{variant:"primary",onClick:()=>void Q(!0),children:"Overwrite"}),m.jsx(ge,{onClick:()=>G(!0),children:"Reload from disk"})]})]}),m.jsx("div",{className:"min-h-0 flex-1 px-5 pb-5",children:T?m.jsx(U8,{path:e,kind:T,tick:l}):o?m.jsx(Gt,{icon:Am,title:o}):h?m.jsx(Gt,{icon:Am,title:h.kind==="binary"?"A binary file":"Too large to open here",hint:h.kind==="binary"?`${nw(h.size)}; it is not shown as text.`:`${nw(h.size)}; files over 2 MB are not opened in the editor.`}):i?D&&R==="preview"?m.jsx("iframe",{title:Y,src:`${Km(e)}?v=${i.mtimeMs}`,sandbox:"allow-scripts allow-forms allow-popups allow-modals",className:"h-full w-full rounded border bg-white"},i.mtimeMs):rL(e)?m.jsx(cc,{fill:!0,value:i.text,onChange:O,blame:F,fileBlame:j}):m.jsx("div",{className:"h-full overflow-hidden rounded border",children:m.jsx(ZC,{path:e,value:i.text,onChange:O,blame:F,fileBlame:j})}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})})]})}function Y8({value:e,onChange:i,categories:r,allowNone:s=!0}){return m.jsxs(vi,{value:e,onValueChange:i,children:[s&&m.jsx(wt,{value:"",children:"None (stays open until you stop it)"}),m.jsx(wt,{value:"auto",children:"Auto (Claude picks one)"}),r.map(l=>m.jsx(wt,{value:l.name,children:l.name},l.id))]})}const K8={"claude-system":"Appended to Claude's system prompt","claude-typed":"Typed into the session",channel:"Sent to channels"};function X8(){const e=rt(()=>ve.prompts(),[]),[i,r]=N.useState("preview"),[s,l]=N.useState(!1),h=p=>{r(p),l(!0)};return m.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[m.jsx("div",{className:"border-b px-5 py-4",children:m.jsx(Qi,{group:"Settings",title:"Hub prompts",description:"Text the hub adds to sessions and sends to channels."})}),m.jsxs("div",{className:"flex min-h-0 flex-1",children:[m.jsxs("div",{className:ye("w-full shrink-0 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",s&&"hidden"),children:[m.jsx(rw,{active:i==="preview",onClick:()=>h("preview"),children:"Preview what a session gets"}),["claude-system","claude-typed","channel"].map(p=>m.jsxs("div",{className:"mt-3",children:[m.jsx("div",{className:"px-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:K8[p]}),(e.data??[]).filter(o=>o.audience===p).map(o=>m.jsxs(rw,{active:i===o.key,onClick:()=>h(o.key),children:[m.jsx("span",{className:"min-w-0 flex-1 truncate",children:o.label}),o.overridden&&m.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-primary",title:"Edited"})]},o.key))]},p))]}),m.jsxs("div",{className:ye("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!s&&"hidden"),children:[m.jsx(uv,{onClick:()=>l(!1)}),i==="preview"?m.jsx(Z8,{}):e.data&&m.jsx(Q8,{prompt:e.data.find(p=>p.key===i),onSaved:e.reload},i)]})]})]})}function rw({active:e,onClick:i,children:r}){return m.jsxs("button",{onClick:i,className:ye("flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs",e?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[m.jsx(Gw,{size:12,className:"shrink-0"}),r]})}function Q8({prompt:e,onSaved:i}){const r=ln(),[s,l]=N.useState(e.text),h=s!==e.text,p=()=>r({title:`Save "${e.label}"?`,description:"New sessions get the new text.",body:m.jsx(Sh,{before:e.text,after:s}),confirmLabel:"Save",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,s),_e.getState().notify("Saved."),i()}}),o=()=>r({title:"Restore the default text?",description:"Your version is discarded.",body:m.jsx(Sh,{before:e.text,after:e.defaultText}),confirmLabel:"Restore default",tone:"destructive",maxWidth:"max-w-3xl",run:async()=>{await ve.savePrompt(e.key,null),l(e.defaultText),i()}});return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold",children:[e.label,e.overridden&&m.jsx(Xe,{tone:"on",children:"edited"})]}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.overridden&&m.jsxs(ge,{variant:"ghost",onClick:()=>void o(),children:[m.jsx(S4,{size:12})," Restore default"]}),h&&m.jsx(ge,{onClick:()=>l(e.text),children:"Discard"}),m.jsx(ge,{variant:"primary",disabled:!h,onClick:()=>void p(),children:"Review & save"})]})]}),e.placeholders.length>0&&m.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Placeholders:"," ",e.placeholders.map(u=>m.jsx("code",{className:"mr-1 rounded bg-muted px-1 font-mono",children:`{{${u}}}`},u))]}),m.jsx(cc,{rows:22,value:s,onChange:l})]})}function Z8(){const[e,i]=N.useState(""),[r,s]=N.useState([]),l=rt(()=>ve.previewSystemPrompt(e),[],e);return N.useEffect(()=>{ve.categories().then(s)},[]),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-sm font-semibold",children:"What the hub appends to a session"}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Passed with --append-system-prompt-file, after Claude Code's own system prompt and your CLAUDE.md files, which still load as usual. Pick a category to see the done protocol a triggered run gets."})]}),m.jsx("div",{className:"w-full max-w-[18rem]",children:m.jsx(Y8,{value:e,onChange:i,categories:r})}),l.data?m.jsx(cc,{rows:24,value:l.data.text}):m.jsx(Gt,{variant:"inline",title:"Loading..."})]})}function l5(e){const[i,r]=N.useState(()=>window.matchMedia(e).matches);return N.useEffect(()=>{const s=window.matchMedia(e),l=()=>r(s.matches);return l(),s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),i}function Ch(e,i,{min:r=200,max:s=720}={}){const l=N.useCallback(d=>Math.min(s,Math.max(r,Math.round(d))),[r,s]),[h,p]=N.useState(()=>{try{const d=Number(localStorage.getItem(e));return d?l(d):i}catch{return i}});N.useEffect(()=>{try{localStorage.setItem(e,String(h))}catch{}},[e,h]);const o=N.useCallback(d=>p(v=>l(v+d)),[l]),u=N.useCallback(()=>p(i),[i]);return{width:h,resizeBy:o,reset:u}}function hg({placeholder:e,disabled:i,onSend:r,value:s,onChange:l,autoFocus:h,className:p}){return m.jsx(sc,{rows:1,autoFocus:h,value:s,disabled:i,placeholder:`${e.replace(/\.\.\.$/,"")} (Enter to send)`,onChange:o=>l(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),s.trim()&&r(s))},className:ye("min-h-[32px] flex-1 font-sans",p)})}const dg=e=>`clauder-hub:answer:${e}`;function J8(e,i){const[r,s]=N.useState(()=>{try{const h=localStorage.getItem(dg(e));return h?{...i,...JSON.parse(h)}:i}catch{return i}});return[r,h=>{s(h);try{localStorage.setItem(dg(e),JSON.stringify(h))}catch{}}]}function e9(e){try{localStorage.removeItem(dg(e))}catch{}}function t9(e){const i=e.findIndex(r=>/recommended/i.test(r.label));return i===-1?0:i}function n9({interactionId:e,questions:i,busy:r,onChoose:s,onReply:l}){const h=i.length>1,[p,o]=J8(e,{picks:{},otherOpen:{},others:{},free:""}),{picks:u,otherOpen:d,others:v,free:c}=p,_=y=>o({...p,...y}),x=y=>{const g=u[y];return!!(g&&("option"in g||g.other.trim()))},C=()=>i.map((y,g)=>{const b=u[g];return"option"in b?String(b.option+1):b.other.trim()}).join(`
572
+ `);return m.jsxs("div",{className:"space-y-3",children:[i.map((y,g)=>{const b=t9(y.options),S=u[g];return m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("span",{className:"mt-px grid h-5 w-5 shrink-0 place-items-center rounded-full bg-primary/15 text-[11px] font-semibold tabular-nums text-primary",children:g+1}),m.jsxs("div",{className:"min-w-0",children:[y.header&&m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:y.header}),m.jsx("div",{className:"break-words text-sm font-semibold leading-snug",children:y.question})]})]}),m.jsxs("div",{className:"space-y-1 pl-7",children:[y.options.map((w,T)=>{const D=!!(S&&"option"in S&&S.option===T);return m.jsxs("button",{disabled:r,onClick:()=>h?_({picks:{...u,[g]:{option:T}}}):s(T),className:ye("flex w-full items-start gap-2.5 rounded-md border px-3 py-1.5 text-left transition-colors hover:bg-muted disabled:opacity-50",T===b&&"border-primary",D&&"bg-primary/15"),children:[m.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:T+1}),m.jsxs("span",{className:"min-w-0",children:[m.jsx("span",{className:"block text-xs font-medium",children:w.label}),w.description&&m.jsx("span",{className:"block text-[11px] text-muted-foreground",children:w.description})]})]},T)}),d[g]?m.jsx("div",{className:ye("rounded-md border px-2 py-1",S&&"other"in S&&"bg-primary/15"),children:m.jsx(hg,{autoFocus:!0,placeholder:"Your own answer",disabled:r,value:v[g]??"",onChange:w=>_({others:{...v,[g]:w},...h?{picks:{...u,[g]:{other:w}}}:{}}),onSend:w=>h?_({picks:{...u,[g]:{other:w}}}):l(w),className:"border-0 bg-transparent px-1 focus:ring-0"})}):m.jsxs("button",{disabled:r,onClick:()=>_({otherOpen:{...d,[g]:!0}}),className:"flex w-full items-center gap-2.5 rounded-md border border-dashed px-3 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:[m.jsx(Xi,{size:12,className:"shrink-0"})," Other, in your own words..."]})]})]},g)}),h&&m.jsxs("div",{className:"flex items-end gap-1.5",children:[m.jsx(hg,{placeholder:"Or answer all of it in your own words",disabled:r,value:c,onChange:y=>_({free:y}),onSend:y=>l(y)}),m.jsx(ge,{variant:"primary",disabled:r||!i.every((y,g)=>x(g)),onClick:()=>l(C()),children:"Send answers"})]})]})}function i9(e,i){N.useEffect(()=>{i||e9(e)},[e,i])}const r9={permission:{label:"Permission",icon:R4},question:{label:"Question",icon:$w},turn:{label:"Waiting",icon:_4},mcp:{label:"MCP suggested",icon:Zl},done:{label:"Done",icon:Uw}};function s9(e){var h,p;const i=e.answer;if(!i)return null;const r=e.presented,s={permission:{1:0,2:1,3:2},mcp:{install:0,skip:1}},l=e.kind==="question"?Number(i)-1:(h=s[e.kind])==null?void 0:h[i];return l!==void 0&&Number.isInteger(l)&&((p=r==null?void 0:r.choices[l])==null?void 0:p.label)||i}function Wl({interaction:e,showSession:i=!1,compact:r=!1,project:s}){var D,R;const l=_e(L=>L.sessions),h=_e(L=>L.go),p=L=>s?window.location.hash=`#/${encodeURIComponent(s.id)}/session/${L.id}`:h(L),[o,u]=N.useState(""),[d,v]=N.useState(!1),[c,_]=N.useState(!1),x=r9[e.kind],C=e.status==="open",y=l.find(L=>L.id===e.sessionId);i9(e.id,C);const g=e.presented??{kind:e.kind,sessionTitle:(y==null?void 0:y.title)??"",headline:e.title,choices:[],quickReplies:[],freeText:"Reply to the session...",details:e.body?{label:"Details",text:e.body,format:"markdown"}:void 0},b=async L=>{v(!0);const A=await qe(L,"Sent to the session.");v(!1),A&&u("")},S=L=>b(()=>s?ve.chooseIn(s.id,e.id,L.ref):ve.choose(e.id,L.ref)),w=L=>L.trim()&&b(()=>s?ve.answerIn(s.id,e.id,L):ve.answer(e.id,L)),T=async()=>{v(!0),await qe(()=>s?ve.dismissIn(s.id,e.id):ve.dismiss(e.id),"Dismissed."),v(!1)};return m.jsxs("div",{className:ye("card p-3",C&&"border-primary/60"),children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Xe,{tone:C?"warning":e.kind==="done"?"success":"off",icon:x.icon,children:x.label}),s&&m.jsx(Xe,{tone:"off",children:s.name}),i&&m.jsx("button",{className:"min-w-0 truncate text-xs font-medium hover:underline",onClick:()=>p({kind:"session",id:e.sessionId}),children:(y==null?void 0:y.title)??(((D=e.presented)==null?void 0:D.sessionTitle)||e.sessionId.slice(0,8))}),m.jsx("span",{className:"ml-auto shrink-0 text-[11px] text-muted-foreground",children:vs(e.createdAt)}),i&&m.jsxs(ge,{variant:"muted",className:"shrink-0",title:y!=null&&y.live?"Open the session's terminal":"Open the session (not running; resume it there)","aria-label":"Open the session's terminal",onClick:()=>p({kind:"session",id:e.sessionId}),children:[m.jsx(Tg,{size:12})," ",m.jsx("span",{className:"hidden sm:inline",children:"Terminal"})]}),C&&m.jsx(ge,{variant:"ghost",size:"icon",className:"shrink-0",disabled:d,title:"Dismiss (nothing is sent to the session)","aria-label":"Dismiss",onClick:()=>void T(),children:m.jsx(xn,{size:13})})]}),m.jsx("div",{className:ye("mt-2 break-words text-sm font-medium",e.kind==="permission"&&"font-mono text-[13px]",r&&"line-clamp-2"),children:g.headline}),g.question&&!r&&m.jsx("div",{className:"mt-0.5 break-words text-xs text-muted-foreground",children:g.question}),C&&!r&&m.jsx("div",{className:"mt-3 space-y-2.5",children:e.kind==="question"&&((R=g.questions)!=null&&R.length)?m.jsx(n9,{interactionId:e.id,questions:g.questions,busy:d,onChoose:L=>void S({ref:`o:${L}`}),onReply:L=>void w(L)}):m.jsxs(m.Fragment,{children:[g.choices.some(L=>L.description)?m.jsx("div",{className:"space-y-1",children:g.choices.map((L,A)=>m.jsxs("button",{disabled:d,onClick:()=>void S(L),className:ye("flex w-full items-start gap-2.5 rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted disabled:opacity-50",L.tone==="primary"&&"border-primary"),children:[m.jsx("span",{className:"mt-px shrink-0 text-xs tabular-nums text-muted-foreground",children:A+1}),m.jsxs("span",{className:"min-w-0",children:[m.jsx("span",{className:"block text-xs font-medium",children:L.label}),L.description&&m.jsx("span",{className:"block text-[11px] text-muted-foreground",children:L.description})]})]},L.ref))}):g.choices.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.choices.map(L=>m.jsx(ge,{variant:L.tone==="primary"?"primary":L.tone==="danger"?"destructive":"muted",disabled:d,onClick:()=>void S(L),children:L.label},L.ref))}),g.quickReplies.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.quickReplies.map(L=>m.jsx("button",{disabled:d,onClick:()=>void S(L),className:"rounded-full border px-2.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",children:L.label},L.ref))}),g.freeText&&m.jsx(hg,{placeholder:g.freeText,disabled:d,value:o,onChange:u,onSend:L=>void w(L)})]})}),g.details&&!r&&m.jsxs("div",{className:"mt-2",children:[m.jsxs("button",{className:"flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",onClick:()=>_(!c),children:[m.jsx(wa,{size:12,className:ye("transition-transform",c&&"rotate-90")}),g.details.label]}),c&&(g.details.format==="code"?m.jsx("pre",{className:"mt-1.5 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 font-mono text-[11px]",children:g.details.text}):m.jsx(Nv,{className:"mt-1.5 max-h-72 overflow-auto rounded bg-muted/40 p-2 text-xs",children:g.details.text}))]}),!C&&e.status==="answered"&&m.jsxs("div",{className:"mt-2 break-words text-[11px] text-muted-foreground",children:[e.answeredBy,": ",m.jsx("span",{className:"text-foreground",children:s9(e)})]}),!C&&e.status==="closed"&&e.answeredBy&&e.kind!=="done"&&m.jsxs("div",{className:"mt-2 text-[11px] text-muted-foreground",children:["Closed (",e.answeredBy,")."]})]})}function o9({size:e=18,className:i}){return m.jsxs("svg",{viewBox:"0 18 48 30",width:e,height:e*30/48,className:i,role:"img","aria-label":"Clauder Hub",children:[m.jsx("rect",{width:"36",height:"24",x:"6",y:"18",fill:"#d77757"}),m.jsx("rect",{width:"3",height:"9",x:"9",y:"39",fill:"#d77757"}),m.jsx("rect",{width:"3",height:"9",x:"15",y:"39",fill:"#d77757"}),m.jsx("rect",{width:"3",height:"9",x:"30",y:"39",fill:"#d77757"}),m.jsx("rect",{width:"3",height:"9",x:"36",y:"39",fill:"#d77757"}),m.jsx("rect",{width:"7.5",height:"6",y:"33",fill:"#d77757"}),m.jsx("rect",{width:"7.5",height:"6",x:"40.5",y:"33",fill:"#d77757"}),m.jsx("rect",{width:"9",height:"9",x:"12",y:"24"}),m.jsx("rect",{width:"9",height:"9",x:"27",y:"24"}),m.jsx("rect",{width:"3",height:"6",x:"22.5",y:"22.5",transform:"rotate(90 24 25.5)"}),m.jsx("rect",{width:"3",height:"7",x:"37",y:"22",transform:"rotate(90 38.5 25.5)"}),m.jsx("rect",{width:"3",height:"7",x:"8",y:"22",transform:"rotate(90 9.5 25.5)"})]})}function a9({temp:e,choice:i}){const[r,s]=N.useState(i.current);return m.jsxs("div",{className:"space-y-0.5 rounded-md border px-2.5 py-2",children:[m.jsx(Cr,{label:`Also clear its Claude temp folder (${Ag(e.bytes)})`,checked:r,onCheckedChange:l=>{i.current=l,s(l)}}),m.jsx("div",{className:"truncate pl-6 font-mono text-[10px] text-muted-foreground",title:e.path,children:e.path})]})}function ed(e){const{view:i,sessions:r,go:s}=_e.getState();if(i.kind!=="session"||!e.includes(i.id))return;const l=r.filter(u=>u.live||u.id===i.id),h=l.findIndex(u=>u.id===i.id),p=u=>!e.includes(u.id),o=l.slice(0,Math.max(h,0)).reverse().find(p)??l.slice(h+1).find(p);o&&s({kind:"session",id:o.id})}function td(){const e=ln(),i=N.useRef(""),r=N.useRef(!0),s=o=>!o||o===_e.getState().projectId;return{rename:(o,u)=>(i.current=o.title,e({title:"Rename session",description:"Also shown in Claude Code's /resume.",body:m.jsx(_t,{autoFocus:!0,size:"md",defaultValue:o.title,onChange:d=>i.current=d.target.value,onFocus:d=>d.target.select()}),confirmLabel:"Rename",run:async()=>{await ve.renameSession(o.id,i.current,s(u)?void 0:u),s(u)&&await _e.getState().refreshSessions()}})),remove:async o=>{const u=await ve.deletionPlan(o.id).catch(v=>(_e.getState().notify(v.message,"error"),null));if(!u)return!1;r.current=!0;const d=await e({title:`Delete "${o.title}" permanently?`,description:o.live?"It is running and will be stopped first. This cannot be undone.":"Removed from ~/.claude. This cannot be undone.",body:m.jsxs("div",{className:"space-y-2 text-xs",children:[u.files.length?m.jsx("div",{className:"divide-y rounded-md border",children:u.files.map(v=>m.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate font-mono text-[11px]",title:v.path,children:v.path}),m.jsx("div",{className:"text-[10px] text-muted-foreground",children:v.what})]}),m.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:Ag(v.bytes)})]},v.path))}):m.jsx("div",{className:"text-muted-foreground",children:"No files on disk; only the hub's own record of it goes."}),u.temp&&m.jsx(a9,{temp:u.temp,choice:r}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Also removed: its interactions and MCP suggestions in the hub. Kept: your prompt history (~/.claude/history.jsonl), which every project shares."})]}),confirmLabel:"Delete permanently",tone:"destructive",maxWidth:"max-w-xl",run:async()=>{await ve.deleteSession(o.id,r.current),await _e.getState().refreshSessions(),_e.getState().notify("Deleted.")}});if(d){const{view:v,go:c}=_e.getState();v.kind==="session"&&v.id===o.id&&c({kind:"page",page:"overview"})}return d},stop:(o,u)=>e({title:`Stop "${o.title}"?`,description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(o.id,s(u)?void 0:u),s(u)&&ed([o.id])}})}}const uc=oo(()=>({projects:null}));function sw(){const e=rt(()=>ve.globalLive(),["projects","sessions","interactions","channels"]);return N.useEffect(()=>{e.data&&uc.setState({projects:e.data})},[e.data]),null}const kh=e=>e.live&&(e.status==="waiting"||e.openInteractions>0);function fg(e){return e.flatMap(i=>i.open.map(r=>({project:i,session:r})))}function l9(){return uc(e=>e.projects?fg(e.projects).filter(i=>kh(i.session)).length:0)}const Ws=[];function ch(e,i){_e.getState().openSessionIn(e,i)}const c9=[{keys:"Ctrl+K",what:"Find and open a session or project"},{keys:"Alt+1 … Alt+9",what:"Open the 1st … 9th session of the Open sessions panel"},{keys:"Alt+`",what:"Back to the session shown before"},{keys:"Alt+W",what:"Next session waiting on you, in any project"},{keys:"Ctrl+`",what:"Show the sidebar's live sessions"},{keys:"Ctrl+Enter",what:"Send now (Claude Code's Ctrl+X Ctrl+S), in a terminal"},{keys:"Ctrl+F",what:"Find in the terminal's scrollback"},{keys:"Ctrl+C",what:"Copy the selection in a terminal (without one, ^C goes to Claude)"},{keys:"Right click",what:"Copy the selection in a terminal"},{keys:"Ctrl+V",what:"Paste into a terminal"},{keys:"Ctrl+click",what:"Open a file path or link printed in a terminal"},{keys:"Drop a file",what:"On a terminal: saves it and pastes its path"}];function ow(){const e=_e(h=>h.projectId),i=_e(h=>h.view),r=_e(h=>h.windowed),[s,l]=N.useState(!1);return N.useEffect(()=>{if(!e||i.kind!=="session")return;const h=Ws[Ws.length-1];h&&h.projectId===e&&h.id===i.id||(Ws.push({projectId:e,id:i.id}),Ws.length>50&&Ws.shift())},[e,i]),N.useEffect(()=>{if(r)return;const h=p=>{if(p.metaKey)return;const o=uc.getState().projects??[],{projectId:u,view:d}=_e.getState(),v=()=>{p.preventDefault(),p.stopPropagation()};if(p.ctrlKey&&!p.altKey&&!p.shiftKey&&p.code==="KeyK"){v(),l(_=>!_);return}if(!p.altKey||p.ctrlKey)return;const c=/^Digit([1-9])$/.exec(p.code);if(c&&!p.shiftKey){const _=fg(o)[Number(c[1])-1];v(),_&&ch(_.project.id,_.session.id);return}if(p.code==="Backquote"&&!p.shiftKey){v();for(let _=Ws.length-1;_>=0;_-=1){const x=Ws[_];if(!(x.projectId===u&&d.kind==="session"&&x.id===d.id))return ch(x.projectId,x.id)}return}if(p.code==="KeyW"&&!p.shiftKey){v();const _=fg(o).filter(y=>kh(y.session));if(!_.length)return _e.getState().notify("No session is waiting on you.");const x=_.findIndex(y=>y.project.id===u&&d.kind==="session"&&y.session.id===d.id),C=_[(x+1)%_.length];ch(C.project.id,C.session.id)}};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[r]),s?m.jsx(h9,{onClose:()=>l(!1)}):null}function u9(e,i){if(!i)return 0;const r=e.toLowerCase(),s=i.toLowerCase().trim(),l=r.indexOf(s);if(l!==-1)return 1e3-l;if(s.split(/\s+/).filter(Boolean).every(o=>r.includes(o)))return 500;let p=0;for(const o of r)o===s[p]&&(p+=1);return p===s.length?100:null}function h9({onClose:e}){const i=uc(C=>C.projects)??[],[r,s]=N.useState([]),[l,h]=N.useState(""),[p,o]=N.useState(0),u=N.useRef(null),d=N.useRef(null),v=N.useRef(document.activeElement);N.useEffect(()=>{var C;(C=u.current)==null||C.focus(),ve.projects().then(s,()=>{})},[]);const c=N.useMemo(()=>{const C=[];for(const y of i)for(const g of y.open)C.push({kind:"session",key:`o:${y.id}:${g.id}`,project:y,session:g,open:!0,label:`${g.title} ${y.name}`});for(const y of i)for(const g of y.recent)C.push({kind:"session",key:`r:${y.id}:${g.id}`,project:y,session:g,open:!1,label:`${g.title} ${y.name}`});for(const y of r)C.push({kind:"project",key:`p:${y.id}`,project:y,label:`${y.name} ${y.root}`});return C.map((y,g)=>({item:y,order:g,score:u9(y.label,l)})).filter(y=>y.score!==null).sort((y,g)=>g.score-y.score||y.order-g.order).slice(0,50).map(y=>y.item)},[i,r,l]);N.useEffect(()=>o(0),[l]),N.useEffect(()=>{var C,y;(y=(C=d.current)==null?void 0:C.querySelector(`[data-index="${p}"]`))==null||y.scrollIntoView({block:"nearest"})},[p]);const _=()=>{var C,y;e(),(y=(C=v.current)==null?void 0:C.focus)==null||y.call(C)},x=C=>{C&&(e(),C.kind==="session"?ch(C.project.id,C.session.id):_e.getState().openProject(C.project.id))};return m.jsx("div",{className:"fixed inset-0 z-[65] flex items-start justify-center bg-foreground/30 px-4 pt-[12vh] animate-in fade-in-0",onMouseDown:C=>C.target===C.currentTarget&&_(),children:m.jsxs("div",{role:"dialog","aria-label":"Open a session or project",className:"w-full max-w-lg overflow-hidden rounded-xl border bg-card shadow-2xl",children:[m.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[m.jsx(Dh,{size:14,className:"shrink-0 text-muted-foreground"}),m.jsx("input",{ref:u,value:l,onChange:C=>h(C.target.value),placeholder:"Open a session or project...","aria-label":"Find a session or project",onKeyDown:C=>{C.key==="Escape"?(C.preventDefault(),_()):C.key==="ArrowDown"?(C.preventDefault(),o(y=>Math.min(c.length-1,y+1))):C.key==="ArrowUp"?(C.preventDefault(),o(y=>Math.max(0,y-1))):C.key==="Enter"&&(C.preventDefault(),x(c[p]))},className:"min-w-0 flex-1 bg-transparent text-sm focus:outline-none"}),m.jsx("kbd",{className:"rounded border px-1 text-[10px] text-muted-foreground",children:"Esc"})]}),m.jsxs("div",{ref:d,className:"max-h-[50vh] overflow-y-auto p-1",children:[!c.length&&m.jsx("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Nothing matches."}),c.map((C,y)=>m.jsxs("button",{"data-index":y,onMouseMove:()=>o(y),onMouseEnter:()=>C.project.id!==pi&&jm(C.project.id),onClick:()=>x(C),className:ye("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-xs",y===p?"bg-primary/15":"hover:bg-muted"),children:[C.kind==="session"?m.jsx(Tg,{size:13,className:ye("shrink-0",C.open&&kh(C.session)?"text-severity-warning":C.open?"text-success":"text-muted-foreground")}):m.jsx(Zs,{size:13,className:"shrink-0 text-muted-foreground"}),m.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.kind==="session"?C.session.title:C.project.name}),m.jsx("span",{className:"shrink-0 truncate text-[10px] text-muted-foreground",children:C.kind==="session"?`${C.project.name} · ${C.open?kh(C.session)?"waiting":C.session.live?"open":"stopped":C.session.lastAt?vs(C.session.lastAt):"recent"}`:"project"})]},C.key))]}),m.jsxs("div",{className:"flex gap-3 border-t px-3 py-1.5 text-[10px] text-muted-foreground",children:[m.jsx("span",{children:"↑↓ to move"}),m.jsx("span",{children:"Enter to open"}),m.jsx("span",{children:"A stopped session resumes when opened"})]})]})})}function d9(){return m.jsxs(Da,{align:"start",className:"w-[22rem] max-w-[calc(100vw-1rem)] p-2",trigger:m.jsx("button",{title:"Keyboard shortcuts","aria-label":"Keyboard shortcuts",className:"self-center rounded p-0.5 text-muted-foreground/70 hover:bg-muted hover:text-foreground",children:m.jsx(f4,{size:13})}),children:[m.jsx("div",{className:"px-1 pb-1.5 text-xs font-semibold",children:"Keyboard shortcuts"}),m.jsx("div",{className:"space-y-0.5",children:c9.map(e=>m.jsxs("div",{className:"flex items-start gap-3 rounded px-1 py-1 text-[11px]",children:[m.jsx("kbd",{className:"w-24 shrink-0 whitespace-nowrap rounded border bg-muted px-1 py-0.5 text-center font-mono text-[10px]",children:e.keys}),m.jsx("span",{className:"text-muted-foreground",children:e.what})]},e.keys))})]})}const f9=async()=>{const e=await fetch(`${_i()}/git`),i=await e.json().catch(()=>({}));if(!e.ok)throw new Error(i.error??e.statusText);return i.git??null};function p9(){const e=rt(f9,["files","runs"]),{reload:i}=e;N.useEffect(()=>{const h=window.setInterval(i,3e4);return window.addEventListener("focus",i),()=>{window.clearInterval(h),window.removeEventListener("focus",i)}},[i]);const r=e.data;if(!r)return null;const s=r.staged+r.changed+r.untracked,l=[r.branch?`Branch ${r.branch}`:"No branch",r.ahead!==null?`${r.ahead} to push, ${r.behind} to pull`:"No upstream",`${r.staged} staged, ${r.changed} changed, ${r.untracked} untracked${r.conflicted?`, ${r.conflicted} in conflict`:""}`,r.last?`Last commit ${r.last.hash} ${vs(r.last.at)}: ${r.last.subject}`:"No commit yet","Click to read again"].join(`
573
+ `);return m.jsxs("button",{onClick:i,title:l,"aria-label":"Git status",className:"group flex h-7 shrink-0 items-center gap-1.5 border-t px-3 text-[11px] text-muted-foreground hover:bg-muted hover:text-foreground",children:[m.jsx(a4,{size:12,className:"shrink-0"}),m.jsx("span",{className:"min-w-0 truncate font-mono",children:r.branch??"no branch"}),r.ahead?m.jsxs("span",{className:"flex shrink-0 items-center tabular-nums",children:[m.jsx(zw,{size:10}),r.ahead]}):null,r.behind?m.jsxs("span",{className:"flex shrink-0 items-center tabular-nums",children:[m.jsx(Z3,{size:10}),r.behind]}):null,m.jsx("span",{className:"flex-1"}),r.conflicted>0&&m.jsxs("span",{className:"shrink-0 tabular-nums text-destructive",children:[r.conflicted," conflict",r.conflicted>1?"s":""]}),m.jsx("span",{className:ye("shrink-0 tabular-nums",s?"text-severity-warning":""),children:s?`${s} changed`:"clean"}),m.jsx(so,{size:10,className:"hidden shrink-0 group-hover:block"})]})}let c5=null;const m9=fetch("/api/file-icons/manifest").then(e=>e.ok?e.json():null).then(e=>c5=e).catch(()=>null);function g9(e,i,r,s){const l=i.toLowerCase(),h=(u,d)=>Object.hasOwn(u,d)?u[d]:void 0;if(r)return h(s?e.folderNamesExpanded:e.folderNames,l)??(s?e.folderExpanded:e.folder);const p=h(e.fileNames,l);if(p)return p;const o=l.split(".");for(let u=1;u<o.length;u++){const d=h(e.fileExtensions,o.slice(u).join("."));if(d)return d}return e.file}function u5({name:e,folder:i=!1,open:r=!1,size:s=14,className:l}){const[h,p]=N.useState(c5);if(N.useEffect(()=>{h||m9.then(o=>o&&p(o))},[h]),!h){const o=i?r?Zs:Sg:wg;return m.jsx(o,{size:s-1,className:ye("shrink-0",l)})}return m.jsx("img",{src:`/api/file-icons/${g9(h,e,i,r)}.svg`,alt:"",width:s,height:s,draggable:!1,className:ye("shrink-0",l)})}var v9=Object.defineProperty,Vt=(e,i)=>v9(e,"name",{value:i,configurable:!0}),[Ov,gP]=Er("Tooltip",[Ra]),nd=Ra(),_9="TooltipProvider",x9=700,pg="tooltip.open",[y9,Bv]=Ov(_9),b9=Vt(e=>{const{__scopeTooltip:i,delayDuration:r=x9,skipDelayDuration:s=300,disableHoverableContent:l=!1,children:h}=e,p=N.useRef(!0),o=N.useRef(!1),u=N.useRef(0);return N.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),m.jsx(y9,{scope:i,isOpenDelayedRef:p,delayDuration:r,onOpen:N.useCallback(()=>{s<=0||(window.clearTimeout(u.current),p.current=!1)},[s]),onClose:N.useCallback(()=>{s<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>p.current=!0,s))},[s]),isPointerInTransitRef:o,onPointerInTransitChange:N.useCallback(d=>{o.current=d},[]),disableHoverableContent:l,children:h})},"TooltipProvider"),mg="Tooltip",[w9,hc]=Ov(mg),S9=Vt(e=>{const{__scopeTooltip:i,children:r,open:s,defaultOpen:l,onOpenChange:h,disableHoverableContent:p,delayDuration:o}=e,u=Bv(mg,e.__scopeTooltip),d=nd(i),[v,c]=N.useState(null),[_,x]=N.useState(void 0),C=Vi(),y=N.useRef(0),g=p??u.disableHoverableContent,b=o??u.delayDuration,S=N.useRef(!1),[w,T]=Js({prop:s,defaultProp:l??!1,onChange:Vt(j=>{j?(u.onOpen(),document.dispatchEvent(new CustomEvent(pg))):u.onClose(),h==null||h(j)},"onChange"),caller:mg}),D=N.useMemo(()=>w?S.current?"delayed-open":"instant-open":"closed",[w]),R=N.useCallback(()=>{window.clearTimeout(y.current),y.current=0,S.current=!1,T(!0)},[T]),L=N.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),A=N.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{S.current=!0,T(!0),y.current=0},b)},[b,T]);N.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const M=_??C;return m.jsx(ev,{...d,children:m.jsx(w9,{scope:i,contentId:M,setContentId:x,open:w,stateAttribute:D,trigger:v,onTriggerChange:c,onTriggerEnter:N.useCallback(()=>{u.isOpenDelayedRef.current?A():R()},[u.isOpenDelayedRef,A,R]),onTriggerLeave:N.useCallback(()=>{g?L():(window.clearTimeout(y.current),y.current=0)},[L,g]),onOpen:R,onClose:L,disableHoverableContent:g,children:r})})},"Tooltip"),aw="TooltipTrigger",C9=N.forwardRef(Vt(function(i,r){const{__scopeTooltip:s,"aria-describedby":l,...h}=i,p=hc(aw,s),o=Bv(aw,s),u=nd(s),d=N.useRef(null),v=ht(r,d,p.onTriggerChange),c=N.useRef(!1),_=N.useRef(!1),x=N.useCallback(()=>c.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),m.jsx(tv,{asChild:!0,...u,children:m.jsx(Et.button,{"aria-describedby":p.open?x5(l,p.contentId):l,"data-state":p.stateAttribute,...h,ref:v,onPointerMove:it(i.onPointerMove,C=>{C.pointerType!=="touch"&&!_.current&&!o.isPointerInTransitRef.current&&(p.onTriggerEnter(),_.current=!0)}),onPointerLeave:it(i.onPointerLeave,()=>{p.onTriggerLeave(),_.current=!1}),onPointerDown:it(i.onPointerDown,()=>{p.open&&p.onClose(),c.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:it(i.onFocus,()=>{c.current||p.onOpen()}),onBlur:it(i.onBlur,p.onClose),onClick:it(i.onClick,p.onClose)})})},"TooltipTrigger")),h5="TooltipPortal",[k9,E9]=Ov(h5,{forceMount:void 0}),T9=Vt(e=>{const{__scopeTooltip:i,forceMount:r,children:s,container:l}=e,h=hc(h5,i);return m.jsx(k9,{scope:i,forceMount:r,children:m.jsx(Tr,{present:r||h.open,children:m.jsx(Nh,{asChild:!0,container:l,children:s})})})},"TooltipPortal"),Gl="TooltipContent",R9=N.forwardRef(Vt(function(i,r){const s=E9(Gl,i.__scopeTooltip),{forceMount:l=s.forceMount,side:h="top",...p}=i,o=hc(Gl,i.__scopeTooltip);return m.jsx(Tr,{present:l||o.open,children:o.disableHoverableContent?m.jsx(d5,{side:h,...p,ref:r}):m.jsx(A9,{side:h,...p,ref:r})})},"TooltipContent")),A9=N.forwardRef(Vt(function(i,r){const s=hc(Gl,i.__scopeTooltip),l=Bv(Gl,i.__scopeTooltip),h=N.useRef(null),p=ht(r,h),[o,u]=N.useState(null),{trigger:d,onClose:v}=s,c=h.current,{onPointerInTransitChange:_}=l,x=N.useCallback(()=>{u(null),_(!1)},[_]),C=N.useCallback((y,g)=>{const b=y.currentTarget,S={x:y.clientX,y:y.clientY},w=f5(S,b.getBoundingClientRect()),T=p5(S,w),D=m5(g.getBoundingClientRect()),R=v5([...T,...D]);u(R),_(!0)},[_]);return N.useEffect(()=>()=>x(),[x]),N.useEffect(()=>{if(d&&c){const y=Vt(b=>C(b,c),"handleTriggerLeave"),g=Vt(b=>C(b,d),"handleContentLeave");return d.addEventListener("pointerleave",y),c.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerleave",y),c.removeEventListener("pointerleave",g)}}},[d,c,C,x]),N.useEffect(()=>{if(o){const y=Vt(g=>{const b=g.target,S={x:g.clientX,y:g.clientY},w=(d==null?void 0:d.contains(b))||(c==null?void 0:c.contains(b)),T=!g5(S,o);w?x():T&&(x(),v())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,c,o,v,x]),m.jsx(d5,{...i,ref:p})},"TooltipContentHoverable")),D9=yS("TooltipContent"),d5=N.forwardRef(Vt(function(i,r){const{__scopeTooltip:s,children:l,"aria-label":h,id:p,onEscapeKeyDown:o,onPointerDownOutside:u,...d}=i,v=hc(Gl,s),c=nd(s),{onClose:_}=v,[x,C]=N.useState(null),y=ht(r,C);Pg(x),N.useEffect(()=>(document.addEventListener(pg,_),()=>document.removeEventListener(pg,_)),[_]),N.useEffect(()=>{if(v.trigger){const b=Vt(S=>{S.target instanceof Node&&S.target.contains(v.trigger)&&_()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[v.trigger,_]);const{setContentId:g}=v;return Wt(()=>(g(p),()=>{g(void 0)}),[p,g]),m.jsx(Mh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:u,onFocusOutside:b=>b.preventDefault(),onDismiss:_,children:m.jsxs(nv,{"data-state":v.stateAttribute,role:h?void 0:"tooltip",id:h?void 0:v.contentId,...c,...d,ref:y,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(D9,{children:l}),h?m.jsx(H6,{id:v.contentId,role:"tooltip",children:h}):null]})})},"TooltipContentImpl")),L9=N.forwardRef(Vt(function(i,r){const{__scopeTooltip:s,...l}=i,h=nd(s);return m.jsx(B6,{...h,...l,ref:r})},"TooltipArrow"));function f5(e,i){const r=Math.abs(i.top-e.y),s=Math.abs(i.bottom-e.y),l=Math.abs(i.right-e.x),h=Math.abs(i.left-e.x);switch(Math.min(r,s,l,h)){case h:return"left";case l:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}Vt(f5,"getExitSideFromRect");function p5(e,i,r=5){const s=[];switch(i){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}Vt(p5,"getPaddedExitPoints");function m5(e){const{top:i,right:r,bottom:s,left:l}=e;return[{x:l,y:i},{x:r,y:i},{x:r,y:s},{x:l,y:s}]}Vt(m5,"getPointsFromRect");function g5(e,i){const{x:r,y:s}=e;let l=!1;for(let h=0,p=i.length-1;h<i.length;p=h++){const o=i[h],u=i[p],d=o.x,v=o.y,c=u.x,_=u.y;v>s!=_>s&&r<(c-d)*(s-v)/(_-v)+d&&(l=!l)}return l}Vt(g5,"isPointInPolygon");function v5(e){const i=e.slice();return i.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),_5(i)}Vt(v5,"getHull");function _5(e){if(e.length<=1)return e.slice();const i=[];for(let s=0;s<e.length;s++){const l=e[s];for(;i.length>=2;){const h=i[i.length-1],p=i[i.length-2];if((h.x-p.x)*(l.y-p.y)>=(h.y-p.y)*(l.x-p.x))i.pop();else break}i.push(l)}i.pop();const r=[];for(let s=e.length-1;s>=0;s--){const l=e[s];for(;r.length>=2;){const h=r[r.length-1],p=r[r.length-2];if((h.x-p.x)*(l.y-p.y)>=(h.y-p.y)*(l.x-p.x))r.pop();else break}r.push(l)}return r.pop(),i.length===1&&r.length===1&&i[0].x===r[0].x&&i[0].y===r[0].y?i:i.concat(r)}Vt(_5,"getHullPresorted");function x5(...e){const i=new Set;for(const r of e)if(typeof r=="string")for(const s of String(r).trim().split(/\s+/))s&&i.add(s);return i.size>0?Array.from(i).join(" "):void 0}Vt(x5,"concatAriaDescribedby");function gr({content:e,children:i,side:r="top",asChild:s=!1,className:l,wide:h}){return e?m.jsx(b9,{delayDuration:300,children:m.jsxs(S9,{children:[m.jsx(C9,{asChild:!0,children:s?i:m.jsx("span",{className:ye("inline-flex",l),children:i})}),m.jsx(T9,{children:m.jsxs(R9,{side:r,sideOffset:6,collisionPadding:8,className:ye("z-[100] rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95 dark:bg-secondary dark:text-foreground",h?"max-w-md":"max-w-xs"),children:[e,m.jsx(L9,{className:"fill-foreground dark:fill-secondary"})]})})]})}):m.jsx(m.Fragment,{children:i})}const lw=()=>`clauder-hub:files-expanded:${_e.getState().projectId}`,cw="clauder-hub:files-show-ignored",y5=N.createContext(null),id=()=>N.useContext(y5);function uw(e,i){try{const r=localStorage.getItem(e);return r===null?i:JSON.parse(r)}catch{return i}}function hw(e,i){try{localStorage.setItem(e,JSON.stringify(i))}catch{}}const b5=(e,i)=>e?`${e}/${i}`:i,w5=e=>e.includes("/")?e.slice(0,e.lastIndexOf("/")):"";async function gg(e,i,r){const s=vr.getState().item;if(!s)return;if(s.mode==="copy"){await qe(()=>Jt.copy(s.path,e))&&e&&r(e);return}const l=s.path.split("/").pop()??s.path,h=b5(e,l);if(h===s.path)return vr.getState().set(null);const p=await qe(()=>Jt.rename(s.path,h));if(!p)return;vr.getState().set(null),on.getState().move(s.path,p.path),In.getState().rename(s.path,p.path),e&&r(e);const o=_e.getState().view;o.kind==="file"&&(o.path===s.path||o.path.startsWith(`${s.path}/`))&&i({kind:"file",path:p.path+o.path.slice(s.path.length)})}function j9(){const[e,i]=N.useState(()=>uw(cw,!1)),[r,s]=N.useState(()=>new Set(uw(lw(),[]))),[l,h]=N.useState(0),[p,o]=N.useState(null),[u,d]=N.useState(null),v=vr(g=>g.item),c=_e(g=>g.go);N.useEffect(()=>hw(lw(),[...r]),[r]),N.useEffect(()=>{const g=()=>h(b=>b+1);return window.addEventListener("focus",g),()=>window.removeEventListener("focus",g)},[]);const _=(g,b)=>s(S=>{const w=new Set(S);return b??!w.has(g)?w.add(g):w.delete(g),w}),x={showIgnored:e,epoch:l,expanded:r,toggle:_,editing:p,setEditing:o,openMenu:(g,b,S)=>d({entry:g,x:b,y:S})},C=_e(g=>{var b;return((b=g.health)==null?void 0:b.project)??"Project"}),y=g=>{g.defaultPrevented||(g.preventDefault(),d({entry:{name:C,path:"",kind:"dir",size:0,ignored:!1},x:g.clientX,y:g.clientY}))};return m.jsxs(y5.Provider,{value:x,children:[m.jsxs("div",{className:"flex min-h-full flex-col",onContextMenu:y,children:[m.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-0.5 bg-background px-3 pb-1",children:[m.jsx("div",{className:"flex-1 text-[10px] text-muted-foreground",children:"Project files"}),m.jsx(gr,{content:"New file",asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon","aria-label":"New file",onClick:()=>o({kind:"file",parent:""}),children:m.jsx(Rm,{size:13})})}),m.jsx(gr,{content:"New folder",asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon","aria-label":"New folder",onClick:()=>o({kind:"folder",parent:""}),children:m.jsx(Dm,{size:13})})}),m.jsx(gr,{content:e?"Hide ignored":"Show ignored",asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon","aria-label":"Show ignored","aria-pressed":e,className:ye(e&&"bg-muted text-foreground"),onClick:()=>{i(!e),hw(cw,!e)},children:e?m.jsx(Ql,{size:13}):m.jsx(bg,{size:13})})}),v&&m.jsx(gr,{content:`Paste ${v.path.split("/").pop()} into the project root`,asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon","aria-label":"Paste into the project root",onClick:()=>void gg("",c,g=>_(g,!0)),children:m.jsx(Tm,{size:13})})}),m.jsx(gr,{content:"Refresh",asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon","aria-label":"Refresh",onClick:()=>h(l+1),children:m.jsx(so,{size:13})})})]}),m.jsx("div",{className:"flex-1 px-2",children:m.jsx(S5,{path:"",depth:0})})]}),u&&m.jsx(N9,{...u,onClose:()=>d(null)})]})}function S5({path:e,depth:i}){const{showIgnored:r,epoch:s,editing:l}=id(),{data:h,error:p}=rt(()=>Jt.list(e,r),["files","sessions"],[e,r,s]),o=l&&l.kind!=="rename"&&l.parent===e?l.kind:null,u={paddingLeft:`${i*12+8}px`};return m.jsxs(m.Fragment,{children:[o&&m.jsx(C5,{depth:i,icon:o==="folder"?Sg:wg,initial:""}),p&&m.jsx("div",{className:"py-1 text-[11px] text-severity-critical",style:u,children:p}),!h&&!p&&m.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:u,children:"Loading..."}),h&&!h.entries.length&&!o&&m.jsx("div",{className:"py-1 text-[11px] text-muted-foreground",style:u,children:"Empty"}),h==null?void 0:h.entries.map(d=>m.jsx(M9,{entry:d,depth:i},d.path))]})}function M9({entry:e,depth:i}){const{expanded:r,toggle:s,editing:l,openMenu:h}=id(),p=_e(x=>x.go),o=_e(x=>x.view.kind==="file"&&x.view.path===e.path),u=on(x=>ls(x.drafts[e.path])),d=vr(x=>{var C;return((C=x.item)==null?void 0:C.mode)==="cut"&&x.item.path===e.path}),v=e.kind==="dir"&&r.has(e.path),c=N.useRef({fired:!1}),_=()=>window.clearTimeout(c.current.timer);return(l==null?void 0:l.kind)==="rename"&&l.entry.path===e.path?m.jsx(C5,{depth:i,icon:e.kind==="dir"?Sg:wg,initial:e.name}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"relative",children:[m.jsxs("button",{onClick:()=>{c.current.fired||(e.kind==="dir"?s(e.path):p({kind:"file",path:e.path}))},onDoubleClick:()=>e.kind==="file"&&In.getState().pin(e.path),onContextMenu:x=>{x.preventDefault(),h(e,x.clientX,x.clientY)},onPointerDown:x=>{if(c.current.fired=!1,x.pointerType!=="touch")return;const{clientX:C,clientY:y}=x;window.clearTimeout(c.current.timer),c.current.timer=window.setTimeout(()=>{c.current.fired=!0,h(e,C,y)},500)},onPointerUp:_,onPointerLeave:_,onPointerCancel:_,title:e.path,className:ye("flex w-full select-none items-center gap-1.5 rounded-md py-1 pr-8 text-left text-xs transition-colors [-webkit-touch-callout:none] md:pr-2",o?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground",e.ignored&&"opacity-55",d&&"opacity-45"),style:{paddingLeft:`${i*12+4}px`},children:[e.kind==="dir"?v?m.jsx(ba,{size:11,className:"shrink-0"}):m.jsx(wa,{size:11,className:"shrink-0"}):m.jsx("span",{className:"w-[11px] shrink-0"}),m.jsx(u5,{name:e.name,folder:e.kind==="dir",open:v}),m.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name}),u&&m.jsx("span",{title:"Unsaved changes",className:"h-1.5 w-1.5 shrink-0 rounded-full bg-severity-warning"})]}),m.jsx("button",{"aria-label":"File actions",title:"File actions",onClick:x=>{const C=x.currentTarget.getBoundingClientRect();h(e,C.right-192,C.bottom+4)},className:"absolute right-1 top-0.5 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:m.jsx(qw,{size:13})})]}),v&&m.jsx(S5,{path:e.path,depth:i+1})]})}function C5({depth:e,icon:i,initial:r}){const{editing:s,setEditing:l,toggle:h}=id(),p=_e(c=>c.go),[o,u]=N.useState(r),d=N.useRef(!1),v=async()=>{const c=o.trim();if(d.current)return;if(!s||!c)return l(null);if(s.kind==="rename"&&/[\\/]/.test(c)){_e.getState().notify("A name cannot contain / or \\. To move it, use Cut and Paste.","error");return}const _=s.kind==="rename"?w5(s.entry.path):s.parent,x=c.startsWith("/")?c.replace(/^\/+/,""):b5(_,c);if(d.current=!0,s.kind==="rename"){const C=s.entry.path;if(x===C)return l(null);const y=await qe(()=>Jt.rename(C,x));if(d.current=!1,!y)return;on.getState().move(C,y.path),In.getState().rename(C,y.path);const g=_e.getState().view;g.kind==="file"&&(g.path===C||g.path.startsWith(`${C}/`))&&p({kind:"file",path:y.path+g.path.slice(C.length)})}else{const C=await qe(()=>s.kind==="folder"?Jt.mkdir(x):Jt.create(x));if(d.current=!1,!C)return;s.kind==="file"?p({kind:"file",path:C.path}):h(C.path,!0)}l(null)};return m.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 pr-2",style:{paddingLeft:`${e*12+19}px`},children:[m.jsx(i,{size:13,className:"shrink-0 text-muted-foreground"}),m.jsx("input",{autoFocus:!0,value:o,onChange:c=>u(c.target.value),onFocus:c=>{const _=r.lastIndexOf(".");c.currentTarget.setSelectionRange(0,_>0?_:r.length)},onKeyDown:c=>{c.key==="Enter"&&v(),c.key==="Escape"&&l(null)},onBlur:()=>!d.current&&l(null),placeholder:(s==null?void 0:s.kind)==="folder"?"Folder name":"File name",spellCheck:!1,className:"min-w-0 flex-1 rounded border border-primary/60 bg-background px-1.5 py-0.5 text-xs focus:outline-none"})]})}function N9({entry:e,x:i,y:r,onClose:s}){const{setEditing:l,toggle:h}=id(),p=_e(g=>g.go),o=_e(g=>{var b;return((b=g.health)==null?void 0:b.projectRoot)??""}),u=vr(g=>g.item),d=o.includes("\\"),v=e.path==="",c=v?o:o?d?`${o}\\${e.path.replace(/\//g,"\\")}`:`${o}/${e.path}`:e.path,_=(g,b)=>{var S;return void((S=navigator.clipboard)==null?void 0:S.writeText(g).then(()=>_e.getState().notify(`Copied the ${b}.`),()=>_e.getState().notify("The browser did not allow copying.","error")))};N.useEffect(()=>{const g=()=>s(),b=S=>S.key==="Escape"&&s();return window.addEventListener("pointerdown",g),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),window.addEventListener("keydown",b),()=>{window.removeEventListener("pointerdown",g),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),window.removeEventListener("keydown",b)}},[s]);const x=async()=>{if(!await qe(()=>Jt.remove(e.path),`Deleted ${e.name}.`))return;const{drafts:b,drop:S}=on.getState();for(const R of Object.keys(b))(R===e.path||R.startsWith(`${e.path}/`))&&S(R);const w=_e.getState().view,T=w.kind==="file"?w.path:null,D=In.getState().close(yT(e.path),T);T&&D!==T?p(D?{kind:"file",path:D}:{kind:"page",page:"overview"}):w.kind==="file"&&(w.path===e.path||w.path.startsWith(`${e.path}/`))&&p({kind:"page",page:"overview"})},C=(g,b,S,w=!1)=>{const T=b;return m.jsxs("button",{onPointerDown:D=>{D.stopPropagation(),s(),window.setTimeout(S)},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",w?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[m.jsx(T,{size:13}),g]})},y=g=>()=>{h(e.path,!0),l({kind:g,parent:e.path})};return v?m.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-220))},onPointerDown:g=>g.stopPropagation(),children:[C("New file",Rm,()=>l({kind:"file",parent:""})),C("New folder",Dm,()=>l({kind:"folder",parent:""})),u&&C("Paste",Tm,()=>void gg("",p,g=>h(g,!0))),m.jsx("div",{className:"my-1 border-t"}),C("Copy Path",Ol,()=>_(c,"path")),C("Reveal in File Explorer",Zs,()=>void qe(()=>Jt.reveal("")))]}):m.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.max(8,Math.min(r,window.innerHeight-380))},onPointerDown:g=>g.stopPropagation(),children:[e.kind==="file"?m.jsxs(m.Fragment,{children:[C("Open",Yl,()=>p({kind:"file",path:e.path})),C("Open in new window",Sa,()=>Dg({kind:"file",path:e.path}))]}):m.jsxs(m.Fragment,{children:[C("New file",Rm,y("file")),C("New folder",Dm,y("folder"))]}),m.jsx("div",{className:"my-1 border-t"}),C("Cut",k4,()=>vr.getState().set({mode:"cut",path:e.path})),C("Copy",Ah,()=>{vr.getState().set({mode:"copy",path:e.path}),qe(()=>Jt.copyToClipboard(e.path),"Copied: paste it here, or with Ctrl+V in Slack, Teams or a mail.")}),u&&C(`Paste${e.kind==="dir"?" into folder":" here"}`,Tm,()=>void gg(e.kind==="dir"?e.path:w5(e.path),p,g=>h(g,!0))),m.jsx("div",{className:"my-1 border-t"}),C("Copy Path",Ol,()=>_(c,"path")),C("Copy Relative Path",Ol,()=>_(e.path,"relative path")),C("Reveal in File Explorer",Zs,()=>void qe(()=>Jt.reveal(e.path))),m.jsx("div",{className:"my-1 border-t"}),C("Rename",Xi,()=>l({kind:"rename",entry:e})),m.jsx("div",{className:"my-1 border-t"}),C("Delete",Ri,()=>void x(),!0)]})}const dw=[{id:"operation",label:"Operation",items:[{page:"overview",label:"Overview",icon:p4},{page:"inbox",label:"Inbox",icon:ds},{page:"automation",label:"Automation",icon:Kl}]},{id:"project",label:"Project",items:[{page:"instructions",label:"Instructions",icon:e4},{page:"agents",label:"Agents",icon:Iw},{page:"skills",label:"Skills",icon:Lh},{page:"commands",label:"Commands",icon:r4},{page:"mcp-servers",label:"MCP servers",icon:Zl},{page:"variables",label:"Variables",icon:Cg},{page:"hooks",label:"Hooks",icon:Jw},{page:"plugins",label:"Plugins",icon:w4}]},{id:"settings",label:"Settings",items:[{page:"claude-settings",label:"Claude settings",icon:A4},{page:"channels",label:"Channels",icon:Jl},{page:"hub-prompts",label:"Hub prompts",icon:Gw},{page:"mcp-suggestions",label:"MCP suggestions",icon:b4},{page:"presets",label:"Toolset presets",icon:kg},{page:"categories",label:"Task categories",icon:Qw}]}];function rd({session:e}){const i=e.status==="waiting"?"bg-severity-warning animate-status-pulse":e.status==="running"?"bg-success animate-status-pulse":e.status==="idle"?"bg-success":e.status==="done"?"border border-success bg-transparent":"bg-muted-foreground/40";return m.jsx("span",{className:ye("inline-block h-2 w-2 shrink-0 rounded-full",i)})}const O9={manual:"hub",cron:"cron",webhook:"webhook",queue:"queue",external:"terminal"},fw="clauder-hub:folded-groups",pw="clauder-hub:sidebar-tab",B9="clauder-hub:history-hide-tasks",vg="clauder:focus-sessions";function P9(e,i){const[r,s]=N.useState(()=>{try{const h=localStorage.getItem(e);return h===null?i:h==="1"}catch{return i}});return[r,h=>{s(h);try{localStorage.setItem(e,h?"1":"0")}catch{}}]}function z9(){const[e,i]=N.useState(()=>{try{const s=localStorage.getItem(pw);return s==="workspace"||s==="files"?s:"sessions"}catch{return"sessions"}});return[e,s=>{i(s);try{localStorage.setItem(pw,s)}catch{}}]}function I9(){const[e,i]=N.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem(fw)??"[]"))}catch{return new Set}});return N.useEffect(()=>{try{localStorage.setItem(fw,JSON.stringify([...e]))}catch{}},[e]),[e,s=>i(l=>{const h=new Set(l);return h.has(s)?h.delete(s):h.add(s),h})]}function k5(e){const i=_e(h=>h.go),[r,s]=N.useState(!1);return{starting:r,newSession:async()=>{if(r)return;s(!0);const h=Math.max(80,Math.floor((window.innerWidth-e-40)/7.8)),p=Math.max(24,Math.floor((window.innerHeight-140)/17)),o=await qe(()=>ve.startSession({cols:h,rows:p}));s(!1),o&&(await _e.getState().refreshSessions(),i({kind:"session",id:o.sessionId}))}}}const H9=[{kind:"hub",label:"Hub task",icon:ec},{kind:"create-job",label:"Create a job",icon:Kl},{kind:"queue-run",label:"Queue a run",icon:va},{kind:"create-category",label:"New task category",icon:Qw},{kind:"create-preset",label:"New toolset preset",icon:kg},{kind:"create-channel",label:"Add a channel",icon:Jl}];function E5({beside:e,size:i="sm",full:r=!1}){const{starting:s,newSession:l}=k5(e),{starting:h,start:p}=zh(),[o,u]=N.useState(!1),d=s||h,v=c=>{u(!1),c()};return m.jsxs("div",{className:ye("flex",r&&"w-full"),children:[m.jsxs(ge,{variant:"primary",size:i,className:"flex-1 rounded-r-none",disabled:d,onClick:()=>void l(),"aria-label":"New session",children:[m.jsx(Rn,{size:i==="md"?14:13})," ",d?"Starting...":"New session"]}),m.jsxs(Da,{open:o,onOpenChange:u,align:"end",className:"w-56 p-1",trigger:m.jsx(ge,{variant:"primary",size:i,className:"rounded-l-none border-l border-primary-foreground/25 px-2",disabled:d,"aria-label":"More ways to start",title:"Plain session or hub task",children:m.jsx(ba,{size:14})}),children:[m.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>v(l),children:[m.jsx(Rn,{size:13})," New session"]}),m.jsx("div",{className:"mx-2 mb-0.5 mt-1.5 border-t pt-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub task"}),H9.map(c=>m.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",onClick:()=>v(()=>p(c.kind)),children:[m.jsx(c.icon,{size:13,className:"text-primary"})," ",c.label]},c.kind))]})]})}function F9({onMenu:e}){const i=_e(r=>r.health);return m.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[m.jsx(ge,{variant:"ghost",size:"icon",onClick:e,"aria-label":"Open menu",title:"Menu",children:m.jsx(Ww,{size:16})}),m.jsx(xa,{}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx(od,{}),m.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[m.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:(i==null?void 0:i.project)??"..."}),m.jsx(L5,{})]})]}),m.jsx(E5,{beside:0})]})}function mw({width:e,collapsed:i,onToggle:r,drawer:s=!1}){const{sessions:l,open:h,view:p,go:o,health:u}=_e(),[d,v]=N.useState(""),[c,_]=I9(),[x,C]=z9(),{starting:y,newSession:g}=k5(s?0:i?48:Number(e)),b=N.useMemo(()=>{const z=d.trim().toLowerCase();return z?l.filter(P=>`${P.title} ${P.firstPrompt??""} ${P.id}`.toLowerCase().includes(z)):l},[l,d]),S=b.filter(z=>z.live),w=b.filter(z=>!z.live),[T,D]=P9(B9,!0),R=T?w.filter(z=>!z.purpose):w,[L,A]=N.useState(0),M=N.useRef(null);N.useEffect(()=>{const z=()=>{C("sessions"),A(P=>P+1),window.setTimeout(()=>{var P;return(P=M.current)==null?void 0:P.scrollIntoView({block:"nearest",behavior:"smooth"})},50)};return window.addEventListener(vg,z),()=>window.removeEventListener(vg,z)},[C]);const j=z=>p.kind==="page"&&p.page===z;return i?m.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[m.jsx(xa,{className:"mb-2"}),m.jsx(gr,{content:"New session",side:"right",asChild:!0,children:m.jsx(ge,{variant:"primary",size:"icon",disabled:y,onClick:()=>void g(),children:m.jsx(Rn,{size:14})})}),dw.map(z=>m.jsx("div",{className:"flex flex-col items-center gap-1 border-t pt-1",children:z.items.map(P=>m.jsx(gr,{content:`${z.label} · ${P.label}`,side:"right",asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon",className:ye(j(P.page)&&"bg-muted text-foreground"),onClick:()=>o({kind:"page",page:P.page}),children:m.jsx(P.icon,{size:15})})},P.page))},z.id)),m.jsx("div",{className:"flex-1"}),m.jsx(ge,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:m.jsx(Fw,{size:15})})]}):m.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[m.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[m.jsx(xa,{}),m.jsxs("div",{className:"min-w-0",children:[m.jsx(od,{}),m.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[m.jsx(gr,{content:u==null?void 0:u.projectRoot,wide:!0,className:"min-w-0",children:m.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:(u==null?void 0:u.project)??"..."})}),m.jsx(L5,{})]})]}),s?m.jsx(ge,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Close menu",children:m.jsx(xn,{size:15})}):m.jsx(ge,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":"Collapse sidebar",children:m.jsx(Hw,{size:15})})]}),m.jsx("div",{className:"px-3 pb-2",children:m.jsx(E5,{beside:i?48:typeof e=="number"?e:280,size:"md",full:!0})}),m.jsx("div",{className:"mx-3 mb-2 flex rounded-md bg-muted p-0.5",children:[["sessions","Sessions",null],["workspace","Workspace",h.length?String(h.length):null],["files","Files",null]].map(([z,P,H])=>m.jsxs("button",{onClick:()=>C(z),className:ye("flex flex-1 items-center justify-center gap-1.5 rounded px-2 py-1 text-xs transition-colors",x===z?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[P,z==="sessions"&&S.length>0&&m.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success",title:`${S.length} running`}),H&&m.jsx("span",{className:ye("rounded-full px-1.5 text-[10px] font-semibold",z==="workspace"?"bg-severity-warning text-background":"bg-success/20 text-success"),children:H})]},z))}),m.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:x==="files"?m.jsx(j9,{}):x==="workspace"?m.jsx("nav",{className:"px-2",children:dw.map(z=>{const P=c.has(z.id),H=z.items.some(F=>j(F.page));return m.jsxs("div",{className:"pb-1",children:[m.jsxs("button",{onClick:()=>_(z.id),className:"flex w-full items-center gap-1 px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:[P?m.jsx(wa,{size:11}):m.jsx(ba,{size:11}),z.label,P&&z.id==="operation"&&h.length>0&&m.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] text-background",children:h.length})]}),(!P||H)&&z.items.filter(F=>!P||j(F.page)).map(F=>m.jsxs("button",{onClick:()=>o({kind:"page",page:F.page}),className:ye("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",j(F.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[m.jsx(F.icon,{size:14}),F.label,F.page==="inbox"&&h.length>0&&m.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:h.length})]},F.page))]},z.id)})}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"sticky top-0 z-10 bg-background px-3 pb-1",children:m.jsxs("div",{className:"relative",children:[m.jsx(Dh,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),m.jsx(_t,{value:d,onChange:z=>v(z.target.value),placeholder:"Search sessions",className:"pl-6"})]})}),m.jsxs("div",{className:"px-2",children:[m.jsx("div",{ref:M,children:m.jsx(gw,{title:`Live (${S.length})`,sessions:S,flash:L})}),m.jsx(gw,{title:`History (${R.length})`,sessions:R,action:m.jsxs("label",{className:"flex cursor-pointer select-none items-center gap-1",title:"Hide the hub's own configuration sessions",children:[m.jsx("input",{type:"checkbox",className:"h-3 w-3 accent-[hsl(var(--primary))]",checked:T,onChange:z=>D(z.target.checked)}),"Hide hub tasks"]})}),!b.length&&m.jsx("div",{className:"px-2 pt-3 text-xs text-muted-foreground",children:d?"No match.":"No sessions yet. Start one above."})]})]})}),m.jsx(p9,{})]})}function U9({session:e,x:i,y:r,onClose:s}){const l=_e(o=>o.go),h=td();N.useEffect(()=>{const o=()=>s(),u=d=>d.key==="Escape"&&s();return window.addEventListener("pointerdown",o),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),window.addEventListener("keydown",u),()=>{window.removeEventListener("pointerdown",o),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o),window.removeEventListener("keydown",u)}},[s]);const p=(o,u,d,v={})=>{const c=u;return m.jsxs("button",{disabled:v.disabled,title:v.hint,onPointerDown:_=>{_.stopPropagation(),!v.disabled&&(s(),d())},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs disabled:cursor-not-allowed disabled:opacity-40",v.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[m.jsx(c,{size:13}),o]})};return m.jsxs("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-270)},onPointerDown:o=>o.stopPropagation(),children:[p("Open",Yl,()=>l({kind:"session",id:e.id})),p("Open in new window",Sa,()=>Dg({kind:"session",id:e.id})),p("Rename",Xi,()=>void h.rename(e)),m.jsx("div",{className:"my-1 border-t"}),e.quiet?p("Allow notifications",ds,()=>void qe(()=>ve.setSessionQuiet(e.id,!1),"Notifications back on for this session.")):p("Do not disturb",ga,()=>void qe(()=>ve.setSessionQuiet(e.id,!0),"Nothing from this session goes out on a channel."),{hint:"Its questions still wait in the inbox; no channel hears of them"}),p(`Clear waiting${e.openInteractions?` (${e.openInteractions})`:""}`,Eg,()=>void qe(()=>ve.dismissWaiting(e.id),"Cleared."),{disabled:!e.openInteractions,hint:"Puts away what it waits on, unanswered; nothing is typed into it"}),m.jsx("div",{className:"my-1 border-t"}),e.live&&p("Stop",jh,()=>void h.stop(e),{hint:"Stops its terminal; the conversation is kept for a later resume"}),p("Delete permanently",Ri,()=>void h.remove(e),{danger:!0,hint:e.live?"Stops it first":void 0})]})}function gw({title:e,sessions:i,action:r,flash:s=0}){const{view:l,go:h}=_e(),[p,o]=N.useState(null),u=N.useRef({fired:!1}),d=(c,_)=>{if(u.current.fired=!1,_.pointerType!=="touch")return;const{clientX:x,clientY:C}=_;window.clearTimeout(u.current.timer),u.current.timer=window.setTimeout(()=>{u.current.fired=!0,o({session:c,x,y:C})},500)},v=()=>window.clearTimeout(u.current.timer);return!i.length&&!r?null:m.jsxs("div",{className:ye("mt-3 rounded-md",s>0&&"sessions-flash"),children:[p&&m.jsx(U9,{...p,onClose:()=>o(null)}),m.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1 text-[10px] text-muted-foreground",children:[m.jsx("span",{children:e}),r]}),m.jsx("div",{className:"space-y-0.5",children:i.map(c=>{const _=l.kind==="session"&&l.id===c.id;return m.jsxs("div",{className:"relative",children:[m.jsxs("button",{onClick:()=>!u.current.fired&&h({kind:"session",id:c.id}),onContextMenu:x=>{x.preventDefault(),o({session:c,x:x.clientX,y:x.clientY})},onPointerDown:x=>d(c,x),onPointerUp:v,onPointerLeave:v,onPointerCancel:v,className:ye("block w-full select-none rounded-md px-2 py-1.5 pr-8 text-left transition-colors [-webkit-touch-callout:none] md:select-auto md:pr-2",_?"bg-muted":"hover:bg-muted/60"),children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(rd,{session:c}),m.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:c.title}),c.purpose&&m.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-primary/15 px-1 text-[9px] font-medium text-primary",title:`Hub task: ${c.purpose.title}`,children:[m.jsx(ec,{size:9})," task"]}),c.quiet&&m.jsx("span",{className:"shrink-0 text-muted-foreground",title:"Do not disturb: no channel hears from it",children:m.jsx(ga,{size:11})}),c.openInteractions>0&&m.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:c.openInteractions})]}),m.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 pl-4 text-[10px] text-muted-foreground",children:[m.jsx("span",{children:O9[c.origin]}),m.jsx("span",{children:"·"}),m.jsx("span",{children:vs(c.lastAt)}),c.tokens&&m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"·"}),m.jsxs("span",{children:[Pn(us(c.tokens))," tok"]})]}),c.diskBytes?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"·"}),m.jsx("span",{title:"On disk: transcript, subagents, file snapshots and temp folder",children:Ag(c.diskBytes)})]}):null]})]}),m.jsx("button",{"aria-label":"Session actions",title:"Session actions",onClick:x=>{const C=x.currentTarget.getBoundingClientRect();o({session:c,x:C.right-192,y:C.bottom+4})},className:"absolute right-1 top-1 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground md:hidden",children:m.jsx(qw,{size:14})})]},c.id)})})]},s)}function T5({x:e,y:i,items:r,onClose:s}){return N.useEffect(()=>{const l=()=>s(),h=p=>p.key==="Escape"&&s();return window.addEventListener("pointerdown",l),window.addEventListener("keydown",h),()=>{window.removeEventListener("pointerdown",l),window.removeEventListener("keydown",h)}},[s]),m.jsx("div",{role:"menu",className:"fixed z-50 w-44 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(e,window.innerWidth-184),top:Math.min(i,window.innerHeight-180)},onPointerDown:l=>l.stopPropagation(),children:r.map(([l,h,p,o,u])=>m.jsxs("button",{disabled:u,onClick:()=>{s(),p()},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent",o&&"mt-1 border-t pt-2"),children:[m.jsx(h,{size:13}),l]},l))})}function $9(){const e=_e(_=>_.sessions),i=_e(_=>_.view),r=_e(_=>_.go),s=ln(),l=N.useRef(null),h=td(),[p,o]=N.useState(null),u=e.filter(_=>_.live),d=i.kind==="session"?i.id:null;if(N.useEffect(()=>{var _,x;d&&((x=(_=l.current)==null?void 0:_.querySelector(`[data-session="${CSS.escape(d)}"]`))==null||x.scrollIntoView({block:"nearest",inline:"nearest"}))},[d,u.length]),!u.length)return null;const v=_=>h.stop(_),c=(_,x)=>s({title:`Stop ${x?"all ":""}${_.length} ${x?"running":"other"} terminal${_.length>1?"s":""}?`,description:"Their conversations are kept for a later resume.",body:m.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:_.map(C=>m.jsx("div",{className:"truncate",children:C.title},C.id))}),confirmLabel:x?"Stop all":"Stop others",tone:"destructive",run:async()=>{await Promise.all(_.map(C=>ve.killSession(C.id))),ed(_.map(C=>C.id))}});return m.jsxs("div",{ref:l,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[p&&m.jsx(T5,{x:p.x,y:p.y,onClose:()=>o(null),items:[["Open",Yl,()=>r({kind:"session",id:p.session.id})],["Rename",Xi,()=>void h.rename(p.session)],["Close",xn,()=>void v(p.session),!0],["Close Others",Xs,()=>void c(u.filter(_=>_.id!==p.session.id),!1),!1,u.length<2],["Close All",Xs,()=>void c(u,!0)]]}),m.jsx("div",{className:"flex shrink-0 items-center px-2 text-muted-foreground",title:"Running terminals",children:m.jsx(Tg,{size:13})}),u.map(_=>{const x=_.id===d;return m.jsxs("div",{"data-session":_.id,title:_.status==="waiting"?`${_.title} (waiting on you)`:_.title,onClick:()=>r({kind:"session",id:_.id}),onContextMenu:C=>{C.preventDefault(),o({session:_,x:C.clientX,y:C.clientY})},onAuxClick:C=>{C.button===1&&(C.preventDefault(),v(_))},className:ye("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",x?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[m.jsx(rd,{session:_}),m.jsx("span",{className:"truncate",children:_.title}),_.openInteractions>0&&m.jsx("span",{className:"grid h-4 min-w-[1rem] shrink-0 place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none text-background",children:_.openInteractions}),m.jsx("button",{"aria-label":`Stop ${_.title}`,title:"Stop this terminal",onClick:C=>{C.stopPropagation(),v(_)},className:ye("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!x&&"invisible group-hover:visible"),children:m.jsx(xn,{size:12})})]},_.id)})]})}const R5="clauder-hub:live-panel";function q9(){try{return localStorage.getItem(R5)!=="0"}catch{return!0}}const sd=oo((e,i)=>({open:q9(),toggle:()=>{const r=!i().open;e({open:r});try{localStorage.setItem(R5,r?"1":"0")}catch{}}}));function V9(){const{open:e,toggle:i}=sd(),r=e?Yw:y4;return m.jsx("button",{onClick:i,title:e?"Hide the live sessions panel":"Show the live sessions of every project, on the right","aria-label":e?"Hide live sessions":"Show live sessions","aria-pressed":e,className:"self-center rounded p-0.5 text-muted-foreground/70 hover:bg-muted hover:text-foreground",children:m.jsx(r,{size:13})})}function W9({status:e}){return m.jsx("span",{className:ye("inline-block h-2 w-2 shrink-0 rounded-full",e==="waiting"?"bg-severity-warning animate-status-pulse":e==="running"?"bg-success animate-status-pulse":e==="idle"?"bg-success":e==="done"?"border border-success bg-transparent":"bg-muted-foreground/40")})}function A5({width:e}){const i=sd(o=>o.toggle),r=uc(o=>o.projects),s=r??[],l=s.reduce((o,u)=>o+u.open.length,0),h=s.filter(o=>o.open.some(u=>!u.live)),p=()=>qe(()=>Promise.all(h.map(o=>ve.closeOpenSessions(o.id,o.open.filter(u=>!u.live).map(u=>u.id)))));return m.jsxs("aside",{"aria-label":"Live sessions",style:{width:e},className:"flex shrink-0 flex-col border-l bg-background",children:[m.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2",children:[m.jsx("span",{className:"text-xs font-semibold",children:"Open sessions"}),m.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-muted px-1 text-[10px] font-semibold leading-none tabular-nums text-muted-foreground",children:l}),m.jsx("div",{className:"flex-1"}),m.jsx(ge,{variant:"ghost",size:"icon",onClick:()=>void p(),disabled:!h.length,title:"Close every stopped session, in every project","aria-label":"Close stopped sessions",children:m.jsx(Eg,{size:13})}),m.jsx(ge,{variant:"ghost",size:"icon",onClick:i,title:"Hide this panel","aria-label":"Hide live sessions",children:m.jsx(Yw,{size:13})})]}),m.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:[r&&!s.length&&m.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No session is open in any project."}),s.map(o=>m.jsx(G9,{project:o},o.id))]})]})}function G9({project:e}){const i=_e(S=>S.projectId),r=_e(S=>S.view),s=_e(S=>S.openProject),l=_e(S=>S.openSessionIn),[h,p]=N.useState(!1),[o,u]=N.useState(!1),[d,v]=N.useState(null),[c,_]=N.useState(null),x=td(),C=ln(),y=i===e.id,g=(S,w)=>{if(!S.length)return;const T=async()=>{await ve.closeOpenSessions(e.id,S.map(R=>R.id)),y&&ed(S.filter(R=>R.live).map(R=>R.id))},D=S.filter(R=>R.live).length;return D?C({title:S.length===1?`Close "${S[0].title}"?`:`Close ${w} in ${e.name}?`,description:`${D===1?"Its terminal stops":`${D} terminals stop`}; the conversation${S.length>1?"s are":" is"} kept for a later resume.`,body:S.length>1?m.jsx("div",{className:"space-y-0.5 text-[11px] text-muted-foreground",children:S.map(R=>m.jsx("div",{className:"truncate",children:R.title},R.id))}):void 0,confirmLabel:"Close",tone:"destructive",run:T}):void qe(T)},b=async()=>{if(h)return;p(!0);const S=document.querySelector("main"),w=Math.max(80,Math.floor((((S==null?void 0:S.clientWidth)??window.innerWidth)-40)/7.8)),T=Math.max(24,Math.floor((window.innerHeight-140)/17)),D=await qe(()=>ve.startSessionIn(e.id,{cols:w,rows:T}));p(!1),D&&(y&&await _e.getState().refreshSessions(),l(e.id,D.sessionId))};return m.jsxs("div",{className:"px-1.5 py-1",children:[c&&m.jsx(Iv,{project:e,x:c.x,y:c.y,onClose:()=>_(null)}),m.jsxs("div",{className:"group flex items-center gap-1 px-1.5 py-1",onMouseEnter:()=>!y&&jm(e.id),onContextMenu:S=>{S.preventDefault(),_({x:S.clientX,y:S.clientY})},children:[m.jsx("button",{onClick:()=>s(e.id),title:`Open ${e.name}`,className:ye("min-w-0 flex-1 truncate text-left text-[11px] font-semibold uppercase tracking-wide hover:text-foreground",y?"text-foreground":"text-muted-foreground"),children:e.name}),m.jsxs(Da,{open:o,onOpenChange:u,align:"end",className:"w-64 p-1",trigger:m.jsx(ge,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`Resume a session of ${e.name}`,"aria-label":"Resume a session",disabled:!e.recent.length,children:m.jsx(u4,{size:12})}),children:[m.jsx("div",{className:"px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Resume"}),e.recent.map(S=>m.jsxs("button",{onClick:()=>{u(!1),l(e.id,S.id)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted",children:[m.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.lastAt&&m.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:vs(S.lastAt)})]},S.id))]}),m.jsx(ge,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`New session in ${e.name}`,"aria-label":"New session",disabled:h,onClick:()=>void b(),children:m.jsx(Rn,{size:12})})]}),e.open.map(S=>{const w=y&&r.kind==="session"&&r.id===S.id,T=()=>l(e.id,S.id);return m.jsxs("div",{role:"button",tabIndex:0,onClick:T,onMouseEnter:()=>!y&&jm(e.id),onKeyDown:D=>{D.key!=="Enter"&&D.key!==" "||(D.preventDefault(),T())},onContextMenu:D=>{D.preventDefault(),v({session:S,x:D.clientX,y:D.clientY})},title:S.live?S.title:`${S.title} (stopped; opening it resumes it)`,className:ye("group/row flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",w?"bg-primary/15 text-foreground":"hover:bg-muted",!S.live&&!w&&"text-muted-foreground"),children:[m.jsx(W9,{status:S.status}),m.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.openInteractions>0&&m.jsx("span",{className:"grid h-4 min-w-[1rem] place-items-center rounded-full bg-severity-warning px-1 text-[10px] font-semibold leading-none tabular-nums text-background",children:S.openInteractions}),m.jsx("button",{onClick:D=>{D.stopPropagation(),g([S],"it")},title:S.live?"Close: stops its terminal, after asking":"Close","aria-label":`Close ${S.title}`,className:"invisible grid h-4 w-4 shrink-0 place-items-center rounded text-muted-foreground hover:bg-foreground/10 hover:text-foreground group-hover/row:visible group-focus-within/row:visible",children:m.jsx(xn,{size:12})})]},S.id)}),d&&m.jsx(T5,{x:d.x,y:d.y,onClose:()=>v(null),items:[["Open",Yl,()=>l(e.id,d.session.id)],["Rename",Xi,()=>void x.rename(d.session,e.id)],["Close",xn,()=>void g([d.session],"it"),!0],["Close Stopped",Eg,()=>void g(e.open.filter(S=>!S.live),"the stopped ones"),!1,!e.open.some(S=>!S.live)],["Close Others",Xs,()=>void g(e.open.filter(S=>S.id!==d.session.id),"the others"),!1,e.open.length<2],["Close All",Xs,()=>void g(e.open,"all")]]})]})}function D5({open:e,onOpenChange:i}){const r=_e(x=>x.openProject),[s,l]=N.useState(null),[h,p]=N.useState(""),[o,u]=N.useState(null),[d,v]=N.useState(!1),c=async x=>{try{const C=await ve.folders(x);l(C),p(C.path),u(null)}catch(C){u(C.message)}};N.useEffect(()=>{e&&c(s==null?void 0:s.path)},[e]);const _=async x=>{v(!0);try{const C=await ve.addProject(x);i(!1),r(C.id)}catch(C){u(C.message)}finally{v(!1)}};return m.jsx(Ug,{open:e,onOpenChange:i,title:"Open folder",description:"Its sessions, jobs and channels run in the hub from now on.",maxWidth:"max-w-xl",height:"h-[min(36rem,calc(100dvh-2rem))]",footer:m.jsxs(m.Fragment,{children:[m.jsx(ge,{onClick:()=>i(!1),children:"Cancel"}),m.jsx(ge,{variant:"primary",disabled:!h.trim()||d,onClick:()=>void _(h.trim()),children:d?"Opening...":"Open this folder"})]}),children:m.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[m.jsxs("form",{className:"flex gap-1.5",onSubmit:x=>{x.preventDefault(),c(h.trim())},children:[m.jsx(_t,{value:h,onChange:x=>p(x.target.value),placeholder:"C:\\Source code\\your-repo",className:"font-mono"}),m.jsx(ge,{type:"submit",title:"Go to this folder",children:m.jsx(wa,{size:13})})]}),m.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[m.jsxs(ge,{variant:"ghost",disabled:!(s!=null&&s.parent),onClick:()=>(s==null?void 0:s.parent)&&void c(s.parent),title:"Up one folder",children:[m.jsx(zw,{size:12})," Up"]}),m.jsxs(ge,{variant:"ghost",onClick:()=>void c(s==null?void 0:s.home),children:[m.jsx(h4,{size:12})," Home"]}),((s==null?void 0:s.drives.length)??0)>1&&s.drives.map(x=>m.jsxs(ge,{variant:"ghost",onClick:()=>void c(x),children:[m.jsx(c4,{size:12})," ",x]},x))]}),o&&m.jsx("div",{className:"text-xs text-severity-critical",children:o}),m.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto rounded-md border",children:s!=null&&s.folders.length?s.folders.map(x=>m.jsxs("button",{onClick:()=>void c(x.path),onDoubleClick:()=>void _(x.path),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs hover:bg-muted",title:x.git?"A git repository. Double-click to open it.":x.path,children:[x.git?m.jsx(Vw,{size:13,className:"shrink-0 text-primary"}):m.jsx(Zs,{size:13,className:"shrink-0 text-muted-foreground"}),m.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.name}),x.git&&m.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"git"})]},x.path)):m.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:s?"No folders in here.":"Loading..."})})]})})}function xa({className:e}){const i=_e(r=>r.openProject);return m.jsx("button",{onClick:()=>i(pi),title:"Global: every project","aria-label":"Go to Global",className:ye("shrink-0 rounded hover:opacity-80",e),children:m.jsx(o9,{size:20})})}let vw=null;function od(){const e=_e(s=>s.openProject),[i,r]=N.useState(null);return N.useEffect(()=>{vw??(vw=ve.hub().then(s=>s.version??null).catch(()=>null)),vw.then(r)},[]),m.jsxs("span",{className:"flex items-baseline gap-1.5",children:[m.jsx("button",{onClick:()=>e(pi),title:"Global: every project",className:"text-left text-sm font-semibold leading-tight hover:underline",children:"Clauder Hub"}),i&&m.jsxs("span",{className:"text-[10px] font-normal leading-tight text-muted-foreground/70",children:["v",i]}),m.jsx(Y9,{}),m.jsx(V9,{}),m.jsx(d9,{})]})}function Y9(){var r;const e=_e(s=>s.projectId),i=rt(()=>ve.channels(),["channels"],e);return!((r=i.data)!=null&&r.paused)||!i.data.channels.length?null:m.jsx("button",{onClick:eL,title:"Notifications are paused on every channel. Click to turn them back on.","aria-label":"Notifications paused",className:"self-center text-severity-warning hover:text-foreground",children:m.jsx(ga,{size:12})})}function L5(){const e=_e(l=>l.projectId),i=_e(l=>l.openProject),s=(rt(()=>ve.projects(),["projects"]).data??[]).filter(l=>l.id!==e).reduce((l,h)=>l+h.waiting,0);return m.jsxs("button",{onClick:()=>i(pi),className:"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground",title:"Back to the global home: every project",children:["Change",s>0&&m.jsx("span",{className:"grid h-3.5 min-w-[0.875rem] place-items-center rounded-full bg-severity-warning px-1 text-[9px] font-semibold leading-none tabular-nums text-background",children:s})]})}function Eh({onDrag:e,onReset:i}){const r=N.useRef(0);return m.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize, double-click to reset",className:"group relative w-1 shrink-0 cursor-col-resize bg-border/60 transition-colors hover:bg-primary/60",onDoubleClick:i,onPointerDown:s=>{s.preventDefault(),s.currentTarget.setPointerCapture(s.pointerId),r.current=s.clientX,document.body.style.userSelect="none"},onPointerMove:s=>{if(!s.currentTarget.hasPointerCapture(s.pointerId))return;const l=s.clientX-r.current;l&&(r.current=s.clientX,e(l))},onPointerUp:s=>{s.currentTarget.releasePointerCapture(s.pointerId),document.body.style.userSelect=""},onPointerCancel:()=>{document.body.style.userSelect=""},children:m.jsx("span",{className:"absolute inset-y-0 -left-1 -right-1"})})}function j5({tools:e}){const i=hT(e),r={};for(const l of i.mcp){const{server:h,tool:p}=uT(l.name),o=r[h]??(r[h]={count:0,errors:0,tools:[]});o.count+=l.count,o.errors+=l.errors,o.tools.push(`${p} ×${l.count}`)}const s=l=>l.map(h=>({key:h.name,label:h.name,value:h.count,note:h.errors?`${h.errors} failed`:void 0}));return m.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[m.jsx(Nt,{title:`Built-in tools (${i["built-in"].reduce((l,h)=>l+h.count,0)})`,children:m.jsx(hs,{rows:s(i["built-in"]),format:String})}),m.jsx(Nt,{title:`MCP servers (${i.mcp.reduce((l,h)=>l+h.count,0)})`,description:"Calls grouped by server; hover a bar for its tools.",children:m.jsx(hs,{rows:Object.entries(r).map(([l,h])=>({key:l,label:l,value:h.count,note:h.errors?`${h.errors} failed`:void 0,sublabel:h.tools.slice(0,3).join(", ")})),format:String,empty:"No MCP calls."})})]})}function K9({agent:e}){const[i,r]=N.useState(!1),s=Object.values(e.tools).reduce((l,h)=>l+h.count,0);return m.jsxs("div",{className:"rounded-md border",children:[m.jsxs("button",{className:"flex w-full items-center gap-2 px-2.5 py-2 text-left",onClick:()=>r(!i),style:{paddingLeft:10+(e.depth-1)*16},children:[i?m.jsx(ba,{size:13}):m.jsx(wa,{size:13}),m.jsx(Iw,{size:13,className:"shrink-0 text-muted-foreground"}),m.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e.agentType}),m.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:e.description}),m.jsxs("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:[s," calls · ",Pn(us(e.tokens))," tok"]})]}),i&&m.jsxs("div",{className:"grid gap-3 border-t p-3 md:grid-cols-2",children:[m.jsxs("div",{className:"space-y-1 text-[11px] text-muted-foreground",children:[m.jsxs("div",{children:["Model: ",e.model??"inherited",e.fork&&" · fork"]}),m.jsxs("div",{children:[Wi(e.startedAt)," → ",Wi(e.lastAt)]}),m.jsxs("div",{children:["Output ",Pn(e.tokens.output)," · cache read ",Pn(e.tokens.cacheRead)]})]}),m.jsx(hs,{rows:Object.entries(e.tools).map(([l,h])=>({key:l,label:l,value:h.count})),format:String,limit:6,empty:"No tool calls."}),e.recent.length>0&&m.jsx("div",{className:"md:col-span-2",children:m.jsx(M5,{calls:e.recent.slice(-10)})})]})]})}function M5({calls:e}){return m.jsx("div",{className:"divide-y rounded-md border",children:[...e].reverse().map(i=>m.jsxs("div",{className:"flex items-baseline gap-2 px-2.5 py-1.5 text-[11px]",children:[m.jsx("span",{className:"hidden w-20 shrink-0 whitespace-nowrap tabular-nums text-muted-foreground sm:block",children:i.ts?new Date(i.ts).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}),m.jsx("span",{className:ye("max-w-[60%] shrink-0 truncate font-mono sm:max-w-none",i.error&&"text-severity-critical"),children:i.name.startsWith("mcp__")?i.name.replace(/^mcp__/,"mcp:"):i.name}),m.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:i.summary})]},i.id))})}function X9({data:e}){const i=e.detail;if(!i)return m.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Claude has not written anything for this session yet."});const r=i.totals,s=Object.values(r.tools).reduce((l,h)=>l+h.count,0);return m.jsxs("div",{className:"space-y-3",children:[m.jsx(YC,{tokens:r.tokens}),m.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[m.jsx(Nt,{title:"Tokens by model",children:m.jsx(hs,{rows:Object.entries(r.tokensByModel).filter(([,l])=>us(l)>0).map(([l,h])=>({key:l,label:l,value:us(h)}))})}),m.jsx(Nt,{title:"Skills & commands",children:m.jsx(hs,{rows:Object.entries(i.skills).map(([l,h])=>({key:l,label:l,value:h})),format:String,empty:"No skills used."})}),m.jsx(Nt,{title:"Shape",children:m.jsxs("div",{className:"space-y-1 text-xs",children:[m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Prompts"}),m.jsx("span",{className:"tabular-nums",children:e.session.turns??0})]}),m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Tool calls (all agents)"}),m.jsx("span",{className:"tabular-nums",children:s})]}),m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Subagents"}),m.jsx("span",{className:"tabular-nums",children:i.subagents.length})]}),m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Branch"}),m.jsx("span",{className:"font-mono text-[11px]",children:e.session.gitBranch??"-"})]}),m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Permission mode"}),m.jsx("span",{children:e.session.permissionMode??"-"})]}),m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Claude Code"}),m.jsx("span",{children:e.session.version??"-"})]})]})})]}),m.jsx(j5,{tools:r.tools}),m.jsx(Nt,{title:`Subagents (${i.subagents.length})`,description:"Each one's own tokens and calls; a fork's inherited context is counted once, on its parent.",children:i.subagents.length?m.jsx("div",{className:"space-y-1.5",children:i.subagents.map(l=>m.jsx(K9,{agent:l},l.id))}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"No subagents."})}),m.jsx(Nt,{title:"Recent calls (main thread)",children:i.recent.length?m.jsx(M5,{calls:i.recent.slice(-40)}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"No tool calls yet."})})]})}const Q9=(e,i)=>JSON.stringify(e)===JSON.stringify(i),xm=e=>e.variables.length?e:{...e,variables:[{name:"",value:""}]};function Z9({sessionId:e,live:i,current:r}){const s=ln(),[l,h]=N.useState(()=>xm(r));N.useEffect(()=>h(xm(r)),[JSON.stringify(r)]);const p={notes:l.notes.trim(),variables:l.variables.map(v=>({name:v.name.trim(),value:v.value.trim()})).filter(v=>v.name)},o=!Q9(p,r),u=(v,c)=>h({...l,variables:l.variables.map((_,x)=>x===v?{..._,...c}:_)}),d=()=>s({title:i?"Save and restart this session?":"Save this setup?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Save & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionSetup(e,p),_e.getState().notify(i?"Restarting with the new setup.":"Saved.")}});return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsx("h2",{className:"text-sm font-semibold",children:"Setup"}),m.jsx("p",{className:"truncate text-[11px] text-muted-foreground",children:"For this session only, appended to its system prompt. Applies at start-up."})]}),m.jsxs("div",{className:"flex gap-1.5",children:[m.jsx(ge,{disabled:!o,onClick:()=>h(xm(r)),children:"Reset"}),m.jsx(ge,{variant:"primary",disabled:!o,onClick:()=>void d(),children:i?"Save & restart":"Save"})]})]}),m.jsxs("section",{className:"space-y-1.5",children:[m.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Notes"}),m.jsx(cc,{rows:10,defaultMode:"edit",value:l.notes,onChange:v=>h({...l,notes:v})})]}),m.jsxs("section",{className:"space-y-1.5",children:[m.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Names"}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Short names you use in this session and what each stands for, e.g. OUT → C:\\reports\\2026."}),l.variables.map((v,c)=>m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(_t,{className:"w-48 shrink-0 font-mono",placeholder:"Name",value:v.name,onChange:_=>u(c,{name:_.target.value})}),m.jsx(_t,{className:"min-w-0 flex-1",placeholder:"What it stands for",value:v.value,onChange:_=>u(c,{value:_.target.value})}),m.jsx(ge,{variant:"ghost",size:"icon",title:"Remove",onClick:()=>h({...l,variables:l.variables.filter((_,x)=>x!==c)}),children:m.jsx(xn,{size:13})})]},c)),m.jsxs(ge,{variant:"ghost",onClick:()=>h({...l,variables:[...l.variables,{name:"",value:""}]}),children:[m.jsx(Rn,{size:12})," Add a name"]})]})]})}function Pv({title:e,subtitle:i,badge:r,mono:s,defaultOpen:l,children:h}){const[p,o]=N.useState(!!l);return m.jsxs("div",{className:"rounded-md bg-muted/30",children:[m.jsxs("button",{onClick:()=>o(!p),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50",children:[m.jsx(wa,{size:13,className:ye("shrink-0 transition-transform",p&&"rotate-90")}),m.jsxs("span",{className:"min-w-0 flex-1",children:[m.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("span",{className:ye("min-w-0 truncate text-xs font-medium",s&&"font-mono"),title:typeof e=="string"?e:void 0,children:e}),r&&m.jsx("span",{className:"shrink-0",children:r})]}),i&&m.jsx("span",{className:"block truncate text-[11px] text-muted-foreground",children:i})]})]}),p&&m.jsx("div",{className:"bg-muted/20 px-3 py-2",children:h})]})}function gs(){return m.jsx(Xe,{tone:"on",className:"px-1 py-0 text-[9px] leading-[14px]",title:"Applies to every project on this machine, not only this one.",children:"global"})}const J9=[{kind:"plugins",title:"Plugins"},{kind:"agents",title:"Agents"},{kind:"skills",title:"Skills"},{kind:"mcp",title:"MCP servers"}];function eB({on:e,disabled:i,onToggle:r}){return m.jsx("button",{role:"switch","aria-checked":e,disabled:i,onClick:r,className:ye("relative h-4 w-7 shrink-0 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-40",e?"bg-primary":"bg-foreground/20"),children:m.jsx("span",{className:ye("absolute top-0.5 h-3 w-3 rounded-full bg-background transition-all",e?"left-3.5":"left-0.5")})})}function N5({catalog:e,value:i,onChange:r}){const[s,l]=N.useState(""),h=N.useMemo(()=>new Set(e.filter(v=>v.kind==="plugins"&&v.scope==="user").map(v=>v.id)),[e]),p=v=>v.scope==="user"||v.scope==="plugin"&&!!(v.plugin&&h.has(v.plugin)),o=v=>{const c=i[v.kind];r({...i,[v.kind]:c.includes(v.id)?c.filter(_=>_!==v.id):[...c,v.id]})},u=(v,c,_)=>{const x=new Set(_.map(y=>y.id)),C=i[v].filter(y=>!x.has(y));r({...i,[v]:c?C:[...C,...x]})},d=s.trim().toLowerCase();return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"relative",children:[m.jsx(Dh,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),m.jsx(_t,{value:s,onChange:v=>l(v.target.value),placeholder:"Filter",className:"pl-6"})]}),J9.map(({kind:v,title:c})=>{const _=e.filter(y=>y.kind===v);if(!_.length)return null;const x=d?_.filter(y=>`${y.label} ${y.description}`.toLowerCase().includes(d)):_,C=_.filter(y=>i[v].includes(y.id)||y.plugin&&i.plugins.includes(y.plugin)).length;return m.jsxs(Pv,{title:c,badge:m.jsx(Xe,{tone:C?"warning":"off",children:C?`${C} of ${_.length} off`:`${_.length} on`}),defaultOpen:!0,children:[m.jsxs("div",{className:"mb-1.5 flex gap-3 text-[11px] text-muted-foreground",children:[m.jsx("button",{className:"hover:text-foreground",onClick:()=>u(v,!0,x),children:"All on"}),m.jsx("button",{className:"hover:text-foreground",onClick:()=>u(v,!1,x),children:"All off"})]}),x.length?m.jsx("div",{className:"divide-y rounded-md border bg-background",children:x.map(y=>{const g=!!(y.plugin&&i.plugins.includes(y.plugin)),b=!g&&!i[v].includes(y.id);return m.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[m.jsx(eB,{on:b,disabled:g,onToggle:()=>o(y)}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"min-w-0 truncate font-mono text-[11px] text-foreground",children:y.label}),p(y)&&m.jsx(gs,{})]}),y.description&&m.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:y.description})]}),g?m.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"off with its plugin"}):!y.leavesContext&&m.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",title:"Turning this off blocks its use; Claude may still see it listed.",children:"blocks use only"}),m.jsx("span",{className:"hidden w-16 shrink-0 text-right text-[10px] text-muted-foreground sm:block",children:y.scope})]},y.id)})}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"No match."})]},v)})]})}function Th(e){return e.agents.length+e.skills.length+e.mcp.length+e.plugins.length}const tB=(e,i)=>JSON.stringify(e)===JSON.stringify(i);function nB({sessionId:e,live:i,current:r}){const s=ln(),l=rt(()=>ve.toolsetCatalog(),[]),h=rt(()=>ve.presets(),["jobs"]),[p,o]=N.useState(r),u=N.useRef("");N.useEffect(()=>o(r),[JSON.stringify(r)]);const d=!tB(p,r),v=()=>s({title:i?"Apply and restart this session?":"Save this toolset?",description:i?"Restarts it on the same conversation.":"Applies on the next resume.",confirmLabel:i?"Apply & restart":"Save",tone:i?"destructive":"primary",run:async()=>{await ve.setSessionToolset(e,p),_e.getState().notify(i?"Restarting with the new toolset.":"Saved.")}}),c=()=>(u.current="",s({title:"Save as a preset",description:"Reusable by jobs and new sessions.",body:m.jsx(_t,{autoFocus:!0,placeholder:"Preset name, e.g. Frontend only",onChange:_=>u.current=_.target.value}),confirmLabel:"Save preset",run:async()=>{await ve.savePreset({name:u.current,toolset:p}),_e.getState().notify("Preset saved."),h.reload()}}));return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 basis-48",children:[m.jsx("h2",{className:"text-sm font-semibold",children:"Toolset"}),m.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[Th(r)?`${Th(r)} turned off for this session.`:"Everything is on."," Applies at start-up."]})]}),m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.data&&h.data.length>0&&m.jsxs(vi,{value:"",onValueChange:_=>{var C;const x=(C=h.data)==null?void 0:C.find(y=>y.id===_);x&&o(x.toolset)},className:"w-40",children:[m.jsx(wt,{value:"",children:"Use a preset..."}),h.data.map(_=>m.jsxs(wt,{value:_.id,children:[_.name,_.isDefault?" (default)":""]},_.id))]}),m.jsx(ge,{onClick:()=>void c(),children:"Save as preset"}),d&&m.jsx(ge,{onClick:()=>o(r),children:"Discard"}),m.jsx(ge,{variant:"primary",disabled:!d,onClick:()=>void v(),children:i?"Apply & restart":"Save"})]})]}),l.data?m.jsx(N5,{catalog:l.data,value:p,onChange:o}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})]})}var ym={exports:{}},_w;function iB(){return _w||(_w=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const h=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(h._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,h=l._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const p=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(o.getPropertyValue("height")),d=Math.max(0,parseInt(o.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),c=u-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),_=d-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-p;return{cols:Math.max(2,Math.floor(_/h.css.cell.width)),rows:Math.max(1,Math.floor(c/h.css.cell.height))}}}})(),r})()))})(ym)),ym.exports}var rB=iB(),bm={exports:{}},xw;function sB(){return xw||(xw=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={345:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const v=[];for(let c=0;c<this._listeners.length;c++)v.push(this._listeners[c]);for(let c=0;c<v.length;c++)v[c].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(u,d){return u((v=>d.fire(v)))},o.runAndSubscribe=function(u,d){return d(void 0),u((v=>d(v)))}},859:(p,o)=>{function u(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)==null||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=u,o.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}}},s={};function l(p){var o=s[p];if(o!==void 0)return o.exports;var u=s[p]={exports:{}};return r[p](u,u.exports,l),u.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.SearchAddon=void 0;const o=l(345),u=l(859),d=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class v extends u.Disposable{constructor(_){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new u.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new u.MutableDisposable,this._onDidChangeResults=this.register(new o.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(_==null?void 0:_.highlightLimit)??1e3}activate(_){this._terminal=_,this.register(this._terminal.onWriteParsed((()=>this._updateMatches()))),this.register(this._terminal.onResize((()=>this._updateMatches()))),this.register((0,u.toDisposable)((()=>this.clearDecorations())))}_updateMatches(){var _;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((_=this._lastSearchOptions)!=null&&_.decorations)&&(this._highlightTimeout=setTimeout((()=>{const x=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(x,{...this._lastSearchOptions,incremental:!0,noScroll:!0})}),200))}clearDecorations(_){this._selectedDecoration.clear(),(0,u.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),_||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(_,x){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const C=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,x);this._lastSearchOptions=x,x!=null&&x.decorations&&(this._cachedSearchTerm===void 0||_!==this._cachedSearchTerm||C)&&this._highlightAllMatches(_,x);const y=this._findNextAndSelect(_,x);return this._fireResults(x),this._cachedSearchTerm=_,y}_highlightAllMatches(_,x){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!_||_.length===0)return void this.clearDecorations();x=x||{},this.clearDecorations(!0);const C=[];let y,g=this._find(_,0,0,x);for(;g&&((y==null?void 0:y.row)!==g.row||(y==null?void 0:y.col)!==g.col)&&!(C.length>=this._highlightLimit);)y=g,C.push(y),g=this._find(_,y.col+y.term.length>=this._terminal.cols?y.row+1:y.row,y.col+y.term.length>=this._terminal.cols?0:y.col+1,x);for(const b of C){const S=this._createResultDecoration(b,x.decorations);S&&(this._highlightedLines.add(S.marker.line),this._highlightDecorations.push({decoration:S,match:b,dispose(){S.dispose()}}))}}_find(_,x,C,y){var S;if(!this._terminal||!_||_.length===0)return(S=this._terminal)==null||S.clearSelection(),void this.clearDecorations();if(C>this._terminal.cols)throw new Error(`Invalid col: ${C} to search in terminal of ${this._terminal.cols} cols`);let g;this._initLinesCache();const b={startRow:x,startCol:C};if(g=this._findInLine(_,b,y),!g)for(let w=x+1;w<this._terminal.buffer.active.baseY+this._terminal.rows&&(b.startRow=w,b.startCol=0,g=this._findInLine(_,b,y),!g);w++);return g}_findNextAndSelect(_,x){var w;if(!this._terminal||!_||_.length===0)return(w=this._terminal)==null||w.clearSelection(),this.clearDecorations(),!1;const C=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=0,g=0;C&&(this._cachedSearchTerm===_?(y=C.end.x,g=C.end.y):(y=C.start.x,g=C.start.y)),this._initLinesCache();const b={startRow:g,startCol:y};let S=this._findInLine(_,b,x);if(!S)for(let T=g+1;T<this._terminal.buffer.active.baseY+this._terminal.rows&&(b.startRow=T,b.startCol=0,S=this._findInLine(_,b,x),!S);T++);if(!S&&g!==0)for(let T=0;T<g&&(b.startRow=T,b.startCol=0,S=this._findInLine(_,b,x),!S);T++);return!S&&C&&(b.startRow=C.start.y,b.startCol=0,S=this._findInLine(_,b,x)),this._selectResult(S,x==null?void 0:x.decorations,x==null?void 0:x.noScroll)}findPrevious(_,x){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const C=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,x);this._lastSearchOptions=x,x!=null&&x.decorations&&(this._cachedSearchTerm===void 0||_!==this._cachedSearchTerm||C)&&this._highlightAllMatches(_,x);const y=this._findPreviousAndSelect(_,x);return this._fireResults(x),this._cachedSearchTerm=_,y}_didOptionsChange(_,x){return!!x&&(_.caseSensitive!==x.caseSensitive||_.regex!==x.regex||_.wholeWord!==x.wholeWord)}_fireResults(_){if(_!=null&&_.decorations){let x=-1;if(this._selectedDecoration.value){const C=this._selectedDecoration.value.match;for(let y=0;y<this._highlightDecorations.length;y++){const g=this._highlightDecorations[y].match;if(g.row===C.row&&g.col===C.col&&g.size===C.size){x=y;break}}}this._onDidChangeResults.fire({resultIndex:x,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(_,x){var T;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!_||_.length===0)return(T=this._terminal)==null||T.clearSelection(),this.clearDecorations(),!1;const C=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=this._terminal.buffer.active.baseY+this._terminal.rows-1,g=this._terminal.cols;const b=!0;this._initLinesCache();const S={startRow:y,startCol:g};let w;if(C&&(S.startRow=y=C.start.y,S.startCol=g=C.start.x,this._cachedSearchTerm!==_&&(w=this._findInLine(_,S,x,!1),w||(S.startRow=y=C.end.y,S.startCol=g=C.end.x))),w||(w=this._findInLine(_,S,x,b)),!w){S.startCol=Math.max(S.startCol,this._terminal.cols);for(let D=y-1;D>=0&&(S.startRow=D,w=this._findInLine(_,S,x,b),!w);D--);}if(!w&&y!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let D=this._terminal.buffer.active.baseY+this._terminal.rows-1;D>=y&&(S.startRow=D,w=this._findInLine(_,S,x,b),!w);D--);return this._selectResult(w,x==null?void 0:x.decorations,x==null?void 0:x.noScroll)}_initLinesCache(){const _=this._terminal;this._linesCache||(this._linesCache=new Array(_.buffer.active.length),this._linesCacheDisposables.value=(0,u.getDisposeArrayDisposable)([_.onLineFeed((()=>this._destroyLinesCache())),_.onCursorMove((()=>this._destroyLinesCache())),_.onResize((()=>this._destroyLinesCache()))])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout((()=>this._destroyLinesCache()),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(_,x,C){return(_===0||d.includes(x[_-1]))&&(_+C.length===x.length||d.includes(x[_+C.length]))}_findInLine(_,x,C={},y=!1){var z;const g=this._terminal,b=x.startRow,S=x.startCol,w=g.buffer.active.getLine(b);if(w!=null&&w.isWrapped)return y?void(x.startCol+=g.cols):(x.startRow--,x.startCol+=g.cols,this._findInLine(_,x,C));let T=(z=this._linesCache)==null?void 0:z[b];T||(T=this._translateBufferLineToStringWithWrap(b,!0),this._linesCache&&(this._linesCache[b]=T));const[D,R]=T,L=this._bufferColsToStringOffset(b,S),A=C.caseSensitive?_:_.toLowerCase(),M=C.caseSensitive?D:D.toLowerCase();let j=-1;if(C.regex){const P=RegExp(A,"g");let H;if(y)for(;H=P.exec(M.slice(0,L));)j=P.lastIndex-H[0].length,_=H[0],P.lastIndex-=_.length-1;else H=P.exec(M.slice(L)),H&&H[0].length>0&&(j=L+(P.lastIndex-H[0].length),_=H[0])}else y?L-A.length>=0&&(j=M.lastIndexOf(A,L-A.length)):j=M.indexOf(A,L);if(j>=0){if(C.wholeWord&&!this._isWholeWord(j,M,_))return;let P=0;for(;P<R.length-1&&j>=R[P+1];)P++;let H=P;for(;H<R.length-1&&j+_.length>=R[H+1];)H++;const F=j-R[P],W=j+_.length-R[H],G=this._stringLengthToBufferSize(b+P,F);return{term:_,col:G,row:b+P,size:this._stringLengthToBufferSize(b+H,W)-G+g.cols*(H-P)}}}_stringLengthToBufferSize(_,x){const C=this._terminal.buffer.active.getLine(_);if(!C)return 0;for(let y=0;y<x;y++){const g=C.getCell(y);if(!g)break;const b=g.getChars();b.length>1&&(x-=b.length-1);const S=C.getCell(y+1);S&&S.getWidth()===0&&x++}return x}_bufferColsToStringOffset(_,x){const C=this._terminal;let y=_,g=0,b=C.buffer.active.getLine(y);for(;x>0&&b;){for(let S=0;S<x&&S<C.cols;S++){const w=b.getCell(S);if(!w)break;w.getWidth()&&(g+=w.getCode()===0?1:w.getChars().length)}if(y++,b=C.buffer.active.getLine(y),b&&!b.isWrapped)break;x-=C.cols}return g}_translateBufferLineToStringWithWrap(_,x){var S;const C=this._terminal,y=[],g=[0];let b=C.buffer.active.getLine(_);for(;b;){const w=C.buffer.active.getLine(_+1),T=!!w&&w.isWrapped;let D=b.translateToString(!T&&x);if(T&&w){const R=b.getCell(b.length-1);R&&R.getCode()===0&&R.getWidth()===1&&((S=w.getCell(0))==null?void 0:S.getWidth())===2&&(D=D.slice(0,-1))}if(y.push(D),!T)break;g.push(g[g.length-1]+D.length),_++,b=w}return[y.join(""),g]}_selectResult(_,x,C){const y=this._terminal;if(this._selectedDecoration.clear(),!_)return y.clearSelection(),!1;if(y.select(_.col,_.row,_.size),x){const g=y.registerMarker(-y.buffer.active.baseY-y.buffer.active.cursorY+_.row);if(g){const b=y.registerDecoration({marker:g,x:_.col,width:_.size,backgroundColor:x.activeMatchBackground,layer:"top",overviewRulerOptions:{color:x.activeMatchColorOverviewRuler}});if(b){const S=[];S.push(g),S.push(b.onRender((w=>this._applyStyles(w,x.activeMatchBorder,!0)))),S.push(b.onDispose((()=>(0,u.disposeArray)(S)))),this._selectedDecoration.value={decoration:b,match:_,dispose(){b.dispose()}}}}}if(!C&&(_.row>=y.buffer.active.viewportY+y.rows||_.row<y.buffer.active.viewportY)){let g=_.row-y.buffer.active.viewportY;g-=Math.floor(y.rows/2),y.scrollLines(g)}return!0}_applyStyles(_,x,C){_.classList.contains("xterm-find-result-decoration")||(_.classList.add("xterm-find-result-decoration"),x&&(_.style.outline=`1px solid ${x}`)),C&&_.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(_,x){const C=this._terminal,y=C.registerMarker(-C.buffer.active.baseY-C.buffer.active.cursorY+_.row);if(!y)return;const g=C.registerDecoration({marker:y,x:_.col,width:_.size,backgroundColor:x.matchBackground,overviewRulerOptions:this._highlightedLines.has(y.line)?void 0:{color:x.matchOverviewRuler,position:"center"}});if(g){const b=[];b.push(y),b.push(g.onRender((S=>this._applyStyles(S,x.matchBorder,!1)))),b.push(g.onDispose((()=>(0,u.disposeArray)(b))))}return g}}p.SearchAddon=v})(),h})()))})(bm)),bm.exports}var oB=sB(),uh={exports:{}},aB=uh.exports,yw;function lB(){return yw||(yw=1,(function(e,i){(function(r,s){e.exports=s()})(aB,(()=>(()=>{var r={433:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV11=void 0;const d=u(938),v=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],c=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],_=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],x=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let C;function y(g,b){let S,w=0,T=b.length-1;if(g<b[0][0]||g>b[T][1])return!1;for(;T>=w;)if(S=w+T>>1,g>b[S][1])w=S+1;else{if(!(g<b[S][0]))return!0;T=S-1}return!1}o.UnicodeV11=class{constructor(){if(this.version="11",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160);for(let g=0;g<v.length;++g)C.fill(0,v[g][0],v[g][1]+1);for(let g=0;g<_.length;++g)C.fill(2,_[g][0],_[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?C[g]:y(g,c)?0:y(g,x)?2:1}charProperties(g,b){let S=this.wcwidth(g),w=S===0&&b!==0;if(w){const T=d.UnicodeService.extractWidth(b);T===0?w=!1:T>S&&(S=T)}return d.UnicodeService.createPropertyValue(0,S,w)}}},345:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const v=[];for(let c=0;c<this._listeners.length;c++)v.push(this._listeners[c]);for(let c=0;c<v.length;c++)v[c].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(u,d){return u((v=>d.fire(v)))},o.runAndSubscribe=function(u,d){return d(void 0),u((v=>d(v)))}},490:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=u(938),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<v.length;++x)_.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,y){let g,b=0,S=y.length-1;if(C<y[0][0]||C>y[S][1])return!1;for(;S>=b;)if(g=b+S>>1,C>y[g][1])b=g+1;else{if(!(C<y[g][0]))return!0;S=g-1}return!1})(x,c)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let y=this.wcwidth(x),g=y===0&&C!==0;if(g){const b=d.UnicodeService.extractWidth(C);b===0?g=!1:b>y&&(y=b)}return d.UnicodeService.createPropertyValue(0,y,g)}}},938:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=u(345),v=u(490);class c{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,y=!1){return(16777215&x)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,y=0;const g=x.length;for(let b=0;b<g;++b){let S=x.charCodeAt(b);if(55296<=S&&S<=56319){if(++b>=g)return C+this.wcwidth(S);const D=x.charCodeAt(b);56320<=D&&D<=57343?S=1024*(S-55296)+D-56320+65536:C+=this.wcwidth(D)}const w=this.charProperties(S,y);let T=c.extractWidth(w);c.extractShouldJoin(w)&&(T-=c.extractWidth(y)),C+=T,y=w}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}o.UnicodeService=c}},s={};function l(p){var o=s[p];if(o!==void 0)return o.exports;var u=s[p]={exports:{}};return r[p](u,u.exports,l),u.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.Unicode11Addon=void 0;const o=l(433);p.Unicode11Addon=class{activate(u){u.unicode.register(new o.UnicodeV11)}dispose(){}}})(),h})()))})(uh)),uh.exports}var cB=lB(),wm={exports:{}},bw;function uB(){return bw||(bw=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(p,o)=>{function u(v){try{const c=new URL(v),_=c.password&&c.username?`${c.protocol}//${c.username}:${c.password}@${c.host}`:c.username?`${c.protocol}//${c.username}@${c.host}`:`${c.protocol}//${c.host}`;return v.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(v,c,_,x={}){this._terminal=v,this._regex=c,this._handler=_,this._options=x}provideLinks(v,c){const _=d.computeLink(v,this._regex,this._terminal,this._handler);c(this._addCallbacks(_))}_addCallbacks(v){return v.map((c=>(c.leave=this._options.leave,c.hover=(_,x)=>{if(this._options.hover){const{range:C}=c;this._options.hover(_,x,C)}},c)))}};class d{static computeLink(c,_,x,C){const y=new RegExp(_.source,(_.flags||"")+"g"),[g,b]=d._getWindowedLineStrings(c-1,x),S=g.join("");let w;const T=[];for(;w=y.exec(S);){const D=w[0];if(!u(D))continue;const[R,L]=d._mapStrIdx(x,b,0,w.index),[A,M]=d._mapStrIdx(x,R,L,D.length);if(R===-1||L===-1||A===-1||M===-1)continue;const j={start:{x:L+1,y:R+1},end:{x:M,y:A+1}};T.push({range:j,text:D,activate:C})}return T}static _getWindowedLineStrings(c,_){let x,C=c,y=c,g=0,b="";const S=[];if(x=_.buffer.active.getLine(c)){const w=x.translateToString(!0);if(x.isWrapped&&w[0]!==" "){for(g=0;(x=_.buffer.active.getLine(--C))&&g<2048&&(b=x.translateToString(!0),g+=b.length,S.push(b),x.isWrapped&&b.indexOf(" ")===-1););S.reverse()}for(S.push(w),g=0;(x=_.buffer.active.getLine(++y))&&x.isWrapped&&g<2048&&(b=x.translateToString(!0),g+=b.length,S.push(b),b.indexOf(" ")===-1););}return[S,C]}static _mapStrIdx(c,_,x,C){const y=c.buffer.active,g=y.getNullCell();let b=x;for(;C;){const S=y.getLine(_);if(!S)return[-1,-1];for(let w=b;w<S.length;++w){S.getCell(w,g);const T=g.getChars();if(g.getWidth()&&(C-=T.length||1,w===S.length-1&&T==="")){const D=y.getLine(_+1);D&&D.isWrapped&&(D.getCell(0,g),g.getWidth()===2&&(C+=1))}if(C<0)return[_,w]}_++,b=0}return[_,b]}}o.LinkComputer=d}},s={};function l(p){var o=s[p];if(o!==void 0)return o.exports;var u=s[p]={exports:{}};return r[p](u,u.exports,l),u.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const o=l(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(v,c){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(v=d,c={}){this._handler=v,this._options=c}activate(v){this._terminal=v;const c=this._options,_=c.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,_,this._handler,c))}dispose(){var v;(v=this._linkProvider)==null||v.dispose()}}})(),h})()))})(wm)),wm.exports}var hB=uB(),Sm={exports:{}},ww;function dB(){return ww||(ww=1,(function(e,i){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={965:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GlyphRenderer=void 0;const d=u(374),v=u(509),c=u(855),_=u(859),x=u(381),C=11,y=C*Float32Array.BYTES_PER_ELEMENT;let g,b=0,S=0,w=0;class T extends _.Disposable{constructor(R,L,A,M){super(),this._terminal=R,this._gl=L,this._dimensions=A,this._optionsService=M,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const j=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(j.getParameter(j.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,x.createProgram)(j,`#version 300 es
574
+ layout (location = 0) in vec2 a_unitquad;
575
+ layout (location = 1) in vec2 a_cellpos;
576
+ layout (location = 2) in vec2 a_offset;
577
+ layout (location = 3) in vec2 a_size;
578
+ layout (location = 4) in float a_texpage;
579
+ layout (location = 5) in vec2 a_texcoord;
580
+ layout (location = 6) in vec2 a_texsize;
581
+
582
+ uniform mat4 u_projection;
583
+ uniform vec2 u_resolution;
584
+
585
+ out vec2 v_texcoord;
586
+ flat out int v_texpage;
587
+
588
+ void main() {
589
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
590
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
591
+ v_texpage = int(a_texpage);
592
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
593
+ }`,(function(G){let Q="";for(let X=1;X<G;X++)Q+=` else if (v_texpage == ${X}) { outColor = texture(u_texture[${X}], v_texcoord); }`;return`#version 300 es
594
+ precision lowp float;
595
+
596
+ in vec2 v_texcoord;
597
+ flat in int v_texpage;
598
+
599
+ uniform sampler2D u_texture[${G}];
600
+
601
+ out vec4 outColor;
602
+
603
+ void main() {
604
+ if (v_texpage == 0) {
605
+ outColor = texture(u_texture[0], v_texcoord);
606
+ } ${Q}
607
+ }`})(v.TextureAtlas.maxAtlasPages))),this.register((0,_.toDisposable)((()=>j.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(j.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,d.throwIfFalsy)(j.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,d.throwIfFalsy)(j.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=j.createVertexArray(),j.bindVertexArray(this._vertexArrayObject);const z=new Float32Array([0,0,1,0,0,1,1,1]),P=j.createBuffer();this.register((0,_.toDisposable)((()=>j.deleteBuffer(P)))),j.bindBuffer(j.ARRAY_BUFFER,P),j.bufferData(j.ARRAY_BUFFER,z,j.STATIC_DRAW),j.enableVertexAttribArray(0),j.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const H=new Uint8Array([0,1,2,3]),F=j.createBuffer();this.register((0,_.toDisposable)((()=>j.deleteBuffer(F)))),j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,F),j.bufferData(j.ELEMENT_ARRAY_BUFFER,H,j.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(j.createBuffer()),this.register((0,_.toDisposable)((()=>j.deleteBuffer(this._attributesBuffer)))),j.bindBuffer(j.ARRAY_BUFFER,this._attributesBuffer),j.enableVertexAttribArray(2),j.vertexAttribPointer(2,2,j.FLOAT,!1,y,0),j.vertexAttribDivisor(2,1),j.enableVertexAttribArray(3),j.vertexAttribPointer(3,2,j.FLOAT,!1,y,2*Float32Array.BYTES_PER_ELEMENT),j.vertexAttribDivisor(3,1),j.enableVertexAttribArray(4),j.vertexAttribPointer(4,1,j.FLOAT,!1,y,4*Float32Array.BYTES_PER_ELEMENT),j.vertexAttribDivisor(4,1),j.enableVertexAttribArray(5),j.vertexAttribPointer(5,2,j.FLOAT,!1,y,5*Float32Array.BYTES_PER_ELEMENT),j.vertexAttribDivisor(5,1),j.enableVertexAttribArray(6),j.vertexAttribPointer(6,2,j.FLOAT,!1,y,7*Float32Array.BYTES_PER_ELEMENT),j.vertexAttribDivisor(6,1),j.enableVertexAttribArray(1),j.vertexAttribPointer(1,2,j.FLOAT,!1,y,9*Float32Array.BYTES_PER_ELEMENT),j.vertexAttribDivisor(1,1),j.useProgram(this._program);const W=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let G=0;G<v.TextureAtlas.maxAtlasPages;G++)W[G]=G;j.uniform1iv(this._textureLocation,W),j.uniformMatrix4fv(this._projectionLocation,!1,x.PROJECTION_MATRIX),this._atlasTextures=[];for(let G=0;G<v.TextureAtlas.maxAtlasPages;G++){const Q=new x.GLTexture((0,d.throwIfFalsy)(j.createTexture()));this.register((0,_.toDisposable)((()=>j.deleteTexture(Q.texture)))),j.activeTexture(j.TEXTURE0+G),j.bindTexture(j.TEXTURE_2D,Q.texture),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texImage2D(j.TEXTURE_2D,0,j.RGBA,1,1,0,j.RGBA,j.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[G]=Q}j.enable(j.BLEND),j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(R,L,A,M,j,z,P,H,F){this._updateCell(this._vertices.attributes,R,L,A,M,j,z,P,H,F)}_updateCell(R,L,A,M,j,z,P,H,F,W){b=(A*this._terminal.cols+L)*C,M!==c.NULL_CELL_CODE&&M!==void 0?this._atlas&&(g=H&&H.length>1?this._atlas.getRasterizedGlyphCombinedChar(H,j,z,P,!1):this._atlas.getRasterizedGlyph(M,j,z,P,!1),S=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),j!==W&&g.offset.x>S?(w=g.offset.x-S,R[b]=-(g.offset.x-w)+this._dimensions.device.char.left,R[b+1]=-g.offset.y+this._dimensions.device.char.top,R[b+2]=(g.size.x-w)/this._dimensions.device.canvas.width,R[b+3]=g.size.y/this._dimensions.device.canvas.height,R[b+4]=g.texturePage,R[b+5]=g.texturePositionClipSpace.x+w/this._atlas.pages[g.texturePage].canvas.width,R[b+6]=g.texturePositionClipSpace.y,R[b+7]=g.sizeClipSpace.x-w/this._atlas.pages[g.texturePage].canvas.width,R[b+8]=g.sizeClipSpace.y):(R[b]=-g.offset.x+this._dimensions.device.char.left,R[b+1]=-g.offset.y+this._dimensions.device.char.top,R[b+2]=g.size.x/this._dimensions.device.canvas.width,R[b+3]=g.size.y/this._dimensions.device.canvas.height,R[b+4]=g.texturePage,R[b+5]=g.texturePositionClipSpace.x,R[b+6]=g.texturePositionClipSpace.y,R[b+7]=g.sizeClipSpace.x,R[b+8]=g.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,d.allowRescaling)(M,F,g.size.x,this._dimensions.device.cell.width)&&(R[b+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):R.fill(0,b,b+C-1-2)}clear(){const R=this._terminal,L=R.cols*R.rows*C;this._vertices.count!==L?this._vertices.attributes=new Float32Array(L):this._vertices.attributes.fill(0);let A=0;for(;A<this._vertices.attributesBuffers.length;A++)this._vertices.count!==L?this._vertices.attributesBuffers[A]=new Float32Array(L):this._vertices.attributesBuffers[A].fill(0);this._vertices.count=L,A=0;for(let M=0;M<R.rows;M++)for(let j=0;j<R.cols;j++)this._vertices.attributes[A+9]=j/R.cols,this._vertices.attributes[A+10]=M/R.rows,A+=C}handleResize(){const R=this._gl;R.useProgram(this._program),R.viewport(0,0,R.canvas.width,R.canvas.height),R.uniform2f(this._resolutionLocation,R.canvas.width,R.canvas.height),this.clear()}render(R){if(!this._atlas)return;const L=this._gl;L.useProgram(this._program),L.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const A=this._vertices.attributesBuffers[this._activeBuffer];let M=0;for(let j=0;j<R.lineLengths.length;j++){const z=j*this._terminal.cols*C,P=this._vertices.attributes.subarray(z,z+R.lineLengths[j]*C);A.set(P,M),M+=P.length}L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.bufferData(L.ARRAY_BUFFER,A.subarray(0,M),L.STREAM_DRAW);for(let j=0;j<this._atlas.pages.length;j++)this._atlas.pages[j].version!==this._atlasTextures[j].version&&this._bindAtlasPageTexture(L,this._atlas,j);L.drawElementsInstanced(L.TRIANGLE_STRIP,4,L.UNSIGNED_BYTE,0,M/C)}setAtlas(R){this._atlas=R;for(const L of this._atlasTextures)L.version=-1}_bindAtlasPageTexture(R,L,A){R.activeTexture(R.TEXTURE0+A),R.bindTexture(R.TEXTURE_2D,this._atlasTextures[A].texture),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,R.RGBA,R.UNSIGNED_BYTE,L.pages[A].canvas),R.generateMipmap(R.TEXTURE_2D),this._atlasTextures[A].version=L.pages[A].version}setDimensions(R){this._dimensions=R}}o.GlyphRenderer=T},742:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RectangleRenderer=void 0;const d=u(374),v=u(859),c=u(310),_=u(381),x=8*Float32Array.BYTES_PER_ELEMENT;class C{constructor(){this.attributes=new Float32Array(160),this.count=0}}let y=0,g=0,b=0,S=0,w=0,T=0,D=0;class R extends v.Disposable{constructor(A,M,j,z){super(),this._terminal=A,this._gl=M,this._dimensions=j,this._themeService=z,this._vertices=new C,this._verticesCursor=new C;const P=this._gl;this._program=(0,d.throwIfFalsy)((0,_.createProgram)(P,`#version 300 es
608
+ layout (location = 0) in vec2 a_position;
609
+ layout (location = 1) in vec2 a_size;
610
+ layout (location = 2) in vec4 a_color;
611
+ layout (location = 3) in vec2 a_unitquad;
612
+
613
+ uniform mat4 u_projection;
614
+
615
+ out vec4 v_color;
616
+
617
+ void main() {
618
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
619
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
620
+ v_color = a_color;
621
+ }`,`#version 300 es
622
+ precision lowp float;
623
+
624
+ in vec4 v_color;
625
+
626
+ out vec4 outColor;
627
+
628
+ void main() {
629
+ outColor = v_color;
630
+ }`)),this.register((0,v.toDisposable)((()=>P.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(P.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=P.createVertexArray(),P.bindVertexArray(this._vertexArrayObject);const H=new Float32Array([0,0,1,0,0,1,1,1]),F=P.createBuffer();this.register((0,v.toDisposable)((()=>P.deleteBuffer(F)))),P.bindBuffer(P.ARRAY_BUFFER,F),P.bufferData(P.ARRAY_BUFFER,H,P.STATIC_DRAW),P.enableVertexAttribArray(3),P.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const W=new Uint8Array([0,1,2,3]),G=P.createBuffer();this.register((0,v.toDisposable)((()=>P.deleteBuffer(G)))),P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,G),P.bufferData(P.ELEMENT_ARRAY_BUFFER,W,P.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(P.createBuffer()),this.register((0,v.toDisposable)((()=>P.deleteBuffer(this._attributesBuffer)))),P.bindBuffer(P.ARRAY_BUFFER,this._attributesBuffer),P.enableVertexAttribArray(0),P.vertexAttribPointer(0,2,P.FLOAT,!1,x,0),P.vertexAttribDivisor(0,1),P.enableVertexAttribArray(1),P.vertexAttribPointer(1,2,P.FLOAT,!1,x,2*Float32Array.BYTES_PER_ELEMENT),P.vertexAttribDivisor(1,1),P.enableVertexAttribArray(2),P.vertexAttribPointer(2,4,P.FLOAT,!1,x,4*Float32Array.BYTES_PER_ELEMENT),P.vertexAttribDivisor(2,1),this._updateCachedColors(z.colors),this.register(this._themeService.onChangeColors((Q=>{this._updateCachedColors(Q),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(A){const M=this._gl;M.useProgram(this._program),M.bindVertexArray(this._vertexArrayObject),M.uniformMatrix4fv(this._projectionLocation,!1,_.PROJECTION_MATRIX),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.bufferData(M.ARRAY_BUFFER,A.attributes,M.DYNAMIC_DRAW),M.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,M.UNSIGNED_BYTE,0,A.count)}handleResize(){this._updateViewportRectangle()}setDimensions(A){this._dimensions=A}_updateCachedColors(A){this._bgFloat=this._colorToFloat32Array(A.background),this._cursorFloat=this._colorToFloat32Array(A.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(A){const M=this._terminal,j=this._vertices;let z,P,H,F,W,G,Q,X,I,O,Y,Z=1;for(z=0;z<M.rows;z++){for(H=-1,F=0,W=0,G=!1,P=0;P<M.cols;P++)Q=(z*M.cols+P)*c.RENDER_MODEL_INDICIES_PER_CELL,X=A.cells[Q+c.RENDER_MODEL_BG_OFFSET],I=A.cells[Q+c.RENDER_MODEL_FG_OFFSET],O=!!(67108864&I),(X!==F||I!==W&&(G||O))&&((F!==0||G&&W!==0)&&(Y=8*Z++,this._updateRectangle(j,Y,W,F,H,P,z)),H=P,F=X,W=I,G=O);(F!==0||G&&W!==0)&&(Y=8*Z++,this._updateRectangle(j,Y,W,F,H,M.cols,z))}j.count=Z}updateCursor(A){const M=this._verticesCursor,j=A.cursor;if(!j||j.style==="block")return void(M.count=0);let z,P=0;j.style!=="bar"&&j.style!=="outline"||(z=8*P++,this._addRectangleFloat(M.attributes,z,j.x*this._dimensions.device.cell.width,j.y*this._dimensions.device.cell.height,j.style==="bar"?j.dpr*j.cursorWidth:j.dpr,this._dimensions.device.cell.height,this._cursorFloat)),j.style!=="underline"&&j.style!=="outline"||(z=8*P++,this._addRectangleFloat(M.attributes,z,j.x*this._dimensions.device.cell.width,(j.y+1)*this._dimensions.device.cell.height-j.dpr,j.width*this._dimensions.device.cell.width,j.dpr,this._cursorFloat)),j.style==="outline"&&(z=8*P++,this._addRectangleFloat(M.attributes,z,j.x*this._dimensions.device.cell.width,j.y*this._dimensions.device.cell.height,j.width*this._dimensions.device.cell.width,j.dpr,this._cursorFloat),z=8*P++,this._addRectangleFloat(M.attributes,z,(j.x+j.width)*this._dimensions.device.cell.width-j.dpr,j.y*this._dimensions.device.cell.height,j.dpr,this._dimensions.device.cell.height,this._cursorFloat)),M.count=P}_updateRectangle(A,M,j,z,P,H,F){if(67108864&j)switch(50331648&j){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&j].rgba;break;case 50331648:y=(16777215&j)<<8;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&z){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&z].rgba;break;case 50331648:y=(16777215&z)<<8;break;default:y=this._themeService.colors.background.rgba}A.attributes.length<M+4&&(A.attributes=(0,_.expandFloat32Array)(A.attributes,this._terminal.rows*this._terminal.cols*8)),g=P*this._dimensions.device.cell.width,b=F*this._dimensions.device.cell.height,S=(y>>24&255)/255,w=(y>>16&255)/255,T=(y>>8&255)/255,D=1,this._addRectangle(A.attributes,M,g,b,(H-P)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,S,w,T,D)}_addRectangle(A,M,j,z,P,H,F,W,G,Q){A[M]=j/this._dimensions.device.canvas.width,A[M+1]=z/this._dimensions.device.canvas.height,A[M+2]=P/this._dimensions.device.canvas.width,A[M+3]=H/this._dimensions.device.canvas.height,A[M+4]=F,A[M+5]=W,A[M+6]=G,A[M+7]=Q}_addRectangleFloat(A,M,j,z,P,H,F){A[M]=j/this._dimensions.device.canvas.width,A[M+1]=z/this._dimensions.device.canvas.height,A[M+2]=P/this._dimensions.device.canvas.width,A[M+3]=H/this._dimensions.device.canvas.height,A[M+4]=F[0],A[M+5]=F[1],A[M+6]=F[2],A[M+7]=F[3]}_colorToFloat32Array(A){return new Float32Array([(A.rgba>>24&255)/255,(A.rgba>>16&255)/255,(A.rgba>>8&255)/255,(255&A.rgba)/255])}}o.RectangleRenderer=R},310:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderModel=o.COMBINED_CHAR_BIT_MASK=o.RENDER_MODEL_EXT_OFFSET=o.RENDER_MODEL_FG_OFFSET=o.RENDER_MODEL_BG_OFFSET=o.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=u(296);o.RENDER_MODEL_INDICIES_PER_CELL=4,o.RENDER_MODEL_BG_OFFSET=1,o.RENDER_MODEL_FG_OFFSET=2,o.RENDER_MODEL_EXT_OFFSET=3,o.COMBINED_CHAR_BIT_MASK=2147483648,o.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(v,c){const _=v*c*o.RENDER_MODEL_INDICIES_PER_CELL;_!==this.cells.length&&(this.cells=new Uint32Array(_),this.lineLengths=new Uint32Array(c))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.JoinedCellData=o.WebglRenderer=void 0;const d=u(820),v=u(274),c=u(627),_=u(457),x=u(56),C=u(374),y=u(345),g=u(859),b=u(147),S=u(782),w=u(855),T=u(965),D=u(742),R=u(310),L=u(733);class A extends g.Disposable{constructor(P,H,F,W,G,Q,X,I,O){super(),this._terminal=P,this._characterJoinerService=H,this._charSizeService=F,this._coreBrowserService=W,this._coreService=G,this._decorationService=Q,this._optionsService=X,this._themeService=I,this._cursorBlinkStateManager=new g.MutableDisposable,this._charAtlasDisposable=this.register(new g.MutableDisposable),this._observerDisposable=this.register(new g.MutableDisposable),this._model=new R.RenderModel,this._workCell=new S.CellData,this._workCell2=new S.CellData,this._rectangleRenderer=this.register(new g.MutableDisposable),this._glyphRenderer=this.register(new g.MutableDisposable),this._onChangeTextureAtlas=this.register(new y.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new y.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new y.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new y.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new v.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new L.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,X,this._themeService)],this.dimensions=(0,C.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(X.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const Y={antialias:!1,depth:!1,preserveDrawingBuffer:O};if(this._gl=this._canvas.getContext("webgl2",Y),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(Z=>{console.log("webglcontextlost event received"),Z.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Z)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(Z=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,c.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((Z,U)=>this._setCanvasDevicePixelDimensions(Z,U))),this.register(this._coreBrowserService.onWindowChange((Z=>{this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,Z,((U,V)=>this._setCanvasDevicePixelDimensions(U,V)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,g.toDisposable)((()=>{var Z;for(const U of this._renderLayers)U.dispose();(Z=this._canvas.parentElement)==null||Z.removeChild(this._canvas),(0,c.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var P;return(P=this._charAtlas)==null?void 0:P.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(P,H){var F,W,G,Q;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const X of this._renderLayers)X.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(F=this._rectangleRenderer.value)==null||F.setDimensions(this.dimensions),(W=this._rectangleRenderer.value)==null||W.handleResize(),(G=this._glyphRenderer.value)==null||G.setDimensions(this.dimensions),(Q=this._glyphRenderer.value)==null||Q.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var P;for(const H of this._renderLayers)H.handleBlur(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.pause(),this._requestRedrawViewport()}handleFocus(){var P;for(const H of this._renderLayers)H.handleFocus(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.resume(),this._requestRedrawViewport()}handleSelectionChanged(P,H,F){for(const W of this._renderLayers)W.handleSelectionChanged(this._terminal,P,H,F);this._model.selection.update(this._core,P,H,F),this._requestRedrawViewport()}handleCursorMove(){var P;for(const H of this._renderLayers)H.handleCursorMove(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new D.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new T.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var H;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const P=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==P&&(this._onChangeTextureAtlas.fire(P.pages[0].canvas),this._charAtlasDisposable.value=(0,g.getDisposeArrayDisposable)([(0,y.forwardEvent)(P.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,y.forwardEvent)(P.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=P,this._charAtlas.warmUp(),(H=this._glyphRenderer.value)==null||H.setAtlas(this._charAtlas)}_clearModel(P){var H;this._model.clear(),P&&((H=this._glyphRenderer.value)==null||H.clear())}clearTextureAtlas(){var P;(P=this._charAtlas)==null||P.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var P;this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);(P=this._cursorBlinkStateManager.value)==null||P.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(P){return-1}deregisterCharacterJoiner(P){return!1}renderRows(P,H){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const F of this._renderLayers)F.handleGridChanged(this._terminal,P,H);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(P,H),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new _.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(P,H){const F=this._core;let W,G,Q,X,I,O,Y,Z,U,V,ne,le,K,$,oe=this._workCell;P=j(P,F.rows-1,0),H=j(H,F.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ue=ee-F.buffer.ydisp,he=Math.min(this._terminal.buffer.active.cursorX,F.cols-1);let Se=-1;const we=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Re=!1;for(G=P;G<=H;G++)for(Q=G+F.buffer.ydisp,X=F.buffer.lines.get(Q),this._model.lineLengths[G]=0,I=this._characterJoinerService.getJoinedCharacters(Q),K=0;K<F.cols;K++)if(W=this._cellColorResolver.result.bg,X.loadCell(K,oe),K===0&&(W=this._cellColorResolver.result.bg),O=!1,Y=K,I.length>0&&K===I[0][0]&&(O=!0,Z=I.shift(),oe=new M(oe,X.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),Y=Z[1]-1),U=oe.getChars(),V=oe.getCode(),le=(G*F.cols+K)*R.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(oe,K,Q,this.dimensions.device.cell.width),we&&Q===ee&&(K===he&&(this._model.cursor={x:he,y:ue,width:oe.getWidth(),style:this._coreBrowserService.isFocused?F.options.cursorStyle||"block":F.options.cursorInactiveStyle,cursorWidth:F.options.cursorWidth,dpr:this._devicePixelRatio},Se=he+oe.getWidth()-1),K>=he&&K<=Se&&(this._coreBrowserService.isFocused&&(F.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&F.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),V!==w.NULL_CELL_CODE&&(this._model.lineLengths[G]=K+1),(this._model.cells[le]!==V||this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Re=!0,U.length>1&&(V|=R.COMBINED_CHAR_BIT_MASK),this._model.cells[le]=V,this._model.cells[le+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[le+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[le+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ne=oe.getWidth(),this._glyphRenderer.value.updateCell(K,G,V,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,U,ne,W),O))for(oe=this._workCell,K++;K<Y;K++)$=(G*F.cols+K)*R.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(K,G,w.NULL_CELL_CODE,0,0,0,w.NULL_CELL_CHAR,0,0),this._model.cells[$]=w.NULL_CELL_CODE,this._model.cells[$+R.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[$+R.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[$+R.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Re&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(P,H){this._canvas.width===P&&this._canvas.height===H||(this._canvas.width=P,this._canvas.height=H,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const P=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:P,end:P})}}o.WebglRenderer=A;class M extends b.AttributeData{constructor(P,H,F){super(),this.content=0,this.combinedData="",this.fg=P.fg,this.bg=P.bg,this.combinedData=H,this._width=F}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(P){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function j(z,P,H=0){return Math.max(Math.min(z,P),H)}o.JoinedCellData=M},381:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GLTexture=o.expandFloat32Array=o.createShader=o.createProgram=o.PROJECTION_MATRIX=void 0;const d=u(374);function v(c,_,x){const C=(0,d.throwIfFalsy)(c.createShader(_));if(c.shaderSource(C,x),c.compileShader(C),c.getShaderParameter(C,c.COMPILE_STATUS))return C;console.error(c.getShaderInfoLog(C)),c.deleteShader(C)}o.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),o.createProgram=function(c,_,x){const C=(0,d.throwIfFalsy)(c.createProgram());if(c.attachShader(C,(0,d.throwIfFalsy)(v(c,c.VERTEX_SHADER,_))),c.attachShader(C,(0,d.throwIfFalsy)(v(c,c.FRAGMENT_SHADER,x))),c.linkProgram(C),c.getProgramParameter(C,c.LINK_STATUS))return C;console.error(c.getProgramInfoLog(C)),c.deleteProgram(C)},o.createShader=v,o.expandFloat32Array=function(c,_){const x=Math.min(2*c.length,_),C=new Float32Array(x);for(let y=0;y<c.length;y++)C[y]=c[y];return C},o.GLTexture=class{constructor(c){this.texture=c,this.version=-1}}},592:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BaseRenderLayer=void 0;const d=u(627),v=u(237),c=u(374),_=u(859);class x extends _.Disposable{constructor(y,g,b,S,w,T,D,R){super(),this._container=g,this._alpha=w,this._coreBrowserService=T,this._optionsService=D,this._themeService=R,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${b}-layer`),this._canvas.style.zIndex=S.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((L=>{this._refreshCharAtlas(y,L),this.reset(y)}))),this.register((0,_.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,c.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(y){}handleFocus(y){}handleCursorMove(y){}handleGridChanged(y,g,b){}handleSelectionChanged(y,g,b,S=!1){}_setTransparency(y,g){if(g===this._alpha)return;const b=this._canvas;this._alpha=g,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,b),this._refreshCharAtlas(y,this._themeService.colors),this.handleGridChanged(y,0,y.rows-1)}_refreshCharAtlas(y,g){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(y,this._optionsService.rawOptions,g,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(y,g){this._deviceCellWidth=g.device.cell.width,this._deviceCellHeight=g.device.cell.height,this._deviceCharWidth=g.device.char.width,this._deviceCharHeight=g.device.char.height,this._deviceCharLeft=g.device.char.left,this._deviceCharTop=g.device.char.top,this._canvas.width=g.device.canvas.width,this._canvas.height=g.device.canvas.height,this._canvas.style.width=`${g.css.canvas.width}px`,this._canvas.style.height=`${g.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(y,this._themeService.colors)}_fillBottomLineAtCells(y,g,b=1){this._ctx.fillRect(y*this._deviceCellWidth,(g+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,b*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(y,g,b,S){this._alpha?this._ctx.clearRect(y*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(y*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,S*this._deviceCellHeight))}_fillCharTrueColor(y,g,b,S){this._ctx.font=this._getFont(y,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(b,S,g.getWidth()),this._ctx.fillText(g.getChars(),b*this._deviceCellWidth+this._deviceCharLeft,S*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(y,g,b){this._ctx.beginPath(),this._ctx.rect(y*this._deviceCellWidth,g*this._deviceCellHeight,b*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(y,g,b){return`${b?"italic":""} ${g?y.options.fontWeightBold:y.options.fontWeight} ${y.options.fontSize*this._coreBrowserService.dpr}px ${y.options.fontFamily}`}}o.BaseRenderLayer=x},733:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkRenderLayer=void 0;const d=u(197),v=u(237),c=u(592);class _ extends c.BaseRenderLayer{constructor(C,y,g,b,S,w,T){super(g,C,"link",y,!0,S,w,T),this.register(b.onShowLinkUnderline((D=>this._handleShowLinkUnderline(D)))),this.register(b.onHideLinkUnderline((D=>this._handleHideLinkUnderline(D))))}resize(C,y){super.resize(C,y),this._state=void 0}reset(C){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const C=this._state.y2-this._state.y1-1;C>0&&this._clearCells(0,this._state.y1+1,this._state.cols,C),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(C){if(C.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:C.fg!==void 0&&(0,d.is256Color)(C.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[C.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,C.y1===C.y2)this._fillBottomLineAtCells(C.x1,C.y1,C.x2-C.x1);else{this._fillBottomLineAtCells(C.x1,C.y1,C.cols-C.x1);for(let y=C.y1+1;y<C.y2;y++)this._fillBottomLineAtCells(0,y,C.cols);this._fillBottomLineAtCells(0,C.y2,C.x2)}this._state=C}_handleHideLinkUnderline(C){this._clearCurrentLink()}}o.LinkRenderLayer=_},820:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(u,d,v,c){u.addEventListener(d,v,c);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(d,v,c))}}}},274:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellColorResolver=void 0;const d=u(855),v=u(160),c=u(374);let _,x=0,C=0,y=!1,g=!1,b=!1,S=0;o.CellColorResolver=class{constructor(w,T,D,R,L,A){this._terminal=w,this._optionService=T,this._selectionRenderModel=D,this._decorationService=R,this._coreBrowserService=L,this._themeService=A,this.result={fg:0,bg:0,ext:0}}resolve(w,T,D,R){if(this.result.bg=w.bg,this.result.fg=w.fg,this.result.ext=268435456&w.bg?w.extended.ext:0,C=0,x=0,g=!1,y=!1,b=!1,_=this._themeService.colors,S=0,w.getCode()!==d.NULL_CELL_CODE&&w.extended.underlineStyle===4){const L=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));S=T*R%(2*Math.round(L))}if(this._decorationService.forEachDecorationAtCell(T,D,"bottom",(L=>{L.backgroundColorRGB&&(C=L.backgroundColorRGB.rgba>>8&16777215,g=!0),L.foregroundColorRGB&&(x=L.foregroundColorRGB.rgba>>8&16777215,y=!0)})),b=this._selectionRenderModel.isCellSelected(this._terminal,T,D),b){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}C=v.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else C=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(g=!0,_.selectionForeground&&(x=_.selectionForeground.rgba>>8&16777215,y=!0),(0,c.treatGlyphAsBackgroundColor)(w.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)x=(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}x=v.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}y=!0}}this._decorationService.forEachDecorationAtCell(T,D,"top",(L=>{L.backgroundColorRGB&&(C=L.backgroundColorRGB.rgba>>8&16777215,g=!0),L.foregroundColorRGB&&(x=L.foregroundColorRGB.rgba>>8&16777215,y=!0)})),g&&(C=b?-16777216&w.bg&-134217729|C|50331648:-16777216&w.bg|C|50331648),y&&(x=-16777216&w.fg&-67108865|x|50331648),67108864&this.result.fg&&(g&&!y&&(x=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&_.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,y=!0),!g&&y&&(C=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&_.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,g=!0)),_=void 0,this.result.bg=g?C:this.result.bg,this.result.fg=y?x:this.result.fg,this.result.ext&=536870911,this.result.ext|=S<<29&3758096384}}},627:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.removeTerminalFromCache=o.acquireTextureAtlas=void 0;const d=u(509),v=u(197),c=[];o.acquireTextureAtlas=function(_,x,C,y,g,b,S,w){const T=(0,v.generateConfig)(y,g,b,S,x,C,w);for(let L=0;L<c.length;L++){const A=c[L],M=A.ownedBy.indexOf(_);if(M>=0){if((0,v.configEquals)(A.config,T))return A.atlas;A.ownedBy.length===1?(A.atlas.dispose(),c.splice(L,1)):A.ownedBy.splice(M,1);break}}for(let L=0;L<c.length;L++){const A=c[L];if((0,v.configEquals)(A.config,T))return A.ownedBy.push(_),A.atlas}const D=_._core,R={atlas:new d.TextureAtlas(document,T,D.unicodeService),config:T,ownedBy:[_]};return c.push(R),R.atlas},o.removeTerminalFromCache=function(_){for(let x=0;x<c.length;x++){const C=c[x].ownedBy.indexOf(_);if(C!==-1){c[x].ownedBy.length===1?(c[x].atlas.dispose(),c.splice(x,1)):c[x].ownedBy.splice(C,1);break}}}},197:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.is256Color=o.configEquals=o.generateConfig=void 0;const d=u(160);o.generateConfig=function(v,c,_,x,C,y,g){const b={foreground:y.foreground,background:y.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:y.ansi.slice(),contrastCache:y.contrastCache,halfContrastCache:y.halfContrastCache};return{customGlyphs:C.customGlyphs,devicePixelRatio:g,letterSpacing:C.letterSpacing,lineHeight:C.lineHeight,deviceCellWidth:v,deviceCellHeight:c,deviceCharWidth:_,deviceCharHeight:x,fontFamily:C.fontFamily,fontSize:C.fontSize,fontWeight:C.fontWeight,fontWeightBold:C.fontWeightBold,allowTransparency:C.allowTransparency,drawBoldTextInBrightColors:C.drawBoldTextInBrightColors,minimumContrastRatio:C.minimumContrastRatio,colors:b}},o.configEquals=function(v,c){for(let _=0;_<v.colors.ansi.length;_++)if(v.colors.ansi[_].rgba!==c.colors.ansi[_].rgba)return!1;return v.devicePixelRatio===c.devicePixelRatio&&v.customGlyphs===c.customGlyphs&&v.lineHeight===c.lineHeight&&v.letterSpacing===c.letterSpacing&&v.fontFamily===c.fontFamily&&v.fontSize===c.fontSize&&v.fontWeight===c.fontWeight&&v.fontWeightBold===c.fontWeightBold&&v.allowTransparency===c.allowTransparency&&v.deviceCharWidth===c.deviceCharWidth&&v.deviceCharHeight===c.deviceCharHeight&&v.drawBoldTextInBrightColors===c.drawBoldTextInBrightColors&&v.minimumContrastRatio===c.minimumContrastRatio&&v.colors.foreground.rgba===c.colors.foreground.rgba&&v.colors.background.rgba===c.colors.background.rgba},o.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorBlinkStateManager=void 0,o.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tryDrawCustomChar=o.powerlineDefinitions=o.boxDrawingDefinitions=o.blockElementDefinitions=void 0;const d=u(374);o.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const v={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};o.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(y,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"║":{1:(y,g)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╒":{1:(y,g)=>`M.5,1 L.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╓":{1:(y,g)=>`M${.5-y},1 L${.5-y},.5 L1,.5 M${.5+y},.5 L${.5+y},1`},"╔":{1:(y,g)=>`M1,${.5-g} L${.5-y},${.5-g} L${.5-y},1 M1,${.5+g} L${.5+y},${.5+g} L${.5+y},1`},"╕":{1:(y,g)=>`M0,${.5-g} L.5,${.5-g} L.5,1 M0,${.5+g} L.5,${.5+g}`},"╖":{1:(y,g)=>`M${.5+y},1 L${.5+y},.5 L0,.5 M${.5-y},.5 L${.5-y},1`},"╗":{1:(y,g)=>`M0,${.5+g} L${.5-y},${.5+g} L${.5-y},1 M0,${.5-g} L${.5+y},${.5-g} L${.5+y},1`},"╘":{1:(y,g)=>`M.5,0 L.5,${.5+g} L1,${.5+g} M.5,${.5-g} L1,${.5-g}`},"╙":{1:(y,g)=>`M1,.5 L${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╚":{1:(y,g)=>`M1,${.5-g} L${.5+y},${.5-g} L${.5+y},0 M1,${.5+g} L${.5-y},${.5+g} L${.5-y},0`},"╛":{1:(y,g)=>`M0,${.5+g} L.5,${.5+g} L.5,0 M0,${.5-g} L.5,${.5-g}`},"╜":{1:(y,g)=>`M0,.5 L${.5+y},.5 L${.5+y},0 M${.5-y},.5 L${.5-y},0`},"╝":{1:(y,g)=>`M0,${.5-g} L${.5-y},${.5-g} L${.5-y},0 M0,${.5+g} L${.5+y},${.5+g} L${.5+y},0`},"╞":{1:(y,g)=>`M.5,0 L.5,1 M.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╟":{1:(y,g)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1 M${.5+y},.5 L1,.5`},"╠":{1:(y,g)=>`M${.5-y},0 L${.5-y},1 M1,${.5+g} L${.5+y},${.5+g} L${.5+y},1 M1,${.5-g} L${.5+y},${.5-g} L${.5+y},0`},"╡":{1:(y,g)=>`M.5,0 L.5,1 M0,${.5-g} L.5,${.5-g} M0,${.5+g} L.5,${.5+g}`},"╢":{1:(y,g)=>`M0,.5 L${.5-y},.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╣":{1:(y,g)=>`M${.5+y},0 L${.5+y},1 M0,${.5+g} L${.5-y},${.5+g} L${.5-y},1 M0,${.5-g} L${.5-y},${.5-g} L${.5-y},0`},"╤":{1:(y,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g} M.5,${.5+g} L.5,1`},"╥":{1:(y,g)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},1 M${.5+y},.5 L${.5+y},1`},"╦":{1:(y,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L${.5-y},${.5+g} L${.5-y},1 M1,${.5+g} L${.5+y},${.5+g} L${.5+y},1`},"╧":{1:(y,g)=>`M.5,0 L.5,${.5-g} M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╨":{1:(y,g)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╩":{1:(y,g)=>`M0,${.5+g} L1,${.5+g} M0,${.5-g} L${.5-y},${.5-g} L${.5-y},0 M1,${.5-g} L${.5+y},${.5-g} L${.5+y},0`},"╪":{1:(y,g)=>`M.5,0 L.5,1 M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╫":{1:(y,g)=>`M0,.5 L1,.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╬":{1:(y,g)=>`M0,${.5+g} L${.5-y},${.5+g} L${.5-y},1 M1,${.5+g} L${.5+y},${.5+g} L${.5+y},1 M0,${.5-g} L${.5-y},${.5-g} L${.5-y},0 M1,${.5-g} L${.5+y},${.5-g} L${.5+y},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(y,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,1,.5`},"╮":{1:(y,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,0,.5`},"╯":{1:(y,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,0,.5`},"╰":{1:(y,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,1,.5`}},o.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.tryDrawCustomChar=function(y,g,b,S,w,T,D,R){const L=o.blockElementDefinitions[g];if(L)return(function(z,P,H,F,W,G){for(let Q=0;Q<P.length;Q++){const X=P[Q],I=W/8,O=G/8;z.fillRect(H+X.x*I,F+X.y*O,X.w*I,X.h*O)}})(y,L,b,S,w,T),!0;const A=v[g];if(A)return(function(z,P,H,F,W,G){let Q=c.get(P);Q||(Q=new Map,c.set(P,Q));const X=z.fillStyle;if(typeof X!="string")throw new Error(`Unexpected fillStyle type "${X}"`);let I=Q.get(X);if(!I){const O=P[0].length,Y=P.length,Z=z.canvas.ownerDocument.createElement("canvas");Z.width=O,Z.height=Y;const U=(0,d.throwIfFalsy)(Z.getContext("2d")),V=new ImageData(O,Y);let ne,le,K,$;if(X.startsWith("#"))ne=parseInt(X.slice(1,3),16),le=parseInt(X.slice(3,5),16),K=parseInt(X.slice(5,7),16),$=X.length>7&&parseInt(X.slice(7,9),16)||1;else{if(!X.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${X}" when drawing pattern glyph`);[ne,le,K,$]=X.substring(5,X.length-1).split(",").map((oe=>parseFloat(oe)))}for(let oe=0;oe<Y;oe++)for(let ee=0;ee<O;ee++)V.data[4*(oe*O+ee)]=ne,V.data[4*(oe*O+ee)+1]=le,V.data[4*(oe*O+ee)+2]=K,V.data[4*(oe*O+ee)+3]=P[oe][ee]*(255*$);U.putImageData(V,0,0),I=(0,d.throwIfFalsy)(z.createPattern(Z,null)),Q.set(X,I)}z.fillStyle=I,z.fillRect(H,F,W,G)})(y,A,b,S,w,T),!0;const M=o.boxDrawingDefinitions[g];if(M)return(function(z,P,H,F,W,G,Q){z.strokeStyle=z.fillStyle;for(const[X,I]of Object.entries(P)){let O;z.beginPath(),z.lineWidth=Q*Number.parseInt(X),O=typeof I=="function"?I(.15,.15/G*W):I;for(const Y of O.split(" ")){const Z=Y[0],U=x[Z];if(!U){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=Y.substring(1).split(",");V[0]&&V[1]&&U(z,C(V,W,G,H,F,!0,Q))}z.stroke(),z.closePath()}})(y,M,b,S,w,T,R),!0;const j=o.powerlineDefinitions[g];return!!j&&((function(z,P,H,F,W,G,Q,X){const I=new Path2D;I.rect(H,F,W,G),z.clip(I),z.beginPath();const O=Q/12;z.lineWidth=X*O;for(const Y of P.d.split(" ")){const Z=Y[0],U=x[Z];if(!U){console.error(`Could not find drawing instructions for "${Z}"`);continue}const V=Y.substring(1).split(",");V[0]&&V[1]&&U(z,C(V,W,G,H,F,!1,X,(P.leftPadding??0)*(O/2),(P.rightPadding??0)*(O/2)))}P.type===1?(z.strokeStyle=z.fillStyle,z.stroke()):z.fill(),z.closePath()})(y,j,b,S,w,T,D,R),!0)};const c=new Map;function _(y,g,b=0){return Math.max(Math.min(y,g),b)}const x={C:(y,g)=>y.bezierCurveTo(g[0],g[1],g[2],g[3],g[4],g[5]),L:(y,g)=>y.lineTo(g[0],g[1]),M:(y,g)=>y.moveTo(g[0],g[1])};function C(y,g,b,S,w,T,D,R=0,L=0){const A=y.map((M=>parseFloat(M)||parseInt(M)));if(A.length<2)throw new Error("Too few arguments for instruction");for(let M=0;M<A.length;M+=2)A[M]*=g-R*D-L*D,T&&A[M]!==0&&(A[M]=_(Math.round(A[M]+.5)-.5,g,0)),A[M]+=S+R*D;for(let M=1;M<A.length;M+=2)A[M]*=b,T&&A[M]!==0&&(A[M]=_(Math.round(A[M]+.5)-.5,b,0)),A[M]+=w;return A}},56:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.observeDevicePixelDimensions=void 0;const d=u(859);o.observeDevicePixelDimensions=function(v,c,_){let x=new c.ResizeObserver((C=>{const y=C.find((S=>S.target===v));if(!y)return;if(!("devicePixelContentBoxSize"in y))return x==null||x.disconnect(),void(x=void 0);const g=y.devicePixelContentBoxSize[0].inlineSize,b=y.devicePixelContentBoxSize[0].blockSize;g>0&&b>0&&_(g,b)}));try{x.observe(v,{box:["device-pixel-content-box"]})}catch{x.disconnect(),x=void 0}return(0,d.toDisposable)((()=>x==null?void 0:x.disconnect()))}},374:(p,o)=>{function u(v){return 57508<=v&&v<=57558}function d(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},o.isPowerlineGlyph=u,o.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},o.isEmoji=d,o.allowRescaling=function(v,c,_,x){return c===1&&_>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!d(v)&&!u(v)&&!(function(C){return 57344<=C&&C<=63743})(v)},o.treatGlyphAsBackgroundColor=function(v){return u(v)||(function(c){return 9472<=c&&c<=9631})(v)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(v,c,_=0){return(v-(2*Math.round(c)-_))%(2*Math.round(c))}},296:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,c,_,x=!1){if(this.selectionStart=c,this.selectionEnd=_,!c||!_||c[0]===_[0]&&c[1]===_[1])return void this.clear();const C=v.buffers.active.ydisp,y=c[1]-C,g=_[1]-C,b=Math.max(y,0),S=Math.min(g,v.rows-1);b>=v.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=y,this.viewportEndRow=g,this.viewportCappedStartRow=b,this.viewportCappedEndRow=S,this.startCol=c[0],this.endCol=_[0])}isCellSelected(v,c,_){return!!this.hasSelection&&(_-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&_>=this.viewportCappedStartRow&&c<this.endCol&&_<=this.viewportCappedEndRow:c<this.startCol&&_>=this.viewportCappedStartRow&&c>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol)}}o.createSelectionRenderModel=function(){return new u}},509:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextureAtlas=void 0;const d=u(237),v=u(860),c=u(374),_=u(160),x=u(345),C=u(485),y=u(385),g=u(147),b=u(855),S={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let w;class T{get pages(){return this._pages}constructor(M,j,z){this._document=M,this._config=j,this._unicodeService=z,this._didWarmUp=!1,this._cacheMap=new C.FourKeyMap,this._cacheMapCombined=new C.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new g.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new x.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new x.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=L(M,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,c.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const M of this.pages)M.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const M=new y.IdleTaskQueue;for(let j=33;j<126;j++)M.enqueue((()=>{if(!this._cacheMap.get(j,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT)){const z=this._drawToCache(j,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT);this._cacheMap.set(j,b.DEFAULT_COLOR,b.DEFAULT_COLOR,b.DEFAULT_EXT,z)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const M of this._pages)M.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(T.maxAtlasPages&&this._pages.length>=Math.max(4,T.maxAtlasPages)){const j=this._pages.filter((Q=>2*Q.canvas.width<=(T.maxTextureSize||4096))).sort(((Q,X)=>X.canvas.width!==Q.canvas.width?X.canvas.width-Q.canvas.width:X.percentageUsed-Q.percentageUsed));let z=-1,P=0;for(let Q=0;Q<j.length;Q++)if(j[Q].canvas.width!==P)z=Q,P=j[Q].canvas.width;else if(Q-z==3)break;const H=j.slice(z,z+4),F=H.map((Q=>Q.glyphs[0].texturePage)).sort(((Q,X)=>Q>X?1:-1)),W=this.pages.length-H.length,G=this._mergePages(H,W);G.version++;for(let Q=F.length-1;Q>=0;Q--)this._deletePage(F[Q]);this.pages.push(G),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(G.canvas)}const M=new D(this._document,this._textureSize);return this._pages.push(M),this._activePages.push(M),this._onAddTextureAtlasCanvas.fire(M.canvas),M}_mergePages(M,j){const z=2*M[0].canvas.width,P=new D(this._document,z,M);for(const[H,F]of M.entries()){const W=H*F.canvas.width%z,G=Math.floor(H/2)*F.canvas.height;P.ctx.drawImage(F.canvas,W,G);for(const X of F.glyphs)X.texturePage=j,X.sizeClipSpace.x=X.size.x/z,X.sizeClipSpace.y=X.size.y/z,X.texturePosition.x+=W,X.texturePosition.y+=G,X.texturePositionClipSpace.x=X.texturePosition.x/z,X.texturePositionClipSpace.y=X.texturePosition.y/z;this._onRemoveTextureAtlasCanvas.fire(F.canvas);const Q=this._activePages.indexOf(F);Q!==-1&&this._activePages.splice(Q,1)}return P}_deletePage(M){this._pages.splice(M,1);for(let j=M;j<this._pages.length;j++){const z=this._pages[j];for(const P of z.glyphs)P.texturePage--;z.version++}}getRasterizedGlyphCombinedChar(M,j,z,P,H){return this._getFromCacheMap(this._cacheMapCombined,M,j,z,P,H)}getRasterizedGlyph(M,j,z,P,H){return this._getFromCacheMap(this._cacheMap,M,j,z,P,H)}_getFromCacheMap(M,j,z,P,H,F=!1){return w=M.get(j,z,P,H),w||(w=this._drawToCache(j,z,P,H,F),M.set(j,z,P,H,w)),w}_getColorFromAnsiIndex(M){if(M>=this._config.colors.ansi.length)throw new Error("No color found for idx "+M);return this._config.colors.ansi[M]}_getBackgroundColor(M,j,z,P){if(this._config.allowTransparency)return _.NULL_COLOR;let H;switch(M){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(j);break;case 50331648:const F=g.AttributeData.toColorRGB(j);H=_.channels.toColor(F[0],F[1],F[2]);break;default:H=z?_.color.opaque(this._config.colors.foreground):this._config.colors.background}return H}_getForegroundColor(M,j,z,P,H,F,W,G,Q,X){const I=this._getMinimumContrastColor(M,j,z,P,H,F,W,Q,G,X);if(I)return I;let O;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Q&&F<8&&(F+=8),O=this._getColorFromAnsiIndex(F);break;case 50331648:const Y=g.AttributeData.toColorRGB(F);O=_.channels.toColor(Y[0],Y[1],Y[2]);break;default:O=W?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=_.color.opaque(O)),G&&(O=_.color.multiplyOpacity(O,d.DIM_OPACITY)),O}_resolveBackgroundRgba(M,j,z){switch(M){case 16777216:case 33554432:return this._getColorFromAnsiIndex(j).rgba;case 50331648:return j<<8;default:return z?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(M,j,z,P){switch(M){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&P&&j<8&&(j+=8),this._getColorFromAnsiIndex(j).rgba;case 50331648:return j<<8;default:return z?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(M,j,z,P,H,F,W,G,Q,X){if(this._config.minimumContrastRatio===1||X)return;const I=this._getContrastCache(Q),O=I.getColor(M,P);if(O!==void 0)return O||void 0;const Y=this._resolveBackgroundRgba(j,z,W),Z=this._resolveForegroundRgba(H,F,W,G),U=_.rgba.ensureContrastRatio(Y,Z,this._config.minimumContrastRatio/(Q?2:1));if(!U)return void I.setColor(M,P,null);const V=_.channels.toColor(U>>24&255,U>>16&255,U>>8&255);return I.setColor(M,P,V),V}_getContrastCache(M){return M?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(M,j,z,P,H=!1){const F=typeof M=="number"?String.fromCharCode(M):M,W=Math.min(this._config.deviceCellWidth*Math.max(F.length,2)+4,this._textureSize);this._tmpCanvas.width<W&&(this._tmpCanvas.width=W);const G=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<G&&(this._tmpCanvas.height=G),this._tmpCtx.save(),this._workAttributeData.fg=z,this._workAttributeData.bg=j,this._workAttributeData.extended.ext=P,this._workAttributeData.isInvisible())return S;const Q=!!this._workAttributeData.isBold(),X=!!this._workAttributeData.isInverse(),I=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),Y=!!this._workAttributeData.isUnderline(),Z=!!this._workAttributeData.isStrikethrough(),U=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),ne=this._workAttributeData.getFgColorMode(),le=this._workAttributeData.getBgColor(),K=this._workAttributeData.getBgColorMode();if(X){const Te=V;V=le,le=Te;const We=ne;ne=K,K=We}const $=this._getBackgroundColor(K,le,X,I);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const oe=Q?this._config.fontWeightBold:this._config.fontWeight,ee=O?"italic":"";this._tmpCtx.font=`${ee} ${oe} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ue=F.length===1&&(0,c.isPowerlineGlyph)(F.charCodeAt(0)),he=F.length===1&&(0,c.isRestrictedPowerlineGlyph)(F.charCodeAt(0)),Se=this._getForegroundColor(j,K,le,z,ne,V,X,I,Q,(0,c.treatGlyphAsBackgroundColor)(F.charCodeAt(0)));this._tmpCtx.fillStyle=Se.css;const we=he?0:4;let Re=!1;this._config.customGlyphs!==!1&&(Re=(0,v.tryDrawCustomChar)(this._tmpCtx,F,we,we,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Ve,Ee=!ue;if(Ve=typeof M=="number"?this._unicodeService.wcwidth(M):this._unicodeService.getStringCellWidth(M),Y){this._tmpCtx.save();const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),We=Te%2==1?.5:0;if(this._tmpCtx.lineWidth=Te,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Ee=!1,this._tmpCtx.strokeStyle=`rgb(${g.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Ee=!1;let Le=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Le<8&&(Le+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Le).css}this._tmpCtx.beginPath();const gt=we,ot=Math.ceil(we+this._config.deviceCharHeight)-We-(H?2*Te:0),fe=ot+Te,xe=ot+2*Te;let De=this._workAttributeData.getUnderlineVariantOffset();for(let Le=0;Le<Ve;Le++){this._tmpCtx.save();const Fe=gt+Le*this._config.deviceCellWidth,je=gt+(Le+1)*this._config.deviceCellWidth,At=Fe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Fe,ot),this._tmpCtx.lineTo(je,ot),this._tmpCtx.moveTo(Fe,xe),this._tmpCtx.lineTo(je,xe);break;case 3:const Yt=Te<=1?xe:Math.ceil(we+this._config.deviceCharHeight-Te/2)-We,An=Te<=1?ot:Math.ceil(we+this._config.deviceCharHeight+Te/2)-We,ti=new Path2D;ti.rect(Fe,ot,this._config.deviceCellWidth,xe-ot),this._tmpCtx.clip(ti),this._tmpCtx.moveTo(Fe-this._config.deviceCellWidth/2,fe),this._tmpCtx.bezierCurveTo(Fe-this._config.deviceCellWidth/2,An,Fe,An,Fe,fe),this._tmpCtx.bezierCurveTo(Fe,Yt,At,Yt,At,fe),this._tmpCtx.bezierCurveTo(At,An,je,An,je,fe),this._tmpCtx.bezierCurveTo(je,Yt,je+this._config.deviceCellWidth/2,Yt,je+this._config.deviceCellWidth/2,fe);break;case 4:const ni=De===0?0:De>=Te?2*Te-De:Te-De;De>=Te||ni===0?(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe+ni,ot),this._tmpCtx.lineTo(je,ot)):(this._tmpCtx.setLineDash([Math.round(Te),Math.round(Te)]),this._tmpCtx.moveTo(Fe,ot),this._tmpCtx.lineTo(Fe+ni,ot),this._tmpCtx.moveTo(Fe+ni+Te,ot),this._tmpCtx.lineTo(je,ot)),De=(0,c.computeNextVariantOffset)(je-Fe,Te,De);break;case 5:const co=.6,Kt=.3,Xt=je-Fe,ii=Math.floor(co*Xt),Sn=Math.floor(Kt*Xt),uo=Xt-ii-Sn;this._tmpCtx.setLineDash([ii,Sn,uo]),this._tmpCtx.moveTo(Fe,ot),this._tmpCtx.lineTo(je,ot);break;default:this._tmpCtx.moveTo(Fe,ot),this._tmpCtx.lineTo(je,ot)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Re&&this._config.fontSize>=12&&!this._config.allowTransparency&&F!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Le=this._tmpCtx.measureText(F);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Le&&Le.actualBoundingBoxDescent>0){this._tmpCtx.save();const Fe=new Path2D;Fe.rect(gt,ot-Math.ceil(Te/2),this._config.deviceCellWidth*Ve,xe-ot+Math.ceil(Te/2)),this._tmpCtx.clip(Fe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(F,we,we+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(U){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),We=Te%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(we,we+We),this._tmpCtx.lineTo(we+this._config.deviceCharWidth*Ve,we+We),this._tmpCtx.stroke()}if(Re||this._tmpCtx.fillText(F,we,we+this._config.deviceCharHeight),F==="_"&&!this._config.allowTransparency){let Te=R(this._tmpCtx.getImageData(we,we,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Se,Ee);if(Te)for(let We=1;We<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(F,we,we+this._config.deviceCharHeight-We),Te=R(this._tmpCtx.getImageData(we,we,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Se,Ee),Te);We++);}if(Z){const Te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),We=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(we,we+Math.floor(this._config.deviceCharHeight/2)-We),this._tmpCtx.lineTo(we+this._config.deviceCharWidth*Ve,we+Math.floor(this._config.deviceCharHeight/2)-We),this._tmpCtx.stroke()}this._tmpCtx.restore();const Ie=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ot;if(Ot=this._config.allowTransparency?(function(Te){for(let We=0;We<Te.data.length;We+=4)if(Te.data[We+3]>0)return!1;return!0})(Ie):R(Ie,$,Se,Ee),Ot)return S;const $e=this._findGlyphBoundingBox(Ie,this._workBoundingBox,W,he,Re,we);let Be,ze;for(;;){if(this._activePages.length===0){const Te=this._createNewPage();Be=Te,ze=Te.currentRow,ze.height=$e.size.y;break}Be=this._activePages[this._activePages.length-1],ze=Be.currentRow;for(const Te of this._activePages)$e.size.y<=Te.currentRow.height&&(Be=Te,ze=Te.currentRow);for(let Te=this._activePages.length-1;Te>=0;Te--)for(const We of this._activePages[Te].fixedRows)We.height<=ze.height&&$e.size.y<=We.height&&(Be=this._activePages[Te],ze=We);if(ze.y+$e.size.y>=Be.canvas.height||ze.height>$e.size.y+2){let Te=!1;if(Be.currentRow.y+Be.currentRow.height+$e.size.y>=Be.canvas.height){let We;for(const gt of this._activePages)if(gt.currentRow.y+gt.currentRow.height+$e.size.y<gt.canvas.height){We=gt;break}if(We)Be=We;else if(T.maxAtlasPages&&this._pages.length>=T.maxAtlasPages&&ze.y+$e.size.y<=Be.canvas.height&&ze.height>=$e.size.y&&ze.x+$e.size.x<=Be.canvas.width)Te=!0;else{const gt=this._createNewPage();Be=gt,ze=gt.currentRow,ze.height=$e.size.y,Te=!0}}Te||(Be.currentRow.height>0&&Be.fixedRows.push(Be.currentRow),ze={x:0,y:Be.currentRow.y+Be.currentRow.height,height:$e.size.y},Be.fixedRows.push(ze),Be.currentRow={x:0,y:ze.y+ze.height,height:0})}if(ze.x+$e.size.x<=Be.canvas.width)break;ze===Be.currentRow?(ze.x=0,ze.y+=ze.height,ze.height=0):Be.fixedRows.splice(Be.fixedRows.indexOf(ze),1)}return $e.texturePage=this._pages.indexOf(Be),$e.texturePosition.x=ze.x,$e.texturePosition.y=ze.y,$e.texturePositionClipSpace.x=ze.x/Be.canvas.width,$e.texturePositionClipSpace.y=ze.y/Be.canvas.height,$e.sizeClipSpace.x/=Be.canvas.width,$e.sizeClipSpace.y/=Be.canvas.height,ze.height=Math.max(ze.height,$e.size.y),ze.x+=$e.size.x,Be.ctx.putImageData(Ie,$e.texturePosition.x-this._workBoundingBox.left,$e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$e.size.x,$e.size.y),Be.addGlyph($e),Be.version++,$e}_findGlyphBoundingBox(M,j,z,P,H,F){j.top=0;const W=P?this._config.deviceCellHeight:this._tmpCanvas.height,G=P?this._config.deviceCellWidth:z;let Q=!1;for(let X=0;X<W;X++){for(let I=0;I<G;I++){const O=X*this._tmpCanvas.width*4+4*I+3;if(M.data[O]!==0){j.top=X,Q=!0;break}}if(Q)break}j.left=0,Q=!1;for(let X=0;X<F+G;X++){for(let I=0;I<W;I++){const O=I*this._tmpCanvas.width*4+4*X+3;if(M.data[O]!==0){j.left=X,Q=!0;break}}if(Q)break}j.right=G,Q=!1;for(let X=F+G-1;X>=F;X--){for(let I=0;I<W;I++){const O=I*this._tmpCanvas.width*4+4*X+3;if(M.data[O]!==0){j.right=X,Q=!0;break}}if(Q)break}j.bottom=W,Q=!1;for(let X=W-1;X>=0;X--){for(let I=0;I<G;I++){const O=X*this._tmpCanvas.width*4+4*I+3;if(M.data[O]!==0){j.bottom=X,Q=!0;break}}if(Q)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:j.right-j.left+1,y:j.bottom-j.top+1},sizeClipSpace:{x:j.right-j.left+1,y:j.bottom-j.top+1},offset:{x:-j.left+F+(P||H?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-j.top+F+(P||H?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}o.TextureAtlas=T;class D{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(M){this._glyphs.push(M),this._usedPixels+=M.size.x*M.size.y}constructor(M,j,z){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],z)for(const P of z)this._glyphs.push(...P.glyphs),this._usedPixels+=P._usedPixels;this.canvas=L(M,j,j),this.ctx=(0,c.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function R(A,M,j,z){const P=M.rgba>>>24,H=M.rgba>>>16&255,F=M.rgba>>>8&255,W=j.rgba>>>24,G=j.rgba>>>16&255,Q=j.rgba>>>8&255,X=Math.floor((Math.abs(P-W)+Math.abs(H-G)+Math.abs(F-Q))/12);let I=!0;for(let O=0;O<A.data.length;O+=4)A.data[O]===P&&A.data[O+1]===H&&A.data[O+2]===F||z&&Math.abs(A.data[O]-P)+Math.abs(A.data[O+1]-H)+Math.abs(A.data[O+2]-F)<X?A.data[O+3]=0:I=!1;return I}function L(A,M,j){const z=A.createElement("canvas");return z.width=M,z.height=j,z}},160:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let u=0,d=0,v=0,c=0;var _,x,C,y,g;function b(w){const T=w.toString(16);return T.length<2?"0"+T:T}function S(w,T){return w<T?(T+.05)/(w+.05):(w+.05)/(T+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(w){w.toCss=function(T,D,R,L){return L!==void 0?`#${b(T)}${b(D)}${b(R)}${b(L)}`:`#${b(T)}${b(D)}${b(R)}`},w.toRgba=function(T,D,R,L=255){return(T<<24|D<<16|R<<8|L)>>>0},w.toColor=function(T,D,R,L){return{css:w.toCss(T,D,R,L),rgba:w.toRgba(T,D,R,L)}}})(_||(o.channels=_={})),(function(w){function T(D,R){return c=Math.round(255*R),[u,d,v]=g.toChannels(D.rgba),{css:_.toCss(u,d,v,c),rgba:_.toRgba(u,d,v,c)}}w.blend=function(D,R){if(c=(255&R.rgba)/255,c===1)return{css:R.css,rgba:R.rgba};const L=R.rgba>>24&255,A=R.rgba>>16&255,M=R.rgba>>8&255,j=D.rgba>>24&255,z=D.rgba>>16&255,P=D.rgba>>8&255;return u=j+Math.round((L-j)*c),d=z+Math.round((A-z)*c),v=P+Math.round((M-P)*c),{css:_.toCss(u,d,v),rgba:_.toRgba(u,d,v)}},w.isOpaque=function(D){return(255&D.rgba)==255},w.ensureContrastRatio=function(D,R,L){const A=g.ensureContrastRatio(D.rgba,R.rgba,L);if(A)return _.toColor(A>>24&255,A>>16&255,A>>8&255)},w.opaque=function(D){const R=(255|D.rgba)>>>0;return[u,d,v]=g.toChannels(R),{css:_.toCss(u,d,v),rgba:R}},w.opacity=T,w.multiplyOpacity=function(D,R){return c=255&D.rgba,T(D,c*R/255)},w.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(x||(o.color=x={})),(function(w){let T,D;try{const R=document.createElement("canvas");R.width=1,R.height=1;const L=R.getContext("2d",{willReadFrequently:!0});L&&(T=L,T.globalCompositeOperation="copy",D=T.createLinearGradient(0,0,1,1))}catch{}w.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),_.toColor(u,d,v);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),c=parseInt(R.slice(4,5).repeat(2),16),_.toColor(u,d,v,c);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const L=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return u=parseInt(L[1]),d=parseInt(L[2]),v=parseInt(L[3]),c=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),_.toColor(u,d,v,c);if(!T||!D)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=D,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,d,v,c]=T.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(u,d,v,c),css:R}}})(C||(o.css=C={})),(function(w){function T(D,R,L){const A=D/255,M=R/255,j=L/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))}w.relativeLuminance=function(D){return T(D>>16&255,D>>8&255,255&D)},w.relativeLuminance2=T})(y||(o.rgb=y={})),(function(w){function T(R,L,A){const M=R>>24&255,j=R>>16&255,z=R>>8&255;let P=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));for(;W<A&&(P>0||H>0||F>0);)P-=Math.max(0,Math.ceil(.1*P)),H-=Math.max(0,Math.ceil(.1*H)),F-=Math.max(0,Math.ceil(.1*F)),W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));return(P<<24|H<<16|F<<8|255)>>>0}function D(R,L,A){const M=R>>24&255,j=R>>16&255,z=R>>8&255;let P=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));for(;W<A&&(P<255||H<255||F<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),H=Math.min(255,H+Math.ceil(.1*(255-H))),F=Math.min(255,F+Math.ceil(.1*(255-F))),W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));return(P<<24|H<<16|F<<8|255)>>>0}w.blend=function(R,L){if(c=(255&L)/255,c===1)return L;const A=L>>24&255,M=L>>16&255,j=L>>8&255,z=R>>24&255,P=R>>16&255,H=R>>8&255;return u=z+Math.round((A-z)*c),d=P+Math.round((M-P)*c),v=H+Math.round((j-H)*c),_.toRgba(u,d,v)},w.ensureContrastRatio=function(R,L,A){const M=y.relativeLuminance(R>>8),j=y.relativeLuminance(L>>8);if(S(M,j)<A){if(j<M){const H=T(R,L,A),F=S(M,y.relativeLuminance(H>>8));if(F<A){const W=D(R,L,A);return F>S(M,y.relativeLuminance(W>>8))?H:W}return H}const z=D(R,L,A),P=S(M,y.relativeLuminance(z>>8));if(P<A){const H=T(R,L,A);return P>S(M,y.relativeLuminance(H>>8))?z:H}return z}},w.reduceLuminance=T,w.increaseLuminance=D,w.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(g||(o.rgba=g={})),o.toPaddedHex=b,o.contrastRatio=S},345:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const v=[];for(let c=0;c<this._listeners.length;c++)v.push(this._listeners[c]);for(let c=0;c<v.length;c++)v[c].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(u,d){return u((v=>d.fire(v)))},o.runAndSubscribe=function(u,d){return d(void 0),u((v=>d(v)))}},859:(p,o)=>{function u(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)==null||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=u,o.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(v,c,_){this._data[v]||(this._data[v]={}),this._data[v][c]=_}get(v,c){return this._data[v]?this._data[v][c]:void 0}clear(){this._data={}}}o.TwoKeyMap=u,o.FourKeyMap=class{constructor(){this._data=new u}set(d,v,c,_,x){this._data.get(d,v)||this._data.set(d,v,new u),this._data.get(d,v).set(c,_,x)}get(d,v,c,_){var x;return(x=this._data.get(d,v))==null?void 0:x.get(c,_)}clear(){this._data.clear()}}},399:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const u=o.isNode?"node":navigator.userAgent,d=o.isNode?"node":navigator.platform;o.isFirefox=u.includes("Firefox"),o.isLegacyEdge=u.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(u),o.getSafariVersion=function(){if(!o.isSafari)return 0;const v=u.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),o.isIpad=d==="iPad",o.isIphone=d==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),o.isLinux=d.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(u)},385:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=u(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,y=0,g=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),y=Math.max(C,y),b=x.timeRemaining(),1.5*y>b)return g-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-C))}ms`),void this._start();g=b}this.clear()}}class c extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}o.PriorityTaskQueue=c,o.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:c,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},147:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new u;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=d},782:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=u(133),v=u(855),c=u(147);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const y=new _;return y.setFromCharData(C),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(C[v.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(C[v.CHAR_DATA_CHAR_INDEX].length===2){const g=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const b=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(g-55296)+b-56320+65536|C[v.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[v.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=C[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},855:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},133:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},o.utf32ToString=function(u,d=0,v=u.length){let c="";for(let _=d;_<v;++_){let x=u[_];x>65535?(x-=65536,c+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):c+=String.fromCharCode(x)}return c},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const v=u.length;if(!v)return 0;let c=0,_=0;if(this._interim){const x=u.charCodeAt(_++);56320<=x&&x<=57343?d[c++]=1024*(this._interim-55296)+x-56320+65536:(d[c++]=this._interim,d[c++]=x),this._interim=0}for(let x=_;x<v;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=v)return this._interim=C,c;const y=u.charCodeAt(x);56320<=y&&y<=57343?d[c++]=1024*(C-55296)+y-56320+65536:(d[c++]=C,d[c++]=y)}else C!==65279&&(d[c++]=C)}return c}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const v=u.length;if(!v)return 0;let c,_,x,C,y=0,g=0,b=0;if(this.interim[0]){let T=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let R,L=0;for(;(R=63&this.interim[++L])&&L<4;)D<<=6,D|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=A-L;for(;b<M;){if(b>=v)return 0;if(R=u[b++],(192&R)!=128){b--,T=!0;break}this.interim[L++]=R,D<<=6,D|=63&R}T||(A===2?D<128?b--:d[y++]=D:A===3?D<2048||D>=55296&&D<=57343||D===65279||(d[y++]=D):D<65536||D>1114111||(d[y++]=D)),this.interim.fill(0)}const S=v-4;let w=b;for(;w<v;){for(;!(!(w<S)||128&(c=u[w])||128&(_=u[w+1])||128&(x=u[w+2])||128&(C=u[w+3]));)d[y++]=c,d[y++]=_,d[y++]=x,d[y++]=C,w+=4;if(c=u[w++],c<128)d[y++]=c;else if((224&c)==192){if(w>=v)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(g=(31&c)<<6|63&_,g<128){w--;continue}d[y++]=g}else if((240&c)==224){if(w>=v)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=v)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(g=(15&c)<<12|(63&_)<<6|63&x,g<2048||g>=55296&&g<=57343||g===65279)continue;d[y++]=g}else if((248&c)==240){if(w>=v)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=v)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(w>=v)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=x,y;if(C=u[w++],(192&C)!=128){w--;continue}if(g=(7&c)<<18|(63&_)<<12|(63&x)<<6|63&C,g<65536||g>1114111)continue;d[y++]=g}}return y}}},776:function(p,o,u){var d=this&&this.__decorate||function(g,b,S,w){var T,D=arguments.length,R=D<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,b,S,w);else for(var L=g.length-1;L>=0;L--)(T=g[L])&&(R=(D<3?T(R):D>3?T(b,S,R):T(b,S))||R);return D>3&&R&&Object.defineProperty(b,S,R),R},v=this&&this.__param||function(g,b){return function(S,w){b(S,w,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const c=u(859),_=u(97),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,y=o.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let b=0;b<g.length;b++)typeof g[b]=="function"&&(g[b]=g[b]())}_log(g,b,S){this._evalLazyOptionalParams(S),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...S)}trace(g,...b){var S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.trace.bind(this._optionsService.options.logger))??console.log,g,b)}debug(g,...b){var S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.debug.bind(this._optionsService.options.logger))??console.log,g,b)}info(g,...b){var S;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.info.bind(this._optionsService.options.logger))??console.info,g,b)}warn(g,...b){var S;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.warn.bind(this._optionsService.options.logger))??console.warn,g,b)}error(g,...b){var S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.error.bind(this._optionsService.options.logger))??console.error,g,b)}};o.LogService=y=d([v(0,_.IOptionsService)],y),o.setTraceLogger=function(g){C=g},o.traceCall=function(g,b,S){if(typeof S.value!="function")throw new Error("not supported");const w=S.value;S.value=function(...T){if(C.logLevel!==_.LogLevelEnum.TRACE)return w.apply(this,T);C.trace(`GlyphRenderer#${w.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const D=w.apply(this,T);return C.trace(`GlyphRenderer#${w.name} return`,D),D}}},726:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const u="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(v){return v[d]||[]},o.createDecorator=function(v){if(o.serviceRegistry.has(v))return o.serviceRegistry.get(v);const c=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,g,b){g[u]===g?g[d].push({id:y,index:b}):(g[d]=[{id:y,index:b}],g[u]=g)})(c,_,C)};return c.toString=()=>v,o.serviceRegistry.set(v,c),c}},97:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const d=u(726);var v;o.IBufferService=(0,d.createDecorator)("BufferService"),o.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),o.ICoreService=(0,d.createDecorator)("CoreService"),o.ICharsetService=(0,d.createDecorator)("CharsetService"),o.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(v||(o.LogLevelEnum=v={})),o.ILogService=(0,d.createDecorator)("LogService"),o.IOptionsService=(0,d.createDecorator)("OptionsService"),o.IOscLinkService=(0,d.createDecorator)("OscLinkService"),o.IUnicodeService=(0,d.createDecorator)("UnicodeService"),o.IDecorationService=(0,d.createDecorator)("DecorationService")}},s={};function l(p){var o=s[p];if(o!==void 0)return o.exports;var u=s[p]={exports:{}};return r[p].call(u.exports,u,u.exports,l),u.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.WebglAddon=void 0;const o=l(345),u=l(859),d=l(399),v=l(666),c=l(776);class _ extends u.Disposable{constructor(C){if(d.isSafari&&(0,d.getSafariVersion)()<16){const y={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",y))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=C,this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new o.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new o.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(C){const y=C._core;if(!C.element)return void this.register(y.onWillOpen((()=>this.activate(C))));this._terminal=C;const g=y.coreService,b=y.optionsService,S=y,w=S._renderService,T=S._characterJoinerService,D=S._charSizeService,R=S._coreBrowserService,L=S._decorationService,A=S._logService,M=S._themeService;(0,c.setTraceLogger)(A),this._renderer=this.register(new v.WebglRenderer(C,T,D,R,g,L,b,M,this._preserveDrawingBuffer)),this.register((0,o.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,o.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,o.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,o.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),w.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const j=this._terminal._core._renderService;j.setRenderer(this._terminal._core._createRenderer()),j.handleResize(C.cols,C.rows)})))}get textureAtlas(){var C;return(C=this._renderer)==null?void 0:C.textureAtlas}clearTextureAtlas(){var C;(C=this._renderer)==null||C.clearTextureAtlas()}}p.WebglAddon=_})(),h})()))})(Sm)),Sm.exports}var fB=dB(),Cm={exports:{}},Sw;function pB(){return Sw||(Sw=1,(function(e,i){(function(r,s){e.exports=s()})(globalThis,(()=>(()=>{var r={4567:function(p,o,u){var d=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var M=S.length-1;M>=0;M--)(R=S[M])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},v=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const c=u(9042),_=u(9924),x=u(844),C=u(4725),y=u(2585),g=u(3656);let b=o.AccessibilityManager=class extends x.Disposable{constructor(S,w,T,D){super(),this._terminal=S,this._coreBrowserService=T,this._renderService=D,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
631
+ `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,g.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(S){for(let w=0;w<S;w++)this._handleChar(" ")}_handleChar(S){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==S&&(this._charsToAnnounce+=S):this._charsToAnnounce+=S,S===`
632
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=c.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(S){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(S)||this._charsToConsume.push(S)}_refreshRows(S,w){this._liveRegionDebouncer.refresh(S,w,this._terminal.rows)}_renderRows(S,w){const T=this._terminal.buffer,D=T.lines.length.toString();for(let R=S;R<=w;R++){const L=T.lines.get(T.ydisp+R),A=[],M=(L==null?void 0:L.translateToString(!0,void 0,void 0,A))||"",j=(T.ydisp+R+1).toString(),z=this._rowElements[R];z&&(M.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=M,this._rowColumns.set(z,A)),z.setAttribute("aria-posinset",j),z.setAttribute("aria-setsize",D))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(S,w){const T=S.target,D=this._rowElements[w===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(w===0?"1":`${this._terminal.buffer.lines.length}`)||S.relatedTarget!==D)return;let R,L;if(w===0?(R=T,L=this._rowElements.pop(),this._rowContainer.removeChild(L)):(R=this._rowElements.shift(),L=T,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),L.removeEventListener("focus",this._bottomBoundaryFocusListener),w===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(w===0?-1:1),this._rowElements[w===0?1:this._rowElements.length-2].focus(),S.preventDefault(),S.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const S=document.getSelection();if(!S)return;if(S.isCollapsed)return void(this._rowContainer.contains(S.anchorNode)&&this._terminal.clearSelection());if(!S.anchorNode||!S.focusNode)return void console.error("anchorNode and/or focusNode are null");let w={node:S.anchorNode,offset:S.anchorOffset},T={node:S.focusNode,offset:S.focusOffset};if((w.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||w.node===T.node&&w.offset>T.offset)&&([w,T]=[T,w]),w.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(w={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(w.node))return;const D=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(D)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:D,offset:((M=D.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(T.node))return;const R=({node:j,offset:z})=>{const P=j instanceof Text?j.parentNode:j;let H=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(P);if(!F)return console.warn("columns is null. Race condition?"),null;let W=z<F.length?F[z]:F.slice(-1)[0]+1;return W>=this._terminal.cols&&(++H,W=0),{row:H,column:W}},L=R(w),A=R(T);if(L&&A){if(L.row>A.row||L.row===A.row&&L.column>=A.column)throw new Error("invalid range");this._terminal.select(L.column,L.row,(A.row-L.row)*this._terminal.cols-L.column+A.column)}}_handleResize(S){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let w=this._rowContainer.children.length;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);for(;this._rowElements.length>S;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const S=this._coreBrowserService.mainDocument.createElement("div");return S.setAttribute("role","listitem"),S.tabIndex=-1,this._refreshRowDimensions(S),S}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let S=0;S<this._terminal.rows;S++)this._refreshRowDimensions(this._rowElements[S])}}_refreshRowDimensions(S){S.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=b=d([v(1,y.IInstantiationService),v(2,C.ICoreBrowserService),v(3,C.IRenderService)],b)},3614:(p,o)=>{function u(_){return _.replace(/\r?\n/g,"\r")}function d(_,x){return x?"\x1B[200~"+_+"\x1B[201~":_}function v(_,x,C,y){_=d(_=u(_),C.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(_,!0),x.value=""}function c(_,x,C){const y=C.getBoundingClientRect(),g=_.clientX-y.left-10,b=_.clientY-y.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${g}px`,x.style.top=`${b}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=u,o.bracketTextForPaste=d,o.copyHandler=function(_,x){_.clipboardData&&_.clipboardData.setData("text/plain",x.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,x,C,y){_.stopPropagation(),_.clipboardData&&v(_.clipboardData.getData("text/plain"),x,C,y)},o.paste=v,o.moveTextAreaUnderMouseCursor=c,o.rightClickHandler=function(_,x,C,y,g){c(_,x,C),g&&y.rightClickSelect(_),x.value=y.selectionText,x.select()}},7239:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const d=u(1505);o.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(v,c,_){this._css.set(v,c,_)}getCss(v,c){return this._css.get(v,c)}setColor(v,c,_){this._color.set(v,c,_)}getColor(v,c){return this._color.get(v,c)}clear(){this._color.clear(),this._css.clear()}}},3656:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(u,d,v,c){u.addEventListener(d,v,c);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(d,v,c))}}}},3551:function(p,o,u){var d=this&&this.__decorate||function(b,S,w,T){var D,R=arguments.length,L=R<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,S,w,T);else for(var A=b.length-1;A>=0;A--)(D=b[A])&&(L=(R<3?D(L):R>3?D(S,w,L):D(S,w))||L);return R>3&&L&&Object.defineProperty(S,w,L),L},v=this&&this.__param||function(b,S){return function(w,T){S(w,T,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const c=u(3656),_=u(8460),x=u(844),C=u(2585),y=u(4725);let g=o.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(b,S,w,T,D){super(),this._element=b,this._mouseService=S,this._renderService=w,this._bufferService=T,this._linkProviderService=D,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,c.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,c.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const S=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!S)return;this._isMouseOut=!1;const w=b.composedPath();for(let T=0;T<w.length;T++){const D=w[T];if(D.classList.contains("xterm"))break;if(D.classList.contains("xterm-hover"))return}this._lastBufferCell&&S.x===this._lastBufferCell.x&&S.y===this._lastBufferCell.y||(this._handleHover(S),this._lastBufferCell=S)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,S){var T,D;this._activeProviderReplies&&S||((T=this._activeProviderReplies)==null||T.forEach((R=>{R==null||R.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let w=!1;for(const[R,L]of this._linkProviderService.linkProviders.entries())S?(D=this._activeProviderReplies)!=null&&D.get(R)&&(w=this._checkLinkProviderResult(R,b,w)):L.provideLinks(b.y,(A=>{var j,z;if(this._isMouseOut)return;const M=A==null?void 0:A.map((P=>({link:P})));(j=this._activeProviderReplies)==null||j.set(R,M),w=this._checkLinkProviderResult(R,b,w),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,S){const w=new Set;for(let T=0;T<S.size;T++){const D=S.get(T);if(D)for(let R=0;R<D.length;R++){const L=D[R],A=L.link.range.start.y<b?0:L.link.range.start.x,M=L.link.range.end.y>b?this._bufferService.cols:L.link.range.end.x;for(let j=A;j<=M;j++){if(w.has(j)){D.splice(R--,1);break}w.add(j)}}}}_checkLinkProviderResult(b,S,w){var R;if(!this._activeProviderReplies)return w;const T=this._activeProviderReplies.get(b);let D=!1;for(let L=0;L<b;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(D=!0);if(!D&&T){const L=T.find((A=>this._linkAtPosition(A.link,S)));L&&(w=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!w)for(let L=0;L<this._activeProviderReplies.size;L++){const A=(R=this._activeProviderReplies.get(L))==null?void 0:R.find((M=>this._linkAtPosition(M.link,S)));if(A){w=!0,this._handleNewLink(A);break}}return w}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const S=this._positionFromMouseEvent(b,this._element,this._mouseService);S&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,S)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,S){this._currentLink&&this._lastMouseEvent&&(!b||!S||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=S)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._linkAtPosition(b.link,S)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var w,T;return(T=(w=this._currentLink)==null?void 0:w.state)==null?void 0:T.decorations.pointerCursor},set:w=>{var T;(T=this._currentLink)!=null&&T.state&&this._currentLink.state.decorations.pointerCursor!==w&&(this._currentLink.state.decorations.pointerCursor=w,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",w))}},underline:{get:()=>{var w,T;return(T=(w=this._currentLink)==null?void 0:w.state)==null?void 0:T.decorations.underline},set:w=>{var T,D,R;(T=this._currentLink)!=null&&T.state&&((R=(D=this._currentLink)==null?void 0:D.state)==null?void 0:R.decorations.underline)!==w&&(this._currentLink.state.decorations.underline=w,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,w))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((w=>{if(!this._currentLink)return;const T=w.start===0?0:w.start+1+this._bufferService.buffer.ydisp,D=this._bufferService.buffer.ydisp+1+w.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=D&&(this._clearCurrentLink(T,D),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(b,S,w){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),S.hover&&S.hover(w,S.text)}_fireUnderlineEvent(b,S){const w=b.range,T=this._bufferService.buffer.ydisp,D=this._createLinkUnderlineEvent(w.start.x-1,w.start.y-T-1,w.end.x,w.end.y-T-1,void 0);(S?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(D)}_linkLeave(b,S,w){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(S,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),S.leave&&S.leave(w,S.text)}_linkAtPosition(b,S){const w=b.range.start.y*this._bufferService.cols+b.range.start.x,T=b.range.end.y*this._bufferService.cols+b.range.end.x,D=S.y*this._bufferService.cols+S.x;return w<=D&&D<=T}_positionFromMouseEvent(b,S,w){const T=w.getCoords(b,S,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,S,w,T,D){return{x1:b,y1:S,x2:w,y2:T,cols:this._bufferService.cols,fg:D}}};o.Linkifier=g=d([v(1,y.IMouseService),v(2,y.IRenderService),v(3,C.IBufferService),v(4,y.ILinkProviderService)],g)},9042:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(p,o,u){var d=this&&this.__decorate||function(y,g,b,S){var w,T=arguments.length,D=T<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,g,b,S);else for(var R=y.length-1;R>=0;R--)(w=y[R])&&(D=(T<3?w(D):T>3?w(g,b,D):w(g,b))||D);return T>3&&D&&Object.defineProperty(g,b,D),D},v=this&&this.__param||function(y,g){return function(b,S){g(b,S,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const c=u(511),_=u(2585);let x=o.OscLinkProvider=class{constructor(y,g,b){this._bufferService=y,this._optionsService=g,this._oscLinkService=b}provideLinks(y,g){var M;const b=this._bufferService.buffer.lines.get(y-1);if(!b)return void g(void 0);const S=[],w=this._optionsService.rawOptions.linkHandler,T=new c.CellData,D=b.getTrimmedLength();let R=-1,L=-1,A=!1;for(let j=0;j<D;j++)if(L!==-1||b.hasContent(j)){if(b.loadCell(j,T),T.hasExtendedAttrs()&&T.extended.urlId){if(L===-1){L=j,R=T.extended.urlId;continue}A=T.extended.urlId!==R}else L!==-1&&(A=!0);if(A||L!==-1&&j===D-1){const z=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(z){const P={start:{x:L+1,y},end:{x:j+(A||j!==D-1?0:1),y}};let H=!1;if(!(w!=null&&w.allowNonHttpProtocols))try{const F=new URL(z);["http:","https:"].includes(F.protocol)||(H=!0)}catch{H=!0}H||S.push({text:z,range:P,activate:(F,W)=>w?w.activate(F,W,P):C(0,W),hover:(F,W)=>{var G;return(G=w==null?void 0:w.hover)==null?void 0:G.call(w,F,W,P)},leave:(F,W)=>{var G;return(G=w==null?void 0:w.leave)==null?void 0:G.call(w,F,W,P)}})}A=!1,T.hasExtendedAttrs()&&T.extended.urlId?(L=j,R=T.extended.urlId):(L=-1,R=-1)}}g(S)}};function C(y,g){if(confirm(`Do you want to navigate to ${g}?
633
+
634
+ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=g}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=x=d([v(0,_.IBufferService),v(1,_.IOptionsService),v(2,_.IOscLinkService)],x)},6193:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,v){this._rowCount=v,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const d=u(3614),v=u(3656),c=u(3551),_=u(9042),x=u(3730),C=u(1680),y=u(3107),g=u(5744),b=u(2950),S=u(1296),w=u(428),T=u(4269),D=u(5114),R=u(8934),L=u(3230),A=u(9312),M=u(4725),j=u(6731),z=u(8055),P=u(8969),H=u(8460),F=u(844),W=u(6114),G=u(8437),Q=u(2584),X=u(7399),I=u(5941),O=u(9074),Y=u(2585),Z=u(5435),U=u(4567),V=u(779);class ne extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(K={}){super(K),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(Y.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,oe)=>this.refresh($,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,F.toDisposable)((()=>{var $,oe;this._customKeyEventHandler=void 0,(oe=($=this.element)==null?void 0:$.parentNode)==null||oe.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const $ of K){let oe,ee="";switch($.index){case 256:oe="foreground",ee="10";break;case 257:oe="background",ee="11";break;case 258:oe="cursor",ee="12";break;default:oe="ansi",ee="4;"+$.index}switch($.type){case 0:const ue=z.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${ee};${(0,I.toRgbString)(ue)}${Q.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((he=>he.ansi[$.index]=z.channels.toColor(...$.color)));else{const he=oe;this._themeService.modifyColors((Se=>Se[he]=z.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(K);if(!$)return;const oe=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,ue=$.getWidth(oe),he=this._renderService.dimensions.css.cell.width*ue,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,we=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=we+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=he+"px",this.textarea.style.height=ee+"px",this.textarea.style.lineHeight=ee+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,d.copyHandler)($,this._selectionService)})));const K=$=>(0,d.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,v.addDisposableDomListener)(this.element,"paste",K)),W.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,d.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var oe;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((oe=this.element)==null?void 0:oe.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),K.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,v.addDisposableDomListener)(this.screenElement,"mousemove",(ee=>this.updateCursorStyle(ee)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(D.CoreBrowserService,this.textarea,K.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(w.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(j.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(L.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ee=>this._onRender.fire(ee)))),this.onResize((ee=>this._renderService.resize(ee.cols,ee.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(c.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ee=>this._renderService.handleSelectionChanged(ee.start,ee.end,ee.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ee=>{this.textarea.value=ee,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ee=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(ee=>this._selectionService.handleMouseDown(ee)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ee=>this._handleScreenReaderModeOptionChange(ee)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ee=>{!this._overviewRulerRenderer&&ee&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(S.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,$=this.element;function oe(he){const Se=K._mouseService.getMouseReportCoords(he,K.screenElement);if(!Se)return!1;let we,Re;switch(he.overrideType||he.type){case"mousemove":Re=32,he.buttons===void 0?(we=3,he.button!==void 0&&(we=he.button<3?he.button:3)):we=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Re=0,we=he.button<3?he.button:3;break;case"mousedown":Re=1,we=he.button<3?he.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(he)===!1||K.viewport.getLinesScrolled(he)===0)return!1;Re=he.deltaY<0?0:1,we=4;break;default:return!1}return!(Re===void 0||we===void 0||we>4)&&K.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:we,action:Re,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ue={mouseup:he=>(oe(he),he.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(he)),wheel:he=>(oe(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&oe(he)},mousemove:he=>{he.buttons||oe(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?ee.mousemove||($.addEventListener("mousemove",ue.mousemove),ee.mousemove=ue.mousemove):($.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&he?ee.wheel||($.addEventListener("wheel",ue.wheel,{passive:!1}),ee.wheel=ue.wheel):($.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&he?ee.mouseup||(ee.mouseup=ue.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&he?ee.mousedrag||(ee.mousedrag=ue.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)($,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return oe(he),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(he)}))),this.register((0,v.addDisposableDomListener)($,"wheel",(he=>{if(!ee.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(he);if(Se===0)return;const we=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Re="";for(let Ve=0;Ve<Math.abs(Se);Ve++)Re+=we;return this.coreService.triggerDataEvent(Re,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)($,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,v.addDisposableDomListener)($,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(K,$){var oe;(oe=this._renderService)==null||oe.refreshRows(K,$)}updateCursorStyle(K){var $;($=this._selectionService)!=null&&$.shouldColumnSelect(K)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(K,$,oe=0){var ee;oe===1?(super.scrollLines(K,$,oe),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(K)}paste(K){(0,d.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,$,oe){this._selectionService.setSelection(K,$,oe)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,$){var oe;(oe=this._selectionService)==null||oe.selectLines(K,$)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!$&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,X.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),oe.type===3||oe.type===2){const ee=this.rows-1;return this.scrollLines(oe.type===2?-ee:ee),this.cancel(K,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(oe.cancel&&this.cancel(K,!0),!oe.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==Q.C0.ETX&&oe.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,$){const oe=K.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||K.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||K.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?oe:oe&&(!$.keyCode||$.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)$=K.charCode;else if(K.which===null||K.which===void 0)$=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;$=K.which}return!(!$||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=K.data;return this.coreService.triggerDataEvent($,!0),this.cancel(K),!0}return!1}resize(K,$){K!==this.cols||$!==this.rows?super.resize(K,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,$){var oe,ee;(oe=this._charSizeService)==null||oe.measure(),(ee=this.viewport)==null||ee.syncScrollArea(!0)}clear(){var K;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let $=1;$<this.rows;$++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var $,oe;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),($=this._selectionService)==null||$.reset(),this._decorationService.reset(),(oe=this.viewport)==null||oe.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case Z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${oe};${$}t`);break;case Z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),ue=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${ue};${ee}t`)}}cancel(K,$){if(this.options.cancelEvents||$)return K.preventDefault(),K.stopPropagation(),!1}}o.Terminal=ne},9924:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,v){this._rowCount=v,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const c=Date.now();if(c-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=c,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=c-this._lastRefreshMs,x=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(p,o,u){var d=this&&this.__decorate||function(b,S,w,T){var D,R=arguments.length,L=R<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,S,w,T);else for(var A=b.length-1;A>=0;A--)(D=b[A])&&(L=(R<3?D(L):R>3?D(S,w,L):D(S,w))||L);return R>3&&L&&Object.defineProperty(S,w,L),L},v=this&&this.__param||function(b,S){return function(w,T){S(w,T,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const c=u(3656),_=u(4725),x=u(8460),C=u(844),y=u(2585);let g=o.Viewport=class extends C.Disposable{constructor(b,S,w,T,D,R,L,A){super(),this._viewportElement=b,this._scrollArea=S,this._bufferService=w,this._optionsService=T,this._charSizeService=D,this._renderService=R,this._coreBrowserService=L,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const S=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==S&&(this._lastRecordedBufferHeight=S,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const S=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,S){const w=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(S<0&&this._viewportElement.scrollTop!==0||S>0&&w<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const S=this._getPixelsScrolled(b);return S!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+S:this._smoothScrollState.target+=S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=S,this._bubbleScroll(b,S))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const S=b*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+S,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let S=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?S*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._currentRowHeight*this._bufferService.rows),S}getBufferElements(b,S){var A;let w,T="";const D=[],R=S??this._bufferService.buffer.lines.length,L=this._bufferService.buffer.lines;for(let M=b;M<R;M++){const j=L.get(M);if(!j)continue;const z=(A=L.get(M+1))==null?void 0:A.isWrapped;if(T+=j.translateToString(!z),!z||M===L.length-1){const P=document.createElement("div");P.textContent=T,D.push(P),T.length>0&&(w=P),T=""}}return{bufferElements:D,cursorElement:w}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let S=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(S/=this._currentRowHeight+0,this._wheelPartialScroll+=S,S=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._bufferService.rows),S}_applyScrollModifier(b,S){const w=this._optionsService.rawOptions.fastScrollModifier;return w==="alt"&&S.altKey||w==="ctrl"&&S.ctrlKey||w==="shift"&&S.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const S=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,S!==0&&(this._viewportElement.scrollTop+=S,this._bubbleScroll(b,S))}};o.Viewport=g=d([v(2,y.IBufferService),v(3,y.IOptionsService),v(4,_.ICharSizeService),v(5,_.IRenderService),v(6,_.ICoreBrowserService),v(7,_.IThemeService)],g)},3107:function(p,o,u){var d=this&&this.__decorate||function(y,g,b,S){var w,T=arguments.length,D=T<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,g,b,S);else for(var R=y.length-1;R>=0;R--)(w=y[R])&&(D=(T<3?w(D):T>3?w(g,b,D):w(g,b))||D);return T>3&&D&&Object.defineProperty(g,b,D),D},v=this&&this.__param||function(y,g){return function(b,S){g(b,S,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const c=u(4725),_=u(844),x=u(2585);let C=o.BufferDecorationRenderer=class extends _.Disposable{constructor(y,g,b,S,w){super(),this._screenElement=y,this._bufferService=g,this._coreBrowserService=b,this._decorationService=S,this._renderService=w,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((T=>this._removeDecoration(T)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var S;const g=this._coreBrowserService.mainDocument.createElement("div");g.classList.add("xterm-decoration"),g.classList.toggle("xterm-decoration-top-layer",((S=y==null?void 0:y.options)==null?void 0:S.layer)==="top"),g.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,g.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",g.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",g.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=y.options.x??0;return b&&b>this._bufferService.cols&&(g.style.display="none"),this._refreshXPosition(y,g),g}_refreshStyle(y){const g=y.marker.line-this._bufferService.buffers.active.ydisp;if(g<0||g>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let b=this._decorationElements.get(y);b||(b=this._createElement(y),y.element=b,this._decorationElements.set(y,b),this._container.appendChild(b),y.onDispose((()=>{this._decorationElements.delete(y),b.remove()}))),b.style.top=g*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(b)}}_refreshXPosition(y,g=y.element){if(!g)return;const b=y.options.x??0;(y.options.anchor||"left")==="right"?g.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":g.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var g;(g=this._decorationElements.get(y))==null||g.remove(),this._decorationElements.delete(y),y.dispose()}};o.BufferDecorationRenderer=C=d([v(1,x.IBufferService),v(2,c.ICoreBrowserService),v(3,x.IDecorationService),v(4,c.IRenderService)],C)},5871:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,v){return d>=u.startBufferLine-this._linePadding[v||"full"]&&d<=u.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(p,o,u){var d=this&&this.__decorate||function(w,T,D,R){var L,A=arguments.length,M=A<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,T,D,R);else for(var j=w.length-1;j>=0;j--)(L=w[j])&&(M=(A<3?L(M):A>3?L(T,D,M):L(T,D))||M);return A>3&&M&&Object.defineProperty(T,D,M),M},v=this&&this.__param||function(w,T){return function(D,R){T(D,R,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const c=u(5871),_=u(4725),x=u(844),C=u(2585),y={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let S=o.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(w,T,D,R,L,A,M){var z;super(),this._viewportElement=w,this._screenElement=T,this._bufferService=D,this._decorationService=R,this._renderService=L,this._optionsService=A,this._coreBrowserService=M,this._colorZoneStore=new c.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const j=this._canvas.getContext("2d");if(!j)throw new Error("Ctx cannot be null");this._ctx=j,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const w=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);g.full=this._canvas.width,g.left=w,g.center=T,g.right=w,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=g.left,b.right=g.left+g.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const w=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(w,12),6)*this._coreBrowserService.dpr);y.left=T,y.center=T,y.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const w=this._colorZoneStore.zones;for(const T of w)T.position!=="full"&&this._renderColorZone(T);for(const T of w)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(w){this._ctx.fillStyle=w.color,this._ctx.fillRect(b[w.position||"full"],Math.round((this._canvas.height-1)*(w.startBufferLine/this._bufferService.buffers.active.lines.length)-y[w.position||"full"]/2),g[w.position||"full"],Math.round((this._canvas.height-1)*((w.endBufferLine-w.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[w.position||"full"]))}_queueRefresh(w,T){this._shouldUpdateDimensions=w||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=S=d([v(2,C.IBufferService),v(3,C.IDecorationService),v(4,_.IRenderService),v(5,C.IOptionsService),v(6,_.ICoreBrowserService)],S)},2950:function(p,o,u){var d=this&&this.__decorate||function(y,g,b,S){var w,T=arguments.length,D=T<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,g,b,S);else for(var R=y.length-1;R>=0;R--)(w=y[R])&&(D=(T<3?w(D):T>3?w(g,b,D):w(g,b))||D);return T>3&&D&&Object.defineProperty(g,b,D),D},v=this&&this.__param||function(y,g){return function(b,S){g(b,S,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const c=u(4725),_=u(2585),x=u(2584);let C=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,g,b,S,w,T){this._textarea=y,this._compositionView=g,this._bufferService=b,this._optionsService=S,this._coreService=w,this._renderService=T,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const g={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,g.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(g.start,g.end):this._textarea.value.substring(g.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const g=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(g,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const g=this._textarea.value,b=g.replace(y,"");this._dataAlreadySent=b,g.length>y.length?this._coreService.triggerDataEvent(b,!0):g.length<y.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):g.length===y.length&&g!==y&&this._coreService.triggerDataEvent(g,!0)}}),0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const g=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,S=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,w=g*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=w+"px",this._compositionView.style.top=S+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const T=this._compositionView.getBoundingClientRect();this._textarea.style.left=w+"px",this._textarea.style.top=S+"px",this._textarea.style.width=Math.max(T.width,1)+"px",this._textarea.style.height=Math.max(T.height,1)+"px",this._textarea.style.lineHeight=T.height+"px"}y||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=C=d([v(2,_.IBufferService),v(3,_.IOptionsService),v(4,_.ICoreService),v(5,c.IRenderService)],C)},9806:(p,o)=>{function u(d,v,c){const _=c.getBoundingClientRect(),x=d.getComputedStyle(c),C=parseInt(x.getPropertyValue("padding-left")),y=parseInt(x.getPropertyValue("padding-top"));return[v.clientX-_.left-C,v.clientY-_.top-y]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=u,o.getCoords=function(d,v,c,_,x,C,y,g,b){if(!C)return;const S=u(d,v,c);return S?(S[0]=Math.ceil((S[0]+(b?y/2:0))/y),S[1]=Math.ceil(S[1]/g),S[0]=Math.min(Math.max(S[0],1),_+(b?1:0)),S[1]=Math.min(Math.max(S[1],1),x),S):void 0}},9504:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const d=u(2584);function v(g,b,S,w){const T=g-c(g,S),D=b-c(b,S),R=Math.abs(T-D)-(function(L,A,M){let j=0;const z=L-c(L,M),P=A-c(A,M);for(let H=0;H<Math.abs(z-P);H++){const F=_(L,A)==="A"?-1:1,W=M.buffer.lines.get(z+F*H);W!=null&&W.isWrapped&&j++}return j})(g,b,S);return y(R,C(_(g,b),w))}function c(g,b){let S=0,w=b.buffer.lines.get(g),T=w==null?void 0:w.isWrapped;for(;T&&g>=0&&g<b.rows;)S++,w=b.buffer.lines.get(--g),T=w==null?void 0:w.isWrapped;return S}function _(g,b){return g>b?"A":"B"}function x(g,b,S,w,T,D){let R=g,L=b,A="";for(;R!==S||L!==w;)R+=T?1:-1,T&&R>D.cols-1?(A+=D.buffer.translateBufferLineToString(L,!1,g,R),R=0,g=0,L++):!T&&R<0&&(A+=D.buffer.translateBufferLineToString(L,!1,0,g+1),R=D.cols-1,g=R,L--);return A+D.buffer.translateBufferLineToString(L,!1,g,R)}function C(g,b){const S=b?"O":"[";return d.C0.ESC+S+g}function y(g,b){g=Math.floor(g);let S="";for(let w=0;w<g;w++)S+=b;return S}o.moveToCellSequence=function(g,b,S,w){const T=S.buffer.x,D=S.buffer.y;if(!S.buffer.hasScrollback)return(function(A,M,j,z,P,H){return v(M,z,P,H).length===0?"":y(x(A,M,A,M-c(M,P),!1,P).length,C("D",H))})(T,D,0,b,S,w)+v(D,b,S,w)+(function(A,M,j,z,P,H){let F;F=v(M,z,P,H).length>0?z-c(z,P):M;const W=z,G=(function(Q,X,I,O,Y,Z){let U;return U=v(I,O,Y,Z).length>0?O-c(O,Y):X,Q<I&&U<=O||Q>=I&&U<O?"C":"D"})(A,M,j,z,P,H);return y(x(A,F,j,W,G==="C",P).length,C(G,H))})(T,D,g,b,S,w);let R;if(D===b)return R=T>g?"D":"C",y(Math.abs(T-g),C(R,w));R=D>b?"D":"C";const L=Math.abs(D-b);return y((function(A,M){return M.cols-A})(D>b?g:T,S)+(L-1)*S.cols+1+((D>b?T:g)-1),C(R,w))}},1296:function(p,o,u){var d=this&&this.__decorate||function(H,F,W,G){var Q,X=arguments.length,I=X<3?F:G===null?G=Object.getOwnPropertyDescriptor(F,W):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(H,F,W,G);else for(var O=H.length-1;O>=0;O--)(Q=H[O])&&(I=(X<3?Q(I):X>3?Q(F,W,I):Q(F,W))||I);return X>3&&I&&Object.defineProperty(F,W,I),I},v=this&&this.__param||function(H,F){return function(W,G){F(W,G,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const c=u(3787),_=u(2550),x=u(2223),C=u(6171),y=u(6052),g=u(4725),b=u(8055),S=u(8460),w=u(844),T=u(2585),D="xterm-dom-renderer-owner-",R="xterm-rows",L="xterm-fg-",A="xterm-bg-",M="xterm-focus",j="xterm-selection";let z=1,P=o.DomRenderer=class extends w.Disposable{constructor(H,F,W,G,Q,X,I,O,Y,Z,U,V,ne){super(),this._terminal=H,this._document=F,this._element=W,this._screenElement=G,this._viewportElement=Q,this._helperContainer=X,this._linkifier2=I,this._charSizeService=Y,this._optionsService=Z,this._bufferService=U,this._coreBrowserService=V,this._themeService=ne,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new S.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(j),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((le=>this._injectCss(le)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(c.DomRendererRowFactory,document),this._element.classList.add(D+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((le=>this._handleLinkHover(le)))),this.register(this._linkifier2.onHideLinkUnderline((le=>this._handleLinkLeave(le)))),this.register((0,w.toDisposable)((()=>{this._element.classList.remove(D+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${R} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${R} .xterm-dim { color: ${b.color.multiplyOpacity(H.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const W=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;F+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${G} { 50% { box-shadow: none; }}`,F+=`@keyframes ${Q} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,F+=`${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${j} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${j} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${j} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[X,I]of H.ansi.entries())F+=`${this._terminalSelector} .${L}${X} { color: ${I.css}; }${this._terminalSelector} .${L}${X}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${A}${X} { background-color: ${I.css}; }`;F+=`${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(H.background).css}; }${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${A}${x.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,F){for(let W=this._rowElements.length;W<=F;W++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,F){this._refreshRowElements(H,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,F,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,F,W),this.renderRows(0,this._bufferService.rows-1),!H||!F)return;this._selectionRenderModel.update(this._terminal,H,F,W);const G=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||I<0)return;const O=this._document.createDocumentFragment();if(W){const Y=H[0]>F[0];O.appendChild(this._createSelectionElement(X,Y?F[0]:H[0],Y?H[0]:F[0],I-X+1))}else{const Y=G===X?H[0]:0,Z=X===Q?F[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(X,Y,Z));const U=I-X-1;if(O.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,U)),X!==I){const V=Q===I?F[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(I,0,V))}}this._selectionContainer.appendChild(O)}_createSelectionElement(H,F,W,G=1){const Q=this._document.createElement("div"),X=F*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(W-F);return X+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-X),Q.style.height=G*this.dimensions.css.cell.height+"px",Q.style.top=H*this.dimensions.css.cell.height+"px",Q.style.left=`${X}px`,Q.style.width=`${I}px`,Q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,F){const W=this._bufferService.buffer,G=W.ybase+W.y,Q=Math.min(W.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let Y=H;Y<=F;Y++){const Z=Y+W.ydisp,U=this._rowElements[Y],V=W.lines.get(Z);if(!U||!V)break;U.replaceChildren(...this._rowFactory.createRow(V,Z,Z===G,I,O,Q,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${D}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,F,W,G,Q,X){W<0&&(H=0),G<0&&(F=0);const I=this._bufferService.rows-1;W=Math.max(Math.min(W,I),0),G=Math.max(Math.min(G,I),0),Q=Math.min(Q,this._bufferService.cols);const O=this._bufferService.buffer,Y=O.ybase+O.y,Z=Math.min(O.x,Q-1),U=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,ne=this._optionsService.rawOptions.cursorInactiveStyle;for(let le=W;le<=G;++le){const K=le+O.ydisp,$=this._rowElements[le],oe=O.lines.get(K);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,K,K===Y,V,ne,Z,U,this.dimensions.css.cell.width,this._widthCache,X?le===W?H:0:-1,X?(le===G?F:Q)-1:-1))}}};o.DomRenderer=P=d([v(7,T.IInstantiationService),v(8,g.ICharSizeService),v(9,T.IOptionsService),v(10,T.IBufferService),v(11,g.ICoreBrowserService),v(12,g.IThemeService)],P)},3787:function(p,o,u){var d=this&&this.__decorate||function(R,L,A,M){var j,z=arguments.length,P=z<3?L:M===null?M=Object.getOwnPropertyDescriptor(L,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(R,L,A,M);else for(var H=R.length-1;H>=0;H--)(j=R[H])&&(P=(z<3?j(P):z>3?j(L,A,P):j(L,A))||P);return z>3&&P&&Object.defineProperty(L,A,P),P},v=this&&this.__param||function(R,L){return function(A,M){L(A,M,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const c=u(2223),_=u(643),x=u(511),C=u(2585),y=u(8055),g=u(4725),b=u(4269),S=u(6171),w=u(3734);let T=o.DomRendererRowFactory=class{constructor(R,L,A,M,j,z,P){this._document=R,this._characterJoinerService=L,this._optionsService=A,this._coreBrowserService=M,this._coreService=j,this._decorationService=z,this._themeService=P,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,L,A){this._selectionStart=R,this._selectionEnd=L,this._columnSelectMode=A}createRow(R,L,A,M,j,z,P,H,F,W,G){const Q=[],X=this._characterJoinerService.getJoinedCharacters(L),I=this._themeService.colors;let O,Y=R.getNoBgTrimmedLength();A&&Y<z+1&&(Y=z+1);let Z=0,U="",V=0,ne=0,le=0,K=!1,$=0,oe=!1,ee=0;const ue=[],he=W!==-1&&G!==-1;for(let Se=0;Se<Y;Se++){R.loadCell(Se,this._workCell);let we=this._workCell.getWidth();if(we===0)continue;let Re=!1,Ve=Se,Ee=this._workCell;if(X.length>0&&Se===X[0][0]){Re=!0;const je=X.shift();Ee=new b.JoinedCellData(this._workCell,R.translateToString(!0,je[0],je[1]),je[1]-je[0]),Ve=je[1]-1,we=Ee.getWidth()}const Ie=this._isCellInSelection(Se,L),Ot=A&&Se===z,$e=he&&Se>=W&&Se<=G;let Be=!1;this._decorationService.forEachDecorationAtCell(Se,L,void 0,(je=>{Be=!0}));let ze=Ee.getChars()||_.WHITESPACE_CELL_CHAR;if(ze===" "&&(Ee.isUnderline()||Ee.isOverline())&&(ze=" "),ee=we*H-F.get(ze,Ee.isBold(),Ee.isItalic()),O){if(Z&&(Ie&&oe||!Ie&&!oe&&Ee.bg===V)&&(Ie&&oe&&I.selectionForeground||Ee.fg===ne)&&Ee.extended.ext===le&&$e===K&&ee===$&&!Ot&&!Re&&!Be){Ee.isInvisible()?U+=_.WHITESPACE_CELL_CHAR:U+=ze,Z++;continue}Z&&(O.textContent=U),O=this._document.createElement("span"),Z=0,U=""}else O=this._document.createElement("span");if(V=Ee.bg,ne=Ee.fg,le=Ee.extended.ext,K=$e,$=ee,oe=Ie,Re&&z>=Se&&z<=Ve&&(z=Se),!this._coreService.isCursorHidden&&Ot&&this._coreService.isCursorInitialized){if(ue.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&ue.push("xterm-cursor-blink"),ue.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(j)switch(j){case"outline":ue.push("xterm-cursor-outline");break;case"block":ue.push("xterm-cursor-block");break;case"bar":ue.push("xterm-cursor-bar");break;case"underline":ue.push("xterm-cursor-underline")}}if(Ee.isBold()&&ue.push("xterm-bold"),Ee.isItalic()&&ue.push("xterm-italic"),Ee.isDim()&&ue.push("xterm-dim"),U=Ee.isInvisible()?_.WHITESPACE_CELL_CHAR:Ee.getChars()||_.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(ue.push(`xterm-underline-${Ee.extended.underlineStyle}`),U===" "&&(U=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${w.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let je=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&je<8&&(je+=8),O.style.textDecorationColor=I.ansi[je].css}Ee.isOverline()&&(ue.push("xterm-overline"),U===" "&&(U=" ")),Ee.isStrikethrough()&&ue.push("xterm-strikethrough"),$e&&(O.style.textDecoration="underline");let Te=Ee.getFgColor(),We=Ee.getFgColorMode(),gt=Ee.getBgColor(),ot=Ee.getBgColorMode();const fe=!!Ee.isInverse();if(fe){const je=Te;Te=gt,gt=je;const At=We;We=ot,ot=At}let xe,De,Le,Fe=!1;switch(this._decorationService.forEachDecorationAtCell(Se,L,void 0,(je=>{je.options.layer!=="top"&&Fe||(je.backgroundColorRGB&&(ot=50331648,gt=je.backgroundColorRGB.rgba>>8&16777215,xe=je.backgroundColorRGB),je.foregroundColorRGB&&(We=50331648,Te=je.foregroundColorRGB.rgba>>8&16777215,De=je.foregroundColorRGB),Fe=je.options.layer==="top")})),!Fe&&Ie&&(xe=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,gt=xe.rgba>>8&16777215,ot=50331648,Fe=!0,I.selectionForeground&&(We=50331648,Te=I.selectionForeground.rgba>>8&16777215,De=I.selectionForeground)),Fe&&ue.push("xterm-decoration-top"),ot){case 16777216:case 33554432:Le=I.ansi[gt],ue.push(`xterm-bg-${gt}`);break;case 50331648:Le=y.channels.toColor(gt>>16,gt>>8&255,255&gt),this._addStyle(O,`background-color:#${D((gt>>>0).toString(16),"0",6)}`);break;default:fe?(Le=I.foreground,ue.push(`xterm-bg-${c.INVERTED_DEFAULT_COLOR}`)):Le=I.background}switch(xe||Ee.isDim()&&(xe=y.color.multiplyOpacity(Le,.5)),We){case 16777216:case 33554432:Ee.isBold()&&Te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Te+=8),this._applyMinimumContrast(O,Le,I.ansi[Te],Ee,xe,void 0)||ue.push(`xterm-fg-${Te}`);break;case 50331648:const je=y.channels.toColor(Te>>16&255,Te>>8&255,255&Te);this._applyMinimumContrast(O,Le,je,Ee,xe,De)||this._addStyle(O,`color:#${D(Te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,Le,I.foreground,Ee,xe,De)||fe&&ue.push(`xterm-fg-${c.INVERTED_DEFAULT_COLOR}`)}ue.length&&(O.className=ue.join(" "),ue.length=0),Ot||Re||Be?O.textContent=U:Z++,ee!==this.defaultSpacing&&(O.style.letterSpacing=`${ee}px`),Q.push(O),Se=Ve}return O&&Z&&(O.textContent=U),Q}_applyMinimumContrast(R,L,A,M,j,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,S.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const P=this._getContrastCache(M);let H;if(j||z||(H=P.getColor(L.rgba,A.rgba)),H===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);H=y.color.ensureContrastRatio(j||L,z||A,F),P.setColor((j||L).rgba,(z||A).rgba,H??null)}return!!H&&(this._addStyle(R,`color:${H.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,L){R.setAttribute("style",`${R.getAttribute("style")||""}${L};`)}_isCellInSelection(R,L){const A=this._selectionStart,M=this._selectionEnd;return!(!A||!M)&&(this._columnSelectMode?A[0]<=M[0]?R>=A[0]&&L>=A[1]&&R<M[0]&&L<=M[1]:R<A[0]&&L>=A[1]&&R>=M[0]&&L<=M[1]:L>A[1]&&L<M[1]||A[1]===M[1]&&L===A[1]&&R>=A[0]&&R<M[0]||A[1]<M[1]&&L===M[1]&&R<M[0]||A[1]<M[1]&&L===A[1]&&R>=A[0])}};function D(R,L,A){for(;R.length<A;)R=L+R;return R}o.DomRendererRowFactory=T=d([v(1,g.ICharacterJoinerService),v(2,C.IOptionsService),v(3,g.ICoreBrowserService),v(4,C.ICoreService),v(5,C.IDecorationService),v(6,g.IThemeService)],T)},2550:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const v=u.createElement("span");v.classList.add("xterm-char-measure-element");const c=u.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold";const _=u.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[v,c,_,x],this._container.appendChild(v),this._container.appendChild(c),this._container.appendChild(_),this._container.appendChild(x),d.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,d,v,c){u===this._font&&d===this._fontSize&&v===this._weight&&c===this._weightBold||(this._font=u,this._fontSize=d,this._weight=v,this._weightBold=c,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${c}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${c}`,this.clear())}get(u,d,v){let c=0;if(!d&&!v&&u.length===1&&(c=u.charCodeAt(0))<256){if(this._flat[c]!==-9999)return this._flat[c];const C=this._measure(u,0);return C>0&&(this._flat[c]=C),C}let _=u;d&&(_+="B"),v&&(_+="I");let x=this._holey.get(_);if(x===void 0){let C=0;d&&(C|=1),v&&(C|=2),x=this._measure(u,C),x>0&&this._holey.set(_,x)}return x}_measure(u,d){const v=this._measureElements[d];return v.textContent=u.repeat(32),v.offsetWidth/32}}},2223:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(p,o)=>{function u(v){return 57508<=v&&v<=57558}function d(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},o.isPowerlineGlyph=u,o.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},o.isEmoji=d,o.allowRescaling=function(v,c,_,x){return c===1&&_>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!d(v)&&!u(v)&&!(function(C){return 57344<=C&&C<=63743})(v)},o.treatGlyphAsBackgroundColor=function(v){return u(v)||(function(c){return 9472<=c&&c<=9631})(v)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(v,c,_=0){return(v-(2*Math.round(c)-_))%(2*Math.round(c))}},6052:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,c,_,x=!1){if(this.selectionStart=c,this.selectionEnd=_,!c||!_||c[0]===_[0]&&c[1]===_[1])return void this.clear();const C=v.buffers.active.ydisp,y=c[1]-C,g=_[1]-C,b=Math.max(y,0),S=Math.min(g,v.rows-1);b>=v.rows||S<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=y,this.viewportEndRow=g,this.viewportCappedStartRow=b,this.viewportCappedEndRow=S,this.startCol=c[0],this.endCol=_[0])}isCellSelected(v,c,_){return!!this.hasSelection&&(_-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&_>=this.viewportCappedStartRow&&c<this.endCol&&_<=this.viewportCappedEndRow:c<this.startCol&&_>=this.viewportCappedStartRow&&c>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&c>=this.startCol)}}o.createSelectionRenderModel=function(){return new u}},456:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(p,o,u){var d=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var M=S.length-1;M>=0;M--)(R=S[M])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},v=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const c=u(2585),_=u(8460),x=u(844);let C=o.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(S,w,T){super(),this._optionsService=T,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new g(S,w,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const S=this._measureStrategy.measure();S.width===this.width&&S.height===this.height||(this.width=S.width,this.height=S.height,this._onCharSizeChange.fire())}};o.CharSizeService=C=d([v(2,c.IOptionsService)],C);class y extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(w,T){w!==void 0&&w>0&&T!==void 0&&T>0&&(this._result.width=w,this._result.height=T)}}class g extends y{constructor(w,T,D){super(),this._document=w,this._parentElement=T,this._optionsService=D,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends y{constructor(w){super(),this._optionsService=w,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const T=this._ctx.measureText("W");if(!("width"in T&&"fontBoundingBoxAscent"in T&&"fontBoundingBoxDescent"in T))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const w=this._ctx.measureText("W");return this._validateAndSet(w.width,w.fontBoundingBoxAscent+w.fontBoundingBoxDescent),this._result}}},4269:function(p,o,u){var d=this&&this.__decorate||function(b,S,w,T){var D,R=arguments.length,L=R<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,S,w,T);else for(var A=b.length-1;A>=0;A--)(D=b[A])&&(L=(R<3?D(L):R>3?D(S,w,L):D(S,w))||L);return R>3&&L&&Object.defineProperty(S,w,L),L},v=this&&this.__param||function(b,S){return function(w,T){S(w,T,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const c=u(3734),_=u(643),x=u(511),C=u(2585);class y extends c.AttributeData{constructor(S,w,T){super(),this.content=0,this.combinedData="",this.fg=S.fg,this.bg=S.bg,this.combinedData=w,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(S){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=y;let g=o.CharacterJoinerService=class O5{constructor(S){this._bufferService=S,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(S){const w={id:this._nextCharacterJoinerId++,handler:S};return this._characterJoiners.push(w),w.id}deregister(S){for(let w=0;w<this._characterJoiners.length;w++)if(this._characterJoiners[w].id===S)return this._characterJoiners.splice(w,1),!0;return!1}getJoinedCharacters(S){if(this._characterJoiners.length===0)return[];const w=this._bufferService.buffer.lines.get(S);if(!w||w.length===0)return[];const T=[],D=w.translateToString(!0);let R=0,L=0,A=0,M=w.getFg(0),j=w.getBg(0);for(let z=0;z<w.getTrimmedLength();z++)if(w.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==j){if(z-R>1){const P=this._getJoinedRanges(D,A,L,w,R);for(let H=0;H<P.length;H++)T.push(P[H])}R=z,A=L,M=this._workCell.fg,j=this._workCell.bg}L+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const z=this._getJoinedRanges(D,A,L,w,R);for(let P=0;P<z.length;P++)T.push(z[P])}return T}_getJoinedRanges(S,w,T,D,R){const L=S.substring(w,T);let A=[];try{A=this._characterJoiners[0].handler(L)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const j=this._characterJoiners[M].handler(L);for(let z=0;z<j.length;z++)O5._mergeRanges(A,j[z])}catch(j){console.error(j)}return this._stringRangesToCellRanges(A,D,R),A}_stringRangesToCellRanges(S,w,T){let D=0,R=!1,L=0,A=S[D];if(A){for(let M=T;M<this._bufferService.cols;M++){const j=w.getWidth(M),z=w.getString(M).length||_.WHITESPACE_CELL_CHAR.length;if(j!==0){if(!R&&A[0]<=L&&(A[0]=M,R=!0),A[1]<=L){if(A[1]=M,A=S[++D],!A)break;A[0]<=L?(A[0]=M,R=!0):R=!1}L+=z}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(S,w){let T=!1;for(let D=0;D<S.length;D++){const R=S[D];if(T){if(w[1]<=R[0])return S[D-1][1]=w[1],S;if(w[1]<=R[1])return S[D-1][1]=Math.max(w[1],R[1]),S.splice(D,1),S;S.splice(D,1),D--}else{if(w[1]<=R[0])return S.splice(D,0,w),S;if(w[1]<=R[1])return R[0]=Math.min(w[0],R[0]),S;w[0]<R[1]&&(R[0]=Math.min(w[0],R[0]),T=!0)}}return T?S[S.length-1][1]=w[1]:S.push(w),S}};o.CharacterJoinerService=g=d([v(0,C.IBufferService)],g)},5114:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const d=u(844),v=u(8460),c=u(3656);class _ extends d.Disposable{constructor(y,g,b){super(),this._textarea=y,this._window=g,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((S=>this._screenDprMonitor.setWindow(S)))),this.register((0,v.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(y){this._window!==y&&(this._window=y,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=_;class x extends d.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,c.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const d=u(844);class v extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const x=this.linkProviders.indexOf(_);x!==-1&&this.linkProviders.splice(x,1)}}}}o.LinkProviderService=v},8934:function(p,o,u){var d=this&&this.__decorate||function(C,y,g,b){var S,w=arguments.length,T=w<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,y,g,b);else for(var D=C.length-1;D>=0;D--)(S=C[D])&&(T=(w<3?S(T):w>3?S(y,g,T):S(y,g))||T);return w>3&&T&&Object.defineProperty(y,g,T),T},v=this&&this.__param||function(C,y){return function(g,b){y(g,b,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const c=u(4725),_=u(9806);let x=o.MouseService=class{constructor(C,y){this._renderService=C,this._charSizeService=y}getCoords(C,y,g,b,S){return(0,_.getCoords)(window,C,y,g,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,S)}getMouseReportCoords(C,y){const g=(0,_.getCoordsRelativeToElement)(window,C,y);if(this._charSizeService.hasValidSize)return g[0]=Math.min(Math.max(g[0],0),this._renderService.dimensions.css.canvas.width-1),g[1]=Math.min(Math.max(g[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(g[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(g[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(g[0]),y:Math.floor(g[1])}}};o.MouseService=x=d([v(0,c.IRenderService),v(1,c.ICharSizeService)],x)},3230:function(p,o,u){var d=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var M=S.length-1;M>=0;M--)(R=S[M])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},v=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const c=u(6193),_=u(4725),x=u(8460),C=u(844),y=u(7226),g=u(2585);let b=o.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(S,w,T,D,R,L,A,M){super(),this._rowCount=S,this._charSizeService=D,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new c.RenderDebouncer(((j,z)=>this._renderRows(j,z)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var j;return(j=this._renderer.value)==null?void 0:j.clear()}))),this.register(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,w),this.register(A.onWindowChange((j=>this._registerIntersectionObserver(j,w))))}_registerIntersectionObserver(S,w){if("IntersectionObserver"in S){const T=new S.IntersectionObserver((D=>this._handleIntersectionChange(D[D.length-1])),{threshold:0});T.observe(w),this._observerDisposable.value=(0,C.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(S){this._isPaused=S.isIntersecting===void 0?S.intersectionRatio===0:!S.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(S,w,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(S,w,this._rowCount))}_renderRows(S,w){this._renderer.value&&(S=Math.min(S,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(S,w),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:S,end:w}),this._onRender.fire({start:S,end:w}),this._isNextRenderRedrawOnly=!0)}resize(S,w){this._rowCount=w,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(S){this._renderer.value=S,this._renderer.value&&(this._renderer.value.onRequestRedraw((w=>this.refreshRows(w.start,w.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(S){return this._renderDebouncer.addRefreshCallback(S)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var S,w;this._renderer.value&&((w=(S=this._renderer.value).clearTextureAtlas)==null||w.call(S),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(S,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var T;return(T=this._renderer.value)==null?void 0:T.handleResize(S,w)})):this._renderer.value.handleResize(S,w),this._fullRefresh())}handleCharSizeChanged(){var S;(S=this._renderer.value)==null||S.handleCharSizeChanged()}handleBlur(){var S;(S=this._renderer.value)==null||S.handleBlur()}handleFocus(){var S;(S=this._renderer.value)==null||S.handleFocus()}handleSelectionChanged(S,w,T){var D;this._selectionState.start=S,this._selectionState.end=w,this._selectionState.columnSelectMode=T,(D=this._renderer.value)==null||D.handleSelectionChanged(S,w,T)}handleCursorMove(){var S;(S=this._renderer.value)==null||S.handleCursorMove()}clear(){var S;(S=this._renderer.value)==null||S.clear()}};o.RenderService=b=d([v(2,g.IOptionsService),v(3,_.ICharSizeService),v(4,g.IDecorationService),v(5,g.IBufferService),v(6,_.ICoreBrowserService),v(7,_.IThemeService)],b)},9312:function(p,o,u){var d=this&&this.__decorate||function(A,M,j,z){var P,H=arguments.length,F=H<3?M:z===null?z=Object.getOwnPropertyDescriptor(M,j):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(A,M,j,z);else for(var W=A.length-1;W>=0;W--)(P=A[W])&&(F=(H<3?P(F):H>3?P(M,j,F):P(M,j))||F);return H>3&&F&&Object.defineProperty(M,j,F),F},v=this&&this.__param||function(A,M){return function(j,z){M(j,z,A)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const c=u(9806),_=u(9504),x=u(456),C=u(4725),y=u(8460),g=u(844),b=u(6114),S=u(4841),w=u(511),T=u(2585),D=" ",R=new RegExp(D,"g");let L=o.SelectionService=class extends g.Disposable{constructor(A,M,j,z,P,H,F,W,G){super(),this._element=A,this._screenElement=M,this._linkifier=j,this._bufferService=z,this._coreService=P,this._mouseService=H,this._optionsService=F,this._renderService=W,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new w.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,g.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!A||!M||A[0]===M[0]&&A[1]===M[1])}get selectionText(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!A||!M)return"";const j=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(A[0]===M[0])return"";const P=A[0]<M[0]?A[0]:M[0],H=A[0]<M[0]?M[0]:A[0];for(let F=A[1];F<=M[1];F++){const W=j.translateBufferLineToString(F,!0,P,H);z.push(W)}}else{const P=A[1]===M[1]?M[0]:void 0;z.push(j.translateBufferLineToString(A[1],!0,A[0],P));for(let H=A[1]+1;H<=M[1]-1;H++){const F=j.lines.get(H),W=j.translateBufferLineToString(H,!0);F!=null&&F.isWrapped?z[z.length-1]+=W:z.push(W)}if(A[1]!==M[1]){const H=j.lines.get(M[1]),F=j.translateBufferLineToString(M[1],!0,0,M[0]);H&&H.isWrapped?z[z.length-1]+=F:z.push(F)}}return z.map((P=>P.replace(R," "))).join(b.isWindows?`\r
635
+ `:`
636
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(A){const M=this._getMouseBufferCoords(A),j=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(j&&z&&M)&&this._areCoordsInSelection(M,j,z)}isCellInSelection(A,M){const j=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!j||!z)&&this._areCoordsInSelection([A,M],j,z)}_areCoordsInSelection(A,M,j){return A[1]>M[1]&&A[1]<j[1]||M[1]===j[1]&&A[1]===M[1]&&A[0]>=M[0]&&A[0]<j[0]||M[1]<j[1]&&A[1]===j[1]&&A[0]<j[0]||M[1]<j[1]&&A[1]===M[1]&&A[0]>=M[0]}_selectWordAtCursor(A,M){var P,H;const j=(H=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:H.range;if(j)return this._model.selectionStart=[j.start.x-1,j.start.y-1],this._model.selectionStartLength=(0,S.getRangeLength)(j,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(A);return!!z&&(this._selectWordAt(z,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,M){this._model.clearSelection(),A=Math.max(A,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const M=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(A){let M=(0,c.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const j=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=j?0:(M>j&&(M-=j),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(A){return b.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const M=this._getMouseBufferCoords(A);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(A){return A.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const j=this._bufferService.buffer;if(this._model.selectionEnd[1]<j.lines.length){const z=j.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const M=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const j=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(j&&j[0]!==void 0&&j[1]!==void 0){const z=(0,_.moveToCellSequence)(j[0]-1,j[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,j=!(!A||!M||A[0]===M[0]&&A[1]===M[1]);j?A&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,M,j)):this._oldHasSelection&&this._fireOnSelectionChange(A,M,j)}_fireOnSelectionChange(A,M,j){this._oldSelectionStart=A,this._oldSelectionEnd=M,this._oldHasSelection=j,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(A,M){let j=M;for(let z=0;M>=z;z++){const P=A.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?j--:P>1&&M!==z&&(j+=P-1)}return j}setSelection(A,M,j){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,M],this._model.selectionStartLength=j,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,M,j=!0,z=!0){if(A[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,H=P.lines.get(A[1]);if(!H)return;const F=P.translateBufferLineToString(A[1],!1);let W=this._convertViewportColToCharacterIndex(H,A[0]),G=W;const Q=A[0]-W;let X=0,I=0,O=0,Y=0;if(F.charAt(W)===" "){for(;W>0&&F.charAt(W-1)===" ";)W--;for(;G<F.length&&F.charAt(G+1)===" ";)G++}else{let V=A[0],ne=A[0];H.getWidth(V)===0&&(X++,V--),H.getWidth(ne)===2&&(I++,ne++);const le=H.getString(ne).length;for(le>1&&(Y+=le-1,G+=le-1);V>0&&W>0&&!this._isCharWordSeparator(H.loadCell(V-1,this._workCell));){H.loadCell(V-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,V--):K>1&&(O+=K-1,W-=K-1),W--,V--}for(;ne<H.length&&G+1<F.length&&!this._isCharWordSeparator(H.loadCell(ne+1,this._workCell));){H.loadCell(ne+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,ne++):K>1&&(Y+=K-1,G+=K-1),G++,ne++}}G++;let Z=W+Q-X+O,U=Math.min(this._bufferService.cols,G-W+X+I-O-Y);if(M||F.slice(W,G).trim()!==""){if(j&&Z===0&&H.getCodePoint(0)!==32){const V=P.lines.get(A[1]-1);if(V&&H.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const ne=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ne){const le=this._bufferService.cols-ne.start;Z-=le,U+=le}}}if(z&&Z+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const V=P.lines.get(A[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const ne=this._getWordAt([0,A[1]+1],!1,!1,!0);ne&&(U+=ne.length)}}return{start:Z,length:U}}}_selectWordAt(A,M){const j=this._getWordAt(A,M);if(j){for(;j.start<0;)j.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[j.start,A[1]],this._model.selectionStartLength=j.length}}_selectToWordAt(A){const M=this._getWordAt(A,!0);if(M){let j=A[1];for(;M.start<0;)M.start+=this._bufferService.cols,j--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,j++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,j]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const M=this._bufferService.buffer.getWrappedRangeForLine(A),j={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,S.getRangeLength)(j,this._bufferService.cols)}};o.SelectionService=L=d([v(3,T.IBufferService),v(4,T.ICoreService),v(5,C.IMouseService),v(6,T.IOptionsService),v(7,C.IRenderService),v(8,C.ICoreBrowserService)],L)},4725:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const d=u(8343);o.ICharSizeService=(0,d.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),o.IMouseService=(0,d.createDecorator)("MouseService"),o.IRenderService=(0,d.createDecorator)("RenderService"),o.ISelectionService=(0,d.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,d.createDecorator)("ThemeService"),o.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(p,o,u){var d=this&&this.__decorate||function(L,A,M,j){var z,P=arguments.length,H=P<3?A:j===null?j=Object.getOwnPropertyDescriptor(A,M):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(L,A,M,j);else for(var F=L.length-1;F>=0;F--)(z=L[F])&&(H=(P<3?z(H):P>3?z(A,M,H):z(A,M))||H);return P>3&&H&&Object.defineProperty(A,M,H),H},v=this&&this.__param||function(L,A){return function(M,j){A(M,j,L)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const c=u(7239),_=u(8055),x=u(8460),C=u(844),y=u(2585),g=_.css.toColor("#ffffff"),b=_.css.toColor("#000000"),S=_.css.toColor("#ffffff"),w=_.css.toColor("#000000"),T={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const L=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let M=0;M<216;M++){const j=A[M/36%6|0],z=A[M/6%6|0],P=A[M%6];L.push({css:_.channels.toCss(j,z,P),rgba:_.channels.toRgba(j,z,P)})}for(let M=0;M<24;M++){const j=8+10*M;L.push({css:_.channels.toCss(j,j,j),rgba:_.channels.toRgba(j,j,j)})}return L})());let D=o.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(L){super(),this._optionsService=L,this._contrastCache=new c.ColorContrastCache,this._halfContrastCache=new c.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:g,background:b,cursor:S,cursorAccent:w,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:_.color.blend(b,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:_.color.blend(b,T),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(L={}){const A=this._colors;if(A.foreground=R(L.foreground,g),A.background=R(L.background,b),A.cursor=R(L.cursor,S),A.cursorAccent=R(L.cursorAccent,w),A.selectionBackgroundTransparent=R(L.selectionBackground,T),A.selectionBackgroundOpaque=_.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(L.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=_.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=L.selectionForeground?R(L.selectionForeground,_.NULL_COLOR):void 0,A.selectionForeground===_.NULL_COLOR&&(A.selectionForeground=void 0),_.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=_.color.opacity(A.selectionBackgroundTransparent,.3)),_.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=_.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=o.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(L.black,o.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(L.red,o.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(L.green,o.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(L.yellow,o.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(L.blue,o.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(L.magenta,o.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(L.cyan,o.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(L.white,o.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(L.brightBlack,o.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(L.brightRed,o.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(L.brightGreen,o.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(L.brightYellow,o.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(L.brightBlue,o.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(L.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(L.brightCyan,o.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(L.brightWhite,o.DEFAULT_ANSI_COLORS[15]),L.extendedAnsi){const M=Math.min(A.ansi.length-16,L.extendedAnsi.length);for(let j=0;j<M;j++)A.ansi[j+16]=R(L.extendedAnsi[j],o.DEFAULT_ANSI_COLORS[j+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(L){this._restoreColor(L),this._onChangeColors.fire(this.colors)}_restoreColor(L){if(L!==void 0)switch(L){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[L]=this._restoreColors.ansi[L]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(L){L(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(L,A){if(L!==void 0)try{return _.css.toColor(L)}catch{}return A}o.ThemeService=D=d([v(0,y.IOptionsService)],D)},6349:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const d=u(8460),v=u(844);class c extends v.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const C=new Array(x);for(let y=0;y<Math.min(x,this.length);y++)C[y]=this._array[this._getCyclicIndex(y)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,C,...y){if(C){for(let g=x;g<this._length-C;g++)this._array[this._getCyclicIndex(g)]=this._array[this._getCyclicIndex(g+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let g=this._length-1;g>=x;g--)this._array[this._getCyclicIndex(g+y.length)]=this._array[this._getCyclicIndex(g)];for(let g=0;g<y.length;g++)this._array[this._getCyclicIndex(x+g)]=y[g];if(y.length&&this.onInsertEmitter.fire({index:x,amount:y.length}),this._length+y.length>this._maxLength){const g=this._length+y.length-this._maxLength;this._startIndex+=g,this._length=this._maxLength,this.onTrimEmitter.fire(g)}else this._length+=y.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,y){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let b=C-1;b>=0;b--)this.set(x+b+y,this.get(x+b));const g=x+C+y-this._length;if(g>0)for(this._length+=g;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let g=0;g<C;g++)this.set(x+g+y,this.get(x+g))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}o.CircularList=c},1439:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function u(d,v=5){if(typeof d!="object")return d;const c=Array.isArray(d)?[]:{};for(const _ in d)c[_]=v<=1?d[_]:d[_]&&u(d[_],v-1);return c}},8055:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let u=0,d=0,v=0,c=0;var _,x,C,y,g;function b(w){const T=w.toString(16);return T.length<2?"0"+T:T}function S(w,T){return w<T?(T+.05)/(w+.05):(w+.05)/(T+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(w){w.toCss=function(T,D,R,L){return L!==void 0?`#${b(T)}${b(D)}${b(R)}${b(L)}`:`#${b(T)}${b(D)}${b(R)}`},w.toRgba=function(T,D,R,L=255){return(T<<24|D<<16|R<<8|L)>>>0},w.toColor=function(T,D,R,L){return{css:w.toCss(T,D,R,L),rgba:w.toRgba(T,D,R,L)}}})(_||(o.channels=_={})),(function(w){function T(D,R){return c=Math.round(255*R),[u,d,v]=g.toChannels(D.rgba),{css:_.toCss(u,d,v,c),rgba:_.toRgba(u,d,v,c)}}w.blend=function(D,R){if(c=(255&R.rgba)/255,c===1)return{css:R.css,rgba:R.rgba};const L=R.rgba>>24&255,A=R.rgba>>16&255,M=R.rgba>>8&255,j=D.rgba>>24&255,z=D.rgba>>16&255,P=D.rgba>>8&255;return u=j+Math.round((L-j)*c),d=z+Math.round((A-z)*c),v=P+Math.round((M-P)*c),{css:_.toCss(u,d,v),rgba:_.toRgba(u,d,v)}},w.isOpaque=function(D){return(255&D.rgba)==255},w.ensureContrastRatio=function(D,R,L){const A=g.ensureContrastRatio(D.rgba,R.rgba,L);if(A)return _.toColor(A>>24&255,A>>16&255,A>>8&255)},w.opaque=function(D){const R=(255|D.rgba)>>>0;return[u,d,v]=g.toChannels(R),{css:_.toCss(u,d,v),rgba:R}},w.opacity=T,w.multiplyOpacity=function(D,R){return c=255&D.rgba,T(D,c*R/255)},w.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(x||(o.color=x={})),(function(w){let T,D;try{const R=document.createElement("canvas");R.width=1,R.height=1;const L=R.getContext("2d",{willReadFrequently:!0});L&&(T=L,T.globalCompositeOperation="copy",D=T.createLinearGradient(0,0,1,1))}catch{}w.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),_.toColor(u,d,v);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),v=parseInt(R.slice(3,4).repeat(2),16),c=parseInt(R.slice(4,5).repeat(2),16),_.toColor(u,d,v,c);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const L=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return u=parseInt(L[1]),d=parseInt(L[2]),v=parseInt(L[3]),c=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),_.toColor(u,d,v,c);if(!T||!D)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=D,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,d,v,c]=T.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(u,d,v,c),css:R}}})(C||(o.css=C={})),(function(w){function T(D,R,L){const A=D/255,M=R/255,j=L/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))}w.relativeLuminance=function(D){return T(D>>16&255,D>>8&255,255&D)},w.relativeLuminance2=T})(y||(o.rgb=y={})),(function(w){function T(R,L,A){const M=R>>24&255,j=R>>16&255,z=R>>8&255;let P=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));for(;W<A&&(P>0||H>0||F>0);)P-=Math.max(0,Math.ceil(.1*P)),H-=Math.max(0,Math.ceil(.1*H)),F-=Math.max(0,Math.ceil(.1*F)),W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));return(P<<24|H<<16|F<<8|255)>>>0}function D(R,L,A){const M=R>>24&255,j=R>>16&255,z=R>>8&255;let P=L>>24&255,H=L>>16&255,F=L>>8&255,W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));for(;W<A&&(P<255||H<255||F<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),H=Math.min(255,H+Math.ceil(.1*(255-H))),F=Math.min(255,F+Math.ceil(.1*(255-F))),W=S(y.relativeLuminance2(P,H,F),y.relativeLuminance2(M,j,z));return(P<<24|H<<16|F<<8|255)>>>0}w.blend=function(R,L){if(c=(255&L)/255,c===1)return L;const A=L>>24&255,M=L>>16&255,j=L>>8&255,z=R>>24&255,P=R>>16&255,H=R>>8&255;return u=z+Math.round((A-z)*c),d=P+Math.round((M-P)*c),v=H+Math.round((j-H)*c),_.toRgba(u,d,v)},w.ensureContrastRatio=function(R,L,A){const M=y.relativeLuminance(R>>8),j=y.relativeLuminance(L>>8);if(S(M,j)<A){if(j<M){const H=T(R,L,A),F=S(M,y.relativeLuminance(H>>8));if(F<A){const W=D(R,L,A);return F>S(M,y.relativeLuminance(W>>8))?H:W}return H}const z=D(R,L,A),P=S(M,y.relativeLuminance(z>>8));if(P<A){const H=T(R,L,A);return P>S(M,y.relativeLuminance(H>>8))?z:H}return z}},w.reduceLuminance=T,w.increaseLuminance=D,w.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(g||(o.rgba=g={})),o.toPaddedHex=b,o.contrastRatio=S},8969:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const d=u(844),v=u(2585),c=u(4348),_=u(7866),x=u(744),C=u(7302),y=u(6975),g=u(8460),b=u(1753),S=u(1480),w=u(7994),T=u(9282),D=u(5435),R=u(5981),L=u(2660);let A=!1;class M extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new g.EventEmitter),this._onScroll.event((z=>{var P;(P=this._onScrollApi)==null||P.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const P in z)this.optionsService.options[P]=z[P]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new g.EventEmitter),this._instantiationService=new c.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(S.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(w.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(L.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new D.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,g.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,g.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,g.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,g.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((P,H)=>this._inputHandler.parse(P,H)))),this.register((0,g.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,P){this._writeBuffer.write(z,P)}writeSync(z,P){this._logService.logLevel<=v.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(z,P)}input(z,P=!0){this.coreService.triggerDataEvent(z,P)}resize(z,P){isNaN(z)||isNaN(P)||(z=Math.max(z,x.MINIMUM_COLS),P=Math.max(P,x.MINIMUM_ROWS),this._bufferService.resize(z,P))}scroll(z,P=!1){this._bufferService.scroll(z,P)}scrollLines(z,P,H){this._bufferService.scrollLines(z,P,H)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const P=z-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(z,P){return this._inputHandler.registerEscHandler(z,P)}registerDcsHandler(z,P){return this._inputHandler.registerDcsHandler(z,P)}registerCsiHandler(z,P){return this._inputHandler.registerCsiHandler(z,P)}registerOscHandler(z,P){return this._inputHandler.registerOscHandler(z,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?z=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const P of z)P.dispose()}))}}}o.CoreTerminal=M},8460:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const v=[];for(let c=0;c<this._listeners.length;c++)v.push(this._listeners[c]);for(let c=0;c<v.length;c++)v[c].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(u,d){return u((v=>d.fire(v)))},o.runAndSubscribe=function(u,d){return d(void 0),u((v=>d(v)))}},5435:function(p,o,u){var d=this&&this.__decorate||function(X,I,O,Y){var Z,U=arguments.length,V=U<3?I:Y===null?Y=Object.getOwnPropertyDescriptor(I,O):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(X,I,O,Y);else for(var ne=X.length-1;ne>=0;ne--)(Z=X[ne])&&(V=(U<3?Z(V):U>3?Z(I,O,V):Z(I,O))||V);return U>3&&V&&Object.defineProperty(I,O,V),V},v=this&&this.__param||function(X,I){return function(O,Y){I(O,Y,X)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const c=u(2584),_=u(7116),x=u(2015),C=u(844),y=u(482),g=u(8437),b=u(8460),S=u(643),w=u(511),T=u(3734),D=u(2585),R=u(1480),L=u(6242),A=u(6351),M=u(5941),j={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function P(X,I){if(X>24)return I.setWinLines||!1;switch(X){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var H;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let F=0;class W extends C.Disposable{getAttrData(){return this._curAttrData}constructor(I,O,Y,Z,U,V,ne,le,K=new x.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=O,this._coreService=Y,this._logService=Z,this._optionsService=U,this._oscLinkService=V,this._coreMouseService=ne,this._unicodeService=le,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new w.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:oe.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,oe,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:ee})})),this._parser.setDcsHandlerFallback((($,oe,ee)=>{oe==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:ee})})),this._parser.setPrintHandler((($,oe,ee)=>this.print($,oe,ee))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(c.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(c.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(c.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(c.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(c.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(c.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(c.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(c.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(c.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new L.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new L.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new L.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new L.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new L.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new L.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new L.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new L.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new L.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new L.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new L.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new L.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(I,O,Y,Z){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=Y,this._parseStack.position=Z}_logSlowResolvingAsync(I){this._logService.logLevel<=D.LogLevelEnum.WARN&&Promise.race([I,new Promise(((O,Y)=>setTimeout((()=>Y("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,O){let Y,Z=this._activeBuffer.x,U=this._activeBuffer.y,V=0;const ne=this._parseStack.paused;if(ne){if(Y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(Y),Y;Z=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>z&&(V=this._parseStack.position+z)}if(this._logService.logLevel<=D.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,($=>String.fromCharCode($))).join("")}"`),typeof I=="string"?I.split("").map(($=>$.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(I.length,z))),ne||this._dirtyRowTracker.clearRange(),I.length>z)for(let $=V;$<I.length;$+=z){const oe=$+z<I.length?$+z:I.length,ee=typeof I=="string"?this._stringDecoder.decode(I.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(I.subarray($,oe),this._parseBuffer);if(Y=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(Z,U,ee,$),this._logSlowResolvingAsync(Y),Y}else if(!ne){const $=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(Y=this._parser.parse(this._parseBuffer,$))return this._preserveStack(Z,U,$,0),this._logSlowResolvingAsync(Y),Y}this._activeBuffer.x===Z&&this._activeBuffer.y===U||this._onCursorMove.fire();const le=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(le,this._bufferService.rows-1))}print(I,O,Y){let Z,U;const V=this._charsetService.charset,ne=this._optionsService.rawOptions.screenReaderMode,le=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,oe=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&Y-O>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let ue=this._parser.precedingJoinState;for(let he=O;he<Y;++he){if(Z=I[he],Z<127&&V){const Ve=V[String.fromCharCode(Z)];Ve&&(Z=Ve.charCodeAt(0))}const Se=this._unicodeService.charProperties(Z,ue);U=R.UnicodeService.extractWidth(Se);const we=R.UnicodeService.extractShouldJoin(Se),Re=we?R.UnicodeService.extractWidth(ue):0;if(ue=Se,ne&&this._onA11yChar.fire((0,y.stringFromCodePoint)(Z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-Re>le){if(K){const Ve=ee;let Ee=this._activeBuffer.x-Re;for(this._activeBuffer.x=Re,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Re>0&&ee instanceof g.BufferLine&&ee.copyCellsFrom(Ve,Ee,0,Re,!1);Ee<le;)Ve.setCellFromCodepoint(Ee++,0,1,oe)}else if(this._activeBuffer.x=le-1,U===2)continue}if(we&&this._activeBuffer.x){const Ve=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-Ve,Z,U);for(let Ee=U-Re;--Ee>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(ee.insertCells(this._activeBuffer.x,U-Re,this._activeBuffer.getNullCell(oe)),ee.getWidth(le-1)===2&&ee.setCellFromCodepoint(le-1,S.NULL_CELL_CODE,S.NULL_CELL_WIDTH,oe)),ee.setCellFromCodepoint(this._activeBuffer.x++,Z,U,oe),U>0)for(;--U;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=ue,this._activeBuffer.x<le&&Y-O>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,O){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,O):this._parser.registerCsiHandler(I,(Y=>!P(Y.params[0],this._optionsService.rawOptions.windowOptions)||O(Y)))}registerDcsHandler(I,O){return this._parser.registerDcsHandler(I,new A.DcsHandler(O))}registerEscHandler(I,O){return this._parser.registerEscHandler(I,O)}registerOscHandler(I,O){return this._parser.registerOscHandler(I,new L.OscHandler(O))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=I,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+O)}cursorUp(I){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const O=I.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=I.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=I.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const O=I.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,O,Y,Z=!1,U=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);V.replaceCells(O,Y,this._activeBuffer.getNullCell(this._eraseAttrData()),U),Z&&(V.isWrapped=!1)}_resetBufferLine(I,O=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Y&&(Y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),Y.isWrapped=!1)}eraseInDisplay(I,O=!1){let Y;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(Y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(Y),this._eraseInBufferLine(Y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);Y<this._bufferService.rows;Y++)this._resetBufferLine(Y,O);this._dirtyRowTracker.markDirty(Y);break;case 1:for(Y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(Y),this._eraseInBufferLine(Y,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(Y+1).isWrapped=!1);Y--;)this._resetBufferLine(Y,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(Y=this._bufferService.rows,this._dirtyRowTracker.markDirty(Y-1);Y--;)this._resetBufferLine(Y,O);this._dirtyRowTracker.markDirty(0);break;case 3:const Z=this._activeBuffer.lines.length-this._bufferService.rows;Z>0&&(this._activeBuffer.lines.trimStart(Z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Z,0),this._onScroll.fire(0))}return!0}eraseInLine(I,O=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let O=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const Y=this._activeBuffer.ybase+this._activeBuffer.y,Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-Z+1;for(;O--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(Y,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let O=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const Y=this._activeBuffer.ybase+this._activeBuffer.y;let Z;for(Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-Z;O--;)this._activeBuffer.lines.splice(Y,1),this._activeBuffer.lines.splice(Z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let O=I.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(I){let O=I.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(g.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=I.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=I.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=I.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=I.params[0]||1;for(let Y=this._activeBuffer.scrollTop;Y<=this._activeBuffer.scrollBottom;++Y){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+Y);Z.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const O=this._parser.precedingJoinState;if(!O)return!0;const Y=I.params[0]||1,Z=R.UnicodeService.extractWidth(O),U=this._activeBuffer.x-Z,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),ne=new Uint32Array(V.length*Y);let le=0;for(let $=0;$<V.length;){const oe=V.codePointAt($)||0;ne[le++]=oe,$+=oe>65535?2:1}let K=le;for(let $=1;$<Y;++$)ne.copyWithin(K,0,le),K+=le;return this.print(ne,0,K),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(c.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(c.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(c.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(c.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(c.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let O=0;O<I.length;O++)switch(I.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let O=0;O<I.length;O++)switch(I.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(I){for(let O=0;O<I.length;O++)switch(I.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let O=0;O<I.length;O++)switch(I.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),I.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(I,O){const Y=this._coreService.decPrivateModes,{activeProtocol:Z,activeEncoding:U}=this._coreMouseService,V=this._coreService,{buffers:ne,cols:le}=this._bufferService,{active:K,alt:$}=ne,oe=this._optionsService.rawOptions,ee=we=>we?1:2,ue=I.params[0];return he=ue,Se=O?ue===2?4:ue===4?ee(V.modes.insertMode):ue===12?3:ue===20?ee(oe.convertEol):0:ue===1?ee(Y.applicationCursorKeys):ue===3?oe.windowOptions.setWinLines?le===80?2:le===132?1:0:0:ue===6?ee(Y.origin):ue===7?ee(Y.wraparound):ue===8?3:ue===9?ee(Z==="X10"):ue===12?ee(oe.cursorBlink):ue===25?ee(!V.isCursorHidden):ue===45?ee(Y.reverseWraparound):ue===66?ee(Y.applicationKeypad):ue===67?4:ue===1e3?ee(Z==="VT200"):ue===1002?ee(Z==="DRAG"):ue===1003?ee(Z==="ANY"):ue===1004?ee(Y.sendFocus):ue===1005?4:ue===1006?ee(U==="SGR"):ue===1015?4:ue===1016?ee(U==="SGR_PIXELS"):ue===1048?1:ue===47||ue===1047||ue===1049?ee(K===$):ue===2004?ee(Y.bracketedPasteMode):0,V.triggerDataEvent(`${c.C0.ESC}[${O?"":"?"}${he};${Se}$y`),!0;var he,Se}_updateAttrColor(I,O,Y,Z,U){return O===2?(I|=50331648,I&=-16777216,I|=T.AttributeData.fromColorRGB([Y,Z,U])):O===5&&(I&=-50331904,I|=33554432|255&Y),I}_extractColor(I,O,Y){const Z=[0,0,-1,0,0,0];let U=0,V=0;do{if(Z[V+U]=I.params[O+V],I.hasSubParams(O+V)){const ne=I.getSubParams(O+V);let le=0;do Z[1]===5&&(U=1),Z[V+le+1+U]=ne[le];while(++le<ne.length&&le+V+1+U<Z.length);break}if(Z[1]===5&&V+U>=2||Z[1]===2&&V+U>=5)break;Z[1]&&(U=1)}while(++V+O<I.length&&V+U<Z.length);for(let ne=2;ne<Z.length;++ne)Z[ne]===-1&&(Z[ne]=0);switch(Z[0]){case 38:Y.fg=this._updateAttrColor(Y.fg,Z[1],Z[3],Z[4],Z[5]);break;case 48:Y.bg=this._updateAttrColor(Y.bg,Z[1],Z[3],Z[4],Z[5]);break;case 58:Y.extended=Y.extended.clone(),Y.extended.underlineColor=this._updateAttrColor(Y.extended.underlineColor,Z[1],Z[3],Z[4],Z[5])}return V}_processUnderline(I,O){O.extended=O.extended.clone(),(!~I||I>5)&&(I=1),O.extended.underlineStyle=I,O.fg|=268435456,I===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(I){I.fg=g.DEFAULT_ATTR_DATA.fg,I.bg=g.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=I.length;let Y;const Z=this._curAttrData;for(let U=0;U<O;U++)Y=I.params[U],Y>=30&&Y<=37?(Z.fg&=-50331904,Z.fg|=16777216|Y-30):Y>=40&&Y<=47?(Z.bg&=-50331904,Z.bg|=16777216|Y-40):Y>=90&&Y<=97?(Z.fg&=-50331904,Z.fg|=16777224|Y-90):Y>=100&&Y<=107?(Z.bg&=-50331904,Z.bg|=16777224|Y-100):Y===0?this._processSGR0(Z):Y===1?Z.fg|=134217728:Y===3?Z.bg|=67108864:Y===4?(Z.fg|=268435456,this._processUnderline(I.hasSubParams(U)?I.getSubParams(U)[0]:1,Z)):Y===5?Z.fg|=536870912:Y===7?Z.fg|=67108864:Y===8?Z.fg|=1073741824:Y===9?Z.fg|=2147483648:Y===2?Z.bg|=134217728:Y===21?this._processUnderline(2,Z):Y===22?(Z.fg&=-134217729,Z.bg&=-134217729):Y===23?Z.bg&=-67108865:Y===24?(Z.fg&=-268435457,this._processUnderline(0,Z)):Y===25?Z.fg&=-536870913:Y===27?Z.fg&=-67108865:Y===28?Z.fg&=-1073741825:Y===29?Z.fg&=2147483647:Y===39?(Z.fg&=-67108864,Z.fg|=16777215&g.DEFAULT_ATTR_DATA.fg):Y===49?(Z.bg&=-67108864,Z.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):Y===38||Y===48||Y===58?U+=this._extractColor(I,U,Z):Y===53?Z.bg|=1073741824:Y===55?Z.bg&=-1073741825:Y===59?(Z.extended=Z.extended.clone(),Z.extended.underlineColor=-1,Z.updateExtended()):Y===100?(Z.fg&=-67108864,Z.fg|=16777215&g.DEFAULT_ATTR_DATA.fg,Z.bg&=-67108864,Z.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",Y);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${c.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,Y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[${O};${Y}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const O=this._activeBuffer.y+1,Y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[?${O};${Y}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const O=I.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const Y=O%2==1;return this._optionsService.options.cursorBlink=Y,!0}setScrollRegion(I){const O=I.params[0]||1;let Y;return(I.length<2||(Y=I.params[1])>this._bufferService.rows||Y===0)&&(Y=this._bufferService.rows),Y>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=Y-1,this._setCursor(0,0)),!0}windowOptions(I){if(!P(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${c.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const O=[],Y=I.split(";");for(;Y.length>1;){const Z=Y.shift(),U=Y.shift();if(/^\d+$/.exec(Z)){const V=parseInt(Z);if(Q(V))if(U==="?")O.push({type:0,index:V});else{const ne=(0,M.parseColor)(U);ne&&O.push({type:1,index:V,color:ne})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(I){const O=I.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(I,O){this._getCurrentLinkId()&&this._finishHyperlink();const Y=I.split(":");let Z;const U=Y.findIndex((V=>V.startsWith("id=")));return U!==-1&&(Z=Y[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Z,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,O){const Y=I.split(";");for(let Z=0;Z<Y.length&&!(O>=this._specialColors.length);++Z,++O)if(Y[Z]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const U=(0,M.parseColor)(Y[Z]);U&&this._onColor.fire([{type:1,index:this._specialColors[O],color:U}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const O=[],Y=I.split(";");for(let Z=0;Z<Y.length;++Z)if(/^\d+$/.exec(Y[Z])){const U=parseInt(Y[Z]);Q(U)&&O.push({type:2,index:U})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(j[I[0]],_.CHARSETS[I[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new w.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const Y=this._activeBuffer.ybase+this._activeBuffer.y+O,Z=this._activeBuffer.lines.get(Y);Z&&(Z.fill(I),Z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,O){const Y=this._bufferService.buffer,Z=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${c.C0.ESC}${U}${c.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${Y.scrollTop+1};${Y.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[Z.cursorStyle]-(Z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,O){this._dirtyRowTracker.markRangeDirty(I,O)}}o.InputHandler=W;let G=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,I){X>I&&(F=X,X=I,I=F),X<this.start&&(this.start=X),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(X){return 0<=X&&X<256}G=d([v(0,D.IBufferService)],G)},844:(p,o)=>{function u(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)==null||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=u,o.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(v,c,_){this._data[v]||(this._data[v]={}),this._data[v][c]=_}get(v,c){return this._data[v]?this._data[v][c]:void 0}clear(){this._data={}}}o.TwoKeyMap=u,o.FourKeyMap=class{constructor(){this._data=new u}set(d,v,c,_,x){this._data.get(d,v)||this._data.set(d,v,new u),this._data.get(d,v).set(c,_,x)}get(d,v,c,_){var x;return(x=this._data.get(d,v))==null?void 0:x.get(c,_)}clear(){this._data.clear()}}},6114:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const u=o.isNode?"node":navigator.userAgent,d=o.isNode?"node":navigator.platform;o.isFirefox=u.includes("Firefox"),o.isLegacyEdge=u.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(u),o.getSafariVersion=function(){if(!o.isSafari)return 0;const v=u.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),o.isIpad=d==="iPad",o.isIphone=d==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),o.isLinux=d.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(u)},6106:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let u=0;o.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const v=this._getKey(d);if(v===void 0||(u=this._search(v),u===-1)||this._getKey(this._array[u])!==v)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===v);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,v){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do v(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let v=0,c=this._array.length-1;for(;c>=v;){let _=v+c>>1;const x=this._getKey(this._array[_]);if(x>d)c=_-1;else{if(!(x<d)){for(;_>0&&this._getKey(this._array[_-1])===d;)_--;return _}v=_+1}}return v}}},7226:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=u(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,y=0,g=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),y=Math.max(C,y),b=x.timeRemaining(),1.5*y>b)return g-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-C))}ms`),void this._start();g=b}this.clear()}}class c extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}o.PriorityTaskQueue=c,o.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:c,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const d=u(643);o.updateWindowsModeWrappedState=function(v){const c=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),_=c==null?void 0:c.get(v.cols-1),x=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);x&&_&&(x.isWrapped=_[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&_[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new u;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,_=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=d},9092:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const d=u(6349),v=u(7226),c=u(3734),_=u(8437),x=u(4634),C=u(511),y=u(643),g=u(4863),b=u(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(S,w,T){this._hasScrollback=S,this._optionsService=w,this._bufferService=T,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(S){return S?(this._nullCell.fg=S.fg,this._nullCell.bg=S.bg,this._nullCell.extended=S.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new c.ExtendedAttrs),this._nullCell}getWhitespaceCell(S){return S?(this._whitespaceCell.fg=S.fg,this._whitespaceCell.bg=S.bg,this._whitespaceCell.extended=S.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new c.ExtendedAttrs),this._whitespaceCell}getBlankLine(S,w){return new _.BufferLine(this._bufferService.cols,this.getNullCell(S),w)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const S=this.ybase+this.y-this.ydisp;return S>=0&&S<this._rows}_getCorrectBufferLength(S){if(!this._hasScrollback)return S;const w=S+this._optionsService.rawOptions.scrollback;return w>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:w}fillViewportRows(S){if(this.lines.length===0){S===void 0&&(S=_.DEFAULT_ATTR_DATA);let w=this._rows;for(;w--;)this.lines.push(this.getBlankLine(S))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(S,w){const T=this.getNullCell(_.DEFAULT_ATTR_DATA);let D=0;const R=this._getCorrectBufferLength(w);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<S)for(let A=0;A<this.lines.length;A++)D+=+this.lines.get(A).resize(S,T);let L=0;if(this._rows<w)for(let A=this._rows;A<w;A++)this.lines.length<w+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(S,T)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(S,T)));else for(let A=this._rows;A>w;A--)this.lines.length>w+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,S-1),this.y=Math.min(this.y,w-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,S-1),this.scrollTop=0}if(this.scrollBottom=w-1,this._isReflowEnabled&&(this._reflow(S,w),this._cols>S))for(let L=0;L<this.lines.length;L++)D+=+this.lines.get(L).resize(S,T);this._cols=S,this._rows=w,this._memoryCleanupQueue.clear(),D>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let S=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,S=!1);let w=0;for(;this._memoryCleanupPosition<this.lines.length;)if(w+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),w>100)return!0;return S}get _isReflowEnabled(){const S=this._optionsService.rawOptions.windowsPty;return S&&S.buildNumber?this._hasScrollback&&S.backend==="conpty"&&S.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(S,w){this._cols!==S&&(S>this._cols?this._reflowLarger(S,w):this._reflowSmaller(S,w))}_reflowLarger(S,w){const T=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,S,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(T.length>0){const D=(0,x.reflowLargerCreateNewLayout)(this.lines,T);(0,x.reflowLargerApplyNewLayout)(this.lines,D.layout),this._reflowLargerAdjustViewport(S,w,D.countRemoved)}}_reflowLargerAdjustViewport(S,w,T){const D=this.getNullCell(_.DEFAULT_ATTR_DATA);let R=T;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<w&&this.lines.push(new _.BufferLine(S,D))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(S,w){const T=this.getNullCell(_.DEFAULT_ATTR_DATA),D=[];let R=0;for(let L=this.lines.length-1;L>=0;L--){let A=this.lines.get(L);if(!A||!A.isWrapped&&A.getTrimmedLength()<=S)continue;const M=[A];for(;A.isWrapped&&L>0;)A=this.lines.get(--L),M.unshift(A);const j=this.ybase+this.y;if(j>=L&&j<L+M.length)continue;const z=M[M.length-1].getTrimmedLength(),P=(0,x.reflowSmallerGetNewLineLengths)(M,this._cols,S),H=P.length-M.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const W=[];for(let Y=0;Y<H;Y++){const Z=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);W.push(Z)}W.length>0&&(D.push({start:L+M.length+R,newLines:W}),R+=W.length),M.push(...W);let G=P.length-1,Q=P[G];Q===0&&(G--,Q=P[G]);let X=M.length-H-1,I=z;for(;X>=0;){const Y=Math.min(I,Q);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[X],I-Y,Q-Y,Y,!0),Q-=Y,Q===0&&(G--,Q=P[G]),I-=Y,I===0){X--;const Z=Math.max(X,0);I=(0,x.getWrappedLineTrimmedLength)(M,Z,this._cols)}}for(let Y=0;Y<M.length;Y++)P[Y]<S&&M[Y].setCell(P[Y],T);let O=H-F;for(;O-- >0;)this.ybase===0?this.y<w-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-w&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+w-1)}if(D.length>0){const L=[],A=[];for(let G=0;G<this.lines.length;G++)A.push(this.lines.get(G));const M=this.lines.length;let j=M-1,z=0,P=D[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let H=0;for(let G=Math.min(this.lines.maxLength-1,M+R-1);G>=0;G--)if(P&&P.start>j+H){for(let Q=P.newLines.length-1;Q>=0;Q--)this.lines.set(G--,P.newLines[Q]);G++,L.push({index:j+1,amount:P.newLines.length}),H+=P.newLines.length,P=D[++z]}else this.lines.set(G,A[j--]);let F=0;for(let G=L.length-1;G>=0;G--)L[G].index+=F,this.lines.onInsertEmitter.fire(L[G]),F+=L[G].amount;const W=Math.max(0,M+R-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(S,w,T=0,D){const R=this.lines.get(S);return R?R.translateToString(w,T,D):""}getWrappedRangeForLine(S){let w=S,T=S;for(;w>0&&this.lines.get(w).isWrapped;)w--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:w,last:T}}setupTabStops(S){for(S!=null?this.tabs[S]||(S=this.prevStop(S)):(this.tabs={},S=0);S<this._cols;S+=this._optionsService.rawOptions.tabStopWidth)this.tabs[S]=!0}prevStop(S){for(S==null&&(S=this.x);!this.tabs[--S]&&S>0;);return S>=this._cols?this._cols-1:S<0?0:S}nextStop(S){for(S==null&&(S=this.x);!this.tabs[++S]&&S<this._cols;);return S>=this._cols?this._cols-1:S<0?0:S}clearMarkers(S){this._isClearing=!0;for(let w=0;w<this.markers.length;w++)this.markers[w].line===S&&(this.markers[w].dispose(),this.markers.splice(w--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].dispose(),this.markers.splice(S--,1);this._isClearing=!1}addMarker(S){const w=new g.Marker(S);return this.markers.push(w),w.register(this.lines.onTrim((T=>{w.line-=T,w.line<0&&w.dispose()}))),w.register(this.lines.onInsert((T=>{w.line>=T.index&&(w.line+=T.amount)}))),w.register(this.lines.onDelete((T=>{w.line>=T.index&&w.line<T.index+T.amount&&w.dispose(),w.line>T.index&&(w.line-=T.amount)}))),w.register(w.onDispose((()=>this._removeMarker(w)))),w}_removeMarker(S){this._isClearing||this.markers.splice(this.markers.indexOf(S),1)}}},8437:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const d=u(3734),v=u(511),c=u(643),_=u(482);o.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let x=0;class C{constructor(g,b,S=!1){this.isWrapped=S,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*g);const w=b||v.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]);for(let T=0;T<g;++T)this.setCell(T,w);this.length=g}get(g){const b=this._data[3*g+0],S=2097151&b;return[this._data[3*g+1],2097152&b?this._combined[g]:S?(0,_.stringFromCodePoint)(S):"",b>>22,2097152&b?this._combined[g].charCodeAt(this._combined[g].length-1):S]}set(g,b){this._data[3*g+1]=b[c.CHAR_DATA_ATTR_INDEX],b[c.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[g]=b[1],this._data[3*g+0]=2097152|g|b[c.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*g+0]=b[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[c.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(g){return this._data[3*g+0]>>22}hasWidth(g){return 12582912&this._data[3*g+0]}getFg(g){return this._data[3*g+1]}getBg(g){return this._data[3*g+2]}hasContent(g){return 4194303&this._data[3*g+0]}getCodePoint(g){const b=this._data[3*g+0];return 2097152&b?this._combined[g].charCodeAt(this._combined[g].length-1):2097151&b}isCombined(g){return 2097152&this._data[3*g+0]}getString(g){const b=this._data[3*g+0];return 2097152&b?this._combined[g]:2097151&b?(0,_.stringFromCodePoint)(2097151&b):""}isProtected(g){return 536870912&this._data[3*g+2]}loadCell(g,b){return x=3*g,b.content=this._data[x+0],b.fg=this._data[x+1],b.bg=this._data[x+2],2097152&b.content&&(b.combinedData=this._combined[g]),268435456&b.bg&&(b.extended=this._extendedAttrs[g]),b}setCell(g,b){2097152&b.content&&(this._combined[g]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[g]=b.extended),this._data[3*g+0]=b.content,this._data[3*g+1]=b.fg,this._data[3*g+2]=b.bg}setCellFromCodepoint(g,b,S,w){268435456&w.bg&&(this._extendedAttrs[g]=w.extended),this._data[3*g+0]=b|S<<22,this._data[3*g+1]=w.fg,this._data[3*g+2]=w.bg}addCodepointToCell(g,b,S){let w=this._data[3*g+0];2097152&w?this._combined[g]+=(0,_.stringFromCodePoint)(b):2097151&w?(this._combined[g]=(0,_.stringFromCodePoint)(2097151&w)+(0,_.stringFromCodePoint)(b),w&=-2097152,w|=2097152):w=b|4194304,S&&(w&=-12582913,w|=S<<22),this._data[3*g+0]=w}insertCells(g,b,S){if((g%=this.length)&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,S),b<this.length-g){const w=new v.CellData;for(let T=this.length-g-b-1;T>=0;--T)this.setCell(g+b+T,this.loadCell(g+T,w));for(let T=0;T<b;++T)this.setCell(g+T,S)}else for(let w=g;w<this.length;++w)this.setCell(w,S);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,S)}deleteCells(g,b,S){if(g%=this.length,b<this.length-g){const w=new v.CellData;for(let T=0;T<this.length-g-b;++T)this.setCell(g+T,this.loadCell(g+b+T,w));for(let T=this.length-b;T<this.length;++T)this.setCell(T,S)}else for(let w=g;w<this.length;++w)this.setCell(w,S);g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,S),this.getWidth(g)!==0||this.hasContent(g)||this.setCellFromCodepoint(g,0,1,S)}replaceCells(g,b,S,w=!1){if(w)for(g&&this.getWidth(g-1)===2&&!this.isProtected(g-1)&&this.setCellFromCodepoint(g-1,0,1,S),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,S);g<b&&g<this.length;)this.isProtected(g)||this.setCell(g,S),g++;else for(g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,S),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,S);g<b&&g<this.length;)this.setCell(g++,S)}resize(g,b){if(g===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const S=3*g;if(g>this.length){if(this._data.buffer.byteLength>=4*S)this._data=new Uint32Array(this._data.buffer,0,S);else{const w=new Uint32Array(S);w.set(this._data),this._data=w}for(let w=this.length;w<g;++w)this.setCell(w,b)}else{this._data=this._data.subarray(0,S);const w=Object.keys(this._combined);for(let D=0;D<w.length;D++){const R=parseInt(w[D],10);R>=g&&delete this._combined[R]}const T=Object.keys(this._extendedAttrs);for(let D=0;D<T.length;D++){const R=parseInt(T[D],10);R>=g&&delete this._extendedAttrs[R]}}return this.length=g,4*S*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const g=new Uint32Array(this._data.length);return g.set(this._data),this._data=g,1}return 0}fill(g,b=!1){if(b)for(let S=0;S<this.length;++S)this.isProtected(S)||this.setCell(S,g);else{this._combined={},this._extendedAttrs={};for(let S=0;S<this.length;++S)this.setCell(S,g)}}copyFrom(g){this.length!==g.length?this._data=new Uint32Array(g._data):this._data.set(g._data),this.length=g.length,this._combined={};for(const b in g._combined)this._combined[b]=g._combined[b];this._extendedAttrs={};for(const b in g._extendedAttrs)this._extendedAttrs[b]=g._extendedAttrs[b];this.isWrapped=g.isWrapped}clone(){const g=new C(0);g._data=new Uint32Array(this._data),g.length=this.length;for(const b in this._combined)g._combined[b]=this._combined[b];for(const b in this._extendedAttrs)g._extendedAttrs[b]=this._extendedAttrs[b];return g.isWrapped=this.isWrapped,g}getTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0])return g+(this._data[3*g+0]>>22);return 0}getNoBgTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0]||50331648&this._data[3*g+2])return g+(this._data[3*g+0]>>22);return 0}copyCellsFrom(g,b,S,w,T){const D=g._data;if(T)for(let L=w-1;L>=0;L--){for(let A=0;A<3;A++)this._data[3*(S+L)+A]=D[3*(b+L)+A];268435456&D[3*(b+L)+2]&&(this._extendedAttrs[S+L]=g._extendedAttrs[b+L])}else for(let L=0;L<w;L++){for(let A=0;A<3;A++)this._data[3*(S+L)+A]=D[3*(b+L)+A];268435456&D[3*(b+L)+2]&&(this._extendedAttrs[S+L]=g._extendedAttrs[b+L])}const R=Object.keys(g._combined);for(let L=0;L<R.length;L++){const A=parseInt(R[L],10);A>=b&&(this._combined[A-b+S]=g._combined[A])}}translateToString(g,b,S,w){b=b??0,S=S??this.length,g&&(S=Math.min(S,this.getTrimmedLength())),w&&(w.length=0);let T="";for(;b<S;){const D=this._data[3*b+0],R=2097151&D,L=2097152&D?this._combined[b]:R?(0,_.stringFromCodePoint)(R):c.WHITESPACE_CELL_CHAR;if(T+=L,w)for(let A=0;A<L.length;++A)w.push(b);b+=D>>22||1}return w&&w.push(b),T}}o.BufferLine=C},4841:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(p,o)=>{function u(d,v,c){if(v===d.length-1)return d[v].getTrimmedLength();const _=!d[v].hasContent(c-1)&&d[v].getWidth(c-1)===1,x=d[v+1].getWidth(0)===2;return _&&x?c-1:c}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(d,v,c,_,x){const C=[];for(let y=0;y<d.length-1;y++){let g=y,b=d.get(++g);if(!b.isWrapped)continue;const S=[d.get(y)];for(;g<d.length&&b.isWrapped;)S.push(b),b=d.get(++g);if(_>=y&&_<g){y+=S.length-1;continue}let w=0,T=u(S,w,v),D=1,R=0;for(;D<S.length;){const A=u(S,D,v),M=A-R,j=c-T,z=Math.min(M,j);S[w].copyCellsFrom(S[D],R,T,z,!1),T+=z,T===c&&(w++,T=0),R+=z,R===A&&(D++,R=0),T===0&&w!==0&&S[w-1].getWidth(c-1)===2&&(S[w].copyCellsFrom(S[w-1],c-1,T++,1,!1),S[w-1].setCell(c-1,x))}S[w].replaceCells(T,c,x);let L=0;for(let A=S.length-1;A>0&&(A>w||S[A].getTrimmedLength()===0);A--)L++;L>0&&(C.push(y+S.length-L),C.push(L)),y+=S.length-1}return C},o.reflowLargerCreateNewLayout=function(d,v){const c=[];let _=0,x=v[_],C=0;for(let y=0;y<d.length;y++)if(x===y){const g=v[++_];d.onDeleteEmitter.fire({index:y-C,amount:g}),y+=g-1,C+=g,x=v[++_]}else c.push(y);return{layout:c,countRemoved:C}},o.reflowLargerApplyNewLayout=function(d,v){const c=[];for(let _=0;_<v.length;_++)c.push(d.get(v[_]));for(let _=0;_<c.length;_++)d.set(_,c[_]);d.length=v.length},o.reflowSmallerGetNewLineLengths=function(d,v,c){const _=[],x=d.map(((b,S)=>u(d,S,v))).reduce(((b,S)=>b+S));let C=0,y=0,g=0;for(;g<x;){if(x-g<c){_.push(x-g);break}C+=c;const b=u(d,y,v);C>b&&(C-=b,y++);const S=d[y].getWidth(C-1)===2;S&&C--;const w=S?c-1:c;_.push(w),g+=w}return _},o.getWrappedLineTrimmedLength=u},5295:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const d=u(8460),v=u(844),c=u(9092);class _ extends v.Disposable{constructor(C,y){super(),this._optionsService=C,this._bufferService=y,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new c.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new c.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,y){this._normal.resize(C,y),this._alt.resize(C,y),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}o.BufferSet=_},511:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=u(482),v=u(643),c=u(3734);class _ extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const y=new _;return y.setFromCharData(C),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(C[v.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(C[v.CHAR_DATA_CHAR_INDEX].length===2){const g=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const b=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(g-55296)+b-56320+65536|C[v.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[v.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=C[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const d=u(8460),v=u(844);class c{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=c._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}o.Marker=c,c._nextId=1},7116:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(p,o)=>{var u,d,v;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(c){c.NUL="\0",c.SOH="",c.STX="",c.ETX="",c.EOT="",c.ENQ="",c.ACK="",c.BEL="\x07",c.BS="\b",c.HT=" ",c.LF=`
637
+ `,c.VT="\v",c.FF="\f",c.CR="\r",c.SO="",c.SI="",c.DLE="",c.DC1="",c.DC2="",c.DC3="",c.DC4="",c.NAK="",c.SYN="",c.ETB="",c.CAN="",c.EM="",c.SUB="",c.ESC="\x1B",c.FS="",c.GS="",c.RS="",c.US="",c.SP=" ",c.DEL=""})(u||(o.C0=u={})),(function(c){c.PAD="€",c.HOP="",c.BPH="‚",c.NBH="ƒ",c.IND="„",c.NEL="…",c.SSA="†",c.ESA="‡",c.HTS="ˆ",c.HTJ="‰",c.VTS="Š",c.PLD="‹",c.PLU="Œ",c.RI="",c.SS2="Ž",c.SS3="",c.DCS="",c.PU1="‘",c.PU2="’",c.STS="“",c.CCH="”",c.MW="•",c.SPA="–",c.EPA="—",c.SOS="˜",c.SGCI="™",c.SCI="š",c.CSI="›",c.ST="œ",c.OSC="",c.PM="ž",c.APC="Ÿ"})(d||(o.C1=d={})),(function(c){c.ST=`${u.ESC}\\`})(v||(o.C1_ESCAPED=v={}))},7399:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const d=u(2584),v={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(c,_,x,C){const y={type:0,cancel:!1,key:void 0},g=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?y.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?y.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?y.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(y.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:y.key=c.ctrlKey?"\b":d.C0.DEL,c.altKey&&(y.key=d.C0.ESC+y.key);break;case 9:if(c.shiftKey){y.key=d.C0.ESC+"[Z";break}y.key=d.C0.HT,y.cancel=!0;break;case 13:y.key=c.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,y.cancel=!0;break;case 27:y.key=d.C0.ESC,c.altKey&&(y.key=d.C0.ESC+d.C0.ESC),y.cancel=!0;break;case 37:if(c.metaKey)break;g?(y.key=d.C0.ESC+"[1;"+(g+1)+"D",y.key===d.C0.ESC+"[1;3D"&&(y.key=d.C0.ESC+(x?"b":"[1;5D"))):y.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(c.metaKey)break;g?(y.key=d.C0.ESC+"[1;"+(g+1)+"C",y.key===d.C0.ESC+"[1;3C"&&(y.key=d.C0.ESC+(x?"f":"[1;5C"))):y.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(c.metaKey)break;g?(y.key=d.C0.ESC+"[1;"+(g+1)+"A",x||y.key!==d.C0.ESC+"[1;3A"||(y.key=d.C0.ESC+"[1;5A")):y.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(c.metaKey)break;g?(y.key=d.C0.ESC+"[1;"+(g+1)+"B",x||y.key!==d.C0.ESC+"[1;3B"||(y.key=d.C0.ESC+"[1;5B")):y.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(y.key=d.C0.ESC+"[2~");break;case 46:y.key=g?d.C0.ESC+"[3;"+(g+1)+"~":d.C0.ESC+"[3~";break;case 36:y.key=g?d.C0.ESC+"[1;"+(g+1)+"H":_?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:y.key=g?d.C0.ESC+"[1;"+(g+1)+"F":_?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:c.shiftKey?y.type=2:c.ctrlKey?y.key=d.C0.ESC+"[5;"+(g+1)+"~":y.key=d.C0.ESC+"[5~";break;case 34:c.shiftKey?y.type=3:c.ctrlKey?y.key=d.C0.ESC+"[6;"+(g+1)+"~":y.key=d.C0.ESC+"[6~";break;case 112:y.key=g?d.C0.ESC+"[1;"+(g+1)+"P":d.C0.ESC+"OP";break;case 113:y.key=g?d.C0.ESC+"[1;"+(g+1)+"Q":d.C0.ESC+"OQ";break;case 114:y.key=g?d.C0.ESC+"[1;"+(g+1)+"R":d.C0.ESC+"OR";break;case 115:y.key=g?d.C0.ESC+"[1;"+(g+1)+"S":d.C0.ESC+"OS";break;case 116:y.key=g?d.C0.ESC+"[15;"+(g+1)+"~":d.C0.ESC+"[15~";break;case 117:y.key=g?d.C0.ESC+"[17;"+(g+1)+"~":d.C0.ESC+"[17~";break;case 118:y.key=g?d.C0.ESC+"[18;"+(g+1)+"~":d.C0.ESC+"[18~";break;case 119:y.key=g?d.C0.ESC+"[19;"+(g+1)+"~":d.C0.ESC+"[19~";break;case 120:y.key=g?d.C0.ESC+"[20;"+(g+1)+"~":d.C0.ESC+"[20~";break;case 121:y.key=g?d.C0.ESC+"[21;"+(g+1)+"~":d.C0.ESC+"[21~";break;case 122:y.key=g?d.C0.ESC+"[23;"+(g+1)+"~":d.C0.ESC+"[23~";break;case 123:y.key=g?d.C0.ESC+"[24;"+(g+1)+"~":d.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(x&&!C||!c.altKey||c.metaKey)!x||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?y.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(y.key=d.C0.US),c.key==="@"&&(y.key=d.C0.NUL)):c.keyCode===65&&(y.type=1);else{const b=v[c.keyCode],S=b==null?void 0:b[c.shiftKey?1:0];if(S)y.key=d.C0.ESC+S;else if(c.keyCode>=65&&c.keyCode<=90){const w=c.ctrlKey?c.keyCode-64:c.keyCode+32;let T=String.fromCharCode(w);c.shiftKey&&(T=T.toUpperCase()),y.key=d.C0.ESC+T}else if(c.keyCode===32)y.key=d.C0.ESC+(c.ctrlKey?d.C0.NUL:" ");else if(c.key==="Dead"&&c.code.startsWith("Key")){let w=c.code.slice(3,4);c.shiftKey||(w=w.toLowerCase()),y.key=d.C0.ESC+w,y.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?y.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?y.key=d.C0.NUL:c.keyCode>=51&&c.keyCode<=55?y.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?y.key=d.C0.DEL:c.keyCode===219?y.key=d.C0.ESC:c.keyCode===220?y.key=d.C0.FS:c.keyCode===221&&(y.key=d.C0.GS)}return y}},482:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},o.utf32ToString=function(u,d=0,v=u.length){let c="";for(let _=d;_<v;++_){let x=u[_];x>65535?(x-=65536,c+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):c+=String.fromCharCode(x)}return c},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const v=u.length;if(!v)return 0;let c=0,_=0;if(this._interim){const x=u.charCodeAt(_++);56320<=x&&x<=57343?d[c++]=1024*(this._interim-55296)+x-56320+65536:(d[c++]=this._interim,d[c++]=x),this._interim=0}for(let x=_;x<v;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=v)return this._interim=C,c;const y=u.charCodeAt(x);56320<=y&&y<=57343?d[c++]=1024*(C-55296)+y-56320+65536:(d[c++]=C,d[c++]=y)}else C!==65279&&(d[c++]=C)}return c}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const v=u.length;if(!v)return 0;let c,_,x,C,y=0,g=0,b=0;if(this.interim[0]){let T=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let R,L=0;for(;(R=63&this.interim[++L])&&L<4;)D<<=6,D|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=A-L;for(;b<M;){if(b>=v)return 0;if(R=u[b++],(192&R)!=128){b--,T=!0;break}this.interim[L++]=R,D<<=6,D|=63&R}T||(A===2?D<128?b--:d[y++]=D:A===3?D<2048||D>=55296&&D<=57343||D===65279||(d[y++]=D):D<65536||D>1114111||(d[y++]=D)),this.interim.fill(0)}const S=v-4;let w=b;for(;w<v;){for(;!(!(w<S)||128&(c=u[w])||128&(_=u[w+1])||128&(x=u[w+2])||128&(C=u[w+3]));)d[y++]=c,d[y++]=_,d[y++]=x,d[y++]=C,w+=4;if(c=u[w++],c<128)d[y++]=c;else if((224&c)==192){if(w>=v)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(g=(31&c)<<6|63&_,g<128){w--;continue}d[y++]=g}else if((240&c)==224){if(w>=v)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=v)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(g=(15&c)<<12|(63&_)<<6|63&x,g<2048||g>=55296&&g<=57343||g===65279)continue;d[y++]=g}else if((248&c)==240){if(w>=v)return this.interim[0]=c,y;if(_=u[w++],(192&_)!=128){w--;continue}if(w>=v)return this.interim[0]=c,this.interim[1]=_,y;if(x=u[w++],(192&x)!=128){w--;continue}if(w>=v)return this.interim[0]=c,this.interim[1]=_,this.interim[2]=x,y;if(C=u[w++],(192&C)!=128){w--;continue}if(g=(7&c)<<18|(63&_)<<12|(63&x)<<6|63&C,g<65536||g>1114111)continue;d[y++]=g}}return y}}},225:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=u(1480),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<v.length;++x)_.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,y){let g,b=0,S=y.length-1;if(C<y[0][0]||C>y[S][1])return!1;for(;S>=b;)if(g=b+S>>1,C>y[g][1])b=g+1;else{if(!(C<y[g][0]))return!0;S=g-1}return!1})(x,c)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let y=this.wcwidth(x),g=y===0&&C!==0;if(g){const b=d.UnicodeService.extractWidth(C);b===0?g=!1:b>y&&(y=b)}return d.UnicodeService.createPropertyValue(0,y,g)}}},5981:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const d=u(8460),v=u(844);class c extends v.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const y=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const g=this._writeBuffer[this._bufferOffset],b=this._action(g,C);if(b){const w=T=>Date.now()-y>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(y,T);return void b.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(w)}const S=this._callbacks[this._bufferOffset];if(S&&S(),this._bufferOffset++,this._pendingData-=g.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=c},5941:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function v(c,_){const x=c.toString(16),C=x.length<2?"0"+x:x;switch(_){case 4:return x[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}o.parseColor=function(c){if(!c)return;let _=c.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const x=u.exec(_);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),d.exec(_)&&[3,6,9,12].includes(_.length))){const x=_.length/3,C=[0,0,0];for(let y=0;y<3;++y){const g=parseInt(_.slice(x*y,x*y+x),16);C[y]=x===1?g<<4:x===2?g:x===3?g>>4:g>>8}return C}},o.toRgbString=function(c,_=16){const[x,C,y]=c;return`rgb:${v(x,_)}/${v(C,_)}/${v(y,_)}`}},5770:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const d=u(482),v=u(8742),c=u(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(C,y){this._handlers[C]===void 0&&(this._handlers[C]=[]);const g=this._handlers[C];return g.push(y),{dispose:()=>{const b=g.indexOf(y);b!==-1&&g.splice(b,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(C,y){if(this.reset(),this._ident=C,this._active=this._handlers[C]||_,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(C,y,g){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(C,y,g);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,y,g))}unhook(C,y=!0){if(this._active.length){let g=!1,b=this._active.length-1,S=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,g=y,S=this._stack.fallThrough,this._stack.paused=!1),!S&&g===!1){for(;b>=0&&(g=this._active[b].unhook(C),g!==!0);b--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,g;b--}for(;b>=0;b--)if(g=this._active[b].unhook(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,g}else this._handlerFb(this._ident,"UNHOOK",C);this._active=_,this._ident=0}};const x=new v.Params;x.addParam(0),o.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,y,g){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,y,g),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let y=!1;if(this._hitLimit)y=!1;else if(C&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then((g=>(this._params=x,this._data="",this._hitLimit=!1,g)));return this._params=x,this._data="",this._hitLimit=!1,y}}},2015:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const d=u(844),v=u(8742),c=u(6242),_=u(6351);class x{constructor(b){this.table=new Uint8Array(b)}setDefault(b,S){this.table.fill(b<<4|S)}add(b,S,w,T){this.table[S<<8|b]=w<<4|T}addMany(b,S,w,T){for(let D=0;D<b.length;D++)this.table[S<<8|b[D]]=w<<4|T}}o.TransitionTable=x;const C=160;o.VT500_TRANSITION_TABLE=(function(){const g=new x(4095),b=Array.apply(null,Array(256)).map(((L,A)=>A)),S=(L,A)=>b.slice(L,A),w=S(32,127),T=S(0,24);T.push(25),T.push.apply(T,S(28,32));const D=S(0,14);let R;for(R in g.setDefault(1,0),g.addMany(w,0,2,0),D)g.addMany([24,26,153,154],R,3,0),g.addMany(S(128,144),R,3,0),g.addMany(S(144,152),R,3,0),g.add(156,R,0,0),g.add(27,R,11,1),g.add(157,R,4,8),g.addMany([152,158,159],R,0,7),g.add(155,R,11,3),g.add(144,R,11,9);return g.addMany(T,0,3,0),g.addMany(T,1,3,1),g.add(127,1,0,1),g.addMany(T,8,0,8),g.addMany(T,3,3,3),g.add(127,3,0,3),g.addMany(T,4,3,4),g.add(127,4,0,4),g.addMany(T,6,3,6),g.addMany(T,5,3,5),g.add(127,5,0,5),g.addMany(T,2,3,2),g.add(127,2,0,2),g.add(93,1,4,8),g.addMany(w,8,5,8),g.add(127,8,5,8),g.addMany([156,27,24,26,7],8,6,0),g.addMany(S(28,32),8,0,8),g.addMany([88,94,95],1,0,7),g.addMany(w,7,0,7),g.addMany(T,7,0,7),g.add(156,7,0,0),g.add(127,7,0,7),g.add(91,1,11,3),g.addMany(S(64,127),3,7,0),g.addMany(S(48,60),3,8,4),g.addMany([60,61,62,63],3,9,4),g.addMany(S(48,60),4,8,4),g.addMany(S(64,127),4,7,0),g.addMany([60,61,62,63],4,0,6),g.addMany(S(32,64),6,0,6),g.add(127,6,0,6),g.addMany(S(64,127),6,0,0),g.addMany(S(32,48),3,9,5),g.addMany(S(32,48),5,9,5),g.addMany(S(48,64),5,0,6),g.addMany(S(64,127),5,7,0),g.addMany(S(32,48),4,9,5),g.addMany(S(32,48),1,9,2),g.addMany(S(32,48),2,9,2),g.addMany(S(48,127),2,10,0),g.addMany(S(48,80),1,10,0),g.addMany(S(81,88),1,10,0),g.addMany([89,90,92],1,10,0),g.addMany(S(96,127),1,10,0),g.add(80,1,11,9),g.addMany(T,9,0,9),g.add(127,9,0,9),g.addMany(S(28,32),9,0,9),g.addMany(S(32,48),9,9,12),g.addMany(S(48,60),9,8,10),g.addMany([60,61,62,63],9,9,10),g.addMany(T,11,0,11),g.addMany(S(32,128),11,0,11),g.addMany(S(28,32),11,0,11),g.addMany(T,10,0,10),g.add(127,10,0,10),g.addMany(S(28,32),10,0,10),g.addMany(S(48,60),10,8,10),g.addMany([60,61,62,63],10,0,11),g.addMany(S(32,48),10,9,12),g.addMany(T,12,0,12),g.add(127,12,0,12),g.addMany(S(28,32),12,0,12),g.addMany(S(32,48),12,9,12),g.addMany(S(48,64),12,0,11),g.addMany(S(64,127),12,12,13),g.addMany(S(64,127),10,12,13),g.addMany(S(64,127),9,12,13),g.addMany(T,13,13,13),g.addMany(w,13,13,13),g.add(127,13,0,13),g.addMany([27,156,24,26],13,14,0),g.add(C,0,2,0),g.add(C,8,5,8),g.add(C,6,0,6),g.add(C,11,0,11),g.add(C,13,13,13),g})();class y extends d.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(S,w,T)=>{},this._executeHandlerFb=S=>{},this._csiHandlerFb=(S,w)=>{},this._escHandlerFb=S=>{},this._errorHandlerFb=S=>S,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new c.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,S=[64,126]){let w=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(w=b.prefix.charCodeAt(0),w&&60>w||w>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let D=0;D<b.intermediates.length;++D){const R=b.intermediates.charCodeAt(D);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");w<<=8,w|=R}}if(b.final.length!==1)throw new Error("final must be a single byte");const T=b.final.charCodeAt(0);if(S[0]>T||T>S[1])throw new Error(`final must be in range ${S[0]} .. ${S[1]}`);return w<<=8,w|=T,w}identToString(b){const S=[];for(;b;)S.push(String.fromCharCode(255&b)),b>>=8;return S.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,S){const w=this._identifier(b,[48,126]);this._escHandlers[w]===void 0&&(this._escHandlers[w]=[]);const T=this._escHandlers[w];return T.push(S),{dispose:()=>{const D=T.indexOf(S);D!==-1&&T.splice(D,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,S){this._executeHandlers[b.charCodeAt(0)]=S}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,S){const w=this._identifier(b);this._csiHandlers[w]===void 0&&(this._csiHandlers[w]=[]);const T=this._csiHandlers[w];return T.push(S),{dispose:()=>{const D=T.indexOf(S);D!==-1&&T.splice(D,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,S){return this._dcsParser.registerHandler(this._identifier(b),S)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,S){return this._oscParser.registerHandler(b,S)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,S,w,T,D){this._parseStack.state=b,this._parseStack.handlers=S,this._parseStack.handlerPos=w,this._parseStack.transition=T,this._parseStack.chunkPos=D}parse(b,S,w){let T,D=0,R=0,L=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,L=this._parseStack.chunkPos+1;else{if(w===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(w===!1&&M>-1){for(;M>=0&&(T=A[M](this._params),T!==!0);M--)if(T instanceof Promise)return this._parseStack.handlerPos=M,T}this._parseStack.handlers=[];break;case 4:if(w===!1&&M>-1){for(;M>=0&&(T=A[M](),T!==!0);M--)if(T instanceof Promise)return this._parseStack.handlerPos=M,T}this._parseStack.handlers=[];break;case 6:if(D=b[this._parseStack.chunkPos],T=this._dcsParser.unhook(D!==24&&D!==26,w),T)return T;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(D=b[this._parseStack.chunkPos],T=this._oscParser.end(D!==24&&D!==26,w),T)return T;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,L=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=L;A<S;++A){switch(D=b[A],R=this._transitions.table[this.currentState<<8|(D<160?D:C)],R>>4){case 2:for(let H=A+1;;++H){if(H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}if(++H>=S||(D=b[H])<32||D>126&&D<C){this._printHandler(b,A,H),A=H-1;break}}break;case 3:this._executeHandlers[D]?this._executeHandlers[D]():this._executeHandlerFb(D),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:D,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|D];let j=M?M.length-1:-1;for(;j>=0&&(T=M[j](this._params),T!==!0);j--)if(T instanceof Promise)return this._preserveStack(3,M,j,R,A),T;j<0&&this._csiHandlerFb(this._collect<<8|D,this._params),this.precedingJoinState=0;break;case 8:do switch(D){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(D-48)}while(++A<S&&(D=b[A])>47&&D<60);A--;break;case 9:this._collect<<=8,this._collect|=D;break;case 10:const z=this._escHandlers[this._collect<<8|D];let P=z?z.length-1:-1;for(;P>=0&&(T=z[P](),T!==!0);P--)if(T instanceof Promise)return this._preserveStack(4,z,P,R,A),T;P<0&&this._escHandlerFb(this._collect<<8|D),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|D,this._params);break;case 13:for(let H=A+1;;++H)if(H>=S||(D=b[H])===24||D===26||D===27||D>127&&D<C){this._dcsParser.put(b,A,H),A=H-1;break}break;case 14:if(T=this._dcsParser.unhook(D!==24&&D!==26),T)return this._preserveStack(6,[],0,R,A),T;D===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let H=A+1;;H++)if(H>=S||(D=b[H])<32||D>127&&D<C){this._oscParser.put(b,A,H),A=H-1;break}break;case 6:if(T=this._oscParser.end(D!==24&&D!==26),T)return this._preserveStack(5,[],0,R,A),T;D===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}o.EscapeSequenceParser=y},6242:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const d=u(5770),v=u(482),c=[];o.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const C=this._handlers[_];return C.push(x),{dispose:()=>{const y=C.indexOf(x);y!==-1&&C.splice(y,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,x,C){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(_,x,C);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(_,x,C))}start(){this.reset(),this._state=1}put(_,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const y=_[x++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&C-x>0&&this._put(_,x,C)}}end(_,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,y=this._active.length-1,g=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,C=x,g=this._stack.fallThrough,this._stack.paused=!1),!g&&C===!1){for(;y>=0&&(C=this._active[y].end(_),C!==!0);y--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,C;y--}for(;y>=0;y--)if(C=this._active[y].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",_);this._active=c,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,x,C){this._hitLimit||(this._data+=(0,v.utf32ToString)(_,x,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const u=2147483647;class d{static fromArray(c){const _=new d;if(!c.length)return _;for(let x=Array.isArray(c[0])?1:0;x<c.length;++x){const C=c[x];if(Array.isArray(C))for(let y=0;y<C.length;++y)_.addSubParam(C[y]);else _.addParam(C)}return _}constructor(c=32,_=32){if(this.maxLength=c,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const c=new d(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c}toArray(){const c=[];for(let _=0;_<this.length;++_){c.push(this.params[_]);const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&c.push(Array.prototype.slice.call(this._subParams,x,C))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>u?u:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>u?u:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const _=this._subParamsIdx[c]>>8,x=255&this._subParamsIdx[c];return x-_>0?this._subParams.subarray(_,x):null}getSubParamsAll(){const c={};for(let _=0;_<this.length;++_){const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&(c[_]=this._subParams.slice(x,C))}return c}addDigit(c){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[_-1];x[_-1]=~C?Math.min(10*C+c,u):c}}o.Params=d},5741:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const v={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(v),d.dispose=()=>this._wrappedAddonDispose(v),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===u){d=v;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const d=u(3785),v=u(511);o.BufferApiView=class{constructor(c,_){this._buffer=c,this.type=_}init(c){return this._buffer=c,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(c){const _=this._buffer.lines.get(c);if(_)return new d.BufferLineApiView(_)}getNullCell(){return new v.CellData}}},3785:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const d=u(511);o.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,c){if(!(v<0||v>=this._line.length))return c?(this._line.loadCell(v,c),c):this._line.loadCell(v,new d.CellData)}translateToString(v,c,_){return this._line.translateToString(v,c,_)}}},8285:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const d=u(8771),v=u(8460),c=u(844);class _ extends c.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=_},7975:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(v=>d(v.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((v,c)=>d(v,c.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(p,o,u){var d=this&&this.__decorate||function(g,b,S,w){var T,D=arguments.length,R=D<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,b,S,w);else for(var L=g.length-1;L>=0;L--)(T=g[L])&&(R=(D<3?T(R):D>3?T(b,S,R):T(b,S))||R);return D>3&&R&&Object.defineProperty(b,S,R),R},v=this&&this.__param||function(g,b){return function(S,w){b(S,w,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const c=u(8460),_=u(844),x=u(5295),C=u(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let y=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(g){super(),this.isUserScrolling=!1,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(g.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(g.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(g,this))}resize(g,b){this.cols=g,this.rows=b,this.buffers.resize(g,b),this._onResize.fire({cols:g,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(g,b=!1){const S=this.buffer;let w;w=this._cachedBlankLine,w&&w.length===this.cols&&w.getFg(0)===g.fg&&w.getBg(0)===g.bg||(w=S.getBlankLine(g,b),this._cachedBlankLine=w),w.isWrapped=b;const T=S.ybase+S.scrollTop,D=S.ybase+S.scrollBottom;if(S.scrollTop===0){const R=S.lines.isFull;D===S.lines.length-1?R?S.lines.recycle().copyFrom(w):S.lines.push(w.clone()):S.lines.splice(D+1,0,w.clone()),R?this.isUserScrolling&&(S.ydisp=Math.max(S.ydisp-1,0)):(S.ybase++,this.isUserScrolling||S.ydisp++)}else{const R=D-T+1;S.lines.shiftElements(T+1,R-1,-1),S.lines.set(D,w.clone())}this.isUserScrolling||(S.ydisp=S.ybase),this._onScroll.fire(S.ydisp)}scrollLines(g,b,S){const w=this.buffer;if(g<0){if(w.ydisp===0)return;this.isUserScrolling=!0}else g+w.ydisp>=w.ybase&&(this.isUserScrolling=!1);const T=w.ydisp;w.ydisp=Math.max(Math.min(w.ydisp+g,w.ybase),0),T!==w.ydisp&&(b||this._onScroll.fire(w.ydisp))}};o.BufferService=y=d([v(0,C.IOptionsService)],y)},7994:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(p,o,u){var d=this&&this.__decorate||function(w,T,D,R){var L,A=arguments.length,M=A<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,T,D,R);else for(var j=w.length-1;j>=0;j--)(L=w[j])&&(M=(A<3?L(M):A>3?L(T,D,M):L(T,D))||M);return A>3&&M&&Object.defineProperty(T,D,M),M},v=this&&this.__param||function(w,T){return function(D,R){T(D,R,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const c=u(2585),_=u(8460),x=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:w=>w.button!==4&&w.action===1&&(w.ctrl=!1,w.alt=!1,w.shift=!1,!0)},VT200:{events:19,restrict:w=>w.action!==32},DRAG:{events:23,restrict:w=>w.action!==32||w.button!==3},ANY:{events:31,restrict:w=>!0}};function y(w,T){let D=(w.ctrl?16:0)|(w.shift?4:0)|(w.alt?8:0);return w.button===4?(D|=64,D|=w.action):(D|=3&w.button,4&w.button&&(D|=64),8&w.button&&(D|=128),w.action===32?D|=32:w.action!==0||T||(D|=3)),D}const g=String.fromCharCode,b={DEFAULT:w=>{const T=[y(w,!1)+32,w.col+32,w.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${g(T[0])}${g(T[1])}${g(T[2])}`},SGR:w=>{const T=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${y(w,!0)};${w.col};${w.row}${T}`},SGR_PIXELS:w=>{const T=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${y(w,!0)};${w.x};${w.y}${T}`}};let S=o.CoreMouseService=class extends x.Disposable{constructor(w,T){super(),this._bufferService=w,this._coreService=T,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const D of Object.keys(C))this.addProtocol(D,C[D]);for(const D of Object.keys(b))this.addEncoding(D,b[D]);this.reset()}addProtocol(w,T){this._protocols[w]=T}addEncoding(w,T){this._encodings[w]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(w){if(!this._protocols[w])throw new Error(`unknown protocol "${w}"`);this._activeProtocol=w,this._onProtocolChange.fire(this._protocols[w].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(w){if(!this._encodings[w])throw new Error(`unknown encoding "${w}"`);this._activeEncoding=w}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(w){if(w.col<0||w.col>=this._bufferService.cols||w.row<0||w.row>=this._bufferService.rows||w.button===4&&w.action===32||w.button===3&&w.action!==32||w.button!==4&&(w.action===2||w.action===3)||(w.col++,w.row++,w.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,w,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(w))return!1;const T=this._encodings[this._activeEncoding](w);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=w,!0}explainEvents(w){return{down:!!(1&w),up:!!(2&w),drag:!!(4&w),move:!!(8&w),wheel:!!(16&w)}}_equalEvents(w,T,D){if(D){if(w.x!==T.x||w.y!==T.y)return!1}else if(w.col!==T.col||w.row!==T.row)return!1;return w.button===T.button&&w.action===T.action&&w.ctrl===T.ctrl&&w.alt===T.alt&&w.shift===T.shift}};o.CoreMouseService=S=d([v(0,c.IBufferService),v(1,c.ICoreService)],S)},6975:function(p,o,u){var d=this&&this.__decorate||function(S,w,T,D){var R,L=arguments.length,A=L<3?w:D===null?D=Object.getOwnPropertyDescriptor(w,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,w,T,D);else for(var M=S.length-1;M>=0;M--)(R=S[M])&&(A=(L<3?R(A):L>3?R(w,T,A):R(w,T))||A);return L>3&&A&&Object.defineProperty(w,T,A),A},v=this&&this.__param||function(S,w){return function(T,D){w(T,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const c=u(1439),_=u(8460),x=u(844),C=u(2585),y=Object.freeze({insertMode:!1}),g=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends x.Disposable{constructor(S,w,T){super(),this._bufferService=S,this._logService=w,this._optionsService=T,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,c.clone)(y),this.decPrivateModes=(0,c.clone)(g)}reset(){this.modes=(0,c.clone)(y),this.decPrivateModes=(0,c.clone)(g)}triggerDataEvent(S,w=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;w&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),w&&this._onUserInput.fire(),this._logService.debug(`sending data "${S}"`,(()=>S.split("").map((D=>D.charCodeAt(0))))),this._onData.fire(S)}triggerBinaryEvent(S){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${S}"`,(()=>S.split("").map((w=>w.charCodeAt(0))))),this._onBinary.fire(S))}};o.CoreService=b=d([v(0,C.IBufferService),v(1,C.ILogService),v(2,C.IOptionsService)],b)},9074:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const d=u(8055),v=u(8460),c=u(844),_=u(6106);let x=0,C=0;class y extends c.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((S=>S==null?void 0:S.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,c.toDisposable)((()=>this.reset())))}registerDecoration(S){if(S.marker.isDisposed)return;const w=new g(S);if(w){const T=w.marker.onDispose((()=>w.dispose()));w.onDispose((()=>{w&&(this._decorations.delete(w)&&this._onDecorationRemoved.fire(w),T.dispose())})),this._decorations.insert(w),this._onDecorationRegistered.fire(w)}return w}reset(){for(const S of this._decorations.values())S.dispose();this._decorations.clear()}*getDecorationsAtCell(S,w,T){let D=0,R=0;for(const L of this._decorations.getKeyIterator(w))D=L.options.x??0,R=D+(L.options.width??1),S>=D&&S<R&&(!T||(L.options.layer??"bottom")===T)&&(yield L)}forEachDecorationAtCell(S,w,T,D){this._decorations.forEachByKey(w,(R=>{x=R.options.x??0,C=x+(R.options.width??1),S>=x&&S<C&&(!T||(R.options.layer??"bottom")===T)&&D(R)}))}}o.DecorationService=y;class g extends c.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(S){super(),this.options=S,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=S.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const d=u(2585),v=u(8343);class c{constructor(...x){this._entries=new Map;for(const[C,y]of x)this.set(C,y)}set(x,C){const y=this._entries.get(x);return this._entries.set(x,C),y}forEach(x){for(const[C,y]of this._entries.entries())x(C,y)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}o.ServiceCollection=c,o.InstantiationService=class{constructor(){this._services=new c,this._services.set(d.IInstantiationService,this)}setService(_,x){this._services.set(_,x)}getService(_){return this._services.get(_)}createInstance(_,...x){const C=(0,v.getServiceDependencies)(_).sort(((b,S)=>b.index-S.index)),y=[];for(const b of C){const S=this._services.get(b.id);if(!S)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${b.id}.`);y.push(S)}const g=C.length>0?C[0].index:x.length;if(x.length!==g)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${g+1} conflicts with ${x.length} static arguments`);return new _(...x,...y)}}},7866:function(p,o,u){var d=this&&this.__decorate||function(g,b,S,w){var T,D=arguments.length,R=D<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,b,S,w);else for(var L=g.length-1;L>=0;L--)(T=g[L])&&(R=(D<3?T(R):D>3?T(b,S,R):T(b,S))||R);return D>3&&R&&Object.defineProperty(b,S,R),R},v=this&&this.__param||function(g,b){return function(S,w){b(S,w,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const c=u(844),_=u(2585),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,y=o.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let b=0;b<g.length;b++)typeof g[b]=="function"&&(g[b]=g[b]())}_log(g,b,S){this._evalLazyOptionalParams(S),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...S)}trace(g,...b){var S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.trace.bind(this._optionsService.options.logger))??console.log,g,b)}debug(g,...b){var S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.debug.bind(this._optionsService.options.logger))??console.log,g,b)}info(g,...b){var S;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.info.bind(this._optionsService.options.logger))??console.info,g,b)}warn(g,...b){var S;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.warn.bind(this._optionsService.options.logger))??console.warn,g,b)}error(g,...b){var S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((S=this._optionsService.options.logger)==null?void 0:S.error.bind(this._optionsService.options.logger))??console.error,g,b)}};o.LogService=y=d([v(0,_.IOptionsService)],y),o.setTraceLogger=function(g){C=g},o.traceCall=function(g,b,S){if(typeof S.value!="function")throw new Error("not supported");const w=S.value;S.value=function(...T){if(C.logLevel!==_.LogLevelEnum.TRACE)return w.apply(this,T);C.trace(`GlyphRenderer#${w.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const D=w.apply(this,T);return C.trace(`GlyphRenderer#${w.name} return`,D),D}}},7302:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const d=u(8460),v=u(844),c=u(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:c.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends v.Disposable{constructor(y){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const g={...o.DEFAULT_OPTIONS};for(const b in y)if(b in g)try{const S=y[b];g[b]=this._sanitizeAndValidateOption(b,S)}catch(S){console.error(S)}this.rawOptions=g,this.options={...g},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(y,g){return this.onOptionChange((b=>{b===y&&g(this.rawOptions[y])}))}onMultipleOptionChange(y,g){return this.onOptionChange((b=>{y.indexOf(b)!==-1&&g()}))}_setupOptions(){const y=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},g=(b,S)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);S=this._sanitizeAndValidateOption(b,S),this.rawOptions[b]!==S&&(this.rawOptions[b]=S,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const S={get:y.bind(this,b),set:g.bind(this,b)};Object.defineProperty(this.options,b,S)}}_sanitizeAndValidateOption(y,g){switch(y){case"cursorStyle":if(g||(g=o.DEFAULT_OPTIONS[y]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(g))throw new Error(`"${g}" is not a valid value for ${y}`);break;case"wordSeparator":g||(g=o.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof g=="number"&&1<=g&&g<=1e3)break;g=_.includes(g)?g:o.DEFAULT_OPTIONS[y];break;case"cursorWidth":g=Math.floor(g);case"lineHeight":case"tabStopWidth":if(g<1)throw new Error(`${y} cannot be less than 1, value: ${g}`);break;case"minimumContrastRatio":g=Math.max(1,Math.min(21,Math.round(10*g)/10));break;case"scrollback":if((g=Math.min(g,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${g}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(g<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${g}`);break;case"rows":case"cols":if(!g&&g!==0)throw new Error(`${y} must be numeric, value: ${g}`);break;case"windowsPty":g=g??{}}return g}}o.OptionsService=x},2660:function(p,o,u){var d=this&&this.__decorate||function(x,C,y,g){var b,S=arguments.length,w=S<3?C:g===null?g=Object.getOwnPropertyDescriptor(C,y):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(x,C,y,g);else for(var T=x.length-1;T>=0;T--)(b=x[T])&&(w=(S<3?b(w):S>3?b(C,y,w):b(C,y))||w);return S>3&&w&&Object.defineProperty(C,y,w),w},v=this&&this.__param||function(x,C){return function(y,g){C(y,g,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const c=u(2585);let _=o.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const T=C.addMarker(C.ybase+C.y),D={data:x,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(D,T))),this._dataByLinkId.set(D.id,D),D.id}const y=x,g=this._getEntryIdKey(y),b=this._entriesWithId.get(g);if(b)return this.addLineToLink(b.id,C.ybase+C.y),b.id;const S=C.addMarker(C.ybase+C.y),w={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(w,S))),this._entriesWithId.set(w.key,w),this._dataByLinkId.set(w.id,w),w.id}addLineToLink(x,C){const y=this._dataByLinkId.get(x);if(y&&y.lines.every((g=>g.line!==C))){const g=this._bufferService.buffer.addMarker(C);y.lines.push(g),g.onDispose((()=>this._removeMarkerFromLink(y,g)))}}getLinkData(x){var C;return(C=this._dataByLinkId.get(x))==null?void 0:C.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const y=x.lines.indexOf(C);y!==-1&&(x.lines.splice(y,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};o.OscLinkService=_=d([v(0,c.IBufferService)],_)},8343:(p,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const u="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(v){return v[d]||[]},o.createDecorator=function(v){if(o.serviceRegistry.has(v))return o.serviceRegistry.get(v);const c=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,g,b){g[u]===g?g[d].push({id:y,index:b}):(g[d]=[{id:y,index:b}],g[u]=g)})(c,_,C)};return c.toString=()=>v,o.serviceRegistry.set(v,c),c}},2585:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const d=u(8343);var v;o.IBufferService=(0,d.createDecorator)("BufferService"),o.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),o.ICoreService=(0,d.createDecorator)("CoreService"),o.ICharsetService=(0,d.createDecorator)("CharsetService"),o.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(v||(o.LogLevelEnum=v={})),o.ILogService=(0,d.createDecorator)("LogService"),o.IOptionsService=(0,d.createDecorator)("OptionsService"),o.IOscLinkService=(0,d.createDecorator)("OscLinkService"),o.IUnicodeService=(0,d.createDecorator)("UnicodeService"),o.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(p,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=u(8460),v=u(225);class c{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,y=!1){return(16777215&x)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,y=0;const g=x.length;for(let b=0;b<g;++b){let S=x.charCodeAt(b);if(55296<=S&&S<=56319){if(++b>=g)return C+this.wcwidth(S);const D=x.charCodeAt(b);56320<=D&&D<=57343?S=1024*(S-55296)+D-56320+65536:C+=this.wcwidth(D)}const w=this.charProperties(S,y);let T=c.extractWidth(w);c.extractShouldJoin(w)&&(T-=c.extractWidth(y)),C+=T,y=w}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}o.UnicodeService=c}},s={};function l(p){var o=s[p];if(o!==void 0)return o.exports;var u=s[p]={exports:{}};return r[p].call(u.exports,u,u.exports,l),u.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.Terminal=void 0;const o=l(9042),u=l(3236),d=l(844),v=l(5741),c=l(8285),_=l(7975),x=l(7090),C=["cols","rows"];class y extends d.Disposable{constructor(b){super(),this._core=this.register(new u.Terminal(b)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const S=T=>this._core.options[T],w=(T,D)=>{this._checkReadonlyOptions(T),this._core.options[T]=D};for(const T in this._core.options){const D={get:S.bind(this,T),set:w.bind(this,T)};Object.defineProperty(this._publicOptions,T,D)}}_checkReadonlyOptions(b){if(C.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new c.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let S="none";switch(this._core.coreMouseService.activeProtocol){case"X10":S="x10";break;case"VT200":S="vt200";break;case"DRAG":S="drag";break;case"ANY":S="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:S,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const S in b)this._publicOptions[S]=b[S]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,S=!0){this._core.input(b,S)}resize(b,S){this._verifyIntegers(b,S),this._core.resize(b,S)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,S,w){this._verifyIntegers(b,S,w),this._core.select(b,S,w)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,S){this._verifyIntegers(b,S),this._core.selectLines(b,S)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,S){this._core.write(b,S)}writeln(b,S){this._core.write(b),this._core.write(`\r
638
+ `,S)}paste(b){this._core.paste(b)}refresh(b,S){this._verifyIntegers(b,S),this._core.refresh(b,S)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const S of b)if(S===1/0||isNaN(S)||S%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const S of b)if(S&&(S===1/0||isNaN(S)||S%1!=0||S<0))throw new Error("This API only accepts positive integers")}}p.Terminal=y})(),h})()))})(Cm)),Cm.exports}var mB=pB();const gB=/(?:[A-Za-z]:[\\/]|\.{1,2}[\\/]|[\\/])?(?:[\w.@-]+[\\/])+[\w.@-]+\.[A-Za-z0-9]{1,10}(?::\d+(?::\d+)?)?/g;function ad(e){var s;let i=e;if(/^file:/i.test(i))try{i=decodeURIComponent(new URL(i).pathname).replace(/^\/([A-Za-z]:)/,"$1")}catch{return null}i=i.replace(/\\/g,"/").replace(/:\d+(?::\d+)?$/,"");const r=(s=_e.getState().health)==null?void 0:s.projectRoot.replace(/\\/g,"/").replace(/\/$/,"");if(/^([A-Za-z]:)?\//.test(i)){if(!r||!i.toLowerCase().startsWith(`${r.toLowerCase()}/`))return null;i=i.slice(r.length+1)}return i=i.replace(/^(\.\/)+/,""),i&&!i.startsWith("../")?i:null}function zv(e){if(ad(e))return null;const i=e.replace(/:\d+(?::\d+)?$/,"");return/^([A-Za-z]:[\\/]|\/)/.test(i)?i:null}const Cw=new Map;function vB(e){const i=ad(e),r=i?null:zv(e),s=i??r;if(!s)return Promise.resolve(!1);const l=Cw.get(s);if(l&&Date.now()-l.at<3e4)return l.exists;const h=(i?Jt.stat(i):fetch(`/api/local-file/stat?path=${encodeURIComponent(r)}`).then(p=>p.json())).then(p=>p.exists,()=>!1);return Cw.set(s,{at:Date.now(),exists:h}),h}function _B(e,i){var d;const r=e.buffer.active,s=v=>{var c;return((c=r.getLine(v))==null?void 0:c.translateToString(!0))??""},l=v=>{const c=r.getLine(v+1);return!!(c&&(c.isWrapped||s(v).length>=e.cols-2&&/^ {1,4}\S/.test(s(v+1))))};let h=i;for(;h>0&&l(h-1);)h-=1;let p=i;for(;p<r.length-1&&l(p);)p+=1;let o="";const u=[];for(let v=h;v<=p;v+=1){const c=s(v),_=v>h?((d=/^ {1,4}(?=\S)/.exec(c))==null?void 0:d[0].length)??0:0;for(let x=_;x<c.length;x+=1)u.push({x:x+1,y:v+1});o+=c.slice(_)}return{text:o,cells:u}}function xB(e){var l;const i=[],r=(l=_e.getState().health)==null?void 0:l.projectRoot.replace(/\\/g,"/").replace(/\/$/,"").toLowerCase(),s=e.replace(/\\/g,"/").toLowerCase();for(let h=r?s.indexOf(`${r}/`):-1;r&&h!==-1;h=s.indexOf(`${r}/`,h+1)){const p=/^[^\s:*?"<>|()]+(?::\d+(?::\d+)?)?/.exec(e.slice(h+r.length+1));p&&i.push({index:h,text:e.slice(h,h+r.length+1+p[0].length)})}for(const h of e.matchAll(gB)){const p=h.index;i.some(o=>p<o.index+o.text.length&&o.index<p+h[0].length)||/[a-z][\w+.-]*:\/{1,2}\S*$/i.test(e.slice(0,p))||i.push({index:p,text:h[0]})}return i}function kw(e,i,r){if(!e.ctrlKey&&!e.metaKey)return!1;const s=ad(i),l=s?null:zv(i);if(l)return window.open(`/api/local-file?path=${encodeURIComponent(l)}`,"_blank","noopener"),!0;if(!s)return!1;const{sessions:h,go:p}=_e.getState(),o=h.find(u=>u.terminalId===r);return o&&vT(s,o.id),In.getState().pin(s),p({kind:"file",path:s}),!0}const yB=8,Ks=new Map;function Ew(e,i){e.state=i;for(const r of e.listeners)r()}function bB(){const e=[...Ks.values()].filter(r=>!r.mounted);for(const r of e)(r.ended||r.state==="closed")&&r.dispose();const i=[...Ks.values()].filter(r=>!r.mounted).sort((r,s)=>r.usedAt-s.usedAt);for(;Ks.size>yB&&i.length;)i.shift().dispose()}function wB(e){const i=Ks.get(e);if(i&&i.state!=="closed")return i;i==null||i.dispose();const r=new mB.Terminal({cursorBlink:!0,fontFamily:'ui-monospace, "Cascadia Mono", Consolas, SFMono-Regular, Menlo, monospace',fontSize:13,scrollback:1e4,allowProposedApi:!0,rescaleOverlappingGlyphs:!0,linkHandler:{allowNonHttpProtocols:!0,activate:(c,_)=>{/^https?:/i.test(_)?window.open(_,"_blank","noopener"):kw(c,_,e)}},theme:{background:"#141413",foreground:"#f5f4ee",cursor:"#d77757",selectionBackground:"#d7775755"}}),s=new rB.FitAddon;r.loadAddon(s),r.loadAddon(new hB.WebLinksAddon);const l=new oB.SearchAddon;r.loadAddon(l);const h=r.registerLinkProvider({provideLinks:(c,_)=>{const{text:x,cells:C}=_B(r,c-1),y=xB(x).filter(g=>(ad(g.text)||zv(g.text))&&C.slice(g.index,g.index+g.text.length).some(b=>b.y===c));if(!y.length)return _(void 0);Promise.all(y.map(g=>vB(g.text))).then(g=>{const b=y.filter((S,w)=>g[w]).map(S=>({text:S.text,range:{start:C[S.index],end:C[S.index+S.text.length-1]},activate:(w,T)=>void kw(w,T,e)}));_(b.length?b:void 0)})}});r.loadAddon(new cB.Unicode11Addon),r.unicode.activeVersion="11";const p=document.createElement("div");p.className="h-full w-full";const o=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api/terminals/${e}`),u=c=>o.readyState===WebSocket.OPEN&&o.send(JSON.stringify(c)),d={terminalId:e,term:r,fit:s,search:l,element:p,socket:o,state:"connecting",ended:!1,mounted:!1,usedAt:Date.now(),opened:!1,listeners:new Set,send:u,sendSize:()=>u({type:"resize",cols:r.cols,rows:r.rows}),copy:()=>{const c=r.getSelection();return c?(navigator.clipboard.writeText(c).then(()=>_e.getState().notify("Copied."),()=>_e.getState().notify("Could not copy to the clipboard.","error")),r.clearSelection(),!0):!1},dispose:()=>{Ks.get(e)===d&&Ks.delete(e),h.dispose(),v.dispose(),o.onclose=null,o.close(),r.dispose(),p.remove()}};r.attachCustomKeyEventHandler(c=>c.type!=="keydown"||!c.ctrlKey||c.altKey||c.metaKey?!0:c.code==="KeyV"&&!c.shiftKey?!1:c.code==="KeyC"&&r.hasSelection()?(c.preventDefault(),d.copy(),!1):c.code==="KeyF"&&!c.shiftKey&&d.onFind?(c.preventDefault(),d.onFind(),!1):c.key==="Enter"&&!c.shiftKey?(c.preventDefault(),u({type:"input",data:""}),!1):!0),o.onopen=()=>{Ew(d,"open"),d.sendSize(),d.mounted&&r.focus()},o.onmessage=c=>{var x;const _=JSON.parse(c.data);_.type==="output"&&_.data&&r.write(_.data),_.type==="exit"&&(d.ended=!0,r.write(`\r
639
+ \x1B[2m[session ended, exit code ${_.code}]\x1B[0m\r
640
+ `),(x=d.onExit)==null||x.call(d))},o.onclose=()=>{Ew(d,"closed"),d.mounted||d.dispose()};const v=r.onData(c=>u({type:"input",data:c}));return Ks.set(e,d),d}function SB(e,i){if(e.mounted=!0,e.usedAt=Date.now(),i.appendChild(e.element),!e.opened){e.opened=!0,e.term.open(e.element);try{const r=new fB.WebglAddon;r.onContextLoss(()=>r.dispose()),e.term.loadAddon(r)}catch{}}try{e.fit.fit(),e.sendSize()}catch{}requestAnimationFrame(()=>{const r=e.term;if(!e.mounted||r.buffer.active.baseY===0)return;const s=r.buffer.active.viewportY>0?-1:1;r.scrollLines(s),r.scrollLines(-s)}),e.term.focus()}const CB=e=>/\s/.test(e)?`"${e}"`:e;function kB({terminalId:e,onExit:i}){const r=N.useRef(null),s=N.useRef(null),[l,h]=N.useState("connecting"),[p,o]=N.useState(!1),[u,d]=N.useState(!1);N.useEffect(()=>{if(!r.current)return;const c=wB(e);s.current=c;const _=()=>h(c.state);c.listeners.add(_),_(),c.onExit=i,c.onFind=()=>o(!0),SB(c,r.current);const x=new ResizeObserver(()=>{try{c.fit.fit(),c.sendSize()}catch{}});return x.observe(r.current),()=>{x.disconnect(),c.listeners.delete(_),c.onExit=void 0,c.onFind=void 0,c.mounted=!1,c.usedAt=Date.now(),c.element.remove(),s.current=null,bB()}},[e]);const v=async c=>{c.preventDefault(),d(!1);const _=s.current;if(!_)return;const x=[...c.dataTransfer.files];if(!x.length){const C=c.dataTransfer.getData("text/plain");C&&_.term.paste(C),_.term.focus();return}try{const C=[];for(const y of x){const g=await fetch(`${_i()}/drop`,{method:"POST",headers:{"Content-Type":"application/octet-stream","X-File-Name":encodeURIComponent(y.name)},body:y}),b=await g.json().catch(()=>({}));if(!g.ok||!b.path)throw new Error(b.error??`${g.status} ${g.statusText}`);C.push(CB(b.path))}_.term.paste(C.join(" ")+" "),_.term.focus()}catch(C){_e.getState().notify(`Could not drop the file: ${C.message}`,"error")}};return m.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden rounded-lg border bg-[#141413]",onDragOver:c=>{[...c.dataTransfer.types].some(_=>_==="Files"||_==="text/plain")&&(c.preventDefault(),c.dataTransfer.dropEffect="copy",d(!0))},onDragLeave:c=>{c.currentTarget.contains(c.relatedTarget)||d(!1)},onDrop:c=>void v(c),children:[m.jsx("div",{ref:r,className:"terminal-host h-full w-full",onContextMenu:c=>{var _;c.preventDefault(),(_=s.current)==null||_.copy()}}),p&&s.current&&m.jsx(TB,{search:s.current.search,onClose:()=>{var c,_;(c=s.current)==null||c.search.clearDecorations(),o(!1),(_=s.current)==null||_.term.focus()}}),u&&m.jsx("div",{className:"pointer-events-none absolute inset-2 grid place-items-center rounded-lg border-2 border-dashed border-primary/70 bg-primary/10 text-xs text-foreground",children:"Drop to paste its path"}),l==="connecting"&&m.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"connecting..."}),l==="closed"&&m.jsx("div",{className:"absolute bottom-2 right-3 text-[11px] text-muted-foreground",children:"detached"})]})}const EB={matchBackground:"#d7775755",matchOverviewRuler:"#d77757",activeMatchBackground:"#d77757",activeMatchColorOverviewRuler:"#f5f4ee"};function TB({search:e,onClose:i}){const[r,s]=N.useState(""),[l,h]=N.useState(null),p=N.useRef(null);N.useEffect(()=>{var d;(d=p.current)==null||d.focus();const u=e.onDidChangeResults(v=>h({index:v.resultIndex,count:v.resultCount}));return()=>u.dispose()},[e]);const o=(u,d=r)=>{if(!d){e.clearDecorations(),h(null);return}const v={decorations:EB,incremental:!1};u?e.findNext(d,v):e.findPrevious(d,v)};return m.jsxs("div",{className:"absolute right-3 top-2 z-10 flex items-center gap-1 rounded-md border bg-background/95 px-1.5 py-1 shadow-lg",children:[m.jsx("input",{ref:p,value:r,placeholder:"Find","aria-label":"Find in the terminal",onChange:u=>{s(u.target.value),o(!0,u.target.value)},onKeyDown:u=>{u.key==="Escape"?(u.preventDefault(),i()):u.key==="Enter"&&(u.preventDefault(),o(!u.shiftKey))},className:"w-44 bg-transparent px-1 text-xs focus:outline-none"}),m.jsx("span",{className:"min-w-[3.5rem] text-right text-[10px] tabular-nums text-muted-foreground",children:r?l&&l.count?`${l.index+1}/${l.count}`:"none":""}),m.jsx("button",{onClick:()=>o(!1),title:"Previous (Shift+Enter)","aria-label":"Previous match",className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:m.jsx(n4,{size:13})}),m.jsx("button",{onClick:()=>o(!0),title:"Next (Enter)","aria-label":"Next match",className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:m.jsx(ba,{size:13})}),m.jsx("button",{onClick:i,title:"Close (Esc)","aria-label":"Close find",className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:m.jsx(xn,{size:13})})]})}function B5({trigger:e,title:i,icon:r,badge:s,description:l,open:h,onOpenChange:p,children:o}){return m.jsxs(ZS,{open:h,onOpenChange:p,children:[m.jsx(YR,{asChild:!0,children:e}),m.jsxs(tC,{children:[m.jsx(nC,{className:"fixed inset-0 z-50 bg-foreground/30 animate-in fade-in-0"}),m.jsxs(iC,{className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-xl flex-col border-l bg-card shadow-xl focus:outline-none animate-in slide-in-from-right",children:[m.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-3",children:[r,s,m.jsx(sC,{className:"min-w-0 truncate text-sm font-semibold",children:i}),m.jsx(oC,{className:"sr-only",children:l}),m.jsx(aC,{asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon",className:"ml-auto","aria-label":"Close",children:m.jsx(xn,{size:15})})})]}),m.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:o})]})]})]})}function P5({id:e}){const i=_e(w=>w.sessions.find(T=>T.id===e)),r=_e(w=>w.transcriptTicks[e]??0),s=_e(w=>w.ticks.interactions),[l,h]=N.useState(null),[p,o]=N.useState("terminal"),[u,d]=N.useState(!1),v=_e(w=>w.windowed),c=ln(),_=td(),[x,C]=N.useState("idle"),y=N.useRef(!1);if(N.useEffect(()=>{y.current||!i||(y.current=!0,!i.live&&(C("starting"),ve.resumeSession(e).then(()=>C("idle"),w=>{C("failed"),_e.getState().notify(w.message,"error")})))},[e,i]),N.useEffect(()=>{h(null),d(!1),o("terminal")},[e]),N.useEffect(()=>{let w=!1;return ve.session(e).then(T=>!w&&h(T),()=>!w&&d(!0)),()=>{w=!0}},[e,r,s,i==null?void 0:i.status,i==null?void 0:i.terminalId]),!i&&u)return m.jsx(Gt,{title:"This session is gone.",hint:"Its transcript may have been cleaned up by Claude Code.",className:"m-6"});if(!i)return m.jsx("div",{className:"p-6 text-xs text-muted-foreground",children:"Loading..."});const g=((l==null?void 0:l.interactions)??[]).filter(w=>w.status==="open"),b=()=>qe(()=>ve.resumeSession(e)),S=()=>c({title:"Stop this session?",description:"The conversation is kept for a later resume.",confirmLabel:"Stop",tone:"destructive",run:async()=>{await ve.killSession(e),ed([e])}});return m.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[m.jsxs("header",{className:"flex items-center gap-3 border-b px-3 py-3 sm:px-5",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(rd,{session:i}),m.jsx("h1",{className:"truncate text-sm font-semibold",children:i.title})]}),m.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] text-muted-foreground [&>*]:shrink-0",children:[m.jsx(Xe,{tone:i.status==="waiting"?"warning":i.status==="running"||i.status==="idle"?"success":i.status==="done"?"on":"off",children:i.status}),m.jsx(Xe,{tone:"off",children:i.origin==="external"?"started in a terminal":`from ${i.origin}`}),i.category&&m.jsxs(Xe,{tone:"off",children:["category: ",i.category]}),i.purpose&&m.jsxs(Xe,{tone:"on",icon:ec,children:["hub task: ",i.purpose.title]}),m.jsx("span",{children:Wi(i.startedAt)}),i.tokens&&m.jsxs("span",{children:["· ",Pn(us(i.tokens))," tokens"]}),m.jsxs("span",{className:"inline-flex min-w-0 !shrink items-center gap-1 font-mono",title:`Claude Code session id: ${i.id}`,children:[m.jsx("span",{className:"truncate",children:i.id}),m.jsx(io,{text:i.id})]})]})]}),m.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[m.jsx(ge,{variant:"ghost",size:"icon",title:"Rename","aria-label":"Rename",onClick:()=>void _.rename(i),children:m.jsx(Xi,{size:13})}),m.jsx(ge,{variant:"ghost",size:"icon",title:i.live?"Stop and delete permanently":"Delete permanently","aria-label":"Delete permanently",onClick:()=>void _.remove(i),children:m.jsx(Ri,{size:13})}),!v&&m.jsxs(ge,{variant:"ghost",title:"Open in a window of its own","aria-label":"New window",onClick:()=>Dg({kind:"session",id:e}),children:[m.jsx(Sa,{size:12})," ",m.jsx("span",{className:"hidden sm:inline",children:"New window"})]}),i.live?m.jsxs(ge,{variant:"muted",title:"Stop","aria-label":"Stop",onClick:()=>void S(),children:[m.jsx(jh,{size:12})," ",m.jsx("span",{className:"hidden sm:inline",children:"Stop"})]}):m.jsxs(ge,{variant:"primary",title:"Resume here","aria-label":"Resume here",onClick:()=>void b(),children:[m.jsx(va,{size:12})," ",m.jsx("span",{className:"hidden sm:inline",children:"Resume here"})]})]})]}),m.jsx("div",{className:"no-scrollbar flex gap-1 overflow-x-auto border-b px-2 sm:px-4",children:[["terminal","Terminal"],["setup","Setup"],["activity","Activity"],["toolset","Toolset"],["interactions",`Interactions${l!=null&&l.interactions.length?` (${l.interactions.length})`:""}`]].map(([w,T])=>m.jsx("button",{onClick:()=>o(w),className:ye("shrink-0 whitespace-nowrap border-b-2 px-3 py-2 text-xs transition-colors",p===w?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:T},w))}),m.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[m.jsxs("div",{className:ye("relative h-full p-2 sm:p-3",p!=="terminal"&&"hidden"),children:[m.jsxs("div",{className:"absolute right-4 top-4 z-10 flex gap-1.5 sm:right-5 sm:top-5",children:[m.jsx(AB,{items:g}),i.purpose&&(l==null?void 0:l.purposeNote)&&m.jsx(RB,{title:i.purpose.title,note:l.purposeNote})]}),i.terminalId?m.jsx(kB,{terminalId:i.terminalId},i.terminalId):m.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 rounded-lg border border-dashed",children:[x==="starting"?m.jsx("div",{className:"text-xs text-muted-foreground",children:"Starting the terminal..."}):m.jsxs(ge,{variant:"primary",size:"md",onClick:()=>void b(),children:[m.jsx(va,{size:13})," Start the terminal again"]}),i.done&&m.jsxs("div",{className:"card max-w-lg p-3 text-xs",children:[m.jsx("div",{className:"font-medium",children:i.done.summary}),Object.entries(i.done.deliverables??{}).map(([w,T])=>m.jsxs("div",{className:"mt-1 text-[11px]",children:[m.jsxs("span",{className:"font-medium",children:[w,": "]}),m.jsx("span",{className:"break-all text-muted-foreground",children:typeof T=="string"?T:JSON.stringify(T)})]},w))]})]})]}),p==="activity"&&m.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?m.jsx(X9,{data:l}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="setup"&&m.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?m.jsx(Z9,{sessionId:e,live:i.live,current:l.setup}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="toolset"&&m.jsx("div",{className:"h-full overflow-y-auto p-4",children:l?m.jsx(nB,{sessionId:e,live:i.live,current:l.toolset}):m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading..."})}),p==="interactions"&&m.jsx("div",{className:"h-full space-y-2 overflow-y-auto p-4",children:l!=null&&l.interactions.length?l.interactions.map(w=>m.jsx(Wl,{interaction:w},w.id)):m.jsx(Gt,{title:"Nothing asked yet.",hint:"Permission requests, questions, ends of turns and MCP suggestions from this session land here and on every channel."})})]})]})}function RB({title:e,note:i}){return m.jsx(B5,{title:e,icon:m.jsx(ec,{size:14,className:"shrink-0 text-primary"}),badge:m.jsx(Xe,{tone:"on",children:"hub task"}),description:"Parameters, samples and API of this hub task.",trigger:m.jsxs(ge,{variant:"primary",className:"shadow-md",title:"What this hub task is for: parameters, samples, API",children:[m.jsx(J3,{size:12})," ",m.jsx("span",{className:"hidden sm:inline",children:"Params & samples"})]}),children:m.jsx(Nv,{className:"text-xs",children:i.replace(/^# .*\n+/,"")})})}function AB({items:e}){const[i,r]=N.useState(!1);return N.useEffect(()=>{i&&!e.length&&r(!1)},[i,e.length]),e.length?m.jsx(B5,{open:i,onOpenChange:r,title:`${e.length} waiting on you`,icon:m.jsx(ds,{size:14,className:"shrink-0 text-severity-warning"}),description:"Questions and requests this session is waiting on.",trigger:m.jsxs(ge,{className:"bg-severity-warning text-background shadow-md hover:bg-severity-warning/90",title:"What this session is waiting on",children:[m.jsx(ds,{size:12,className:"animate-status-pulse"})," ",e.length," ",m.jsx("span",{className:"hidden sm:inline",children:"waiting"})]}),children:m.jsx("div",{className:"space-y-2",children:e.map(s=>m.jsx(Wl,{interaction:s},s.id))})}):null}function z5(){const[e,i]=N.useState(null),[r,s]=N.useState(!1),[l,h]=N.useState(!1);N.useEffect(()=>{let v=!0;return ve.hub().then(c=>v&&i(c.claudeStatus)).catch(()=>{}),()=>{v=!1}},[]);const p=async()=>{s(!0);try{i(await ve.checkClaude())}catch{}finally{s(!1)}},o=(e==null?void 0:e.problem)??null,u=e===null;if(N.useEffect(()=>{if(!o&&!u)return;const v=setInterval(()=>void(o?p():ve.hub().then(c=>i(c.claudeStatus)).catch(()=>{})),o?3e4:5e3);return()=>clearInterval(v)},[o,u]),!(e!=null&&e.problem))return null;const d=()=>{var v;(v=navigator.clipboard)==null||v.writeText(e.fix??"").then(()=>{h(!0),setTimeout(()=>h(!1),1500)})};return m.jsxs("div",{role:"alert",className:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b bg-destructive/15 px-5 py-2 text-xs",children:[m.jsx(Zw,{size:14,className:"shrink-0 text-destructive"}),m.jsxs("span",{className:"min-w-0",children:[m.jsx("b",{children:e.message})," Sessions, runs and chat commands cannot start until then."]}),e.fix&&m.jsxs("span",{className:"flex items-center gap-1",children:["Run",m.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:e.fix}),m.jsx(ge,{variant:"ghost",size:"icon",onClick:d,title:l?"Copied":"Copy","aria-label":"Copy the command",children:m.jsx(Ah,{size:12})}),e.problem==="missing"?"in a terminal, then sign in with":"in a terminal on this machine.",e.problem==="missing"&&m.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:"claude auth login"})]}),m.jsxs(ge,{variant:"muted",onClick:()=>void p(),disabled:r,className:"ml-auto",children:[m.jsx(so,{size:12,className:r?"animate-spin":void 0}),r?"Checking...":"Check again"]})]})}const km=[{page:"overview",label:"Projects",icon:m4},{page:"inbox",label:"Inbox",icon:d4},{page:"channels",label:"Channels",icon:Jl}];let Tw=null;function DB(){return Tw??(Tw=ve.folders().then(e=>e.home,()=>null)),Tw}function Rw(e,i){var r;(r=navigator.clipboard)==null||r.writeText(e).then(()=>_e.getState().notify(`Copied the ${i}.`),()=>_e.getState().notify("The browser did not allow copying.","error"))}function Iv({project:e,x:i,y:r,onClose:s}){const l=_e(v=>v.openProject),h=ln(),p=()=>qe(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),o=()=>h({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),_e.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}});N.useEffect(()=>{const v=()=>s(),c=_=>_.key==="Escape"&&s();return window.addEventListener("pointerdown",v),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),window.addEventListener("keydown",c),()=>{window.removeEventListener("pointerdown",v),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v),window.removeEventListener("keydown",c)}},[s]);const u=async()=>{const v=await DB(),c=e.root,_=c.includes("\\")?"\\":"/",x=v&&c.toLowerCase().startsWith(`${v.replace(/[\\/]$/,"").toLowerCase()}${_}`);Rw(x?`~${_}${c.slice(v.replace(/[\\/]$/,"").length+1)}`:c,"relative path")},d=(v,c,_,x={})=>{const C=c;return m.jsxs("button",{title:x.hint,onPointerDown:y=>{y.stopPropagation(),s(),_()},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs",x.danger?"text-severity-critical hover:bg-destructive/15":"hover:bg-muted"),children:[m.jsx(C,{size:13}),v]})};return m.jsxs("div",{role:"menu",className:"fixed z-50 w-56 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-232),top:Math.min(r,window.innerHeight-290)},onPointerDown:v=>v.stopPropagation(),children:[d("Open",Yl,()=>l(e.id)),m.jsx("div",{className:"my-1 border-t"}),e.paused?d("Allow notifications",ds,()=>void qe(()=>ve.pauseNotificationsIn(e.id,!1),`Notifications from ${e.name} are back on.`)):d("Do not disturb",ga,()=>void qe(()=>ve.pauseNotificationsIn(e.id,!0),`No channel hears from ${e.name} now.`),{hint:"Pauses every channel of this project, and the global ones for it; questions still wait in the inbox"}),d(e.muted?"Hear on global channels":"Mute on global channels",e.muted?Jl:D4,()=>void p(),{hint:"Only the global channels; the project's own channels are not changed"}),m.jsx("div",{className:"my-1 border-t"}),d("Copy Path",Ol,()=>Rw(e.root,"path")),d("Copy Relative Path",Ol,()=>void u(),{hint:"From your home folder, as ~/..."}),d("Reveal in File Explorer",Zs,()=>void qe(()=>ve.revealIn(e.id))),m.jsx("div",{className:"my-1 border-t"}),d("Remove from the hub",Ri,()=>void o(),{danger:!0,hint:"The folder and its saved settings stay"})]})}function LB({project:e}){const i=_e(o=>o.openProject),r=ln(),s=()=>qe(()=>ve.setMuted(e.id,!e.muted),e.muted?`${e.name} is heard on the global channels again.`:`The global channels no longer hear from ${e.name}.`),l=()=>r({title:`Remove ${e.name} from the hub?`,description:"Its running sessions stop and its jobs no longer run. The folder and its saved settings stay.",confirmLabel:"Remove",tone:"destructive",run:async()=>{await ve.removeProject(e.id),_e.getState().notify(`Removed ${e.name}. Opening its folder again brings it back as it was.`)}}),[h,p]=N.useState(null);return m.jsxs("div",{className:"card flex min-w-0 flex-col gap-2 p-3",onContextMenu:o=>{o.preventDefault(),p({x:o.clientX,y:o.clientY})},children:[h&&m.jsx(Iv,{project:e,...h,onClose:()=>p(null)}),m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsxs("button",{onClick:()=>i(e.id),className:"min-w-0 flex-1 text-left",title:e.root,children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[m.jsx("span",{className:"truncate text-sm font-semibold hover:underline",children:e.name}),e.paused&&m.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 rounded bg-severity-warning/15 px-1 text-[9px] font-medium text-severity-warning",title:"Do not disturb: no channel hears from it",children:[m.jsx(ga,{size:9})," DND"]})]}),m.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:e.root})]}),m.jsx("button",{onClick:()=>void s(),title:e.muted?"Muted on the global channels: click to hear from it again":"Heard on the global channels: click to mute","aria-label":e.muted?`Unmute ${e.name}`:`Mute ${e.name}`,className:ye("shrink-0 rounded p-1 hover:bg-muted",e.muted?"text-muted-foreground":"text-foreground"),children:e.muted?m.jsx(ga,{size:13}):m.jsx(ds,{size:13})}),m.jsx("button",{onClick:()=>void l(),title:"Remove from the hub","aria-label":`Remove ${e.name}`,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:m.jsx(xn,{size:13})})]}),m.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px]",children:[m.jsxs("span",{className:ye(e.waiting?"font-semibold text-severity-warning":"text-muted-foreground"),children:["⏳ ",e.waiting," waiting"]}),m.jsxs("span",{className:"text-muted-foreground",children:["▶️ ",e.running," running"]}),m.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:e.runningRun?`Running: ${e.runningRun}`:void 0,children:[m.jsx(g4,{size:11})," ",e.runningRun?"1 running, ":"",e.queued," queued"]})]}),m.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[m.jsxs("span",{className:"flex min-w-0 max-w-full items-center gap-1 truncate",title:e.nextCron?`${e.nextCron.name}: ${Wi(e.nextCron.at)}`:void 0,children:[m.jsx(Kl,{size:11,className:"shrink-0"})," ",m.jsx("span",{className:"truncate",children:e.nextCron?`${e.nextCron.name} · ${Wi(e.nextCron.at)}`:"no cron job"})]}),m.jsxs("span",{title:"Sent and written in the sessions active today, cache reads left out",children:[e.activeToday," active today · ",Pn(e.tokensToday)," tokens"]})]})]})}function I5({children:e}){return m.jsx("div",{className:"h-full overflow-y-auto",children:m.jsx("div",{className:"mx-auto max-w-6xl space-y-4 p-5",children:e})})}function jB(){var s;const[e,i]=N.useState(!1),r=rt(()=>ve.globalOverview(),["projects","sessions","interactions","runs","jobs","channels"]);return m.jsxs(I5,{children:[m.jsx(Qi,{group:"Global",title:"Projects",description:"Every project in the hub, most recently opened first. The bell says whether the global channels hear from it.",action:m.jsxs(ge,{variant:"primary",onClick:()=>i(!0),children:[m.jsx(Rn,{size:12})," Open folder..."]})}),m.jsx(D5,{open:e,onOpenChange:i}),(s=r.data)!=null&&s.length?m.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",children:r.data.map(l=>m.jsx(LB,{project:l},l.id))}):m.jsx(Gt,{variant:"inline",title:r.data?"No projects yet.":"Loading..."})]})}function MB(){var i;const e=rt(()=>ve.globalInbox(),["projects","interactions"]);return m.jsxs(I5,{children:[m.jsx(Qi,{group:"Global",title:"Inbox",description:"Everything waiting on you, in every project."}),(i=e.data)!=null&&i.length?m.jsx("div",{className:"space-y-2",children:e.data.map(r=>m.jsx(Wl,{interaction:r,project:r.project,showSession:!0},`${r.project.id}:${r.id}`))}):m.jsx(Gt,{icon:ds,title:e.data?"Nothing is waiting on you.":"Loading..."})]})}function Aw({width:e,collapsed:i,onToggle:r,drawer:s=!1}){var S;const l=_e(w=>w.view),h=_e(w=>w.go),p=_e(w=>w.openProject),o=_e(w=>w.sessions),u=rt(()=>ve.projects(),["projects"]),d=rt(()=>ve.globalOverview(),["projects","channels"]),[v,c]=N.useState(null),[_,x]=N.useState(!1),y=((S=rt(()=>ve.globalInbox(),["projects","interactions"]).data)==null?void 0:S.length)??0,g=o.filter(w=>w.origin!=="external"||w.live).slice(0,10),b=w=>l.kind==="page"&&(l.page===w||w==="overview"&&!km.some(T=>T.page===l.page));return i?m.jsxs("aside",{className:"flex w-12 shrink-0 flex-col items-center gap-1 overflow-y-auto border-r py-3",children:[m.jsx(xa,{className:"mb-2"}),km.map(w=>m.jsx(gr,{content:`Global · ${w.label}`,side:"right",asChild:!0,children:m.jsx(ge,{variant:"ghost",size:"icon",className:ye(b(w.page)&&"bg-muted text-foreground"),onClick:()=>h({kind:"page",page:w.page}),children:m.jsx(w.icon,{size:15})})},w.page)),m.jsx("div",{className:"flex-1"}),m.jsx(ge,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Expand sidebar",children:m.jsx(Fw,{size:15})})]}):m.jsxs("aside",{className:"flex shrink-0 flex-col",style:{width:e},children:[m.jsxs("div",{className:"flex items-center gap-2 px-3 pb-2 pt-3",children:[m.jsx(xa,{}),m.jsxs("div",{className:"min-w-0",children:[m.jsx(od,{}),m.jsx("div",{className:"flex min-w-0 items-center gap-1.5",children:m.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:"Global"})})]}),m.jsx(ge,{variant:"ghost",size:"icon",className:"ml-auto",onClick:r,"aria-label":s?"Close menu":"Collapse sidebar",children:s?m.jsx(xn,{size:15}):m.jsx(Hw,{size:15})})]}),m.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pb-3",children:[m.jsx("nav",{className:"px-2",children:km.map(w=>m.jsxs("button",{onClick:()=>h({kind:"page",page:w.page}),className:ye("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs transition-colors",b(w.page)?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[m.jsx(w.icon,{size:14}),w.label,w.page==="inbox"&&y>0&&m.jsx("span",{className:"ml-auto rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:y})]},w.page))}),m.jsxs("div",{className:"mt-2 px-2",children:[m.jsxs("div",{className:"flex items-center px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:["Projects",m.jsx("button",{onClick:()=>x(!0),title:"Open folder...","aria-label":"Add a project",className:"ml-auto rounded p-0.5 hover:bg-muted hover:text-foreground",children:m.jsx(Rn,{size:12})})]}),v&&m.jsx(Iv,{project:v.project,x:v.x,y:v.y,onClose:()=>c(null)}),(u.data??[]).map(w=>m.jsxs("button",{disabled:!w.exists,onClick:()=>p(w.id),onContextMenu:T=>{var R;T.preventDefault();const D=(R=d.data)==null?void 0:R.find(L=>L.id===w.id);c({project:{id:w.id,name:w.name,root:w.root,muted:D==null?void 0:D.muted,paused:D==null?void 0:D.paused},x:T.clientX,y:T.clientY})},title:w.root,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground disabled:opacity-50",children:[m.jsx(Vw,{size:14,className:"shrink-0"}),m.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.name}),w.waiting>0&&m.jsx("span",{className:"rounded-full bg-severity-warning px-1.5 text-[10px] font-semibold text-background",children:w.waiting}),w.running>0&&m.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px]",title:`${w.running} running`,children:[m.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success"})," ",w.running]})]},w.id)),u.data&&!u.data.length&&m.jsx("div",{className:"px-2 py-1 text-[11px] text-muted-foreground",children:"No projects yet."})]}),g.length>0&&m.jsxs("div",{className:"mt-2 px-2",children:[m.jsx("div",{className:"px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Hub tasks"}),g.map(w=>m.jsxs("button",{onClick:()=>h({kind:"session",id:w.id}),className:ye("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors",l.kind==="session"&&l.id===w.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[m.jsx(ec,{size:13,className:"shrink-0"}),m.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.title}),m.jsx(rd,{session:w})]},w.id))]})]}),m.jsxs("div",{className:"border-t px-2 py-2",children:[m.jsxs(ge,{variant:"ghost",className:"w-full justify-start",onClick:()=>x(!0),children:[m.jsx(Rn,{size:13})," Open folder..."]}),m.jsx(D5,{open:_,onOpenChange:x})]})]})}const Dw="clauder-hub:global-sidebar-collapsed";function NB(){const e=_e(v=>v.view),i=Ch("clauder-hub:sidebar-width",280,{min:220,max:480}),r=Ch("clauder-hub:live-panel-width",260,{min:200,max:420}),s=sd(v=>v.open),l=l5("(min-width: 768px)"),[h,p]=N.useState(!1),[o,u]=N.useState(()=>{try{return localStorage.getItem(Dw)==="1"}catch{return!1}});N.useEffect(()=>{document.title="Clauder Hub · Global"},[]),N.useEffect(()=>{try{localStorage.setItem(Dw,o?"1":"0")}catch{}},[o]),N.useEffect(()=>p(!1),[e,l]);const d=e.kind==="session"?m.jsx(P5,{id:e.id},e.id):e.kind==="page"&&e.page==="inbox"?m.jsx(MB,{}):e.kind==="page"&&e.page==="channels"?m.jsx("div",{className:"h-full overflow-y-auto",children:m.jsx("div",{className:"mx-auto max-w-6xl p-5",children:m.jsx(XC,{global:!0})})}):m.jsx(jB,{});return m.jsxs("div",{className:"flex h-screen overflow-hidden",children:[l&&m.jsx(Aw,{width:i.width,collapsed:o,onToggle:()=>u(!o)}),l&&!o&&m.jsx(Eh,{onDrag:i.resizeBy,onReset:i.reset}),!l&&m.jsxs(m.Fragment,{children:[h&&m.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>p(!1)}),m.jsx("div",{inert:!h,className:ye("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",h?"translate-x-0 shadow-xl":"-translate-x-full"),children:m.jsx(Aw,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>p(!1),drawer:!0})})]}),m.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&m.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[m.jsx(ge,{variant:"ghost",size:"icon",onClick:()=>p(!0),"aria-label":"Open menu",title:"Menu",children:m.jsx(Ww,{size:16})}),m.jsx(xa,{}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx(od,{}),m.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Global"})]})]}),m.jsx(z5,{}),m.jsx("div",{className:"min-h-0 flex-1",children:d})]}),l&&s&&m.jsx(Eh,{onDrag:v=>r.resizeBy(-v),onReset:r.reset}),l&&s&&m.jsx(A5,{width:r.width})]})}function OB(){const e=_e(s=>s.open),r=(rt(()=>ve.interactions(),["interactions"]).data??[]).filter(s=>s.status!=="open").slice(0,60);return m.jsx("div",{className:"h-full overflow-y-auto",children:m.jsxs("div",{className:"space-y-4 p-5",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Operation"}),m.jsx("h1",{className:"text-base font-semibold",children:"Inbox"}),m.jsx("p",{className:"truncate text-xs text-muted-foreground",title:"What sessions are waiting on. The first answer wins, from anywhere.",children:"What sessions are waiting on. The first answer wins, from anywhere."})]}),e.length?m.jsx("div",{className:"space-y-2",children:e.map(s=>m.jsx(Wl,{interaction:s,showSession:!0},s.id))}):m.jsx(Gt,{icon:ds,title:"Nothing is waiting on you."}),r.length>0&&m.jsxs("div",{className:"space-y-2",children:[m.jsx("h2",{className:"pt-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Recent"}),r.map(s=>m.jsx(Wl,{interaction:s,showSession:!0,compact:!0},s.id))]})]})})}function BB(){var p;const e=rt(()=>ve.suggestions(),["mcp"]),i=rt(()=>ve.mcpSuggestionsEnabled(),["mcp"]),r=!!((p=i.data)!=null&&p.enabled),s=_e(o=>o.go),l=(e.data??[]).filter(o=>o.status==="suggested"),h=(e.data??[]).filter(o=>o.status!=="suggested");return m.jsx("div",{className:"h-full overflow-y-auto",children:m.jsxs("div",{className:"space-y-4 p-5",children:[m.jsx(Qi,{group:"Settings",title:"MCP suggestions",description:"Servers that blocked sessions asked for. Nothing installs without you.",action:m.jsxs(ge,{onClick:()=>s({kind:"page",page:"mcp-servers"}),children:[m.jsx(Zl,{size:12})," Configured servers"]})}),m.jsx(Nt,{title:"Suggest MCP servers",description:"When on, sessions are told they may stop and ask for a missing MCP server. Off: that part of the system prompt is left out. Applies to sessions started from now on.",action:m.jsx("button",{role:"switch","aria-checked":r,"aria-label":"Suggest MCP servers",disabled:!i.data,onClick:()=>void qe(()=>ve.setMcpSuggestionsEnabled(!r),r?"MCP suggestions off.":"MCP suggestions on."),className:ye("relative h-5 w-9 shrink-0 rounded-full transition-colors",r?"bg-primary":"bg-foreground/20"),children:m.jsx("span",{className:ye("absolute top-0.5 h-4 w-4 rounded-full bg-background transition-all",r?"left-[18px]":"left-0.5")})}),children:null}),m.jsx(Nt,{title:`Waiting (${l.length})`,children:l.length?m.jsx("div",{className:"space-y-2",children:l.map(o=>m.jsx(Lw,{suggestion:o},o.id))}):m.jsx(Gt,{variant:"inline",title:"No session is waiting on an MCP server."})}),h.length>0&&m.jsx(Nt,{title:"History",children:m.jsx("div",{className:"space-y-2",children:h.map(o=>m.jsx(Lw,{suggestion:o},o.id))})})]})})}function Lw({suggestion:e}){const i=_e(o=>o.go),r=ln(),s=e.status==="installed"?"success":e.status==="failed"?"critical":e.status==="suggested"?"warning":"off",l=()=>r({title:`Install '${e.name}'?`,description:"Adds it to this project's .mcp.json.",body:m.jsxs("div",{className:"space-y-2",children:[m.jsx("pre",{className:"whitespace-pre-wrap rounded bg-muted p-3 font-mono text-[11px]",children:e.runs}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:"If it succeeds, the session that asked is restarted on the same conversation so the server loads, and is told to continue."})]}),confirmLabel:"Run it",run:async()=>{const o=await ve.installSuggestion(e.id);_e.getState().notify(o.status==="installed"?"Installed; the session is resuming.":"The install failed; see its output.",o.status==="installed"?"info":"error")}}),h=()=>r({title:`Carry on without '${e.name}'?`,description:"The session continues without it.",confirmLabel:"Skip it",run:()=>ve.skipSuggestion(e.id)}),p=()=>r({title:"Remove this suggestion from the history?",confirmLabel:"Remove",tone:"destructive",run:()=>ve.deleteSuggestion(e.id)});return m.jsxs("div",{className:"rounded-md border p-3",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.jsx(Zl,{size:14,className:"shrink-0"}),m.jsx("span",{className:"min-w-0 break-all text-xs font-semibold",children:e.name}),m.jsx(Xe,{tone:s,children:e.status}),m.jsxs("button",{className:"text-[11px] text-muted-foreground hover:underline",onClick:()=>i({kind:"session",id:e.sessionId}),children:["from session ",e.sessionId.slice(0,8)]}),m.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:vs(e.createdAt)})]}),m.jsx("div",{className:"mt-1.5 break-words text-xs text-muted-foreground",children:e.reason}),m.jsx("pre",{className:"mt-1.5 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 font-mono text-[11px]",children:e.runs??e.command}),e.refused&&m.jsx("div",{className:"mt-1 text-[11px] text-severity-critical",children:e.refused}),e.output&&m.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap rounded border p-2 font-mono text-[10px] text-muted-foreground",children:e.output}),m.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[e.status==="suggested"&&m.jsxs(m.Fragment,{children:[m.jsxs(ge,{variant:"primary",disabled:!e.runs,onClick:()=>void l(),children:[m.jsx(s4,{size:12})," Install & resume"]}),m.jsxs(ge,{onClick:()=>void h(),children:[m.jsx(xn,{size:12})," Skip"]})]}),e.docs&&m.jsx("a",{href:e.docs,target:"_blank",rel:"noreferrer",children:m.jsxs(ge,{variant:"ghost",children:[m.jsx(Sa,{size:12})," Docs"]})}),e.status!=="suggested"&&m.jsx(ge,{variant:"ghost",className:"ml-auto",onClick:()=>void p(),children:m.jsx(Ri,{size:12})})]})]})}function PB(){const e=rt(()=>ve.stats(),["sessions","transcript"]),i=rt(()=>ve.inventory(),["sessions"]),r=_e(l=>l.sessions),s=e.data;return m.jsx("div",{className:"h-full overflow-y-auto",children:m.jsxs("div",{className:"space-y-4 p-5",children:[m.jsx(Qi,{group:"Operation",title:"Overview",description:"Stats from this project's Claude Code transcripts."}),m.jsxs("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:[m.jsx(cs,{label:"Sessions",value:String((s==null?void 0:s.sessions)??"-")}),m.jsx(cs,{label:"Live now",value:String(r.filter(l=>l.live).length)}),m.jsx(cs,{label:"Waiting on you",value:String(r.filter(l=>l.status==="waiting").length)}),m.jsx(cs,{label:"Tool calls",value:s?Pn(Object.values(s.tools).reduce((l,h)=>l+h.count,0)):"-"})]}),s&&m.jsx(YC,{tokens:s.tokens}),s&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"grid gap-3 lg:grid-cols-3",children:[m.jsx(Nt,{title:"Output tokens per day",className:"lg:col-span-2",children:m.jsx(KD,{days:s.byDay,valueOf:l=>l.output,label:"output tokens"})}),m.jsx(Nt,{title:"Tokens by model",children:m.jsx(hs,{rows:Object.entries(s.byModel).filter(([,l])=>us(l)>0).map(([l,h])=>({key:l,label:l,value:us(h)}))})})]}),m.jsx(j5,{tools:s.tools}),m.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[m.jsx(Nt,{title:"Subagents by type",description:"How often each was spawned, with its own tokens.",children:m.jsx(hs,{rows:Object.entries(s.agents).map(([l,h])=>({key:l,label:l,value:h.count,sublabel:`${Pn(us(h.tokens))} tok`})),format:String,empty:"No subagents yet."})}),m.jsx(Nt,{title:"Skills & commands",children:m.jsx(hs,{rows:Object.entries(s.skills).map(([l,h])=>({key:l,label:l,value:h})),format:String,empty:"No skills used yet."})})]})]}),e.error&&m.jsx("div",{className:"text-xs text-severity-critical",children:e.error}),i.data&&m.jsx(IB,{inventory:i.data})]})})}const zB=[{page:"agents",label:"Agents",count:e=>e.agents.length},{page:"skills",label:"Skills",count:e=>e.skills.length},{page:"commands",label:"Commands",count:e=>e.commands.length},{page:"mcp-servers",label:"MCP servers",count:e=>e.mcpServers.length},{page:"hooks",label:"Hooks",count:e=>e.hooks.length},{page:"plugins",label:"Plugins",count:e=>e.plugins.filter(i=>i.enabled).length}];function IB({inventory:e}){const i=_e(r=>r.go);return m.jsx(Nt,{title:"What sessions can reach for",description:"All scopes together: this project, your user config and enabled plugins. Open one under Project.",children:m.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-6",children:zB.map(r=>m.jsxs("button",{onClick:()=>i({kind:"page",page:r.page}),className:"rounded-md border px-3 py-2 text-left transition-colors hover:bg-muted",children:[m.jsx("div",{className:"text-[11px] text-muted-foreground",children:r.label}),m.jsx("div",{className:"text-lg font-semibold tabular-nums",children:r.count(e)})]},r.page))})})}const HB={name:"",toolset:{agents:[],skills:[],mcp:[],plugins:[]},isDefault:!1};function FB(){const e=rt(()=>ve.presets(),["jobs"]),i=rt(()=>ve.toolsetCatalog(),[]),[r,s]=N.useState(null),[l,h]=N.useState(!1),p=v=>{s(v),h(v!==null)},o=e.data??[],u=r==="new"?null:o.find(v=>v.id===r)??o[0]??null,d=r==="new"||!o.length&&e.data!==null;return m.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[m.jsx("div",{className:"border-b px-5 py-4",children:m.jsx(Qi,{group:"Settings",title:"Toolset presets",description:"Named sets of agents, skills, MCP servers and plugins to turn off.",action:m.jsxs(ge,{variant:"primary",onClick:()=>p("new"),children:[m.jsx(Rn,{size:12})," New preset"]})})}),m.jsxs("div",{className:"flex min-h-0 flex-1",children:[m.jsxs("div",{className:ye("w-full shrink-0 space-y-0.5 overflow-y-auto p-3 md:block md:w-56 md:border-r lg:w-72",l&&"hidden"),children:[o.map(v=>m.jsxs("button",{onClick:()=>p(v.id),className:ye("block w-full rounded-md px-2 py-1.5 text-left text-foreground",(u==null?void 0:u.id)===v.id&&!d?"bg-muted":"hover:bg-muted/60"),children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(kg,{size:12,className:"shrink-0 text-muted-foreground"}),m.jsx("span",{className:"min-w-0 truncate text-xs",children:v.name}),v.isDefault&&m.jsx(Xe,{tone:"on",children:"default"})]}),m.jsx("div",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:Th(v.toolset)?`${Th(v.toolset)} turned off`:"everything on"})]},v.id)),!o.length&&m.jsx(Gt,{variant:"inline",title:"No presets yet."})]}),m.jsxs("div",{className:ye("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!l&&"hidden"),children:[m.jsx(uv,{onClick:()=>h(!1)}),i.data&&(d||u)?m.jsx(UB,{preset:d?HB:u,catalog:i.data,onSaved:v=>{e.reload(),s(v)},onDeleted:()=>{e.reload(),p(null)}},d?"new":u.id):null]})]})]})}function UB({preset:e,catalog:i,onSaved:r,onDeleted:s}){const l=ln(),{starting:h,start:p}=zh(),[o,u]=N.useState(e);N.useEffect(()=>u(e),[e]);const d=JSON.stringify(o)!==JSON.stringify(e),v=async()=>{const _=await qe(()=>ve.savePreset(o),"Saved.");_&&r(_.id)},c=()=>l({title:`Delete the preset '${e.name}'?`,description:"Jobs using it fall back to the default.",confirmLabel:"Delete",tone:"destructive",run:async()=>{await ve.deletePreset(e.id),_e.getState().notify("Deleted."),s()}});return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[m.jsxs("div",{className:"flex min-w-0 flex-1 basis-48 items-center gap-3",children:[m.jsx(_t,{value:o.name,onChange:_=>u({...o,name:_.target.value}),placeholder:"Preset name",className:"max-w-xs",size:"md"}),m.jsx(Cr,{label:"Default for new sessions and jobs",checked:o.isDefault,onCheckedChange:_=>u({...o,isDefault:_})})]}),m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[m.jsxs(ge,{variant:"ghost",disabled:h,onClick:()=>void p(e.id?"edit-preset":"create-preset",e.id,{name:o.name,isDefault:o.isDefault,toolset:o.toolset}),title:"Opens a Claude session with what is set here; describe the rest instead of flipping switches",children:[m.jsx(Lh,{size:12})," ",h?"Opening...":"Set up with Claude"]}),e.id&&m.jsxs(ge,{variant:"ghost",onClick:()=>void c(),children:[m.jsx(Ri,{size:12})," Delete"]}),d&&e.id&&m.jsx(ge,{onClick:()=>u(e),children:"Discard"}),m.jsx(ge,{variant:"primary",disabled:!o.name.trim()||!d&&!!e.id,onClick:()=>void v(),children:"Save"})]})]}),m.jsx(N5,{catalog:i,value:o.toolset,onChange:_=>u({...o,toolset:_})})]})}function $B(e){if(e.params.length){const i=e.params.filter(r=>r.required).map(r=>r.name);return{icon:Cg,text:i.length?`Needs ${i.join(", ")}`:"Optional settings"}}return e.auth==="oauth"?{icon:v4,text:"Sign in after adding"}:{icon:Xl,text:"Nothing to set up"}}function qB(){var s;const e=rt(()=>ve.mcpCatalog(),["mcp"]),{starting:i,start:r}=zh();return(s=e.data)!=null&&s.length?m.jsx(Nt,{title:"Recommended",description:"Common servers. Adding one opens a hub task that asks for what it needs.",action:m.jsxs(ge,{disabled:i,onClick:()=>void r("add-mcp"),title:"Opens a hub task to add any MCP server",children:[m.jsx(Lh,{size:12})," Add another server"]}),children:m.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:e.data.map(l=>{const h=$B(l);return m.jsxs("div",{className:"flex flex-col rounded-md border p-3",children:[m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate text-xs font-semibold",children:l.name}),m.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.vendor})]}),m.jsx(Xe,{tone:"off",children:l.category})]}),m.jsx("p",{className:"mt-1.5 line-clamp-2 flex-1 text-[11px] text-muted-foreground",title:l.description,children:l.description}),m.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[m.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1 truncate text-[10px] text-muted-foreground",title:h.text,children:[m.jsx(h.icon,{size:11,className:"shrink-0"})," ",m.jsx("span",{className:"truncate",children:h.text})]}),m.jsx("a",{href:l.docs,target:"_blank",rel:"noreferrer",title:"Docs",className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:m.jsx(Sa,{size:12})}),l.installed?m.jsx(Xe,{tone:"success",icon:Xl,children:"added"}):m.jsxs(ge,{className:"shrink-0 bg-white text-neutral-900 hover:bg-white/85",disabled:i,onClick:()=>void r("add-mcp",l.id),children:[m.jsx(Rn,{size:12})," Add"]})]})]},l.id)})})}):null}const VB=["user","project","local","plugin","built-in"],H5={project:"This project (shared, in the repo)",local:"This project (local, only on this machine)",user:"You (every project)",plugin:"Plugins","built-in":"Built into Claude Code"};function Rh(e,i){var r;return e.scope==="user"?!0:e.scope==="plugin"&&((r=i.find(s=>s.id===e.plugin))==null?void 0:r.scope)==="user"}function ld(){return rt(()=>ve.inventory(),["sessions"])}function Hv(){var l;const e=rt(()=>ve.presets(),["jobs"]),i=rt(()=>ve.toolsetCatalog(),["sessions"]);return!e.data||!i.data?null:{off:((l=e.data.find(h=>h.isDefault))==null?void 0:l.toolset)??{agents:[],skills:[],mcp:[],plugins:[]},mcpId:h=>{var p;return(p=i.data.find(o=>o.kind==="mcp"&&o.label===h))==null?void 0:p.id}}}function Fv({defaults:e,kind:i,id:r,plugin:s}){if(!e||!r)return null;const l=!!(s&&e.off.plugins.includes(s));return m.jsx(Cr,{ariaLabel:`${r} in new sessions`,title:l?`Off with its plugin ${s}`:"On in new sessions (default preset)",disabled:l,checked:!l&&!e.off[i].includes(r),onCheckedChange:h=>void qe(()=>ve.setDefaultItem(i,r,h),`${r} ${h?"on":"off"} in new sessions.`)})}function F5(e){return VB.map(i=>[i,e.filter(r=>r.scope===i)]).filter(([,i])=>i.length)}function U5({items:e,keyOf:i,render:r,detail:s,searchText:l,empty:h,leading:p}){var g;const[o,u]=N.useState(""),[d,v]=N.useState(null),[c,_]=N.useState(!1),x=N.useMemo(()=>{const b=o.trim().toLowerCase();return b?e.filter(S=>l(S).toLowerCase().includes(b)):e},[e,o,l]),C=F5(x),y=e.find(b=>i(b)===d)??((g=C[0])==null?void 0:g[1][0])??null;return e.length?m.jsxs("div",{className:"flex min-h-0 flex-1",children:[m.jsxs("div",{className:ye("w-full shrink-0 overflow-y-auto p-3 md:block md:w-60 md:border-r lg:w-80",c&&"hidden"),children:[m.jsxs("div",{className:"relative mb-2",children:[m.jsx(Dh,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),m.jsx(_t,{value:o,onChange:b=>u(b.target.value),placeholder:`Filter ${e.length}`,className:"pl-6"})]}),m.jsx("div",{className:"space-y-1.5",children:C.map(([b,S])=>m.jsx(Pv,{title:H5[b],badge:m.jsx(Xe,{tone:"off",children:S.length}),defaultOpen:!0,children:S.map(w=>m.jsxs("div",{className:ye("flex items-center gap-1 rounded-md",p&&"pl-2",y&&i(y)===i(w)?"bg-muted":"hover:bg-muted/60"),children:[p==null?void 0:p(w),m.jsx("button",{onClick:()=>{v(i(w)),_(!0)},className:"block min-w-0 flex-1 px-2 py-1.5 text-left text-foreground",children:r(w)})]},i(w)))},b))}),!C.length&&m.jsx("div",{className:"px-1 text-xs text-muted-foreground",children:"No match."})]}),m.jsxs("div",{className:ye("min-w-0 flex-1 overflow-y-auto p-4 md:block md:p-5",!c&&"hidden"),children:[m.jsx(uv,{onClick:()=>_(!1)}),y?s(y):null]})]}):m.jsx(Gt,{title:h,className:"m-5"})}function dc({title:e,description:i,children:r}){return m.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[m.jsx("div",{className:"border-b px-5 py-4",children:m.jsx(Qi,{group:"Project",title:e,description:i})}),r]})}const jw={memory:"CLAUDE.md",rules:"Rule","auto-memory":"Auto memory"};function WB(){const e=rt(()=>ve.memory(),[]),i=(e.data??[]).filter(r=>r.group in jw);return m.jsx(dc,{title:"Instructions",description:"CLAUDE.md, rules and memory that every session loads.",children:e.data&&m.jsx(U5,{items:i,keyOf:r=>r.path,searchText:r=>r.label,empty:"No instruction files.",render:r=>m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(o4,{size:12,className:"shrink-0"}),m.jsx("span",{className:ye("min-w-0 truncate font-mono text-[11px]",!r.exists&&"opacity-50"),children:r.label}),r.scope==="user"&&m.jsx(gs,{}),m.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground",children:r.exists?jw[r.group]:"new"})]}),detail:r=>m.jsx(a5,{path:r.path,title:r.label,badge:r.scope==="user"?m.jsx(gs,{}):null,onSaved:e.reload},r.path)})})}const GB={agents:{title:"Agents",description:"Subagents Claude can delegate to. Ticked ones are on in new sessions.",empty:"No agents defined. Claude still has its built-in ones (Explore, Plan, general-purpose)."},skills:{title:"Skills",description:"Instructions Claude loads when a task matches. Ticked ones are on in new sessions.",empty:"No skills installed."},commands:{title:"Commands",description:"Slash commands, typed as /name.",empty:"No custom commands."}};function Em({kind:e}){const i=ld(),r=Hv(),s=GB[e];return m.jsx(dc,{title:s.title,description:s.description,children:i.data&&m.jsx(U5,{items:i.data[e],keyOf:l=>l.path||`${l.scope}:${l.name}`,searchText:l=>`${l.name} ${l.description}`,empty:s.empty,leading:e==="commands"?void 0:l=>m.jsx(Fv,{defaults:r,kind:e,id:l.name,plugin:l.plugin}),render:l=>m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:e==="commands"?`/${l.name}`:l.name}),Rh(l,i.data.plugins)&&m.jsx(gs,{})]}),l.description&&m.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:l.description})]}),detail:l=>m.jsxs("div",{className:"space-y-3",children:[l.description&&m.jsx("p",{className:"text-xs text-muted-foreground",children:l.description}),m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[m.jsx(Xe,{tone:"off",children:l.scope}),l.plugin&&m.jsx(Xe,{tone:"off",children:l.plugin}),l.model&&m.jsxs(Xe,{tone:"off",children:["model: ",l.model]})]}),l.scope==="built-in"?m.jsxs("div",{className:"space-y-1",children:[m.jsx("h2",{className:"font-mono text-sm font-semibold",children:l.name}),m.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Built into Claude Code, so there is no file to show or edit. It can be turned off per session in its Toolset tab, or in a preset."})]}):m.jsx(a5,{path:l.path,title:e==="commands"?`/${l.name}`:l.name,badge:Rh(l,i.data.plugins)?m.jsx(gs,{}):null,subtitle:l.path,onSaved:i.reload},l.path)]})})})}function $5({items:e,row:i,empty:r,footer:s}){return m.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-5",children:[!e.length&&m.jsx(Gt,{title:r}),F5(e).map(([l,h])=>m.jsx(Pv,{title:H5[l],badge:m.jsx(Xe,{tone:"off",children:h.length}),defaultOpen:!0,children:m.jsx("div",{className:"divide-y rounded-md border bg-background",children:h.map((p,o)=>i(p,o))})},l)),s]})}function YB(){const e=ld(),i=Hv();return m.jsx(dc,{title:"MCP servers",description:"Servers configured in files. claude.ai connectors are not listed.",children:e.data&&m.jsx($5,{items:e.data.mcpServers,empty:"No MCP servers configured in files.",footer:m.jsx(qB,{}),row:r=>m.jsxs("div",{className:ye("flex items-center gap-2 px-3 py-2",r.disabled&&"opacity-50"),children:[m.jsx(Fv,{defaults:i,kind:"mcp",id:i==null?void 0:i.mcpId(r.name),plugin:r.plugin}),m.jsx(Zl,{size:13,className:"shrink-0 text-muted-foreground"}),m.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:r.name}),Rh(r,e.data.plugins)&&m.jsx(gs,{}),m.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-muted-foreground",title:r.target,children:r.target}),r.disabled&&m.jsx(Xe,{tone:"off",children:"disabled"}),m.jsx(Xe,{tone:"off",children:r.transport})]},`${r.scope}:${r.name}`)})})}function KB(){const e=ld();return m.jsx(dc,{title:"Hooks",description:"Your hooks, from settings files and plugins.",children:e.data&&m.jsx($5,{items:e.data.hooks,empty:"No hooks configured.",row:(i,r)=>m.jsxs("div",{className:"px-3 py-2",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px]",children:[m.jsx("span",{className:"font-mono",children:i.event}),Rh(i,e.data.plugins)&&m.jsx(gs,{}),i.matcher&&m.jsx(Xe,{tone:"off",children:i.matcher}),m.jsx(Xe,{tone:"off",children:i.type}),i.plugin&&m.jsx("span",{className:"text-muted-foreground",children:i.plugin.split("@")[0]})]}),m.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px] text-muted-foreground",title:i.summary,children:i.summary})]},r)})})}function XB(){var l;const e=ld(),i=Hv(),r=((l=e.data)==null?void 0:l.plugins)??[],s=h=>{const p=d=>d.filter(v=>v.plugin===h).length,o=e.data;return[[p(o.agents),"agents"],[p(o.skills),"skills"],[p(o.commands),"commands"],[o.mcpServers.filter(d=>d.plugin===h).length,"MCP"],[o.hooks.filter(d=>d.plugin===h).length,"hooks"]].filter(([d])=>d).map(([d,v])=>`${d} ${v}`).join(" · ")};return m.jsx(dc,{title:"Plugins",description:"Installed plugins and what each adds.",children:e.data&&m.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:r.length?m.jsx("div",{className:"divide-y rounded-md border",children:r.map(h=>m.jsxs("div",{className:ye("px-3 py-2",!h.enabled&&"opacity-50"),children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[h.enabled&&m.jsx(Fv,{defaults:i,kind:"plugins",id:h.id}),m.jsx("span",{className:"min-w-0 break-all font-mono text-[11px]",children:h.id}),h.scope==="user"&&m.jsx(gs,{}),m.jsxs(Xe,{tone:"off",children:["v",h.version]}),m.jsx(Xe,{tone:h.enabled?"success":"off",children:h.enabled?"enabled":"disabled"}),m.jsx(Xe,{tone:"off",children:h.scope})]}),m.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:s(h.id)||"Nothing this hub can list."})]},h.id))}):m.jsx(Gt,{title:"No plugins installed."})})})}const QB=864e5,q5=7,ZB={user:"Every project on this machine",project:"Shared with the repository: committed with it, usually",local:"This project on this machine only"};function _g(e){var r;const i=(r=e.match(/^([A-Za-z]:[\\/]Users[\\/][^\\/]+|\/(?:home|Users)\/[^/]+)/))==null?void 0:r[1];return i?`~${e.slice(i.length)}`:e}function V5(e){var r;const i=e.expirySource==="token"?"read from the token":e.expirySource==="check"?"told by the service":"noted by you";if(e.expiresAt){const s=Date.parse(e.expiresAt)-Date.now(),l=`Expires ${Wi(e.expiresAt)}, ${i}`;if(s<=0)return{tone:"critical",text:"expired",title:l};const h=Math.ceil(s/QB);return h<=q5?{tone:"warning",text:`expires in ${h} day${h>1?"s":""}`,title:l}:{tone:"success",text:`expires ${new Date(e.expiresAt).toLocaleDateString()}`,title:l}}return(r=e.check)!=null&&r.ok?{tone:"success",text:"works",title:`${e.check.detail} Checked ${Wi(e.check.at)}.`}:null}function JB({variable:e}){const[i,r]=N.useState(null),s=async()=>{if(i!==null)return r(null);const l=await qe(()=>ve.variableValue(e.id));l&&r(l.value??"(not set)")};return m.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[m.jsx("code",{className:ye("min-w-0 truncate rounded bg-muted px-1.5 py-0.5 text-[11px]",i===null&&e.secret&&"tracking-wider"),title:i??e.shown,children:i??(e.shown||"(empty)")}),e.reference&&m.jsx(Xe,{tone:e.resolved?"success":"warning",children:e.resolved?"set here":"not set here"}),(e.secret||e.reference)&&m.jsx(ge,{variant:"ghost",size:"icon",title:i===null?"Show the value":"Hide it","aria-label":i===null?"Show the value":"Hide the value",onClick:()=>void s(),children:i===null?m.jsx(Ql,{size:12}):m.jsx(bg,{size:12})}),i!==null&&m.jsx(io,{text:i})]})}function eP({variable:e,onSaved:i}){const[r,s]=N.useState(!1),l=e.expirySource==="noted"&&e.expiresAt?e.expiresAt.slice(0,10):"",[h,p]=N.useState(l),o=async u=>{await qe(()=>ve.setVariableExpiry(e.id,u?`${u}T00:00:00`:null),u?"Noted.":"Cleared.")&&(s(!1),i())};return m.jsxs(Da,{open:r,onOpenChange:u=>{s(u),u&&p(l)},align:"end",className:"w-60 space-y-2 p-3",trigger:m.jsx(ge,{variant:"ghost",size:"icon",title:"Note when it expires","aria-label":"Note when it expires",children:m.jsx(Kl,{size:12})}),children:[m.jsx("div",{className:"text-xs font-medium",children:"When does it expire?"}),m.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["The page warns ",q5," days before. A date read from the token or the service comes first."]}),m.jsx(_t,{type:"date",value:h,onChange:u=>p(u.target.value)}),m.jsxs("div",{className:"flex justify-end gap-1.5",children:[l&&m.jsx(ge,{onClick:()=>void o(null),children:"Clear"}),m.jsx(ge,{variant:"primary",disabled:!h,onClick:()=>void o(h),children:"Save"})]})]})}function tP({holder:e,name:i}){const[r,s]=N.useState(""),[l,h]=N.useState(!1);return m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(_t,{autoFocus:!0,type:l?"text":"password",autoComplete:"off",value:r,onChange:p=>{s(p.target.value),e.value=p.target.value},placeholder:`New value for ${i}`,className:"font-mono"}),m.jsx(ge,{type:"button",variant:"ghost",size:"icon","aria-label":l?"Hide":"Show",onClick:()=>h(!l),children:l?m.jsx(bg,{size:13}):m.jsx(Ql,{size:13})})]})}function nP({variable:e,onChanged:i}){const r=ln(),[s,l]=N.useState(!1),h=V5(e),p=e.check&&!e.check.ok,o=()=>{const d={value:""};r({title:`${e.secret?"Rotate":"Edit"} ${e.name}`,description:`${e.where}, in ${_g(e.file)}`,body:m.jsxs("div",{className:"space-y-2",children:[m.jsx(tP,{holder:d,name:e.name}),m.jsxs("ul",{className:"list-disc space-y-0.5 pl-4 text-[11px] text-muted-foreground",children:[m.jsx("li",{children:"Written straight into the file; nothing else in it changes."}),e.scope==="project"&&m.jsx("li",{className:"text-severity-warning",children:"This file is shared with the repository: a secret here gets committed. A local-scope server keeps it on this machine."}),m.jsx("li",{children:"Sessions started from now on use it; a running one keeps the old value until it is restarted."})]})]}),confirmLabel:"Write to file",run:async()=>{if(!d.value)throw new Error("Type the new value first.");await ve.saveVariable(e.id,d.value),_e.getState().notify(`Written to ${_g(e.file)}.`),i()}})},u=async()=>{l(!0),await qe(()=>ve.checkVariable(e.id)),l(!1),i()};return m.jsxs("div",{className:"grid grid-cols-1 items-center gap-x-3 gap-y-1 px-3 py-2 sm:grid-cols-[minmax(0,14rem)_minmax(0,1fr)_auto]",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"truncate font-mono text-xs",title:e.name,children:e.name}),m.jsxs("div",{className:"truncate text-[10px] text-muted-foreground",title:e.where,children:[e.where,e.kind&&` · ${e.kind}`]})]}),m.jsx(JB,{variable:e}),m.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1",children:[p&&m.jsx("span",{title:`${e.check.detail} Checked ${Wi(e.check.at)}.`,children:m.jsx(Xe,{tone:"critical",children:"not accepted"})}),h&&m.jsx("span",{title:h.title,children:m.jsx(Xe,{tone:h.tone,children:h.text})}),e.checkable&&m.jsx(ge,{variant:"ghost",size:"icon",disabled:s,title:"Ask its service whether it still works (and, for GitHub, when it expires)","aria-label":"Check",onClick:()=>void u(),children:s?m.jsx(so,{size:12,className:"animate-spin"}):m.jsx(T4,{size:12})}),e.secret&&!e.reference&&e.expirySource!=="token"&&m.jsx(eP,{variable:e,onSaved:i}),e.editable&&m.jsx(ge,{variant:"ghost",title:"Write a new value into the file",onClick:o,children:e.secret?"Rotate":"Edit"})]})]})}function iP(){var p;const e=rt(()=>ve.variables(),["files"]),[i,r]=N.useState(""),s=(e.data??[]).filter(o=>!i||`${o.name} ${o.where} ${o.file}`.toLowerCase().includes(i.toLowerCase())),l=[...new Set(s.map(o=>o.file))],h=(e.data??[]).filter(o=>{const u=V5(o);return o.check&&!o.check.ok||(u==null?void 0:u.tone)==="critical"||(u==null?void 0:u.tone)==="warning"}).length;return m.jsx("div",{className:"h-full overflow-y-auto",children:m.jsxs("div",{className:"space-y-4 p-5",children:[m.jsx(Qi,{group:"Project",title:"Variables",description:"What Claude Code is given through its files: MCP servers' env and headers, and settings env.",action:m.jsxs(ge,{onClick:e.reload,title:"Read the files again",children:[m.jsx(so,{size:12})," Reload"]})}),m.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.jsx(_t,{value:i,onChange:o=>r(o.target.value),placeholder:"Filter by name, server or file",className:"max-w-xs"}),h>0&&m.jsxs(Xe,{tone:"warning",children:[h," need attention"]})]}),e.data&&!e.data.length&&m.jsx(Gt,{title:"No variables yet.",hint:"None of .mcp.json, ~/.claude.json or the settings files gives Claude Code an env value or a header for this project."}),(p=e.data)!=null&&p.length&&!s.length?m.jsx(Gt,{variant:"inline",title:"Nothing matches the filter."}):null,l.map(o=>{const u=s.filter(v=>v.file===o),d=[...new Set(u.map(v=>v.scope))];return m.jsxs("section",{className:"rounded-md border",children:[m.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/40 px-3 py-1.5",children:[m.jsx(Cg,{size:12,className:"shrink-0 text-muted-foreground"}),m.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",title:o,children:_g(o)}),d.map(v=>m.jsx("span",{title:ZB[v],children:m.jsx(Xe,{tone:"off",children:v})},v)),m.jsx(io,{text:o,className:"ml-auto"})]}),m.jsx("div",{className:"divide-y",children:u.map(v=>m.jsx(nP,{variable:v,onChanged:e.reload},v.id))})]},o)})]})})}function W5(){const e=ln();return async i=>{if(!i.length)return;const{drafts:r,drop:s}=on.getState(),l=i.filter(_=>ls(r[_]));if(l.length&&!await e({title:l.length===1?`Close ${l[0].split("/").pop()} without saving?`:`Close ${l.length} files without saving?`,description:"Their unsaved edits are lost.",body:l.length>1?m.jsx("div",{className:"space-y-0.5 font-mono text-[11px] text-muted-foreground",children:l.map(x=>m.jsx("div",{children:x},x))}):void 0,confirmLabel:"Discard and close",tone:"destructive"}))return;for(const _ of i)s(_);const{view:h,go:p,sessions:o}=_e.getState(),u=h.kind==="file"?h.path:null,d=new Map(i.map(_=>[_,_T(_)])),v=In.getState().close(i,u);if(!u||v===u)return;const c=d.get(u);if(c&&o.some(_=>_.id===c))return p({kind:"session",id:c});p(v?{kind:"file",path:v}:{kind:"page",page:"overview"})}}function rP({path:e,x:i,y:r,onClose:s}){const l=In(u=>u.tabs),h=W5();N.useEffect(()=>{const u=()=>s(),d=v=>v.key==="Escape"&&s();return window.addEventListener("pointerdown",u),window.addEventListener("keydown",d),()=>{window.removeEventListener("pointerdown",u),window.removeEventListener("keydown",d)}},[s]);const p=l.findIndex(u=>u.path===e),o=[["Close",xn,()=>void h([e])],["Close Others",Xs,()=>void h(l.filter(u=>u.path!==e).map(u=>u.path)),l.length<2],["Close to the Right",Xs,()=>void h(l.slice(p+1).map(u=>u.path)),p===l.length-1],["Close All",Xs,()=>void h(l.map(u=>u.path))],["Copy Relative Path",Ah,()=>{var u;return void((u=navigator.clipboard)==null?void 0:u.writeText(e))}],["Reveal in File Explorer",Zs,()=>void qe(()=>Jt.reveal(e))]];return m.jsx("div",{role:"menu",className:"fixed z-50 w-48 rounded-lg border bg-card p-1 shadow-lg",style:{left:Math.min(i,window.innerWidth-200),top:Math.min(r,window.innerHeight-230)},onPointerDown:u=>u.stopPropagation(),children:o.map(([u,d,v,c],_)=>m.jsxs("button",{disabled:c,onClick:()=>{s(),v()},className:ye("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",_===4&&"mt-1 border-t pt-2"),children:[m.jsx(d,{size:13}),u]},u))})}function sP({active:e}){const i=In(x=>x.tabs),{pin:r,reorder:s}=In.getState(),l=on(x=>x.drafts),h=_e(x=>x.go),p=W5(),[o,u]=N.useState(null),[d,v]=N.useState(null),c=N.useRef(null);if(N.useEffect(()=>{var x,C;e&&((C=(x=c.current)==null?void 0:x.querySelector(`[data-path="${CSS.escape(e)}"]`))==null||C.scrollIntoView({block:"nearest",inline:"nearest"}))},[e,i.length]),!i.length)return null;const _=i.map(x=>x.path.split("/").pop()??x.path);return m.jsxs("div",{ref:c,className:"no-scrollbar flex shrink-0 overflow-x-auto border-b bg-muted/30",children:[o&&m.jsx(rP,{...o,onClose:()=>u(null)}),i.map((x,C)=>{const y=_[C],g=_.filter(T=>T===y).length>1,b=x.path.includes("/")?x.path.slice(0,x.path.lastIndexOf("/")):"",S=ls(l[x.path]),w=x.path===e;return m.jsxs("div",{"data-path":x.path,draggable:!0,title:x.path,onClick:()=>h({kind:"file",path:x.path}),onDoubleClick:()=>r(x.path),onAuxClick:T=>{T.button===1&&(T.preventDefault(),p([x.path]))},onContextMenu:T=>{T.preventDefault(),u({path:x.path,x:T.clientX,y:T.clientY})},onDragStart:T=>{v(x.path),T.dataTransfer.effectAllowed="move"},onDragOver:T=>{!d||d===x.path||(T.preventDefault(),s(d,x.path))},onDragEnd:()=>v(null),className:ye("group flex max-w-[16rem] shrink-0 cursor-pointer select-none items-center gap-1.5 border-r border-t-2 px-3 py-1.5 text-xs transition-colors",w?"-mb-px border-t-primary bg-background text-foreground":"border-t-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground",d===x.path&&"opacity-50"),children:[m.jsx(u5,{name:y,size:13}),m.jsx("span",{className:ye("truncate",x.preview&&"italic"),children:y}),g&&b&&m.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b}),m.jsx("button",{"aria-label":`Close ${y}`,title:"Close",onClick:T=>{T.stopPropagation(),p([x.path])},className:ye("grid h-4 w-4 shrink-0 place-items-center rounded hover:bg-muted",!S&&!w&&"invisible group-hover:visible"),children:S?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"h-2 w-2 rounded-full bg-foreground group-hover:hidden"}),m.jsx(xn,{size:12,className:"hidden group-hover:block"})]}):m.jsx(xn,{size:12})})]},x.path)})]})}const Mw="clauder-hub:sidebar-collapsed";function Nw({text:e,failed:i}){const r=i?Zw:Uw;return m.jsxs("div",{role:i?"alert":"status",className:ye("fixed bottom-4 left-1/2 z-[60] flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-xl px-3.5 py-2.5 text-xs opacity-85 shadow-lg shadow-black/25 transition-opacity animate-in fade-in-0 slide-in-from-bottom-2 hover:opacity-100 sm:max-w-lg",i?"bg-primary text-primary-foreground":"bg-success text-success-foreground"),children:[m.jsx(r,{size:15,className:"shrink-0"}),m.jsx("span",{className:"min-w-0 break-words",children:e})]})}function Ow(){const e=_e(i=>i.switching);return e?m.jsx("div",{role:"progressbar","aria-label":`Opening ${e}`,title:`Opening ${e}...`,className:"pointer-events-none fixed inset-x-0 top-0 z-[70] h-0.5 overflow-hidden bg-primary/20",children:m.jsx("div",{className:"switching-bar h-full w-2/5 bg-primary"})}):null}const oP={overview:()=>m.jsx(PB,{}),inbox:()=>m.jsx(OB,{}),automation:()=>m.jsx(UD,{}),instructions:()=>m.jsx(WB,{}),agents:()=>m.jsx(Em,{kind:"agents"},"agents"),skills:()=>m.jsx(Em,{kind:"skills"},"skills"),commands:()=>m.jsx(Em,{kind:"commands"},"commands"),"mcp-servers":()=>m.jsx(YB,{}),variables:()=>m.jsx(iP,{}),hooks:()=>m.jsx(KB,{}),plugins:()=>m.jsx(XB,{}),channels:()=>m.jsx(XC,{}),"hub-prompts":()=>m.jsx(X8,{}),"claude-settings":()=>m.jsx(iL,{}),"mcp-suggestions":()=>m.jsx(BB,{}),presets:()=>m.jsx(FB,{}),categories:()=>m.jsx(QD,{})};function aP(){const{boot:e,view:i,toast:r,health:s,windowed:l,projectId:h}=_e(),[p,o]=N.useState(null),u=Ch("clauder-hub:sidebar-width",280,{min:220,max:480}),d=Ch("clauder-hub:live-panel-width",260,{min:200,max:420}),v=sd(D=>D.open),c=l5("(min-width: 768px)"),[_,x]=N.useState(!1),[C,y]=N.useState(()=>{try{return localStorage.getItem(Mw)==="1"}catch{return!1}});N.useEffect(()=>{try{localStorage.setItem(Mw,C?"1":"0")}catch{}},[C]),N.useEffect(()=>x(!1),[i,c]);const g=_e(D=>D.sessions.some(R=>R.live)),b=In(D=>D.tabs.length>0),S=g||b;N.useEffect(()=>{if(!S)return;const D=R=>{R.preventDefault(),R.returnValue=""};return window.addEventListener("beforeunload",D),()=>window.removeEventListener("beforeunload",D)},[S]),N.useEffect(()=>{if(l)return;const D=R=>{!R.ctrlKey||R.altKey||R.metaKey||R.code!=="Backquote"||(R.preventDefault(),R.stopPropagation(),y(!1),c||x(!0),window.setTimeout(()=>window.dispatchEvent(new Event(vg)),30))};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[l,c]),N.useEffect(()=>{if(!_)return;const D=R=>R.key==="Escape"&&x(!1);return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[_]),N.useEffect(()=>{e().catch(D=>o(D.message))},[e]);const w=l9();if(N.useEffect(()=>{s&&(document.title=w?`(${w}) ${s.project}`:s.project)},[s,w]),!s)return m.jsx("div",{className:"grid h-screen place-items-center text-xs text-muted-foreground",children:"Opening the project..."});if(h===pi)return m.jsxs(Vy,{children:[m.jsx(NB,{}),m.jsx(Ow,{}),m.jsx(sw,{}),m.jsx(ow,{}),(p||r)&&m.jsx(Nw,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]});const T=i.kind==="session"?m.jsx(P5,{id:i.id},i.id):i.kind==="file"?m.jsx(G8,{path:i.path},i.path):oP[i.page]();return m.jsx(Vy,{children:m.jsxs("div",{className:"flex h-screen overflow-hidden",children:[!l&&c&&m.jsx(mw,{width:u.width,collapsed:C,onToggle:()=>y(!C)}),!l&&c&&!C&&m.jsx(Eh,{onDrag:u.resizeBy,onReset:u.reset}),!l&&!c&&m.jsxs(m.Fragment,{children:[_&&m.jsx("div",{className:"fixed inset-0 z-40 bg-foreground/40 animate-in fade-in-0",onClick:()=>x(!1)}),m.jsx("div",{inert:!_,className:ye("fixed inset-y-0 left-0 z-40 flex border-r bg-background transition-transform duration-200",_?"translate-x-0 shadow-xl":"-translate-x-full"),children:m.jsx(mw,{width:"min(280px, 85vw)",collapsed:!1,onToggle:()=>x(!1),drawer:!0})})]}),m.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[!l&&!c&&m.jsx(F9,{onMenu:()=>x(!0)}),m.jsx(z5,{}),!l&&m.jsx($9,{}),!l&&m.jsx(sP,{active:i.kind==="file"?i.path:null}),m.jsx("div",{className:"min-h-0 flex-1",children:T})]}),!l&&c&&v&&m.jsx(Eh,{onDrag:D=>d.resizeBy(-D),onReset:d.reset}),!l&&c&&v&&m.jsx(A5,{width:d.width}),m.jsx(Ow,{}),m.jsx(sw,{}),m.jsx(ow,{}),(p||r)&&m.jsx(Nw,{text:p??(r==null?void 0:r.text),failed:!!p||(r==null?void 0:r.tone)==="error"})]},h)})}Y3.createRoot(document.getElementById("root")).render(m.jsx(Nl.StrictMode,{children:m.jsx(aP,{})}));export{Nl as W,lL as _,Jt as f,xg as g,m as j,N as r,_e as u};