maxsimcli 3.8.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/assets/CHANGELOG.md +14 -0
- package/dist/assets/dashboard/client/assets/index-CtVWREze.js +233 -0
- package/dist/assets/dashboard/client/assets/index-Dp_gMUmG.css +32 -0
- package/dist/assets/dashboard/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/dashboard/client/assets/index-CLRX0EWc.js +0 -217
- package/dist/assets/dashboard/client/assets/index-CcYax_Rz.css +0 -32
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=i(r);fetch(r.href,s)}})();function WS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Hv={exports:{}},bu={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var J5;function Nj(){if(J5)return bu;J5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(n,r,s){var o=null;if(s!==void 0&&(o=""+s),r.key!==void 0&&(o=""+r.key),"key"in r){s={};for(var l in r)l!=="key"&&(s[l]=r[l])}else s=r;return r=s.ref,{$$typeof:t,type:n,key:o,ref:r!==void 0?r:null,props:s}}return bu.Fragment=e,bu.jsx=i,bu.jsxs=i,bu}var eT;function jj(){return eT||(eT=1,Hv.exports=Nj()),Hv.exports}var S=jj(),Fv={exports:{}},je={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var tT;function Ij(){if(tT)return je;tT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function O(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function w(I,K,Q){this.props=I,this.context=K,this.refs=x,this.updater=Q||_}w.prototype.isReactComponent={},w.prototype.setState=function(I,K){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,K,"setState")},w.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function k(){}k.prototype=w.prototype;function T(I,K,Q){this.props=I,this.context=K,this.refs=x,this.updater=Q||_}var A=T.prototype=new k;A.constructor=T,b(A,w.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function E(){}var N={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function Z(I,K,Q){var ue=Q.ref;return{$$typeof:t,type:I,key:K,ref:ue!==void 0?ue:null,props:Q}}function J(I,K){return Z(I.type,K,I.props)}function U(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function R(I){var K={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Q){return K[Q]})}var B=/\/+/g;function D(I,K){return typeof I=="object"&&I!==null&&I.key!=null?R(""+I.key):K.toString(36)}function j(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(E,E):(I.status="pending",I.then(function(K){I.status==="pending"&&(I.status="fulfilled",I.value=K)},function(K){I.status==="pending"&&(I.status="rejected",I.reason=K)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function $(I,K,Q,ue,he){var fe=typeof I;(fe==="undefined"||fe==="boolean")&&(I=null);var Oe=!1;if(I===null)Oe=!0;else switch(fe){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(I.$$typeof){case t:case e:Oe=!0;break;case d:return Oe=I._init,$(Oe(I._payload),K,Q,ue,he)}}if(Oe)return he=he(I),Oe=ue===""?"."+D(I,0):ue,L(he)?(Q="",Oe!=null&&(Q=Oe.replace(B,"$&/")+"/"),$(he,K,Q,"",function(nt){return nt})):he!=null&&(U(he)&&(he=J(he,Q+(he.key==null||I&&I.key===he.key?"":(""+he.key).replace(B,"$&/")+"/")+Oe)),K.push(he)),1;Oe=0;var Ce=ue===""?".":ue+":";if(L(I))for(var ye=0;ye<I.length;ye++)ue=I[ye],fe=Ce+D(ue,ye),Oe+=$(ue,K,Q,fe,he);else if(ye=O(I),typeof ye=="function")for(I=ye.call(I),ye=0;!(ue=I.next()).done;)ue=ue.value,fe=Ce+D(ue,ye++),Oe+=$(ue,K,Q,fe,he);else if(fe==="object"){if(typeof I.then=="function")return $(j(I),K,Q,ue,he);throw K=String(I),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function X(I,K,Q){if(I==null)return I;var ue=[],he=0;return $(I,ue,"","",function(fe){return K.call(Q,fe,he++)}),ue}function H(I){if(I._status===-1){var K=I._result;K=K(),K.then(function(Q){(I._status===0||I._status===-1)&&(I._status=1,I._result=Q)},function(Q){(I._status===0||I._status===-1)&&(I._status=2,I._result=Q)}),I._status===-1&&(I._status=0,I._result=K)}if(I._status===1)return I._result.default;throw I._result}var F=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},M={map:X,forEach:function(I,K,Q){X(I,function(){K.apply(this,arguments)},Q)},count:function(I){var K=0;return X(I,function(){K++}),K},toArray:function(I){return X(I,function(K){return K})||[]},only:function(I){if(!U(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return je.Activity=p,je.Children=M,je.Component=w,je.Fragment=i,je.Profiler=r,je.PureComponent=T,je.StrictMode=n,je.Suspense=c,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,je.__COMPILER_RUNTIME={__proto__:null,c:function(I){return N.H.useMemoCache(I)}},je.cache=function(I){return function(){return I.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(I,K,Q){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ue=b({},I.props),he=I.key;if(K!=null)for(fe in K.key!==void 0&&(he=""+K.key),K)!z.call(K,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&K.ref===void 0||(ue[fe]=K[fe]);var fe=arguments.length-2;if(fe===1)ue.children=Q;else if(1<fe){for(var Oe=Array(fe),Ce=0;Ce<fe;Ce++)Oe[Ce]=arguments[Ce+2];ue.children=Oe}return Z(I.type,he,ue)},je.createContext=function(I){return I={$$typeof:o,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:s,_context:I},I},je.createElement=function(I,K,Q){var ue,he={},fe=null;if(K!=null)for(ue in K.key!==void 0&&(fe=""+K.key),K)z.call(K,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(he[ue]=K[ue]);var Oe=arguments.length-2;if(Oe===1)he.children=Q;else if(1<Oe){for(var Ce=Array(Oe),ye=0;ye<Oe;ye++)Ce[ye]=arguments[ye+2];he.children=Ce}if(I&&I.defaultProps)for(ue in Oe=I.defaultProps,Oe)he[ue]===void 0&&(he[ue]=Oe[ue]);return Z(I,fe,he)},je.createRef=function(){return{current:null}},je.forwardRef=function(I){return{$$typeof:l,render:I}},je.isValidElement=U,je.lazy=function(I){return{$$typeof:d,_payload:{_status:-1,_result:I},_init:H}},je.memo=function(I,K){return{$$typeof:u,type:I,compare:K===void 0?null:K}},je.startTransition=function(I){var K=N.T,Q={};N.T=Q;try{var ue=I(),he=N.S;he!==null&&he(Q,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(E,F)}catch(fe){F(fe)}finally{K!==null&&Q.types!==null&&(K.types=Q.types),N.T=K}},je.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},je.use=function(I){return N.H.use(I)},je.useActionState=function(I,K,Q){return N.H.useActionState(I,K,Q)},je.useCallback=function(I,K){return N.H.useCallback(I,K)},je.useContext=function(I){return N.H.useContext(I)},je.useDebugValue=function(){},je.useDeferredValue=function(I,K){return N.H.useDeferredValue(I,K)},je.useEffect=function(I,K){return N.H.useEffect(I,K)},je.useEffectEvent=function(I){return N.H.useEffectEvent(I)},je.useId=function(){return N.H.useId()},je.useImperativeHandle=function(I,K,Q){return N.H.useImperativeHandle(I,K,Q)},je.useInsertionEffect=function(I,K){return N.H.useInsertionEffect(I,K)},je.useLayoutEffect=function(I,K){return N.H.useLayoutEffect(I,K)},je.useMemo=function(I,K){return N.H.useMemo(I,K)},je.useOptimistic=function(I,K){return N.H.useOptimistic(I,K)},je.useReducer=function(I,K,Q){return N.H.useReducer(I,K,Q)},je.useRef=function(I){return N.H.useRef(I)},je.useState=function(I){return N.H.useState(I)},je.useSyncExternalStore=function(I,K,Q){return N.H.useSyncExternalStore(I,K,Q)},je.useTransition=function(){return N.H.useTransition()},je.version="19.2.4",je}var iT;function US(){return iT||(iT=1,Fv.exports=Ij()),Fv.exports}var q=US(),Gv={exports:{}},Su={},Kv={exports:{}},Jv={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var nT;function Vj(){return nT||(nT=1,(function(t){function e($,X){var H=$.length;$.push(X);e:for(;0<H;){var F=H-1>>>1,M=$[F];if(0<r(M,X))$[F]=X,$[H]=M,H=F;else break e}}function i($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var X=$[0],H=$.pop();if(H!==X){$[0]=H;e:for(var F=0,M=$.length,I=M>>>1;F<I;){var K=2*(F+1)-1,Q=$[K],ue=K+1,he=$[ue];if(0>r(Q,H))ue<M&&0>r(he,Q)?($[F]=he,$[ue]=H,F=ue):($[F]=Q,$[K]=H,F=K);else if(ue<M&&0>r(he,H))$[F]=he,$[ue]=H,F=ue;else break e}}return X}function r($,X){var H=$.sortIndex-X.sortIndex;return H!==0?H:$.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,p=null,g=3,O=!1,_=!1,b=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A($){for(var X=i(u);X!==null;){if(X.callback===null)n(u);else if(X.startTime<=$)n(u),X.sortIndex=X.expirationTime,e(c,X);else break;X=i(u)}}function L($){if(b=!1,A($),!_)if(i(c)!==null)_=!0,E||(E=!0,R());else{var X=i(u);X!==null&&j(L,X.startTime-$)}}var E=!1,N=-1,z=5,Z=-1;function J(){return x?!0:!(t.unstable_now()-Z<z)}function U(){if(x=!1,E){var $=t.unstable_now();Z=$;var X=!0;try{e:{_=!1,b&&(b=!1,k(N),N=-1),O=!0;var H=g;try{t:{for(A($),p=i(c);p!==null&&!(p.expirationTime>$&&J());){var F=p.callback;if(typeof F=="function"){p.callback=null,g=p.priorityLevel;var M=F(p.expirationTime<=$);if($=t.unstable_now(),typeof M=="function"){p.callback=M,A($),X=!0;break t}p===i(c)&&n(c),A($)}else n(c);p=i(c)}if(p!==null)X=!0;else{var I=i(u);I!==null&&j(L,I.startTime-$),X=!1}}break e}finally{p=null,g=H,O=!1}X=void 0}}finally{X?R():E=!1}}}var R;if(typeof T=="function")R=function(){T(U)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=U,R=function(){D.postMessage(null)}}else R=function(){w(U,0)};function j($,X){N=w(function(){$(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function($){switch(g){case 1:case 2:case 3:var X=3;break;default:X=g}var H=g;g=X;try{return $()}finally{g=H}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function($,X){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=g;g=$;try{return X()}finally{g=H}},t.unstable_scheduleCallback=function($,X,H){var F=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?F+H:F):H=F,$){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=H+M,$={id:d++,callback:X,priorityLevel:$,startTime:H,expirationTime:M,sortIndex:-1},H>F?($.sortIndex=H,e(u,$),i(c)===null&&$===i(u)&&(b?(k(N),N=-1):b=!0,j(L,H-F))):($.sortIndex=M,e(c,$),_||O||(_=!0,E||(E=!0,R()))),$},t.unstable_shouldYield=J,t.unstable_wrapCallback=function($){var X=g;return function(){var H=g;g=X;try{return $.apply(this,arguments)}finally{g=H}}}})(Jv)),Jv}var rT;function Xj(){return rT||(rT=1,Kv.exports=Vj()),Kv.exports}var e_={exports:{}},Ji={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var sT;function Zj(){if(sT)return Ji;sT=1;var t=US();function e(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var n={d:{f:i,r:function(){throw Error(e(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(c,u,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:c,containerInfo:u,implementation:d}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Ji.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Ji.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(c,u,null,d)},Ji.flushSync=function(c){var u=o.T,d=n.p;try{if(o.T=null,n.p=2,c)return c()}finally{o.T=u,n.p=d,n.d.f()}},Ji.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},Ji.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},Ji.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,p=l(d,u.crossOrigin),g=typeof u.integrity=="string"?u.integrity:void 0,O=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:O}):d==="script"&&n.d.X(c,{crossOrigin:p,integrity:g,fetchPriority:O,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Ji.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},Ji.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,p=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Ji.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},Ji.requestFormReset=function(c){n.d.r(c)},Ji.unstable_batchedUpdates=function(c,u){return c(u)},Ji.useFormState=function(c,u,d){return o.H.useFormState(c,u,d)},Ji.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ji.version="19.2.4",Ji}var oT;function qj(){if(oT)return e_.exports;oT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),e_.exports=Zj(),e_.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var aT;function Wj(){if(aT)return Su;aT=1;var t=Xj(),e=US(),i=qj();function n(a){var h="https://react.dev/errors/"+a;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)h+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+a+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var h=a,f=a;if(a.alternate)for(;h.return;)h=h.return;else{a=h;do h=a,(h.flags&4098)!==0&&(f=h.return),a=h.return;while(a)}return h.tag===3?f:null}function o(a){if(a.tag===13){var h=a.memoizedState;if(h===null&&(a=a.alternate,a!==null&&(h=a.memoizedState)),h!==null)return h.dehydrated}return null}function l(a){if(a.tag===31){var h=a.memoizedState;if(h===null&&(a=a.alternate,a!==null&&(h=a.memoizedState)),h!==null)return h.dehydrated}return null}function c(a){if(s(a)!==a)throw Error(n(188))}function u(a){var h=a.alternate;if(!h){if(h=s(a),h===null)throw Error(n(188));return h!==a?null:a}for(var f=a,m=h;;){var v=f.return;if(v===null)break;var y=v.alternate;if(y===null){if(m=v.return,m!==null){f=m;continue}break}if(v.child===y.child){for(y=v.child;y;){if(y===f)return c(v),a;if(y===m)return c(v),h;y=y.sibling}throw Error(n(188))}if(f.return!==m.return)f=v,m=y;else{for(var C=!1,P=v.child;P;){if(P===f){C=!0,f=v,m=y;break}if(P===m){C=!0,m=v,f=y;break}P=P.sibling}if(!C){for(P=y.child;P;){if(P===f){C=!0,f=y,m=v;break}if(P===m){C=!0,m=y,f=v;break}P=P.sibling}if(!C)throw Error(n(189))}}if(f.alternate!==m)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?a:h}function d(a){var h=a.tag;if(h===5||h===26||h===27||h===6)return a;for(a=a.child;a!==null;){if(h=d(a),h!==null)return h;a=a.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function R(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var B=Symbol.for("react.client.reference");function D(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===B?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case b:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case L:return"Suspense";case E:return"SuspenseList";case Z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case _:return"Portal";case T:return a.displayName||"Context";case k:return(a._context.displayName||"Context")+".Consumer";case A:var h=a.render;return a=a.displayName,a||(a=h.displayName||h.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case N:return h=a.displayName||null,h!==null?h:D(a.type)||"Memo";case z:h=a._payload,a=a._init;try{return D(a(h))}catch{}}return null}var j=Array.isArray,$=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},F=[],M=-1;function I(a){return{current:a}}function K(a){0>M||(a.current=F[M],F[M]=null,M--)}function Q(a,h){M++,F[M]=a.current,a.current=h}var ue=I(null),he=I(null),fe=I(null),Oe=I(null);function Ce(a,h){switch(Q(fe,h),Q(he,a),Q(ue,null),h.nodeType){case 9:case 11:a=(a=h.documentElement)&&(a=a.namespaceURI)?S5(a):0;break;default:if(a=h.tagName,h=h.namespaceURI)h=S5(h),a=x5(h,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}K(ue),Q(ue,a)}function ye(){K(ue),K(he),K(fe)}function nt(a){a.memoizedState!==null&&Q(Oe,a);var h=ue.current,f=x5(h,a.type);h!==f&&(Q(he,a),Q(ue,f))}function Qt(a){he.current===a&&(K(ue),K(he)),Oe.current===a&&(K(Oe),Ou._currentValue=H)}var Yt,ei;function Le(a){if(Yt===void 0)try{throw Error()}catch(f){var h=f.stack.trim().match(/\n( *(at )?)/);Yt=h&&h[1]||"",ei=-1<f.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Yt+a+ei}var ar=!1;function Co(a,h){if(!a||ar)return"";ar=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(h){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ne){var ie=ne}Reflect.construct(a,[],le)}else{try{le.call()}catch(ne){ie=ne}a.call(le.prototype)}}else{try{throw Error()}catch(ne){ie=ne}(le=a())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ne){if(ne&&ie&&typeof ne.stack=="string")return[ne.stack,ie.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=m.DetermineComponentFrameRoot(),C=y[0],P=y[1];if(C&&P){var W=C.split(`
|
|
44
|
+
`),te=P.split(`
|
|
45
|
+
`);for(v=m=0;m<W.length&&!W[m].includes("DetermineComponentFrameRoot");)m++;for(;v<te.length&&!te[v].includes("DetermineComponentFrameRoot");)v++;if(m===W.length||v===te.length)for(m=W.length-1,v=te.length-1;1<=m&&0<=v&&W[m]!==te[v];)v--;for(;1<=m&&0<=v;m--,v--)if(W[m]!==te[v]){if(m!==1||v!==1)do if(m--,v--,0>v||W[m]!==te[v]){var re=`
|
|
46
|
+
`+W[m].replace(" at new "," at ");return a.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",a.displayName)),re}while(1<=m&&0<=v);break}}}finally{ar=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Le(f):""}function ko(a,h){switch(a.tag){case 26:case 27:case 5:return Le(a.type);case 16:return Le("Lazy");case 13:return a.child!==h&&h!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Co(a.type,!1);case 11:return Co(a.type.render,!1);case 1:return Co(a.type,!0);case 31:return Le("Activity");default:return""}}function Qa(a){try{var h="",f=null;do h+=ko(a,f),f=a,a=a.return;while(a);return h}catch(m){return`
|
|
47
|
+
Error generating stack: `+m.message+`
|
|
48
|
+
`+m.stack}}var Ds=Object.prototype.hasOwnProperty,To=t.unstable_scheduleCallback,Eh=t.unstable_cancelCallback,LO=t.unstable_shouldYield,DO=t.unstable_requestPaint,cn=t.unstable_now,BO=t.unstable_getCurrentPriorityLevel,oe=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,ht=t.unstable_IdlePriority,In=t.log,Bs=t.unstable_setDisableYieldValue,hn=null,fi=null;function Sn(a){if(typeof In=="function"&&Bs(a),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(hn,a)}catch{}}var _t=Math.clz32?Math.clz32:CN,Ao=Math.log,Br=Math.LN2;function CN(a){return a>>>=0,a===0?32:31-(Ao(a)/Br|0)|0}var Td=256,Ad=262144,Ed=4194304;function La(a){var h=a&42;if(h!==0)return h;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Md(a,h,f){var m=a.pendingLanes;if(m===0)return 0;var v=0,y=a.suspendedLanes,C=a.pingedLanes;a=a.warmLanes;var P=m&134217727;return P!==0?(m=P&~y,m!==0?v=La(m):(C&=P,C!==0?v=La(C):f||(f=P&~a,f!==0&&(v=La(f))))):(P=m&~y,P!==0?v=La(P):C!==0?v=La(C):f||(f=m&~a,f!==0&&(v=La(f)))),v===0?0:h!==0&&h!==v&&(h&y)===0&&(y=v&-v,f=h&-h,y>=f||y===32&&(f&4194048)!==0)?h:v}function Mh(a,h){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&h)===0}function kN(a,h){switch(a){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 nC(){var a=Ed;return Ed<<=1,(Ed&62914560)===0&&(Ed=4194304),a}function $O(a){for(var h=[],f=0;31>f;f++)h.push(a);return h}function Ph(a,h){a.pendingLanes|=h,h!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function TN(a,h,f,m,v,y){var C=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var P=a.entanglements,W=a.expirationTimes,te=a.hiddenUpdates;for(f=C&~f;0<f;){var re=31-_t(f),le=1<<re;P[re]=0,W[re]=-1;var ie=te[re];if(ie!==null)for(te[re]=null,re=0;re<ie.length;re++){var ne=ie[re];ne!==null&&(ne.lane&=-536870913)}f&=~le}m!==0&&rC(a,m,0),y!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=y&~(C&~h))}function rC(a,h,f){a.pendingLanes|=h,a.suspendedLanes&=~h;var m=31-_t(h);a.entangledLanes|=h,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function sC(a,h){var f=a.entangledLanes|=h;for(a=a.entanglements;f;){var m=31-_t(f),v=1<<m;v&h|a[m]&h&&(a[m]|=h),f&=~v}}function oC(a,h){var f=h&-h;return f=(f&42)!==0?1:zO(f),(f&(a.suspendedLanes|h))!==0?0:f}function zO(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function NO(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function aC(){var a=X.p;return a!==0?a:(a=window.event,a===void 0?32:W5(a.type))}function lC(a,h){var f=X.p;try{return X.p=a,h()}finally{X.p=f}}var Eo=Math.random().toString(36).slice(2),zi="__reactFiber$"+Eo,xn="__reactProps$"+Eo,zl="__reactContainer$"+Eo,jO="__reactEvents$"+Eo,AN="__reactListeners$"+Eo,EN="__reactHandles$"+Eo,cC="__reactResources$"+Eo,Rh="__reactMarker$"+Eo;function IO(a){delete a[zi],delete a[xn],delete a[jO],delete a[AN],delete a[EN]}function Nl(a){var h=a[zi];if(h)return h;for(var f=a.parentNode;f;){if(h=f[zl]||f[zi]){if(f=h.alternate,h.child!==null||f!==null&&f.child!==null)for(a=M5(a);a!==null;){if(f=a[zi])return f;a=M5(a)}return h}a=f,f=a.parentNode}return null}function jl(a){if(a=a[zi]||a[zl]){var h=a.tag;if(h===5||h===6||h===13||h===31||h===26||h===27||h===3)return a}return null}function Qh(a){var h=a.tag;if(h===5||h===26||h===27||h===6)return a.stateNode;throw Error(n(33))}function Il(a){var h=a[cC];return h||(h=a[cC]={hoistableStyles:new Map,hoistableScripts:new Map}),h}function bi(a){a[Rh]=!0}var hC=new Set,uC={};function Da(a,h){Vl(a,h),Vl(a+"Capture",h)}function Vl(a,h){for(uC[a]=h,a=0;a<h.length;a++)hC.add(h[a])}var MN=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]*$"),fC={},dC={};function PN(a){return Ds.call(dC,a)?!0:Ds.call(fC,a)?!1:MN.test(a)?dC[a]=!0:(fC[a]=!0,!1)}function Pd(a,h,f){if(PN(h))if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(h);return;case"boolean":var m=h.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(h);return}}a.setAttribute(h,""+f)}}function Rd(a,h,f){if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttribute(h,""+f)}}function $s(a,h,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(h,f,""+m)}}function lr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function pC(a){var h=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function RN(a,h,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,h);if(!a.hasOwnProperty(h)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var v=m.get,y=m.set;return Object.defineProperty(a,h,{configurable:!0,get:function(){return v.call(this)},set:function(C){f=""+C,y.call(this,C)}}),Object.defineProperty(a,h,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(C){f=""+C},stopTracking:function(){a._valueTracker=null,delete a[h]}}}}function VO(a){if(!a._valueTracker){var h=pC(a)?"checked":"value";a._valueTracker=RN(a,h,""+a[h])}}function mC(a){if(!a)return!1;var h=a._valueTracker;if(!h)return!0;var f=h.getValue(),m="";return a&&(m=pC(a)?a.checked?"true":"false":a.value),a=m,a!==f?(h.setValue(a),!0):!1}function Qd(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var QN=/[\n"\\]/g;function cr(a){return a.replace(QN,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function XO(a,h,f,m,v,y,C,P){a.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?a.type=C:a.removeAttribute("type"),h!=null?C==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+lr(h)):a.value!==""+lr(h)&&(a.value=""+lr(h)):C!=="submit"&&C!=="reset"||a.removeAttribute("value"),h!=null?ZO(a,C,lr(h)):f!=null?ZO(a,C,lr(f)):m!=null&&a.removeAttribute("value"),v==null&&y!=null&&(a.defaultChecked=!!y),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?a.name=""+lr(P):a.removeAttribute("name")}function gC(a,h,f,m,v,y,C,P){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),h!=null||f!=null){if(!(y!=="submit"&&y!=="reset"||h!=null)){VO(a);return}f=f!=null?""+lr(f):"",h=h!=null?""+lr(h):f,P||h===a.value||(a.value=h),a.defaultValue=h}m=m??v,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=P?a.checked:!!m,a.defaultChecked=!!m,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(a.name=C),VO(a)}function ZO(a,h,f){h==="number"&&Qd(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Xl(a,h,f,m){if(a=a.options,h){h={};for(var v=0;v<f.length;v++)h["$"+f[v]]=!0;for(f=0;f<a.length;f++)v=h.hasOwnProperty("$"+a[f].value),a[f].selected!==v&&(a[f].selected=v),v&&m&&(a[f].defaultSelected=!0)}else{for(f=""+lr(f),h=null,v=0;v<a.length;v++){if(a[v].value===f){a[v].selected=!0,m&&(a[v].defaultSelected=!0);return}h!==null||a[v].disabled||(h=a[v])}h!==null&&(h.selected=!0)}}function OC(a,h,f){if(h!=null&&(h=""+lr(h),h!==a.value&&(a.value=h),f==null)){a.defaultValue!==h&&(a.defaultValue=h);return}a.defaultValue=f!=null?""+lr(f):""}function vC(a,h,f,m){if(h==null){if(m!=null){if(f!=null)throw Error(n(92));if(j(m)){if(1<m.length)throw Error(n(93));m=m[0]}f=m}f==null&&(f=""),h=f}f=lr(h),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),VO(a)}function Zl(a,h){if(h){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=h;return}}a.textContent=h}var LN=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(a,h,f){var m=h.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="":m?a.setProperty(h,f):typeof f!="number"||f===0||LN.has(h)?h==="float"?a.cssFloat=f:a[h]=(""+f).trim():a[h]=f+"px"}function yC(a,h,f){if(h!=null&&typeof h!="object")throw Error(n(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||h!=null&&h.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var v in h)m=h[v],h.hasOwnProperty(v)&&f[v]!==m&&_C(a,v,m)}else for(var y in h)h.hasOwnProperty(y)&&_C(a,y,h[y])}function qO(a){if(a.indexOf("-")===-1)return!1;switch(a){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 DN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),BN=/^[\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 Ld(a){return BN.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function zs(){}var WO=null;function UO(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ql=null,Wl=null;function bC(a){var h=jl(a);if(h&&(a=h.stateNode)){var f=a[xn]||null;e:switch(a=h.stateNode,h.type){case"input":if(XO(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),h=f.name,f.type==="radio"&&h!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+cr(""+h)+'"][type="radio"]'),h=0;h<f.length;h++){var m=f[h];if(m!==a&&m.form===a.form){var v=m[xn]||null;if(!v)throw Error(n(90));XO(m,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(h=0;h<f.length;h++)m=f[h],m.form===a.form&&mC(m)}break e;case"textarea":OC(a,f.value,f.defaultValue);break e;case"select":h=f.value,h!=null&&Xl(a,!!f.multiple,h,!1)}}}var YO=!1;function SC(a,h,f){if(YO)return a(h,f);YO=!0;try{var m=a(h);return m}finally{if(YO=!1,(ql!==null||Wl!==null)&&(bp(),ql&&(h=ql,a=Wl,Wl=ql=null,bC(h),a)))for(h=0;h<a.length;h++)bC(a[h])}}function Lh(a,h){var f=a.stateNode;if(f===null)return null;var m=f[xn]||null;if(m===null)return null;f=m[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,h,typeof f));return f}var Ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),HO=!1;if(Ns)try{var Dh={};Object.defineProperty(Dh,"passive",{get:function(){HO=!0}}),window.addEventListener("test",Dh,Dh),window.removeEventListener("test",Dh,Dh)}catch{HO=!1}var Mo=null,FO=null,Dd=null;function xC(){if(Dd)return Dd;var a,h=FO,f=h.length,m,v="value"in Mo?Mo.value:Mo.textContent,y=v.length;for(a=0;a<f&&h[a]===v[a];a++);var C=f-a;for(m=1;m<=C&&h[f-m]===v[y-m];m++);return Dd=v.slice(a,1<m?1-m:void 0)}function Bd(a){var h=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&h===13&&(a=13)):a=h,a===10&&(a=13),32<=a||a===13?a:0}function $d(){return!0}function wC(){return!1}function wn(a){function h(f,m,v,y,C){this._reactName=f,this._targetInst=v,this.type=m,this.nativeEvent=y,this.target=C,this.currentTarget=null;for(var P in a)a.hasOwnProperty(P)&&(f=a[P],this[P]=f?f(y):y[P]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?$d:wC,this.isPropagationStopped=wC,this}return p(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=$d)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=$d)},persist:function(){},isPersistent:$d}),h}var Ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zd=wn(Ba),Bh=p({},Ba,{view:0,detail:0}),$N=wn(Bh),GO,KO,$h,Nd=p({},Bh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:e0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==$h&&($h&&a.type==="mousemove"?(GO=a.screenX-$h.screenX,KO=a.screenY-$h.screenY):KO=GO=0,$h=a),GO)},movementY:function(a){return"movementY"in a?a.movementY:KO}}),CC=wn(Nd),zN=p({},Nd,{dataTransfer:0}),NN=wn(zN),jN=p({},Bh,{relatedTarget:0}),JO=wn(jN),IN=p({},Ba,{animationName:0,elapsedTime:0,pseudoElement:0}),VN=wn(IN),XN=p({},Ba,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ZN=wn(XN),qN=p({},Ba,{data:0}),kC=wn(qN),WN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UN={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"},YN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HN(a){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(a):(a=YN[a])?!!h[a]:!1}function e0(){return HN}var FN=p({},Bh,{key:function(a){if(a.key){var h=WN[a.key]||a.key;if(h!=="Unidentified")return h}return a.type==="keypress"?(a=Bd(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?UN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:e0,charCode:function(a){return a.type==="keypress"?Bd(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Bd(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),GN=wn(FN),KN=p({},Nd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),TC=wn(KN),JN=p({},Bh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:e0}),e8=wn(JN),t8=p({},Ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),i8=wn(t8),n8=p({},Nd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),r8=wn(n8),s8=p({},Ba,{newState:0,oldState:0}),o8=wn(s8),a8=[9,13,27,32],t0=Ns&&"CompositionEvent"in window,zh=null;Ns&&"documentMode"in document&&(zh=document.documentMode);var l8=Ns&&"TextEvent"in window&&!zh,AC=Ns&&(!t0||zh&&8<zh&&11>=zh),EC=" ",MC=!1;function PC(a,h){switch(a){case"keyup":return a8.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function RC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ul=!1;function c8(a,h){switch(a){case"compositionend":return RC(h);case"keypress":return h.which!==32?null:(MC=!0,EC);case"textInput":return a=h.data,a===EC&&MC?null:a;default:return null}}function h8(a,h){if(Ul)return a==="compositionend"||!t0&&PC(a,h)?(a=xC(),Dd=FO=Mo=null,Ul=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return AC&&h.locale!=="ko"?null:h.data;default:return null}}var u8={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 QC(a){var h=a&&a.nodeName&&a.nodeName.toLowerCase();return h==="input"?!!u8[a.type]:h==="textarea"}function LC(a,h,f,m){ql?Wl?Wl.push(m):Wl=[m]:ql=m,h=Ap(h,"onChange"),0<h.length&&(f=new zd("onChange","change",null,f,m),a.push({event:f,listeners:h}))}var Nh=null,jh=null;function f8(a){g5(a,0)}function jd(a){var h=Qh(a);if(mC(h))return a}function DC(a,h){if(a==="change")return h}var BC=!1;if(Ns){var i0;if(Ns){var n0="oninput"in document;if(!n0){var $C=document.createElement("div");$C.setAttribute("oninput","return;"),n0=typeof $C.oninput=="function"}i0=n0}else i0=!1;BC=i0&&(!document.documentMode||9<document.documentMode)}function zC(){Nh&&(Nh.detachEvent("onpropertychange",NC),jh=Nh=null)}function NC(a){if(a.propertyName==="value"&&jd(jh)){var h=[];LC(h,jh,a,UO(a)),SC(f8,h)}}function d8(a,h,f){a==="focusin"?(zC(),Nh=h,jh=f,Nh.attachEvent("onpropertychange",NC)):a==="focusout"&&zC()}function p8(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return jd(jh)}function m8(a,h){if(a==="click")return jd(h)}function g8(a,h){if(a==="input"||a==="change")return jd(h)}function O8(a,h){return a===h&&(a!==0||1/a===1/h)||a!==a&&h!==h}var Vn=typeof Object.is=="function"?Object.is:O8;function Ih(a,h){if(Vn(a,h))return!0;if(typeof a!="object"||a===null||typeof h!="object"||h===null)return!1;var f=Object.keys(a),m=Object.keys(h);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var v=f[m];if(!Ds.call(h,v)||!Vn(a[v],h[v]))return!1}return!0}function jC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function IC(a,h){var f=jC(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=h&&m>=h)return{node:f,offset:h-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=jC(f)}}function VC(a,h){return a&&h?a===h?!0:a&&a.nodeType===3?!1:h&&h.nodeType===3?VC(a,h.parentNode):"contains"in a?a.contains(h):a.compareDocumentPosition?!!(a.compareDocumentPosition(h)&16):!1:!1}function XC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var h=Qd(a.document);h instanceof a.HTMLIFrameElement;){try{var f=typeof h.contentWindow.location.href=="string"}catch{f=!1}if(f)a=h.contentWindow;else break;h=Qd(a.document)}return h}function r0(a){var h=a&&a.nodeName&&a.nodeName.toLowerCase();return h&&(h==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||h==="textarea"||a.contentEditable==="true")}var v8=Ns&&"documentMode"in document&&11>=document.documentMode,Yl=null,s0=null,Vh=null,o0=!1;function ZC(a,h,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;o0||Yl==null||Yl!==Qd(m)||(m=Yl,"selectionStart"in m&&r0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Vh&&Ih(Vh,m)||(Vh=m,m=Ap(s0,"onSelect"),0<m.length&&(h=new zd("onSelect","select",null,h,f),a.push({event:h,listeners:m}),h.target=Yl)))}function $a(a,h){var f={};return f[a.toLowerCase()]=h.toLowerCase(),f["Webkit"+a]="webkit"+h,f["Moz"+a]="moz"+h,f}var Hl={animationend:$a("Animation","AnimationEnd"),animationiteration:$a("Animation","AnimationIteration"),animationstart:$a("Animation","AnimationStart"),transitionrun:$a("Transition","TransitionRun"),transitionstart:$a("Transition","TransitionStart"),transitioncancel:$a("Transition","TransitionCancel"),transitionend:$a("Transition","TransitionEnd")},a0={},qC={};Ns&&(qC=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function za(a){if(a0[a])return a0[a];if(!Hl[a])return a;var h=Hl[a],f;for(f in h)if(h.hasOwnProperty(f)&&f in qC)return a0[a]=h[f];return a}var WC=za("animationend"),UC=za("animationiteration"),YC=za("animationstart"),_8=za("transitionrun"),y8=za("transitionstart"),b8=za("transitioncancel"),HC=za("transitionend"),FC=new Map,l0="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");l0.push("scrollEnd");function $r(a,h){FC.set(a,h),Da(h,[a])}var Id=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(h))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},hr=[],Fl=0,c0=0;function Vd(){for(var a=Fl,h=c0=Fl=0;h<a;){var f=hr[h];hr[h++]=null;var m=hr[h];hr[h++]=null;var v=hr[h];hr[h++]=null;var y=hr[h];if(hr[h++]=null,m!==null&&v!==null){var C=m.pending;C===null?v.next=v:(v.next=C.next,C.next=v),m.pending=v}y!==0&&GC(f,v,y)}}function Xd(a,h,f,m){hr[Fl++]=a,hr[Fl++]=h,hr[Fl++]=f,hr[Fl++]=m,c0|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function h0(a,h,f,m){return Xd(a,h,f,m),Zd(a)}function Na(a,h){return Xd(a,null,null,h),Zd(a)}function GC(a,h,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var v=!1,y=a.return;y!==null;)y.childLanes|=f,m=y.alternate,m!==null&&(m.childLanes|=f),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(v=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,v&&h!==null&&(v=31-_t(f),a=y.hiddenUpdates,m=a[v],m===null?a[v]=[h]:m.push(h),h.lane=f|536870912),y):null}function Zd(a){if(50<hu)throw hu=0,_v=null,Error(n(185));for(var h=a.return;h!==null;)a=h,h=a.return;return a.tag===3?a.stateNode:null}var Gl={};function S8(a,h,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(a,h,f,m){return new S8(a,h,f,m)}function u0(a){return a=a.prototype,!(!a||!a.isReactComponent)}function js(a,h){var f=a.alternate;return f===null?(f=Xn(a.tag,h,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=h,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,h=a.dependencies,f.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function KC(a,h){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=h,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,h=f.dependencies,a.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext}),a}function qd(a,h,f,m,v,y){var C=0;if(m=a,typeof a=="function")u0(a)&&(C=1);else if(typeof a=="string")C=Tj(a,f,ue.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case Z:return a=Xn(31,f,h,v),a.elementType=Z,a.lanes=y,a;case b:return ja(f.children,v,y,h);case x:C=8,v|=24;break;case w:return a=Xn(12,f,h,v|2),a.elementType=w,a.lanes=y,a;case L:return a=Xn(13,f,h,v),a.elementType=L,a.lanes=y,a;case E:return a=Xn(19,f,h,v),a.elementType=E,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case T:C=10;break e;case k:C=9;break e;case A:C=11;break e;case N:C=14;break e;case z:C=16,m=null;break e}C=29,f=Error(n(130,a===null?"null":typeof a,"")),m=null}return h=Xn(C,f,h,v),h.elementType=a,h.type=m,h.lanes=y,h}function ja(a,h,f,m){return a=Xn(7,a,m,h),a.lanes=f,a}function f0(a,h,f){return a=Xn(6,a,null,h),a.lanes=f,a}function JC(a){var h=Xn(18,null,null,0);return h.stateNode=a,h}function d0(a,h,f){return h=Xn(4,a.children!==null?a.children:[],a.key,h),h.lanes=f,h.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},h}var ek=new WeakMap;function ur(a,h){if(typeof a=="object"&&a!==null){var f=ek.get(a);return f!==void 0?f:(h={value:a,source:h,stack:Qa(h)},ek.set(a,h),h)}return{value:a,source:h,stack:Qa(h)}}var Kl=[],Jl=0,Wd=null,Xh=0,fr=[],dr=0,Po=null,es=1,ts="";function Is(a,h){Kl[Jl++]=Xh,Kl[Jl++]=Wd,Wd=a,Xh=h}function tk(a,h,f){fr[dr++]=es,fr[dr++]=ts,fr[dr++]=Po,Po=a;var m=es;a=ts;var v=32-_t(m)-1;m&=~(1<<v),f+=1;var y=32-_t(h)+v;if(30<y){var C=v-v%5;y=(m&(1<<C)-1).toString(32),m>>=C,v-=C,es=1<<32-_t(h)+v|f<<v|m,ts=y+a}else es=1<<y|f<<v|m,ts=a}function p0(a){a.return!==null&&(Is(a,1),tk(a,1,0))}function m0(a){for(;a===Wd;)Wd=Kl[--Jl],Kl[Jl]=null,Xh=Kl[--Jl],Kl[Jl]=null;for(;a===Po;)Po=fr[--dr],fr[dr]=null,ts=fr[--dr],fr[dr]=null,es=fr[--dr],fr[dr]=null}function ik(a,h){fr[dr++]=es,fr[dr++]=ts,fr[dr++]=Po,es=h.id,ts=h.overflow,Po=a}var Ni=null,At=null,tt=!1,Ro=null,pr=!1,g0=Error(n(519));function Qo(a){var h=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zh(ur(h,a)),g0}function nk(a){var h=a.stateNode,f=a.type,m=a.memoizedProps;switch(h[zi]=a,h[xn]=m,f){case"dialog":He("cancel",h),He("close",h);break;case"iframe":case"object":case"embed":He("load",h);break;case"video":case"audio":for(f=0;f<fu.length;f++)He(fu[f],h);break;case"source":He("error",h);break;case"img":case"image":case"link":He("error",h),He("load",h);break;case"details":He("toggle",h);break;case"input":He("invalid",h),gC(h,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":He("invalid",h);break;case"textarea":He("invalid",h),vC(h,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||h.textContent===""+f||m.suppressHydrationWarning===!0||y5(h.textContent,f)?(m.popover!=null&&(He("beforetoggle",h),He("toggle",h)),m.onScroll!=null&&He("scroll",h),m.onScrollEnd!=null&&He("scrollend",h),m.onClick!=null&&(h.onclick=zs),h=!0):h=!1,h||Qo(a,!0)}function rk(a){for(Ni=a.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:pr=!1;return;case 27:case 3:pr=!0;return;default:Ni=Ni.return}}function ec(a){if(a!==Ni)return!1;if(!tt)return rk(a),tt=!0,!1;var h=a.tag,f;if((f=h!==3&&h!==27)&&((f=h===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||Lv(a.type,a.memoizedProps)),f=!f),f&&At&&Qo(a),rk(a),h===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));At=E5(a)}else if(h===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));At=E5(a)}else h===27?(h=At,Uo(a.type)?(a=Nv,Nv=null,At=a):At=h):At=Ni?gr(a.stateNode.nextSibling):null;return!0}function Ia(){At=Ni=null,tt=!1}function O0(){var a=Ro;return a!==null&&(An===null?An=a:An.push.apply(An,a),Ro=null),a}function Zh(a){Ro===null?Ro=[a]:Ro.push(a)}var v0=I(null),Va=null,Vs=null;function Lo(a,h,f){Q(v0,h._currentValue),h._currentValue=f}function Xs(a){a._currentValue=v0.current,K(v0)}function _0(a,h,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&h)!==h?(a.childLanes|=h,m!==null&&(m.childLanes|=h)):m!==null&&(m.childLanes&h)!==h&&(m.childLanes|=h),a===f)break;a=a.return}}function y0(a,h,f,m){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var y=v.dependencies;if(y!==null){var C=v.child;y=y.firstContext;e:for(;y!==null;){var P=y;y=v;for(var W=0;W<h.length;W++)if(P.context===h[W]){y.lanes|=f,P=y.alternate,P!==null&&(P.lanes|=f),_0(y.return,f,a),m||(C=null);break e}y=P.next}}else if(v.tag===18){if(C=v.return,C===null)throw Error(n(341));C.lanes|=f,y=C.alternate,y!==null&&(y.lanes|=f),_0(C,f,a),C=null}else C=v.child;if(C!==null)C.return=v;else for(C=v;C!==null;){if(C===a){C=null;break}if(v=C.sibling,v!==null){v.return=C.return,C=v;break}C=C.return}v=C}}function tc(a,h,f,m){a=null;for(var v=h,y=!1;v!==null;){if(!y){if((v.flags&524288)!==0)y=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var C=v.alternate;if(C===null)throw Error(n(387));if(C=C.memoizedProps,C!==null){var P=v.type;Vn(v.pendingProps.value,C.value)||(a!==null?a.push(P):a=[P])}}else if(v===Oe.current){if(C=v.alternate,C===null)throw Error(n(387));C.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(Ou):a=[Ou])}v=v.return}a!==null&&y0(h,a,f,m),h.flags|=262144}function Ud(a){for(a=a.firstContext;a!==null;){if(!Vn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Xa(a){Va=a,Vs=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ji(a){return sk(Va,a)}function Yd(a,h){return Va===null&&Xa(a),sk(a,h)}function sk(a,h){var f=h._currentValue;if(h={context:h,memoizedValue:f,next:null},Vs===null){if(a===null)throw Error(n(308));Vs=h,a.dependencies={lanes:0,firstContext:h},a.flags|=524288}else Vs=Vs.next=h;return f}var x8=typeof AbortController<"u"?AbortController:function(){var a=[],h=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){h.aborted=!0,a.forEach(function(f){return f()})}},w8=t.unstable_scheduleCallback,C8=t.unstable_NormalPriority,ti={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function b0(){return{controller:new x8,data:new Map,refCount:0}}function qh(a){a.refCount--,a.refCount===0&&w8(C8,function(){a.controller.abort()})}var Wh=null,S0=0,ic=0,nc=null;function k8(a,h){if(Wh===null){var f=Wh=[];S0=0,ic=Cv(),nc={status:"pending",value:void 0,then:function(m){f.push(m)}}}return S0++,h.then(ok,ok),h}function ok(){if(--S0===0&&Wh!==null){nc!==null&&(nc.status="fulfilled");var a=Wh;Wh=null,ic=0,nc=null;for(var h=0;h<a.length;h++)(0,a[h])()}}function T8(a,h){var f=[],m={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return a.then(function(){m.status="fulfilled",m.value=h;for(var v=0;v<f.length;v++)(0,f[v])(h)},function(v){for(m.status="rejected",m.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),m}var ak=$.S;$.S=function(a,h){Z2=cn(),typeof h=="object"&&h!==null&&typeof h.then=="function"&&k8(a,h),ak!==null&&ak(a,h)};var Za=I(null);function x0(){var a=Za.current;return a!==null?a:yt.pooledCache}function Hd(a,h){h===null?Q(Za,Za.current):Q(Za,h.pool)}function lk(){var a=x0();return a===null?null:{parent:ti._currentValue,pool:a}}var rc=Error(n(460)),w0=Error(n(474)),Fd=Error(n(542)),Gd={then:function(){}};function ck(a){return a=a.status,a==="fulfilled"||a==="rejected"}function hk(a,h,f){switch(f=a[f],f===void 0?a.push(h):f!==h&&(h.then(zs,zs),h=f),h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,fk(a),a;default:if(typeof h.status=="string")h.then(zs,zs);else{if(a=yt,a!==null&&100<a.shellSuspendCounter)throw Error(n(482));a=h,a.status="pending",a.then(function(m){if(h.status==="pending"){var v=h;v.status="fulfilled",v.value=m}},function(m){if(h.status==="pending"){var v=h;v.status="rejected",v.reason=m}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,fk(a),a}throw Wa=h,rc}}function qa(a){try{var h=a._init;return h(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Wa=f,rc):f}}var Wa=null;function uk(){if(Wa===null)throw Error(n(459));var a=Wa;return Wa=null,a}function fk(a){if(a===rc||a===Fd)throw Error(n(483))}var sc=null,Uh=0;function Kd(a){var h=Uh;return Uh+=1,sc===null&&(sc=[]),hk(sc,a,h)}function Yh(a,h){h=h.props.ref,a.ref=h!==void 0?h:null}function Jd(a,h){throw h.$$typeof===g?Error(n(525)):(a=Object.prototype.toString.call(h),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":a)))}function dk(a){function h(G,Y){if(a){var ee=G.deletions;ee===null?(G.deletions=[Y],G.flags|=16):ee.push(Y)}}function f(G,Y){if(!a)return null;for(;Y!==null;)h(G,Y),Y=Y.sibling;return null}function m(G){for(var Y=new Map;G!==null;)G.key!==null?Y.set(G.key,G):Y.set(G.index,G),G=G.sibling;return Y}function v(G,Y){return G=js(G,Y),G.index=0,G.sibling=null,G}function y(G,Y,ee){return G.index=ee,a?(ee=G.alternate,ee!==null?(ee=ee.index,ee<Y?(G.flags|=67108866,Y):ee):(G.flags|=67108866,Y)):(G.flags|=1048576,Y)}function C(G){return a&&G.alternate===null&&(G.flags|=67108866),G}function P(G,Y,ee,ae){return Y===null||Y.tag!==6?(Y=f0(ee,G.mode,ae),Y.return=G,Y):(Y=v(Y,ee),Y.return=G,Y)}function W(G,Y,ee,ae){var Re=ee.type;return Re===b?re(G,Y,ee.props.children,ae,ee.key):Y!==null&&(Y.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===z&&qa(Re)===Y.type)?(Y=v(Y,ee.props),Yh(Y,ee),Y.return=G,Y):(Y=qd(ee.type,ee.key,ee.props,null,G.mode,ae),Yh(Y,ee),Y.return=G,Y)}function te(G,Y,ee,ae){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ee.containerInfo||Y.stateNode.implementation!==ee.implementation?(Y=d0(ee,G.mode,ae),Y.return=G,Y):(Y=v(Y,ee.children||[]),Y.return=G,Y)}function re(G,Y,ee,ae,Re){return Y===null||Y.tag!==7?(Y=ja(ee,G.mode,ae,Re),Y.return=G,Y):(Y=v(Y,ee),Y.return=G,Y)}function le(G,Y,ee){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=f0(""+Y,G.mode,ee),Y.return=G,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case O:return ee=qd(Y.type,Y.key,Y.props,null,G.mode,ee),Yh(ee,Y),ee.return=G,ee;case _:return Y=d0(Y,G.mode,ee),Y.return=G,Y;case z:return Y=qa(Y),le(G,Y,ee)}if(j(Y)||R(Y))return Y=ja(Y,G.mode,ee,null),Y.return=G,Y;if(typeof Y.then=="function")return le(G,Kd(Y),ee);if(Y.$$typeof===T)return le(G,Yd(G,Y),ee);Jd(G,Y)}return null}function ie(G,Y,ee,ae){var Re=Y!==null?Y.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Re!==null?null:P(G,Y,""+ee,ae);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:return ee.key===Re?W(G,Y,ee,ae):null;case _:return ee.key===Re?te(G,Y,ee,ae):null;case z:return ee=qa(ee),ie(G,Y,ee,ae)}if(j(ee)||R(ee))return Re!==null?null:re(G,Y,ee,ae,null);if(typeof ee.then=="function")return ie(G,Y,Kd(ee),ae);if(ee.$$typeof===T)return ie(G,Y,Yd(G,ee),ae);Jd(G,ee)}return null}function ne(G,Y,ee,ae,Re){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return G=G.get(ee)||null,P(Y,G,""+ae,Re);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case O:return G=G.get(ae.key===null?ee:ae.key)||null,W(Y,G,ae,Re);case _:return G=G.get(ae.key===null?ee:ae.key)||null,te(Y,G,ae,Re);case z:return ae=qa(ae),ne(G,Y,ee,ae,Re)}if(j(ae)||R(ae))return G=G.get(ee)||null,re(Y,G,ae,Re,null);if(typeof ae.then=="function")return ne(G,Y,ee,Kd(ae),Re);if(ae.$$typeof===T)return ne(G,Y,ee,Yd(Y,ae),Re);Jd(Y,ae)}return null}function we(G,Y,ee,ae){for(var Re=null,rt=null,Ee=Y,Ve=Y=0,Je=null;Ee!==null&&Ve<ee.length;Ve++){Ee.index>Ve?(Je=Ee,Ee=null):Je=Ee.sibling;var st=ie(G,Ee,ee[Ve],ae);if(st===null){Ee===null&&(Ee=Je);break}a&&Ee&&st.alternate===null&&h(G,Ee),Y=y(st,Y,Ve),rt===null?Re=st:rt.sibling=st,rt=st,Ee=Je}if(Ve===ee.length)return f(G,Ee),tt&&Is(G,Ve),Re;if(Ee===null){for(;Ve<ee.length;Ve++)Ee=le(G,ee[Ve],ae),Ee!==null&&(Y=y(Ee,Y,Ve),rt===null?Re=Ee:rt.sibling=Ee,rt=Ee);return tt&&Is(G,Ve),Re}for(Ee=m(Ee);Ve<ee.length;Ve++)Je=ne(Ee,G,Ve,ee[Ve],ae),Je!==null&&(a&&Je.alternate!==null&&Ee.delete(Je.key===null?Ve:Je.key),Y=y(Je,Y,Ve),rt===null?Re=Je:rt.sibling=Je,rt=Je);return a&&Ee.forEach(function(Ko){return h(G,Ko)}),tt&&Is(G,Ve),Re}function Qe(G,Y,ee,ae){if(ee==null)throw Error(n(151));for(var Re=null,rt=null,Ee=Y,Ve=Y=0,Je=null,st=ee.next();Ee!==null&&!st.done;Ve++,st=ee.next()){Ee.index>Ve?(Je=Ee,Ee=null):Je=Ee.sibling;var Ko=ie(G,Ee,st.value,ae);if(Ko===null){Ee===null&&(Ee=Je);break}a&&Ee&&Ko.alternate===null&&h(G,Ee),Y=y(Ko,Y,Ve),rt===null?Re=Ko:rt.sibling=Ko,rt=Ko,Ee=Je}if(st.done)return f(G,Ee),tt&&Is(G,Ve),Re;if(Ee===null){for(;!st.done;Ve++,st=ee.next())st=le(G,st.value,ae),st!==null&&(Y=y(st,Y,Ve),rt===null?Re=st:rt.sibling=st,rt=st);return tt&&Is(G,Ve),Re}for(Ee=m(Ee);!st.done;Ve++,st=ee.next())st=ne(Ee,G,Ve,st.value,ae),st!==null&&(a&&st.alternate!==null&&Ee.delete(st.key===null?Ve:st.key),Y=y(st,Y,Ve),rt===null?Re=st:rt.sibling=st,rt=st);return a&&Ee.forEach(function(zj){return h(G,zj)}),tt&&Is(G,Ve),Re}function gt(G,Y,ee,ae){if(typeof ee=="object"&&ee!==null&&ee.type===b&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:e:{for(var Re=ee.key;Y!==null;){if(Y.key===Re){if(Re=ee.type,Re===b){if(Y.tag===7){f(G,Y.sibling),ae=v(Y,ee.props.children),ae.return=G,G=ae;break e}}else if(Y.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===z&&qa(Re)===Y.type){f(G,Y.sibling),ae=v(Y,ee.props),Yh(ae,ee),ae.return=G,G=ae;break e}f(G,Y);break}else h(G,Y);Y=Y.sibling}ee.type===b?(ae=ja(ee.props.children,G.mode,ae,ee.key),ae.return=G,G=ae):(ae=qd(ee.type,ee.key,ee.props,null,G.mode,ae),Yh(ae,ee),ae.return=G,G=ae)}return C(G);case _:e:{for(Re=ee.key;Y!==null;){if(Y.key===Re)if(Y.tag===4&&Y.stateNode.containerInfo===ee.containerInfo&&Y.stateNode.implementation===ee.implementation){f(G,Y.sibling),ae=v(Y,ee.children||[]),ae.return=G,G=ae;break e}else{f(G,Y);break}else h(G,Y);Y=Y.sibling}ae=d0(ee,G.mode,ae),ae.return=G,G=ae}return C(G);case z:return ee=qa(ee),gt(G,Y,ee,ae)}if(j(ee))return we(G,Y,ee,ae);if(R(ee)){if(Re=R(ee),typeof Re!="function")throw Error(n(150));return ee=Re.call(ee),Qe(G,Y,ee,ae)}if(typeof ee.then=="function")return gt(G,Y,Kd(ee),ae);if(ee.$$typeof===T)return gt(G,Y,Yd(G,ee),ae);Jd(G,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Y!==null&&Y.tag===6?(f(G,Y.sibling),ae=v(Y,ee),ae.return=G,G=ae):(f(G,Y),ae=f0(ee,G.mode,ae),ae.return=G,G=ae),C(G)):f(G,Y)}return function(G,Y,ee,ae){try{Uh=0;var Re=gt(G,Y,ee,ae);return sc=null,Re}catch(Ee){if(Ee===rc||Ee===Fd)throw Ee;var rt=Xn(29,Ee,null,G.mode);return rt.lanes=ae,rt.return=G,rt}finally{}}}var Ua=dk(!0),pk=dk(!1),Do=!1;function C0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function k0(a,h){a=a.updateQueue,h.updateQueue===a&&(h.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Bo(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function $o(a,h,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(ot&2)!==0){var v=m.pending;return v===null?h.next=h:(h.next=v.next,v.next=h),m.pending=h,h=Zd(a),GC(a,null,f),h}return Xd(a,m,h,f),Zd(a)}function Hh(a,h,f){if(h=h.updateQueue,h!==null&&(h=h.shared,(f&4194048)!==0)){var m=h.lanes;m&=a.pendingLanes,f|=m,h.lanes=f,sC(a,f)}}function T0(a,h){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var v=null,y=null;if(f=f.firstBaseUpdate,f!==null){do{var C={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};y===null?v=y=C:y=y.next=C,f=f.next}while(f!==null);y===null?v=y=h:y=y.next=h}else v=y=h;f={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:y,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=h:a.next=h,f.lastBaseUpdate=h}var A0=!1;function Fh(){if(A0){var a=nc;if(a!==null)throw a}}function Gh(a,h,f,m){A0=!1;var v=a.updateQueue;Do=!1;var y=v.firstBaseUpdate,C=v.lastBaseUpdate,P=v.shared.pending;if(P!==null){v.shared.pending=null;var W=P,te=W.next;W.next=null,C===null?y=te:C.next=te,C=W;var re=a.alternate;re!==null&&(re=re.updateQueue,P=re.lastBaseUpdate,P!==C&&(P===null?re.firstBaseUpdate=te:P.next=te,re.lastBaseUpdate=W))}if(y!==null){var le=v.baseState;C=0,re=te=W=null,P=y;do{var ie=P.lane&-536870913,ne=ie!==P.lane;if(ne?(Ke&ie)===ie:(m&ie)===ie){ie!==0&&ie===ic&&(A0=!0),re!==null&&(re=re.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var we=a,Qe=P;ie=h;var gt=f;switch(Qe.tag){case 1:if(we=Qe.payload,typeof we=="function"){le=we.call(gt,le,ie);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Qe.payload,ie=typeof we=="function"?we.call(gt,le,ie):we,ie==null)break e;le=p({},le,ie);break e;case 2:Do=!0}}ie=P.callback,ie!==null&&(a.flags|=64,ne&&(a.flags|=8192),ne=v.callbacks,ne===null?v.callbacks=[ie]:ne.push(ie))}else ne={lane:ie,tag:P.tag,payload:P.payload,callback:P.callback,next:null},re===null?(te=re=ne,W=le):re=re.next=ne,C|=ie;if(P=P.next,P===null){if(P=v.shared.pending,P===null)break;ne=P,P=ne.next,ne.next=null,v.lastBaseUpdate=ne,v.shared.pending=null}}while(!0);re===null&&(W=le),v.baseState=W,v.firstBaseUpdate=te,v.lastBaseUpdate=re,y===null&&(v.shared.lanes=0),Vo|=C,a.lanes=C,a.memoizedState=le}}function mk(a,h){if(typeof a!="function")throw Error(n(191,a));a.call(h)}function gk(a,h){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)mk(f[a],h)}var oc=I(null),ep=I(0);function Ok(a,h){a=Ks,Q(ep,a),Q(oc,h),Ks=a|h.baseLanes}function E0(){Q(ep,Ks),Q(oc,oc.current)}function M0(){Ks=ep.current,K(oc),K(ep)}var Zn=I(null),mr=null;function zo(a){var h=a.alternate;Q(Ht,Ht.current&1),Q(Zn,a),mr===null&&(h===null||oc.current!==null||h.memoizedState!==null)&&(mr=a)}function P0(a){Q(Ht,Ht.current),Q(Zn,a),mr===null&&(mr=a)}function vk(a){a.tag===22?(Q(Ht,Ht.current),Q(Zn,a),mr===null&&(mr=a)):No()}function No(){Q(Ht,Ht.current),Q(Zn,Zn.current)}function qn(a){K(Zn),mr===a&&(mr=null),K(Ht)}var Ht=I(0);function tp(a){for(var h=a;h!==null;){if(h.tag===13){var f=h.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||$v(f)||zv(f)))return h}else if(h.tag===19&&(h.memoizedProps.revealOrder==="forwards"||h.memoizedProps.revealOrder==="backwards"||h.memoizedProps.revealOrder==="unstable_legacy-backwards"||h.memoizedProps.revealOrder==="together")){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Zs=0,Ie=null,pt=null,ii=null,ip=!1,ac=!1,Ya=!1,np=0,Kh=0,lc=null,A8=0;function jt(){throw Error(n(321))}function R0(a,h){if(h===null)return!1;for(var f=0;f<h.length&&f<a.length;f++)if(!Vn(a[f],h[f]))return!1;return!0}function Q0(a,h,f,m,v,y){return Zs=y,Ie=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,$.H=a===null||a.memoizedState===null?t2:Y0,Ya=!1,y=f(m,v),Ya=!1,ac&&(y=yk(h,f,m,v)),_k(a),y}function _k(a){$.H=tu;var h=pt!==null&&pt.next!==null;if(Zs=0,ii=pt=Ie=null,ip=!1,Kh=0,lc=null,h)throw Error(n(300));a===null||ni||(a=a.dependencies,a!==null&&Ud(a)&&(ni=!0))}function yk(a,h,f,m){Ie=a;var v=0;do{if(ac&&(lc=null),Kh=0,ac=!1,25<=v)throw Error(n(301));if(v+=1,ii=pt=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}$.H=i2,y=h(f,m)}while(ac);return y}function E8(){var a=$.H,h=a.useState()[0];return h=typeof h.then=="function"?Jh(h):h,a=a.useState()[0],(pt!==null?pt.memoizedState:null)!==a&&(Ie.flags|=1024),h}function L0(){var a=np!==0;return np=0,a}function D0(a,h,f){h.updateQueue=a.updateQueue,h.flags&=-2053,a.lanes&=~f}function B0(a){if(ip){for(a=a.memoizedState;a!==null;){var h=a.queue;h!==null&&(h.pending=null),a=a.next}ip=!1}Zs=0,ii=pt=Ie=null,ac=!1,Kh=np=0,lc=null}function un(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ii===null?Ie.memoizedState=ii=a:ii=ii.next=a,ii}function Ft(){if(pt===null){var a=Ie.alternate;a=a!==null?a.memoizedState:null}else a=pt.next;var h=ii===null?Ie.memoizedState:ii.next;if(h!==null)ii=h,pt=a;else{if(a===null)throw Ie.alternate===null?Error(n(467)):Error(n(310));pt=a,a={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},ii===null?Ie.memoizedState=ii=a:ii=ii.next=a}return ii}function rp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jh(a){var h=Kh;return Kh+=1,lc===null&&(lc=[]),a=hk(lc,a,h),h=Ie,(ii===null?h.memoizedState:ii.next)===null&&(h=h.alternate,$.H=h===null||h.memoizedState===null?t2:Y0),a}function sp(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Jh(a);if(a.$$typeof===T)return ji(a)}throw Error(n(438,String(a)))}function $0(a){var h=null,f=Ie.updateQueue;if(f!==null&&(h=f.memoCache),h==null){var m=Ie.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(h={data:m.data.map(function(v){return v.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),f===null&&(f=rp(),Ie.updateQueue=f),f.memoCache=h,f=h.data[h.index],f===void 0)for(f=h.data[h.index]=Array(a),m=0;m<a;m++)f[m]=J;return h.index++,f}function qs(a,h){return typeof h=="function"?h(a):h}function op(a){var h=Ft();return z0(h,pt,a)}function z0(a,h,f){var m=a.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=f;var v=a.baseQueue,y=m.pending;if(y!==null){if(v!==null){var C=v.next;v.next=y.next,y.next=C}h.baseQueue=v=y,m.pending=null}if(y=a.baseState,v===null)a.memoizedState=y;else{h=v.next;var P=C=null,W=null,te=h,re=!1;do{var le=te.lane&-536870913;if(le!==te.lane?(Ke&le)===le:(Zs&le)===le){var ie=te.revertLane;if(ie===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),le===ic&&(re=!0);else if((Zs&ie)===ie){te=te.next,ie===ic&&(re=!0);continue}else le={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(P=W=le,C=y):W=W.next=le,Ie.lanes|=ie,Vo|=ie;le=te.action,Ya&&f(y,le),y=te.hasEagerState?te.eagerState:f(y,le)}else ie={lane:le,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(P=W=ie,C=y):W=W.next=ie,Ie.lanes|=le,Vo|=le;te=te.next}while(te!==null&&te!==h);if(W===null?C=y:W.next=P,!Vn(y,a.memoizedState)&&(ni=!0,re&&(f=nc,f!==null)))throw f;a.memoizedState=y,a.baseState=C,a.baseQueue=W,m.lastRenderedState=y}return v===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function N0(a){var h=Ft(),f=h.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var m=f.dispatch,v=f.pending,y=h.memoizedState;if(v!==null){f.pending=null;var C=v=v.next;do y=a(y,C.action),C=C.next;while(C!==v);Vn(y,h.memoizedState)||(ni=!0),h.memoizedState=y,h.baseQueue===null&&(h.baseState=y),f.lastRenderedState=y}return[y,m]}function bk(a,h,f){var m=Ie,v=Ft(),y=tt;if(y){if(f===void 0)throw Error(n(407));f=f()}else f=h();var C=!Vn((pt||v).memoizedState,f);if(C&&(v.memoizedState=f,ni=!0),v=v.queue,V0(wk.bind(null,m,v,a),[a]),v.getSnapshot!==h||C||ii!==null&&ii.memoizedState.tag&1){if(m.flags|=2048,cc(9,{destroy:void 0},xk.bind(null,m,v,f,h),null),yt===null)throw Error(n(349));y||(Zs&127)!==0||Sk(m,h,f)}return f}function Sk(a,h,f){a.flags|=16384,a={getSnapshot:h,value:f},h=Ie.updateQueue,h===null?(h=rp(),Ie.updateQueue=h,h.stores=[a]):(f=h.stores,f===null?h.stores=[a]:f.push(a))}function xk(a,h,f,m){h.value=f,h.getSnapshot=m,Ck(h)&&kk(a)}function wk(a,h,f){return f(function(){Ck(h)&&kk(a)})}function Ck(a){var h=a.getSnapshot;a=a.value;try{var f=h();return!Vn(a,f)}catch{return!0}}function kk(a){var h=Na(a,2);h!==null&&En(h,a,2)}function j0(a){var h=un();if(typeof a=="function"){var f=a;if(a=f(),Ya){Sn(!0);try{f()}finally{Sn(!1)}}}return h.memoizedState=h.baseState=a,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:a},h}function Tk(a,h,f,m){return a.baseState=f,z0(a,pt,typeof m=="function"?m:qs)}function M8(a,h,f,m,v){if(cp(a))throw Error(n(485));if(a=h.action,a!==null){var y={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){y.listeners.push(C)}};$.T!==null?f(!0):y.isTransition=!1,m(y),f=h.pending,f===null?(y.next=h.pending=y,Ak(h,y)):(y.next=f.next,h.pending=f.next=y)}}function Ak(a,h){var f=h.action,m=h.payload,v=a.state;if(h.isTransition){var y=$.T,C={};$.T=C;try{var P=f(v,m),W=$.S;W!==null&&W(C,P),Ek(a,h,P)}catch(te){I0(a,h,te)}finally{y!==null&&C.types!==null&&(y.types=C.types),$.T=y}}else try{y=f(v,m),Ek(a,h,y)}catch(te){I0(a,h,te)}}function Ek(a,h,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){Mk(a,h,m)},function(m){return I0(a,h,m)}):Mk(a,h,f)}function Mk(a,h,f){h.status="fulfilled",h.value=f,Pk(h),a.state=f,h=a.pending,h!==null&&(f=h.next,f===h?a.pending=null:(f=f.next,h.next=f,Ak(a,f)))}function I0(a,h,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do h.status="rejected",h.reason=f,Pk(h),h=h.next;while(h!==m)}a.action=null}function Pk(a){a=a.listeners;for(var h=0;h<a.length;h++)(0,a[h])()}function Rk(a,h){return h}function Qk(a,h){if(tt){var f=yt.formState;if(f!==null){e:{var m=Ie;if(tt){if(At){t:{for(var v=At,y=pr;v.nodeType!==8;){if(!y){v=null;break t}if(v=gr(v.nextSibling),v===null){v=null;break t}}y=v.data,v=y==="F!"||y==="F"?v:null}if(v){At=gr(v.nextSibling),m=v.data==="F!";break e}}Qo(m)}m=!1}m&&(h=f[0])}}return f=un(),f.memoizedState=f.baseState=h,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rk,lastRenderedState:h},f.queue=m,f=Kk.bind(null,Ie,m),m.dispatch=f,m=j0(!1),y=U0.bind(null,Ie,!1,m.queue),m=un(),v={state:h,dispatch:null,action:a,pending:null},m.queue=v,f=M8.bind(null,Ie,v,y,f),v.dispatch=f,m.memoizedState=a,[h,f,!1]}function Lk(a){var h=Ft();return Dk(h,pt,a)}function Dk(a,h,f){if(h=z0(a,h,Rk)[0],a=op(qs)[0],typeof h=="object"&&h!==null&&typeof h.then=="function")try{var m=Jh(h)}catch(C){throw C===rc?Fd:C}else m=h;h=Ft();var v=h.queue,y=v.dispatch;return f!==h.memoizedState&&(Ie.flags|=2048,cc(9,{destroy:void 0},P8.bind(null,v,f),null)),[m,y,a]}function P8(a,h){a.action=h}function Bk(a){var h=Ft(),f=pt;if(f!==null)return Dk(h,f,a);Ft(),h=h.memoizedState,f=Ft();var m=f.queue.dispatch;return f.memoizedState=a,[h,m,!1]}function cc(a,h,f,m){return a={tag:a,create:f,deps:m,inst:h,next:null},h=Ie.updateQueue,h===null&&(h=rp(),Ie.updateQueue=h),f=h.lastEffect,f===null?h.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,h.lastEffect=a),a}function $k(){return Ft().memoizedState}function ap(a,h,f,m){var v=un();Ie.flags|=a,v.memoizedState=cc(1|h,{destroy:void 0},f,m===void 0?null:m)}function lp(a,h,f,m){var v=Ft();m=m===void 0?null:m;var y=v.memoizedState.inst;pt!==null&&m!==null&&R0(m,pt.memoizedState.deps)?v.memoizedState=cc(h,y,f,m):(Ie.flags|=a,v.memoizedState=cc(1|h,y,f,m))}function zk(a,h){ap(8390656,8,a,h)}function V0(a,h){lp(2048,8,a,h)}function R8(a){Ie.flags|=4;var h=Ie.updateQueue;if(h===null)h=rp(),Ie.updateQueue=h,h.events=[a];else{var f=h.events;f===null?h.events=[a]:f.push(a)}}function Nk(a){var h=Ft().memoizedState;return R8({ref:h,nextImpl:a}),function(){if((ot&2)!==0)throw Error(n(440));return h.impl.apply(void 0,arguments)}}function jk(a,h){return lp(4,2,a,h)}function Ik(a,h){return lp(4,4,a,h)}function Vk(a,h){if(typeof h=="function"){a=a();var f=h(a);return function(){typeof f=="function"?f():h(null)}}if(h!=null)return a=a(),h.current=a,function(){h.current=null}}function Xk(a,h,f){f=f!=null?f.concat([a]):null,lp(4,4,Vk.bind(null,h,a),f)}function X0(){}function Zk(a,h){var f=Ft();h=h===void 0?null:h;var m=f.memoizedState;return h!==null&&R0(h,m[1])?m[0]:(f.memoizedState=[a,h],a)}function qk(a,h){var f=Ft();h=h===void 0?null:h;var m=f.memoizedState;if(h!==null&&R0(h,m[1]))return m[0];if(m=a(),Ya){Sn(!0);try{a()}finally{Sn(!1)}}return f.memoizedState=[m,h],m}function Z0(a,h,f){return f===void 0||(Zs&1073741824)!==0&&(Ke&261930)===0?a.memoizedState=h:(a.memoizedState=f,a=W2(),Ie.lanes|=a,Vo|=a,f)}function Wk(a,h,f,m){return Vn(f,h)?f:oc.current!==null?(a=Z0(a,f,m),Vn(a,h)||(ni=!0),a):(Zs&42)===0||(Zs&1073741824)!==0&&(Ke&261930)===0?(ni=!0,a.memoizedState=f):(a=W2(),Ie.lanes|=a,Vo|=a,h)}function Uk(a,h,f,m,v){var y=X.p;X.p=y!==0&&8>y?y:8;var C=$.T,P={};$.T=P,U0(a,!1,h,f);try{var W=v(),te=$.S;if(te!==null&&te(P,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var re=T8(W,m);eu(a,h,re,Yn(a))}else eu(a,h,m,Yn(a))}catch(le){eu(a,h,{then:function(){},status:"rejected",reason:le},Yn())}finally{X.p=y,C!==null&&P.types!==null&&(C.types=P.types),$.T=C}}function Q8(){}function q0(a,h,f,m){if(a.tag!==5)throw Error(n(476));var v=Yk(a).queue;Uk(a,v,h,H,f===null?Q8:function(){return Hk(a),f(m)})}function Yk(a){var h=a.memoizedState;if(h!==null)return h;h={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:H},next:null};var f={};return h.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:f},next:null},a.memoizedState=h,a=a.alternate,a!==null&&(a.memoizedState=h),h}function Hk(a){var h=Yk(a);h.next===null&&(h=a.alternate.memoizedState),eu(a,h.next.queue,{},Yn())}function W0(){return ji(Ou)}function Fk(){return Ft().memoizedState}function Gk(){return Ft().memoizedState}function L8(a){for(var h=a.return;h!==null;){switch(h.tag){case 24:case 3:var f=Yn();a=Bo(f);var m=$o(h,a,f);m!==null&&(En(m,h,f),Hh(m,h,f)),h={cache:b0()},a.payload=h;return}h=h.return}}function D8(a,h,f){var m=Yn();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},cp(a)?Jk(h,f):(f=h0(a,h,f,m),f!==null&&(En(f,a,m),e2(f,h,m)))}function Kk(a,h,f){var m=Yn();eu(a,h,f,m)}function eu(a,h,f,m){var v={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(cp(a))Jk(h,v);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=h.lastRenderedReducer,y!==null))try{var C=h.lastRenderedState,P=y(C,f);if(v.hasEagerState=!0,v.eagerState=P,Vn(P,C))return Xd(a,h,v,0),yt===null&&Vd(),!1}catch{}finally{}if(f=h0(a,h,v,m),f!==null)return En(f,a,m),e2(f,h,m),!0}return!1}function U0(a,h,f,m){if(m={lane:2,revertLane:Cv(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},cp(a)){if(h)throw Error(n(479))}else h=h0(a,f,m,2),h!==null&&En(h,a,2)}function cp(a){var h=a.alternate;return a===Ie||h!==null&&h===Ie}function Jk(a,h){ac=ip=!0;var f=a.pending;f===null?h.next=h:(h.next=f.next,f.next=h),a.pending=h}function e2(a,h,f){if((f&4194048)!==0){var m=h.lanes;m&=a.pendingLanes,f|=m,h.lanes=f,sC(a,f)}}var tu={readContext:ji,use:sp,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};tu.useEffectEvent=jt;var t2={readContext:ji,use:sp,useCallback:function(a,h){return un().memoizedState=[a,h===void 0?null:h],a},useContext:ji,useEffect:zk,useImperativeHandle:function(a,h,f){f=f!=null?f.concat([a]):null,ap(4194308,4,Vk.bind(null,h,a),f)},useLayoutEffect:function(a,h){return ap(4194308,4,a,h)},useInsertionEffect:function(a,h){ap(4,2,a,h)},useMemo:function(a,h){var f=un();h=h===void 0?null:h;var m=a();if(Ya){Sn(!0);try{a()}finally{Sn(!1)}}return f.memoizedState=[m,h],m},useReducer:function(a,h,f){var m=un();if(f!==void 0){var v=f(h);if(Ya){Sn(!0);try{f(h)}finally{Sn(!1)}}}else v=h;return m.memoizedState=m.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},m.queue=a,a=a.dispatch=D8.bind(null,Ie,a),[m.memoizedState,a]},useRef:function(a){var h=un();return a={current:a},h.memoizedState=a},useState:function(a){a=j0(a);var h=a.queue,f=Kk.bind(null,Ie,h);return h.dispatch=f,[a.memoizedState,f]},useDebugValue:X0,useDeferredValue:function(a,h){var f=un();return Z0(f,a,h)},useTransition:function(){var a=j0(!1);return a=Uk.bind(null,Ie,a.queue,!0,!1),un().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,h,f){var m=Ie,v=un();if(tt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=h(),yt===null)throw Error(n(349));(Ke&127)!==0||Sk(m,h,f)}v.memoizedState=f;var y={value:f,getSnapshot:h};return v.queue=y,zk(wk.bind(null,m,y,a),[a]),m.flags|=2048,cc(9,{destroy:void 0},xk.bind(null,m,y,f,h),null),f},useId:function(){var a=un(),h=yt.identifierPrefix;if(tt){var f=ts,m=es;f=(m&~(1<<32-_t(m)-1)).toString(32)+f,h="_"+h+"R_"+f,f=np++,0<f&&(h+="H"+f.toString(32)),h+="_"}else f=A8++,h="_"+h+"r_"+f.toString(32)+"_";return a.memoizedState=h},useHostTransitionStatus:W0,useFormState:Qk,useActionState:Qk,useOptimistic:function(a){var h=un();h.memoizedState=h.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=f,h=U0.bind(null,Ie,!0,f),f.dispatch=h,[a,h]},useMemoCache:$0,useCacheRefresh:function(){return un().memoizedState=L8.bind(null,Ie)},useEffectEvent:function(a){var h=un(),f={impl:a};return h.memoizedState=f,function(){if((ot&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}},Y0={readContext:ji,use:sp,useCallback:Zk,useContext:ji,useEffect:V0,useImperativeHandle:Xk,useInsertionEffect:jk,useLayoutEffect:Ik,useMemo:qk,useReducer:op,useRef:$k,useState:function(){return op(qs)},useDebugValue:X0,useDeferredValue:function(a,h){var f=Ft();return Wk(f,pt.memoizedState,a,h)},useTransition:function(){var a=op(qs)[0],h=Ft().memoizedState;return[typeof a=="boolean"?a:Jh(a),h]},useSyncExternalStore:bk,useId:Fk,useHostTransitionStatus:W0,useFormState:Lk,useActionState:Lk,useOptimistic:function(a,h){var f=Ft();return Tk(f,pt,a,h)},useMemoCache:$0,useCacheRefresh:Gk};Y0.useEffectEvent=Nk;var i2={readContext:ji,use:sp,useCallback:Zk,useContext:ji,useEffect:V0,useImperativeHandle:Xk,useInsertionEffect:jk,useLayoutEffect:Ik,useMemo:qk,useReducer:N0,useRef:$k,useState:function(){return N0(qs)},useDebugValue:X0,useDeferredValue:function(a,h){var f=Ft();return pt===null?Z0(f,a,h):Wk(f,pt.memoizedState,a,h)},useTransition:function(){var a=N0(qs)[0],h=Ft().memoizedState;return[typeof a=="boolean"?a:Jh(a),h]},useSyncExternalStore:bk,useId:Fk,useHostTransitionStatus:W0,useFormState:Bk,useActionState:Bk,useOptimistic:function(a,h){var f=Ft();return pt!==null?Tk(f,pt,a,h):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:$0,useCacheRefresh:Gk};i2.useEffectEvent=Nk;function H0(a,h,f,m){h=a.memoizedState,f=f(m,h),f=f==null?h:p({},h,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var F0={enqueueSetState:function(a,h,f){a=a._reactInternals;var m=Yn(),v=Bo(m);v.payload=h,f!=null&&(v.callback=f),h=$o(a,v,m),h!==null&&(En(h,a,m),Hh(h,a,m))},enqueueReplaceState:function(a,h,f){a=a._reactInternals;var m=Yn(),v=Bo(m);v.tag=1,v.payload=h,f!=null&&(v.callback=f),h=$o(a,v,m),h!==null&&(En(h,a,m),Hh(h,a,m))},enqueueForceUpdate:function(a,h){a=a._reactInternals;var f=Yn(),m=Bo(f);m.tag=2,h!=null&&(m.callback=h),h=$o(a,m,f),h!==null&&(En(h,a,f),Hh(h,a,f))}};function n2(a,h,f,m,v,y,C){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,y,C):h.prototype&&h.prototype.isPureReactComponent?!Ih(f,m)||!Ih(v,y):!0}function r2(a,h,f,m){a=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(f,m),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(f,m),h.state!==a&&F0.enqueueReplaceState(h,h.state,null)}function Ha(a,h){var f=h;if("ref"in h){f={};for(var m in h)m!=="ref"&&(f[m]=h[m])}if(a=a.defaultProps){f===h&&(f=p({},f));for(var v in a)f[v]===void 0&&(f[v]=a[v])}return f}function s2(a){Id(a)}function o2(a){console.error(a)}function a2(a){Id(a)}function hp(a,h){try{var f=a.onUncaughtError;f(h.value,{componentStack:h.stack})}catch(m){setTimeout(function(){throw m})}}function l2(a,h,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function G0(a,h,f){return f=Bo(f),f.tag=3,f.payload={element:null},f.callback=function(){hp(a,h)},f}function c2(a){return a=Bo(a),a.tag=3,a}function h2(a,h,f,m){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var y=m.value;a.payload=function(){return v(y)},a.callback=function(){l2(h,f,m)}}var C=f.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(a.callback=function(){l2(h,f,m),typeof v!="function"&&(Xo===null?Xo=new Set([this]):Xo.add(this));var P=m.stack;this.componentDidCatch(m.value,{componentStack:P!==null?P:""})})}function B8(a,h,f,m,v){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(h=f.alternate,h!==null&&tc(h,f,v,!0),f=Zn.current,f!==null){switch(f.tag){case 31:case 13:return mr===null?Sp():f.alternate===null&&It===0&&(It=3),f.flags&=-257,f.flags|=65536,f.lanes=v,m===Gd?f.flags|=16384:(h=f.updateQueue,h===null?f.updateQueue=new Set([m]):h.add(m),Sv(a,m,v)),!1;case 22:return f.flags|=65536,m===Gd?f.flags|=16384:(h=f.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=h):(f=h.retryQueue,f===null?h.retryQueue=new Set([m]):f.add(m)),Sv(a,m,v)),!1}throw Error(n(435,f.tag))}return Sv(a,m,v),Sp(),!1}if(tt)return h=Zn.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=v,m!==g0&&(a=Error(n(422),{cause:m}),Zh(ur(a,f)))):(m!==g0&&(h=Error(n(423),{cause:m}),Zh(ur(h,f))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,m=ur(m,f),v=G0(a.stateNode,m,v),T0(a,v),It!==4&&(It=2)),!1;var y=Error(n(520),{cause:m});if(y=ur(y,f),cu===null?cu=[y]:cu.push(y),It!==4&&(It=2),h===null)return!0;m=ur(m,f),f=h;do{switch(f.tag){case 3:return f.flags|=65536,a=v&-v,f.lanes|=a,a=G0(f.stateNode,m,a),T0(f,a),!1;case 1:if(h=f.type,y=f.stateNode,(f.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Xo===null||!Xo.has(y))))return f.flags|=65536,v&=-v,f.lanes|=v,v=c2(v),h2(v,a,f,m),T0(f,v),!1}f=f.return}while(f!==null);return!1}var K0=Error(n(461)),ni=!1;function Ii(a,h,f,m){h.child=a===null?pk(h,null,f,m):Ua(h,a.child,f,m)}function u2(a,h,f,m,v){f=f.render;var y=h.ref;if("ref"in m){var C={};for(var P in m)P!=="ref"&&(C[P]=m[P])}else C=m;return Xa(h),m=Q0(a,h,f,C,y,v),P=L0(),a!==null&&!ni?(D0(a,h,v),Ws(a,h,v)):(tt&&P&&p0(h),h.flags|=1,Ii(a,h,m,v),h.child)}function f2(a,h,f,m,v){if(a===null){var y=f.type;return typeof y=="function"&&!u0(y)&&y.defaultProps===void 0&&f.compare===null?(h.tag=15,h.type=y,d2(a,h,y,m,v)):(a=qd(f.type,null,m,h,h.mode,v),a.ref=h.ref,a.return=h,h.child=a)}if(y=a.child,!ov(a,v)){var C=y.memoizedProps;if(f=f.compare,f=f!==null?f:Ih,f(C,m)&&a.ref===h.ref)return Ws(a,h,v)}return h.flags|=1,a=js(y,m),a.ref=h.ref,a.return=h,h.child=a}function d2(a,h,f,m,v){if(a!==null){var y=a.memoizedProps;if(Ih(y,m)&&a.ref===h.ref)if(ni=!1,h.pendingProps=m=y,ov(a,v))(a.flags&131072)!==0&&(ni=!0);else return h.lanes=a.lanes,Ws(a,h,v)}return J0(a,h,f,m,v)}function p2(a,h,f,m){var v=m.children,y=a!==null?a.memoizedState:null;if(a===null&&h.stateNode===null&&(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((h.flags&128)!==0){if(y=y!==null?y.baseLanes|f:f,a!==null){for(m=h.child=a.child,v=0;m!==null;)v=v|m.lanes|m.childLanes,m=m.sibling;m=v&~y}else m=0,h.child=null;return m2(a,h,y,f,m)}if((f&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},a!==null&&Hd(h,y!==null?y.cachePool:null),y!==null?Ok(h,y):E0(),vk(h);else return m=h.lanes=536870912,m2(a,h,y!==null?y.baseLanes|f:f,f,m)}else y!==null?(Hd(h,y.cachePool),Ok(h,y),No(),h.memoizedState=null):(a!==null&&Hd(h,null),E0(),No());return Ii(a,h,v,f),h.child}function iu(a,h){return a!==null&&a.tag===22||h.stateNode!==null||(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.sibling}function m2(a,h,f,m,v){var y=x0();return y=y===null?null:{parent:ti._currentValue,pool:y},h.memoizedState={baseLanes:f,cachePool:y},a!==null&&Hd(h,null),E0(),vk(h),a!==null&&tc(a,h,m,!0),h.childLanes=v,null}function up(a,h){return h=dp({mode:h.mode,children:h.children},a.mode),h.ref=a.ref,a.child=h,h.return=a,h}function g2(a,h,f){return Ua(h,a.child,null,f),a=up(h,h.pendingProps),a.flags|=2,qn(h),h.memoizedState=null,a}function $8(a,h,f){var m=h.pendingProps,v=(h.flags&128)!==0;if(h.flags&=-129,a===null){if(tt){if(m.mode==="hidden")return a=up(h,m),h.lanes=536870912,iu(null,a);if(P0(h),(a=At)?(a=A5(a,pr),a=a!==null&&a.data==="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Po!==null?{id:es,overflow:ts}:null,retryLane:536870912,hydrationErrors:null},f=JC(a),f.return=h,h.child=f,Ni=h,At=null)):a=null,a===null)throw Qo(h);return h.lanes=536870912,null}return up(h,m)}var y=a.memoizedState;if(y!==null){var C=y.dehydrated;if(P0(h),v)if(h.flags&256)h.flags&=-257,h=g2(a,h,f);else if(h.memoizedState!==null)h.child=a.child,h.flags|=128,h=null;else throw Error(n(558));else if(ni||tc(a,h,f,!1),v=(f&a.childLanes)!==0,ni||v){if(m=yt,m!==null&&(C=oC(m,f),C!==0&&C!==y.retryLane))throw y.retryLane=C,Na(a,C),En(m,a,C),K0;Sp(),h=g2(a,h,f)}else a=y.treeContext,At=gr(C.nextSibling),Ni=h,tt=!0,Ro=null,pr=!1,a!==null&&ik(h,a),h=up(h,m),h.flags|=4096;return h}return a=js(a.child,{mode:m.mode,children:m.children}),a.ref=h.ref,h.child=a,a.return=h,a}function fp(a,h){var f=h.ref;if(f===null)a!==null&&a.ref!==null&&(h.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(a===null||a.ref!==f)&&(h.flags|=4194816)}}function J0(a,h,f,m,v){return Xa(h),f=Q0(a,h,f,m,void 0,v),m=L0(),a!==null&&!ni?(D0(a,h,v),Ws(a,h,v)):(tt&&m&&p0(h),h.flags|=1,Ii(a,h,f,v),h.child)}function O2(a,h,f,m,v,y){return Xa(h),h.updateQueue=null,f=yk(h,m,f,v),_k(a),m=L0(),a!==null&&!ni?(D0(a,h,y),Ws(a,h,y)):(tt&&m&&p0(h),h.flags|=1,Ii(a,h,f,y),h.child)}function v2(a,h,f,m,v){if(Xa(h),h.stateNode===null){var y=Gl,C=f.contextType;typeof C=="object"&&C!==null&&(y=ji(C)),y=new f(m,y),h.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=F0,h.stateNode=y,y._reactInternals=h,y=h.stateNode,y.props=m,y.state=h.memoizedState,y.refs={},C0(h),C=f.contextType,y.context=typeof C=="object"&&C!==null?ji(C):Gl,y.state=h.memoizedState,C=f.getDerivedStateFromProps,typeof C=="function"&&(H0(h,f,C,m),y.state=h.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(C=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),C!==y.state&&F0.enqueueReplaceState(y,y.state,null),Gh(h,m,y,v),Fh(),y.state=h.memoizedState),typeof y.componentDidMount=="function"&&(h.flags|=4194308),m=!0}else if(a===null){y=h.stateNode;var P=h.memoizedProps,W=Ha(f,P);y.props=W;var te=y.context,re=f.contextType;C=Gl,typeof re=="object"&&re!==null&&(C=ji(re));var le=f.getDerivedStateFromProps;re=typeof le=="function"||typeof y.getSnapshotBeforeUpdate=="function",P=h.pendingProps!==P,re||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(P||te!==C)&&r2(h,y,m,C),Do=!1;var ie=h.memoizedState;y.state=ie,Gh(h,m,y,v),Fh(),te=h.memoizedState,P||ie!==te||Do?(typeof le=="function"&&(H0(h,f,le,m),te=h.memoizedState),(W=Do||n2(h,f,W,m,ie,te,C))?(re||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(h.flags|=4194308)):(typeof y.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=m,h.memoizedState=te),y.props=m,y.state=te,y.context=C,m=W):(typeof y.componentDidMount=="function"&&(h.flags|=4194308),m=!1)}else{y=h.stateNode,k0(a,h),C=h.memoizedProps,re=Ha(f,C),y.props=re,le=h.pendingProps,ie=y.context,te=f.contextType,W=Gl,typeof te=="object"&&te!==null&&(W=ji(te)),P=f.getDerivedStateFromProps,(te=typeof P=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C!==le||ie!==W)&&r2(h,y,m,W),Do=!1,ie=h.memoizedState,y.state=ie,Gh(h,m,y,v),Fh();var ne=h.memoizedState;C!==le||ie!==ne||Do||a!==null&&a.dependencies!==null&&Ud(a.dependencies)?(typeof P=="function"&&(H0(h,f,P,m),ne=h.memoizedState),(re=Do||n2(h,f,re,m,ie,ne,W)||a!==null&&a.dependencies!==null&&Ud(a.dependencies))?(te||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(m,ne,W),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(m,ne,W)),typeof y.componentDidUpdate=="function"&&(h.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof y.componentDidUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=1024),h.memoizedProps=m,h.memoizedState=ne),y.props=m,y.state=ne,y.context=W,m=re):(typeof y.componentDidUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=1024),m=!1)}return y=m,fp(a,h),m=(h.flags&128)!==0,y||m?(y=h.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:y.render(),h.flags|=1,a!==null&&m?(h.child=Ua(h,a.child,null,v),h.child=Ua(h,null,f,v)):Ii(a,h,f,v),h.memoizedState=y.state,a=h.child):a=Ws(a,h,v),a}function _2(a,h,f,m){return Ia(),h.flags|=256,Ii(a,h,f,m),h.child}var ev={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tv(a){return{baseLanes:a,cachePool:lk()}}function iv(a,h,f){return a=a!==null?a.childLanes&~f:0,h&&(a|=Un),a}function y2(a,h,f){var m=h.pendingProps,v=!1,y=(h.flags&128)!==0,C;if((C=y)||(C=a!==null&&a.memoizedState===null?!1:(Ht.current&2)!==0),C&&(v=!0,h.flags&=-129),C=(h.flags&32)!==0,h.flags&=-33,a===null){if(tt){if(v?zo(h):No(),(a=At)?(a=A5(a,pr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Po!==null?{id:es,overflow:ts}:null,retryLane:536870912,hydrationErrors:null},f=JC(a),f.return=h,h.child=f,Ni=h,At=null)):a=null,a===null)throw Qo(h);return zv(a)?h.lanes=32:h.lanes=536870912,null}var P=m.children;return m=m.fallback,v?(No(),v=h.mode,P=dp({mode:"hidden",children:P},v),m=ja(m,v,f,null),P.return=h,m.return=h,P.sibling=m,h.child=P,m=h.child,m.memoizedState=tv(f),m.childLanes=iv(a,C,f),h.memoizedState=ev,iu(null,m)):(zo(h),nv(h,P))}var W=a.memoizedState;if(W!==null&&(P=W.dehydrated,P!==null)){if(y)h.flags&256?(zo(h),h.flags&=-257,h=rv(a,h,f)):h.memoizedState!==null?(No(),h.child=a.child,h.flags|=128,h=null):(No(),P=m.fallback,v=h.mode,m=dp({mode:"visible",children:m.children},v),P=ja(P,v,f,null),P.flags|=2,m.return=h,P.return=h,m.sibling=P,h.child=m,Ua(h,a.child,null,f),m=h.child,m.memoizedState=tv(f),m.childLanes=iv(a,C,f),h.memoizedState=ev,h=iu(null,m));else if(zo(h),zv(P)){if(C=P.nextSibling&&P.nextSibling.dataset,C)var te=C.dgst;C=te,m=Error(n(419)),m.stack="",m.digest=C,Zh({value:m,source:null,stack:null}),h=rv(a,h,f)}else if(ni||tc(a,h,f,!1),C=(f&a.childLanes)!==0,ni||C){if(C=yt,C!==null&&(m=oC(C,f),m!==0&&m!==W.retryLane))throw W.retryLane=m,Na(a,m),En(C,a,m),K0;$v(P)||Sp(),h=rv(a,h,f)}else $v(P)?(h.flags|=192,h.child=a.child,h=null):(a=W.treeContext,At=gr(P.nextSibling),Ni=h,tt=!0,Ro=null,pr=!1,a!==null&&ik(h,a),h=nv(h,m.children),h.flags|=4096);return h}return v?(No(),P=m.fallback,v=h.mode,W=a.child,te=W.sibling,m=js(W,{mode:"hidden",children:m.children}),m.subtreeFlags=W.subtreeFlags&65011712,te!==null?P=js(te,P):(P=ja(P,v,f,null),P.flags|=2),P.return=h,m.return=h,m.sibling=P,h.child=m,iu(null,m),m=h.child,P=a.child.memoizedState,P===null?P=tv(f):(v=P.cachePool,v!==null?(W=ti._currentValue,v=v.parent!==W?{parent:W,pool:W}:v):v=lk(),P={baseLanes:P.baseLanes|f,cachePool:v}),m.memoizedState=P,m.childLanes=iv(a,C,f),h.memoizedState=ev,iu(a.child,m)):(zo(h),f=a.child,a=f.sibling,f=js(f,{mode:"visible",children:m.children}),f.return=h,f.sibling=null,a!==null&&(C=h.deletions,C===null?(h.deletions=[a],h.flags|=16):C.push(a)),h.child=f,h.memoizedState=null,f)}function nv(a,h){return h=dp({mode:"visible",children:h},a.mode),h.return=a,a.child=h}function dp(a,h){return a=Xn(22,a,null,h),a.lanes=0,a}function rv(a,h,f){return Ua(h,a.child,null,f),a=nv(h,h.pendingProps.children),a.flags|=2,h.memoizedState=null,a}function b2(a,h,f){a.lanes|=h;var m=a.alternate;m!==null&&(m.lanes|=h),_0(a.return,h,f)}function sv(a,h,f,m,v,y){var C=a.memoizedState;C===null?a.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:v,treeForkCount:y}:(C.isBackwards=h,C.rendering=null,C.renderingStartTime=0,C.last=m,C.tail=f,C.tailMode=v,C.treeForkCount=y)}function S2(a,h,f){var m=h.pendingProps,v=m.revealOrder,y=m.tail;m=m.children;var C=Ht.current,P=(C&2)!==0;if(P?(C=C&1|2,h.flags|=128):C&=1,Q(Ht,C),Ii(a,h,m,f),m=tt?Xh:0,!P&&a!==null&&(a.flags&128)!==0)e:for(a=h.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&b2(a,f,h);else if(a.tag===19)b2(a,f,h);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===h)break e;for(;a.sibling===null;){if(a.return===null||a.return===h)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(f=h.child,v=null;f!==null;)a=f.alternate,a!==null&&tp(a)===null&&(v=f),f=f.sibling;f=v,f===null?(v=h.child,h.child=null):(v=f.sibling,f.sibling=null),sv(h,!1,v,f,y,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,v=h.child,h.child=null;v!==null;){if(a=v.alternate,a!==null&&tp(a)===null){h.child=v;break}a=v.sibling,v.sibling=f,f=v,v=a}sv(h,!0,f,null,y,m);break;case"together":sv(h,!1,null,null,void 0,m);break;default:h.memoizedState=null}return h.child}function Ws(a,h,f){if(a!==null&&(h.dependencies=a.dependencies),Vo|=h.lanes,(f&h.childLanes)===0)if(a!==null){if(tc(a,h,f,!1),(f&h.childLanes)===0)return null}else return null;if(a!==null&&h.child!==a.child)throw Error(n(153));if(h.child!==null){for(a=h.child,f=js(a,a.pendingProps),h.child=f,f.return=h;a.sibling!==null;)a=a.sibling,f=f.sibling=js(a,a.pendingProps),f.return=h;f.sibling=null}return h.child}function ov(a,h){return(a.lanes&h)!==0?!0:(a=a.dependencies,!!(a!==null&&Ud(a)))}function z8(a,h,f){switch(h.tag){case 3:Ce(h,h.stateNode.containerInfo),Lo(h,ti,a.memoizedState.cache),Ia();break;case 27:case 5:nt(h);break;case 4:Ce(h,h.stateNode.containerInfo);break;case 10:Lo(h,h.type,h.memoizedProps.value);break;case 31:if(h.memoizedState!==null)return h.flags|=128,P0(h),null;break;case 13:var m=h.memoizedState;if(m!==null)return m.dehydrated!==null?(zo(h),h.flags|=128,null):(f&h.child.childLanes)!==0?y2(a,h,f):(zo(h),a=Ws(a,h,f),a!==null?a.sibling:null);zo(h);break;case 19:var v=(a.flags&128)!==0;if(m=(f&h.childLanes)!==0,m||(tc(a,h,f,!1),m=(f&h.childLanes)!==0),v){if(m)return S2(a,h,f);h.flags|=128}if(v=h.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),Q(Ht,Ht.current),m)break;return null;case 22:return h.lanes=0,p2(a,h,f,h.pendingProps);case 24:Lo(h,ti,a.memoizedState.cache)}return Ws(a,h,f)}function x2(a,h,f){if(a!==null)if(a.memoizedProps!==h.pendingProps)ni=!0;else{if(!ov(a,f)&&(h.flags&128)===0)return ni=!1,z8(a,h,f);ni=(a.flags&131072)!==0}else ni=!1,tt&&(h.flags&1048576)!==0&&tk(h,Xh,h.index);switch(h.lanes=0,h.tag){case 16:e:{var m=h.pendingProps;if(a=qa(h.elementType),h.type=a,typeof a=="function")u0(a)?(m=Ha(a,m),h.tag=1,h=v2(null,h,a,m,f)):(h.tag=0,h=J0(null,h,a,m,f));else{if(a!=null){var v=a.$$typeof;if(v===A){h.tag=11,h=u2(null,h,a,m,f);break e}else if(v===N){h.tag=14,h=f2(null,h,a,m,f);break e}}throw h=D(a)||a,Error(n(306,h,""))}}return h;case 0:return J0(a,h,h.type,h.pendingProps,f);case 1:return m=h.type,v=Ha(m,h.pendingProps),v2(a,h,m,v,f);case 3:e:{if(Ce(h,h.stateNode.containerInfo),a===null)throw Error(n(387));m=h.pendingProps;var y=h.memoizedState;v=y.element,k0(a,h),Gh(h,m,null,f);var C=h.memoizedState;if(m=C.cache,Lo(h,ti,m),m!==y.cache&&y0(h,[ti],f,!0),Fh(),m=C.element,y.isDehydrated)if(y={element:m,isDehydrated:!1,cache:C.cache},h.updateQueue.baseState=y,h.memoizedState=y,h.flags&256){h=_2(a,h,m,f);break e}else if(m!==v){v=ur(Error(n(424)),h),Zh(v),h=_2(a,h,m,f);break e}else{switch(a=h.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(At=gr(a.firstChild),Ni=h,tt=!0,Ro=null,pr=!0,f=pk(h,null,m,f),h.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Ia(),m===v){h=Ws(a,h,f);break e}Ii(a,h,m,f)}h=h.child}return h;case 26:return fp(a,h),a===null?(f=L5(h.type,null,h.pendingProps,null))?h.memoizedState=f:tt||(f=h.type,a=h.pendingProps,m=Ep(fe.current).createElement(f),m[zi]=h,m[xn]=a,Vi(m,f,a),bi(m),h.stateNode=m):h.memoizedState=L5(h.type,a.memoizedProps,h.pendingProps,a.memoizedState),null;case 27:return nt(h),a===null&&tt&&(m=h.stateNode=P5(h.type,h.pendingProps,fe.current),Ni=h,pr=!0,v=At,Uo(h.type)?(Nv=v,At=gr(m.firstChild)):At=v),Ii(a,h,h.pendingProps.children,f),fp(a,h),a===null&&(h.flags|=4194304),h.child;case 5:return a===null&&tt&&((v=m=At)&&(m=pj(m,h.type,h.pendingProps,pr),m!==null?(h.stateNode=m,Ni=h,At=gr(m.firstChild),pr=!1,v=!0):v=!1),v||Qo(h)),nt(h),v=h.type,y=h.pendingProps,C=a!==null?a.memoizedProps:null,m=y.children,Lv(v,y)?m=null:C!==null&&Lv(v,C)&&(h.flags|=32),h.memoizedState!==null&&(v=Q0(a,h,E8,null,null,f),Ou._currentValue=v),fp(a,h),Ii(a,h,m,f),h.child;case 6:return a===null&&tt&&((a=f=At)&&(f=mj(f,h.pendingProps,pr),f!==null?(h.stateNode=f,Ni=h,At=null,a=!0):a=!1),a||Qo(h)),null;case 13:return y2(a,h,f);case 4:return Ce(h,h.stateNode.containerInfo),m=h.pendingProps,a===null?h.child=Ua(h,null,m,f):Ii(a,h,m,f),h.child;case 11:return u2(a,h,h.type,h.pendingProps,f);case 7:return Ii(a,h,h.pendingProps,f),h.child;case 8:return Ii(a,h,h.pendingProps.children,f),h.child;case 12:return Ii(a,h,h.pendingProps.children,f),h.child;case 10:return m=h.pendingProps,Lo(h,h.type,m.value),Ii(a,h,m.children,f),h.child;case 9:return v=h.type._context,m=h.pendingProps.children,Xa(h),v=ji(v),m=m(v),h.flags|=1,Ii(a,h,m,f),h.child;case 14:return f2(a,h,h.type,h.pendingProps,f);case 15:return d2(a,h,h.type,h.pendingProps,f);case 19:return S2(a,h,f);case 31:return $8(a,h,f);case 22:return p2(a,h,f,h.pendingProps);case 24:return Xa(h),m=ji(ti),a===null?(v=x0(),v===null&&(v=yt,y=b0(),v.pooledCache=y,y.refCount++,y!==null&&(v.pooledCacheLanes|=f),v=y),h.memoizedState={parent:m,cache:v},C0(h),Lo(h,ti,v)):((a.lanes&f)!==0&&(k0(a,h),Gh(h,null,null,f),Fh()),v=a.memoizedState,y=h.memoizedState,v.parent!==m?(v={parent:m,cache:m},h.memoizedState=v,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=v),Lo(h,ti,m)):(m=y.cache,Lo(h,ti,m),m!==v.cache&&y0(h,[ti],f,!0))),Ii(a,h,h.pendingProps.children,f),h.child;case 29:throw h.pendingProps}throw Error(n(156,h.tag))}function Us(a){a.flags|=4}function av(a,h,f,m,v){if((h=(a.mode&32)!==0)&&(h=!1),h){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(F2())a.flags|=8192;else throw Wa=Gd,w0}else a.flags&=-16777217}function w2(a,h){if(h.type!=="stylesheet"||(h.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!N5(h))if(F2())a.flags|=8192;else throw Wa=Gd,w0}function pp(a,h){h!==null&&(a.flags|=4),a.flags&16384&&(h=a.tag!==22?nC():536870912,a.lanes|=h,dc|=h)}function nu(a,h){if(!tt)switch(a.tailMode){case"hidden":h=a.tail;for(var f=null;h!==null;)h.alternate!==null&&(f=h),h=h.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?h||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Et(a){var h=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(h)for(var v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags&65011712,m|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=m,a.childLanes=f,h}function N8(a,h,f){var m=h.pendingProps;switch(m0(h),h.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(h),null;case 1:return Et(h),null;case 3:return f=h.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),h.memoizedState.cache!==m&&(h.flags|=2048),Xs(ti),ye(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(ec(h)?Us(h):a===null||a.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,O0())),Et(h),null;case 26:var v=h.type,y=h.memoizedState;return a===null?(Us(h),y!==null?(Et(h),w2(h,y)):(Et(h),av(h,v,null,m,f))):y?y!==a.memoizedState?(Us(h),Et(h),w2(h,y)):(Et(h),h.flags&=-16777217):(a=a.memoizedProps,a!==m&&Us(h),Et(h),av(h,v,a,m,f)),null;case 27:if(Qt(h),f=fe.current,v=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==m&&Us(h);else{if(!m){if(h.stateNode===null)throw Error(n(166));return Et(h),null}a=ue.current,ec(h)?nk(h):(a=P5(v,m,f),h.stateNode=a,Us(h))}return Et(h),null;case 5:if(Qt(h),v=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==m&&Us(h);else{if(!m){if(h.stateNode===null)throw Error(n(166));return Et(h),null}if(y=ue.current,ec(h))nk(h);else{var C=Ep(fe.current);switch(y){case 1:y=C.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:y=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":y=C.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":y=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":y=C.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof m.is=="string"?C.createElement("select",{is:m.is}):C.createElement("select"),m.multiple?y.multiple=!0:m.size&&(y.size=m.size);break;default:y=typeof m.is=="string"?C.createElement(v,{is:m.is}):C.createElement(v)}}y[zi]=h,y[xn]=m;e:for(C=h.child;C!==null;){if(C.tag===5||C.tag===6)y.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===h)break e;for(;C.sibling===null;){if(C.return===null||C.return===h)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}h.stateNode=y;e:switch(Vi(y,v,m),v){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Us(h)}}return Et(h),av(h,h.type,a===null?null:a.memoizedProps,h.pendingProps,f),null;case 6:if(a&&h.stateNode!=null)a.memoizedProps!==m&&Us(h);else{if(typeof m!="string"&&h.stateNode===null)throw Error(n(166));if(a=fe.current,ec(h)){if(a=h.stateNode,f=h.memoizedProps,m=null,v=Ni,v!==null)switch(v.tag){case 27:case 5:m=v.memoizedProps}a[zi]=h,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||y5(a.nodeValue,f)),a||Qo(h,!0)}else a=Ep(a).createTextNode(m),a[zi]=h,h.stateNode=a}return Et(h),null;case 31:if(f=h.memoizedState,a===null||a.memoizedState!==null){if(m=ec(h),f!==null){if(a===null){if(!m)throw Error(n(318));if(a=h.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(557));a[zi]=h}else Ia(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Et(h),a=!1}else f=O0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return h.flags&256?(qn(h),h):(qn(h),null);if((h.flags&128)!==0)throw Error(n(558))}return Et(h),null;case 13:if(m=h.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=ec(h),m!==null&&m.dehydrated!==null){if(a===null){if(!v)throw Error(n(318));if(v=h.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(n(317));v[zi]=h}else Ia(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Et(h),v=!1}else v=O0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return h.flags&256?(qn(h),h):(qn(h),null)}return qn(h),(h.flags&128)!==0?(h.lanes=f,h):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=h.child,v=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(v=m.alternate.memoizedState.cachePool.pool),y=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(y=m.memoizedState.cachePool.pool),y!==v&&(m.flags|=2048)),f!==a&&f&&(h.child.flags|=8192),pp(h,h.updateQueue),Et(h),null);case 4:return ye(),a===null&&Ev(h.stateNode.containerInfo),Et(h),null;case 10:return Xs(h.type),Et(h),null;case 19:if(K(Ht),m=h.memoizedState,m===null)return Et(h),null;if(v=(h.flags&128)!==0,y=m.rendering,y===null)if(v)nu(m,!1);else{if(It!==0||a!==null&&(a.flags&128)!==0)for(a=h.child;a!==null;){if(y=tp(a),y!==null){for(h.flags|=128,nu(m,!1),a=y.updateQueue,h.updateQueue=a,pp(h,a),h.subtreeFlags=0,a=f,f=h.child;f!==null;)KC(f,a),f=f.sibling;return Q(Ht,Ht.current&1|2),tt&&Is(h,m.treeForkCount),h.child}a=a.sibling}m.tail!==null&&cn()>_p&&(h.flags|=128,v=!0,nu(m,!1),h.lanes=4194304)}else{if(!v)if(a=tp(y),a!==null){if(h.flags|=128,v=!0,a=a.updateQueue,h.updateQueue=a,pp(h,a),nu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!y.alternate&&!tt)return Et(h),null}else 2*cn()-m.renderingStartTime>_p&&f!==536870912&&(h.flags|=128,v=!0,nu(m,!1),h.lanes=4194304);m.isBackwards?(y.sibling=h.child,h.child=y):(a=m.last,a!==null?a.sibling=y:h.child=y,m.last=y)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=cn(),a.sibling=null,f=Ht.current,Q(Ht,v?f&1|2:f&1),tt&&Is(h,m.treeForkCount),a):(Et(h),null);case 22:case 23:return qn(h),M0(),m=h.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(h.flags|=8192):m&&(h.flags|=8192),m?(f&536870912)!==0&&(h.flags&128)===0&&(Et(h),h.subtreeFlags&6&&(h.flags|=8192)):Et(h),f=h.updateQueue,f!==null&&pp(h,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(m=h.memoizedState.cachePool.pool),m!==f&&(h.flags|=2048),a!==null&&K(Za),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),h.memoizedState.cache!==f&&(h.flags|=2048),Xs(ti),Et(h),null;case 25:return null;case 30:return null}throw Error(n(156,h.tag))}function j8(a,h){switch(m0(h),h.tag){case 1:return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 3:return Xs(ti),ye(),a=h.flags,(a&65536)!==0&&(a&128)===0?(h.flags=a&-65537|128,h):null;case 26:case 27:case 5:return Qt(h),null;case 31:if(h.memoizedState!==null){if(qn(h),h.alternate===null)throw Error(n(340));Ia()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 13:if(qn(h),a=h.memoizedState,a!==null&&a.dehydrated!==null){if(h.alternate===null)throw Error(n(340));Ia()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 19:return K(Ht),null;case 4:return ye(),null;case 10:return Xs(h.type),null;case 22:case 23:return qn(h),M0(),a!==null&&K(Za),a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 24:return Xs(ti),null;case 25:return null;default:return null}}function C2(a,h){switch(m0(h),h.tag){case 3:Xs(ti),ye();break;case 26:case 27:case 5:Qt(h);break;case 4:ye();break;case 31:h.memoizedState!==null&&qn(h);break;case 13:qn(h);break;case 19:K(Ht);break;case 10:Xs(h.type);break;case 22:case 23:qn(h),M0(),a!==null&&K(Za);break;case 24:Xs(ti)}}function ru(a,h){try{var f=h.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var v=m.next;f=v;do{if((f.tag&a)===a){m=void 0;var y=f.create,C=f.inst;m=y(),C.destroy=m}f=f.next}while(f!==v)}}catch(P){dt(h,h.return,P)}}function jo(a,h,f){try{var m=h.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var y=v.next;m=y;do{if((m.tag&a)===a){var C=m.inst,P=C.destroy;if(P!==void 0){C.destroy=void 0,v=h;var W=f,te=P;try{te()}catch(re){dt(v,W,re)}}}m=m.next}while(m!==y)}}catch(re){dt(h,h.return,re)}}function k2(a){var h=a.updateQueue;if(h!==null){var f=a.stateNode;try{gk(h,f)}catch(m){dt(a,a.return,m)}}}function T2(a,h,f){f.props=Ha(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){dt(a,h,m)}}function su(a,h){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(v){dt(a,h,v)}}function is(a,h){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(v){dt(a,h,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){dt(a,h,v)}else f.current=null}function A2(a){var h=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(v){dt(a,a.return,v)}}function lv(a,h,f){try{var m=a.stateNode;lj(m,a.type,f,h),m[xn]=h}catch(v){dt(a,a.return,v)}}function E2(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Uo(a.type)||a.tag===4}function cv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||E2(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Uo(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function hv(a,h,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,h?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,h):(h=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,h.appendChild(a),f=f._reactRootContainer,f!=null||h.onclick!==null||(h.onclick=zs));else if(m!==4&&(m===27&&Uo(a.type)&&(f=a.stateNode,h=null),a=a.child,a!==null))for(hv(a,h,f),a=a.sibling;a!==null;)hv(a,h,f),a=a.sibling}function mp(a,h,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,h?f.insertBefore(a,h):f.appendChild(a);else if(m!==4&&(m===27&&Uo(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(mp(a,h,f),a=a.sibling;a!==null;)mp(a,h,f),a=a.sibling}function M2(a){var h=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,v=h.attributes;v.length;)h.removeAttributeNode(v[0]);Vi(h,m,f),h[zi]=a,h[xn]=f}catch(y){dt(a,a.return,y)}}var Ys=!1,ri=!1,uv=!1,P2=typeof WeakSet=="function"?WeakSet:Set,Si=null;function I8(a,h){if(a=a.containerInfo,Rv=Bp,a=XC(a),r0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var v=m.anchorOffset,y=m.focusNode;m=m.focusOffset;try{f.nodeType,y.nodeType}catch{f=null;break e}var C=0,P=-1,W=-1,te=0,re=0,le=a,ie=null;t:for(;;){for(var ne;le!==f||v!==0&&le.nodeType!==3||(P=C+v),le!==y||m!==0&&le.nodeType!==3||(W=C+m),le.nodeType===3&&(C+=le.nodeValue.length),(ne=le.firstChild)!==null;)ie=le,le=ne;for(;;){if(le===a)break t;if(ie===f&&++te===v&&(P=C),ie===y&&++re===m&&(W=C),(ne=le.nextSibling)!==null)break;le=ie,ie=le.parentNode}le=ne}f=P===-1||W===-1?null:{start:P,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(Qv={focusedElem:a,selectionRange:f},Bp=!1,Si=h;Si!==null;)if(h=Si,a=h.child,(h.subtreeFlags&1028)!==0&&a!==null)a.return=h,Si=a;else for(;Si!==null;){switch(h=Si,y=h.alternate,a=h.flags,h.tag){case 0:if((a&4)!==0&&(a=h.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)v=a[f],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,f=h,v=y.memoizedProps,y=y.memoizedState,m=f.stateNode;try{var we=Ha(f.type,v);a=m.getSnapshotBeforeUpdate(we,y),m.__reactInternalSnapshotBeforeUpdate=a}catch(Qe){dt(f,f.return,Qe)}}break;case 3:if((a&1024)!==0){if(a=h.stateNode.containerInfo,f=a.nodeType,f===9)Bv(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Bv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(n(163))}if(a=h.sibling,a!==null){a.return=h.return,Si=a;break}Si=h.return}}function R2(a,h,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Fs(a,f),m&4&&ru(5,f);break;case 1:if(Fs(a,f),m&4)if(a=f.stateNode,h===null)try{a.componentDidMount()}catch(C){dt(f,f.return,C)}else{var v=Ha(f.type,h.memoizedProps);h=h.memoizedState;try{a.componentDidUpdate(v,h,a.__reactInternalSnapshotBeforeUpdate)}catch(C){dt(f,f.return,C)}}m&64&&k2(f),m&512&&su(f,f.return);break;case 3:if(Fs(a,f),m&64&&(a=f.updateQueue,a!==null)){if(h=null,f.child!==null)switch(f.child.tag){case 27:case 5:h=f.child.stateNode;break;case 1:h=f.child.stateNode}try{gk(a,h)}catch(C){dt(f,f.return,C)}}break;case 27:h===null&&m&4&&M2(f);case 26:case 5:Fs(a,f),h===null&&m&4&&A2(f),m&512&&su(f,f.return);break;case 12:Fs(a,f);break;case 31:Fs(a,f),m&4&&D2(a,f);break;case 13:Fs(a,f),m&4&&B2(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=F8.bind(null,f),gj(a,f))));break;case 22:if(m=f.memoizedState!==null||Ys,!m){h=h!==null&&h.memoizedState!==null||ri,v=Ys;var y=ri;Ys=m,(ri=h)&&!y?Gs(a,f,(f.subtreeFlags&8772)!==0):Fs(a,f),Ys=v,ri=y}break;case 30:break;default:Fs(a,f)}}function Q2(a){var h=a.alternate;h!==null&&(a.alternate=null,Q2(h)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(h=a.stateNode,h!==null&&IO(h)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Lt=null,Cn=!1;function Hs(a,h,f){for(f=f.child;f!==null;)L2(a,h,f),f=f.sibling}function L2(a,h,f){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(hn,f)}catch{}switch(f.tag){case 26:ri||is(f,h),Hs(a,h,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:ri||is(f,h);var m=Lt,v=Cn;Uo(f.type)&&(Lt=f.stateNode,Cn=!1),Hs(a,h,f),pu(f.stateNode),Lt=m,Cn=v;break;case 5:ri||is(f,h);case 6:if(m=Lt,v=Cn,Lt=null,Hs(a,h,f),Lt=m,Cn=v,Lt!==null)if(Cn)try{(Lt.nodeType===9?Lt.body:Lt.nodeName==="HTML"?Lt.ownerDocument.body:Lt).removeChild(f.stateNode)}catch(y){dt(f,h,y)}else try{Lt.removeChild(f.stateNode)}catch(y){dt(f,h,y)}break;case 18:Lt!==null&&(Cn?(a=Lt,k5(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),bc(a)):k5(Lt,f.stateNode));break;case 4:m=Lt,v=Cn,Lt=f.stateNode.containerInfo,Cn=!0,Hs(a,h,f),Lt=m,Cn=v;break;case 0:case 11:case 14:case 15:jo(2,f,h),ri||jo(4,f,h),Hs(a,h,f);break;case 1:ri||(is(f,h),m=f.stateNode,typeof m.componentWillUnmount=="function"&&T2(f,h,m)),Hs(a,h,f);break;case 21:Hs(a,h,f);break;case 22:ri=(m=ri)||f.memoizedState!==null,Hs(a,h,f),ri=m;break;default:Hs(a,h,f)}}function D2(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{bc(a)}catch(f){dt(h,h.return,f)}}}function B2(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{bc(a)}catch(f){dt(h,h.return,f)}}function V8(a){switch(a.tag){case 31:case 13:case 19:var h=a.stateNode;return h===null&&(h=a.stateNode=new P2),h;case 22:return a=a.stateNode,h=a._retryCache,h===null&&(h=a._retryCache=new P2),h;default:throw Error(n(435,a.tag))}}function gp(a,h){var f=V8(a);h.forEach(function(m){if(!f.has(m)){f.add(m);var v=G8.bind(null,a,m);m.then(v,v)}})}function kn(a,h){var f=h.deletions;if(f!==null)for(var m=0;m<f.length;m++){var v=f[m],y=a,C=h,P=C;e:for(;P!==null;){switch(P.tag){case 27:if(Uo(P.type)){Lt=P.stateNode,Cn=!1;break e}break;case 5:Lt=P.stateNode,Cn=!1;break e;case 3:case 4:Lt=P.stateNode.containerInfo,Cn=!0;break e}P=P.return}if(Lt===null)throw Error(n(160));L2(y,C,v),Lt=null,Cn=!1,y=v.alternate,y!==null&&(y.return=null),v.return=null}if(h.subtreeFlags&13886)for(h=h.child;h!==null;)$2(h,a),h=h.sibling}var zr=null;function $2(a,h){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:kn(h,a),Tn(a),m&4&&(jo(3,a,a.return),ru(3,a),jo(5,a,a.return));break;case 1:kn(h,a),Tn(a),m&512&&(ri||f===null||is(f,f.return)),m&64&&Ys&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var v=zr;if(kn(h,a),Tn(a),m&512&&(ri||f===null||is(f,f.return)),m&4){var y=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,v=v.ownerDocument||v;t:switch(m){case"title":y=v.getElementsByTagName("title")[0],(!y||y[Rh]||y[zi]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=v.createElement(m),v.head.insertBefore(y,v.querySelector("head > title"))),Vi(y,m,f),y[zi]=a,bi(y),m=y;break e;case"link":var C=$5("link","href",v).get(m+(f.href||""));if(C){for(var P=0;P<C.length;P++)if(y=C[P],y.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&y.getAttribute("rel")===(f.rel==null?null:f.rel)&&y.getAttribute("title")===(f.title==null?null:f.title)&&y.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){C.splice(P,1);break t}}y=v.createElement(m),Vi(y,m,f),v.head.appendChild(y);break;case"meta":if(C=$5("meta","content",v).get(m+(f.content||""))){for(P=0;P<C.length;P++)if(y=C[P],y.getAttribute("content")===(f.content==null?null:""+f.content)&&y.getAttribute("name")===(f.name==null?null:f.name)&&y.getAttribute("property")===(f.property==null?null:f.property)&&y.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&y.getAttribute("charset")===(f.charSet==null?null:f.charSet)){C.splice(P,1);break t}}y=v.createElement(m),Vi(y,m,f),v.head.appendChild(y);break;default:throw Error(n(468,m))}y[zi]=a,bi(y),m=y}a.stateNode=m}else z5(v,a.type,a.stateNode);else a.stateNode=B5(v,m,a.memoizedProps);else y!==m?(y===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):y.count--,m===null?z5(v,a.type,a.stateNode):B5(v,m,a.memoizedProps)):m===null&&a.stateNode!==null&&lv(a,a.memoizedProps,f.memoizedProps)}break;case 27:kn(h,a),Tn(a),m&512&&(ri||f===null||is(f,f.return)),f!==null&&m&4&&lv(a,a.memoizedProps,f.memoizedProps);break;case 5:if(kn(h,a),Tn(a),m&512&&(ri||f===null||is(f,f.return)),a.flags&32){v=a.stateNode;try{Zl(v,"")}catch(we){dt(a,a.return,we)}}m&4&&a.stateNode!=null&&(v=a.memoizedProps,lv(a,v,f!==null?f.memoizedProps:v)),m&1024&&(uv=!0);break;case 6:if(kn(h,a),Tn(a),m&4){if(a.stateNode===null)throw Error(n(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(we){dt(a,a.return,we)}}break;case 3:if(Rp=null,v=zr,zr=Mp(h.containerInfo),kn(h,a),zr=v,Tn(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{bc(h.containerInfo)}catch(we){dt(a,a.return,we)}uv&&(uv=!1,z2(a));break;case 4:m=zr,zr=Mp(a.stateNode.containerInfo),kn(h,a),Tn(a),zr=m;break;case 12:kn(h,a),Tn(a);break;case 31:kn(h,a),Tn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 13:kn(h,a),Tn(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(vp=cn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 22:v=a.memoizedState!==null;var W=f!==null&&f.memoizedState!==null,te=Ys,re=ri;if(Ys=te||v,ri=re||W,kn(h,a),ri=re,Ys=te,Tn(a),m&8192)e:for(h=a.stateNode,h._visibility=v?h._visibility&-2:h._visibility|1,v&&(f===null||W||Ys||ri||Fa(a)),f=null,h=a;;){if(h.tag===5||h.tag===26){if(f===null){W=f=h;try{if(y=W.stateNode,v)C=y.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{P=W.stateNode;var le=W.memoizedProps.style,ie=le!=null&&le.hasOwnProperty("display")?le.display:null;P.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(we){dt(W,W.return,we)}}}else if(h.tag===6){if(f===null){W=h;try{W.stateNode.nodeValue=v?"":W.memoizedProps}catch(we){dt(W,W.return,we)}}}else if(h.tag===18){if(f===null){W=h;try{var ne=W.stateNode;v?T5(ne,!0):T5(W.stateNode,!1)}catch(we){dt(W,W.return,we)}}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===a)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break e;for(;h.sibling===null;){if(h.return===null||h.return===a)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,gp(a,f))));break;case 19:kn(h,a),Tn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 30:break;case 21:break;default:kn(h,a),Tn(a)}}function Tn(a){var h=a.flags;if(h&2){try{for(var f,m=a.return;m!==null;){if(E2(m)){f=m;break}m=m.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var v=f.stateNode,y=cv(a);mp(a,y,v);break;case 5:var C=f.stateNode;f.flags&32&&(Zl(C,""),f.flags&=-33);var P=cv(a);mp(a,P,C);break;case 3:case 4:var W=f.stateNode.containerInfo,te=cv(a);hv(a,te,W);break;default:throw Error(n(161))}}catch(re){dt(a,a.return,re)}a.flags&=-3}h&4096&&(a.flags&=-4097)}function z2(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var h=a;z2(h),h.tag===5&&h.flags&1024&&h.stateNode.reset(),a=a.sibling}}function Fs(a,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)R2(a,h.alternate,h),h=h.sibling}function Fa(a){for(a=a.child;a!==null;){var h=a;switch(h.tag){case 0:case 11:case 14:case 15:jo(4,h,h.return),Fa(h);break;case 1:is(h,h.return);var f=h.stateNode;typeof f.componentWillUnmount=="function"&&T2(h,h.return,f),Fa(h);break;case 27:pu(h.stateNode);case 26:case 5:is(h,h.return),Fa(h);break;case 22:h.memoizedState===null&&Fa(h);break;case 30:Fa(h);break;default:Fa(h)}a=a.sibling}}function Gs(a,h,f){for(f=f&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var m=h.alternate,v=a,y=h,C=y.flags;switch(y.tag){case 0:case 11:case 15:Gs(v,y,f),ru(4,y);break;case 1:if(Gs(v,y,f),m=y,v=m.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(te){dt(m,m.return,te)}if(m=y,v=m.updateQueue,v!==null){var P=m.stateNode;try{var W=v.shared.hiddenCallbacks;if(W!==null)for(v.shared.hiddenCallbacks=null,v=0;v<W.length;v++)mk(W[v],P)}catch(te){dt(m,m.return,te)}}f&&C&64&&k2(y),su(y,y.return);break;case 27:M2(y);case 26:case 5:Gs(v,y,f),f&&m===null&&C&4&&A2(y),su(y,y.return);break;case 12:Gs(v,y,f);break;case 31:Gs(v,y,f),f&&C&4&&D2(v,y);break;case 13:Gs(v,y,f),f&&C&4&&B2(v,y);break;case 22:y.memoizedState===null&&Gs(v,y,f),su(y,y.return);break;case 30:break;default:Gs(v,y,f)}h=h.sibling}}function fv(a,h){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(a=h.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&qh(f))}function dv(a,h){a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&qh(a))}function Nr(a,h,f,m){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)N2(a,h,f,m),h=h.sibling}function N2(a,h,f,m){var v=h.flags;switch(h.tag){case 0:case 11:case 15:Nr(a,h,f,m),v&2048&&ru(9,h);break;case 1:Nr(a,h,f,m);break;case 3:Nr(a,h,f,m),v&2048&&(a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&qh(a)));break;case 12:if(v&2048){Nr(a,h,f,m),a=h.stateNode;try{var y=h.memoizedProps,C=y.id,P=y.onPostCommit;typeof P=="function"&&P(C,h.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){dt(h,h.return,W)}}else Nr(a,h,f,m);break;case 31:Nr(a,h,f,m);break;case 13:Nr(a,h,f,m);break;case 23:break;case 22:y=h.stateNode,C=h.alternate,h.memoizedState!==null?y._visibility&2?Nr(a,h,f,m):ou(a,h):y._visibility&2?Nr(a,h,f,m):(y._visibility|=2,hc(a,h,f,m,(h.subtreeFlags&10256)!==0||!1)),v&2048&&fv(C,h);break;case 24:Nr(a,h,f,m),v&2048&&dv(h.alternate,h);break;default:Nr(a,h,f,m)}}function hc(a,h,f,m,v){for(v=v&&((h.subtreeFlags&10256)!==0||!1),h=h.child;h!==null;){var y=a,C=h,P=f,W=m,te=C.flags;switch(C.tag){case 0:case 11:case 15:hc(y,C,P,W,v),ru(8,C);break;case 23:break;case 22:var re=C.stateNode;C.memoizedState!==null?re._visibility&2?hc(y,C,P,W,v):ou(y,C):(re._visibility|=2,hc(y,C,P,W,v)),v&&te&2048&&fv(C.alternate,C);break;case 24:hc(y,C,P,W,v),v&&te&2048&&dv(C.alternate,C);break;default:hc(y,C,P,W,v)}h=h.sibling}}function ou(a,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var f=a,m=h,v=m.flags;switch(m.tag){case 22:ou(f,m),v&2048&&fv(m.alternate,m);break;case 24:ou(f,m),v&2048&&dv(m.alternate,m);break;default:ou(f,m)}h=h.sibling}}var au=8192;function uc(a,h,f){if(a.subtreeFlags&au)for(a=a.child;a!==null;)j2(a,h,f),a=a.sibling}function j2(a,h,f){switch(a.tag){case 26:uc(a,h,f),a.flags&au&&a.memoizedState!==null&&Aj(f,zr,a.memoizedState,a.memoizedProps);break;case 5:uc(a,h,f);break;case 3:case 4:var m=zr;zr=Mp(a.stateNode.containerInfo),uc(a,h,f),zr=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=au,au=16777216,uc(a,h,f),au=m):uc(a,h,f));break;default:uc(a,h,f)}}function I2(a){var h=a.alternate;if(h!==null&&(a=h.child,a!==null)){h.child=null;do h=a.sibling,a.sibling=null,a=h;while(a!==null)}}function lu(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var m=h[f];Si=m,X2(m,a)}I2(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)V2(a),a=a.sibling}function V2(a){switch(a.tag){case 0:case 11:case 15:lu(a),a.flags&2048&&jo(9,a,a.return);break;case 3:lu(a);break;case 12:lu(a);break;case 22:var h=a.stateNode;a.memoizedState!==null&&h._visibility&2&&(a.return===null||a.return.tag!==13)?(h._visibility&=-3,Op(a)):lu(a);break;default:lu(a)}}function Op(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var m=h[f];Si=m,X2(m,a)}I2(a)}for(a=a.child;a!==null;){switch(h=a,h.tag){case 0:case 11:case 15:jo(8,h,h.return),Op(h);break;case 22:f=h.stateNode,f._visibility&2&&(f._visibility&=-3,Op(h));break;default:Op(h)}a=a.sibling}}function X2(a,h){for(;Si!==null;){var f=Si;switch(f.tag){case 0:case 11:case 15:jo(8,f,h);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:qh(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Si=m;else e:for(f=a;Si!==null;){m=Si;var v=m.sibling,y=m.return;if(Q2(m),m===f){Si=null;break e}if(v!==null){v.return=y,Si=v;break e}Si=y}}}var X8={getCacheForType:function(a){var h=ji(ti),f=h.data.get(a);return f===void 0&&(f=a(),h.data.set(a,f)),f},cacheSignal:function(){return ji(ti).controller.signal}},Z8=typeof WeakMap=="function"?WeakMap:Map,ot=0,yt=null,Ye=null,Ke=0,ft=0,Wn=null,Io=!1,fc=!1,pv=!1,Ks=0,It=0,Vo=0,Ga=0,mv=0,Un=0,dc=0,cu=null,An=null,gv=!1,vp=0,Z2=0,_p=1/0,yp=null,Xo=null,di=0,Zo=null,pc=null,Js=0,Ov=0,vv=null,q2=null,hu=0,_v=null;function Yn(){return(ot&2)!==0&&Ke!==0?Ke&-Ke:$.T!==null?Cv():aC()}function W2(){if(Un===0)if((Ke&536870912)===0||tt){var a=Ad;Ad<<=1,(Ad&3932160)===0&&(Ad=262144),Un=a}else Un=536870912;return a=Zn.current,a!==null&&(a.flags|=32),Un}function En(a,h,f){(a===yt&&(ft===2||ft===9)||a.cancelPendingCommit!==null)&&(mc(a,0),qo(a,Ke,Un,!1)),Ph(a,f),((ot&2)===0||a!==yt)&&(a===yt&&((ot&2)===0&&(Ga|=f),It===4&&qo(a,Ke,Un,!1)),ns(a))}function U2(a,h,f){if((ot&6)!==0)throw Error(n(327));var m=!f&&(h&127)===0&&(h&a.expiredLanes)===0||Mh(a,h),v=m?U8(a,h):bv(a,h,!0),y=m;do{if(v===0){fc&&!m&&qo(a,h,0,!1);break}else{if(f=a.current.alternate,y&&!q8(f)){v=bv(a,h,!1),y=!1;continue}if(v===2){if(y=h,a.errorRecoveryDisabledLanes&y)var C=0;else C=a.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){h=C;e:{var P=a;v=cu;var W=P.current.memoizedState.isDehydrated;if(W&&(mc(P,C).flags|=256),C=bv(P,C,!1),C!==2){if(pv&&!W){P.errorRecoveryDisabledLanes|=y,Ga|=y,v=4;break e}y=An,An=v,y!==null&&(An===null?An=y:An.push.apply(An,y))}v=C}if(y=!1,v!==2)continue}}if(v===1){mc(a,0),qo(a,h,0,!0);break}e:{switch(m=a,y=v,y){case 0:case 1:throw Error(n(345));case 4:if((h&4194048)!==h)break;case 6:qo(m,h,Un,!Io);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(n(329))}if((h&62914560)===h&&(v=vp+300-cn(),10<v)){if(qo(m,h,Un,!Io),Md(m,0,!0)!==0)break e;Js=h,m.timeoutHandle=w5(Y2.bind(null,m,f,An,yp,gv,h,Un,Ga,dc,Io,y,"Throttled",-0,0),v);break e}Y2(m,f,An,yp,gv,h,Un,Ga,dc,Io,y,null,-0,0)}}break}while(!0);ns(a)}function Y2(a,h,f,m,v,y,C,P,W,te,re,le,ie,ne){if(a.timeoutHandle=-1,le=h.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zs},j2(h,y,le);var we=(y&62914560)===y?vp-cn():(y&4194048)===y?Z2-cn():0;if(we=Ej(le,we),we!==null){Js=y,a.cancelPendingCommit=we(i5.bind(null,a,h,y,f,m,v,C,P,W,re,le,null,ie,ne)),qo(a,y,C,!te);return}}i5(a,h,y,f,m,v,C,P,W)}function q8(a){for(var h=a;;){var f=h.tag;if((f===0||f===11||f===15)&&h.flags&16384&&(f=h.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var v=f[m],y=v.getSnapshot;v=v.value;try{if(!Vn(y(),v))return!1}catch{return!1}}if(f=h.child,h.subtreeFlags&16384&&f!==null)f.return=h,h=f;else{if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function qo(a,h,f,m){h&=~mv,h&=~Ga,a.suspendedLanes|=h,a.pingedLanes&=~h,m&&(a.warmLanes|=h),m=a.expirationTimes;for(var v=h;0<v;){var y=31-_t(v),C=1<<y;m[y]=-1,v&=~C}f!==0&&rC(a,f,h)}function bp(){return(ot&6)===0?(uu(0),!1):!0}function yv(){if(Ye!==null){if(ft===0)var a=Ye.return;else a=Ye,Vs=Va=null,B0(a),sc=null,Uh=0,a=Ye;for(;a!==null;)C2(a.alternate,a),a=a.return;Ye=null}}function mc(a,h){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,uj(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),Js=0,yv(),yt=a,Ye=f=js(a.current,null),Ke=h,ft=0,Wn=null,Io=!1,fc=Mh(a,h),pv=!1,dc=Un=mv=Ga=Vo=It=0,An=cu=null,gv=!1,(h&8)!==0&&(h|=h&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=h;0<m;){var v=31-_t(m),y=1<<v;h|=a[v],m&=~y}return Ks=h,Vd(),f}function H2(a,h){Ie=null,$.H=tu,h===rc||h===Fd?(h=uk(),ft=3):h===w0?(h=uk(),ft=4):ft=h===K0?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,Wn=h,Ye===null&&(It=1,hp(a,ur(h,a.current)))}function F2(){var a=Zn.current;return a===null?!0:(Ke&4194048)===Ke?mr===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?a===mr:!1}function G2(){var a=$.H;return $.H=tu,a===null?tu:a}function K2(){var a=$.A;return $.A=X8,a}function Sp(){It=4,Io||(Ke&4194048)!==Ke&&Zn.current!==null||(fc=!0),(Vo&134217727)===0&&(Ga&134217727)===0||yt===null||qo(yt,Ke,Un,!1)}function bv(a,h,f){var m=ot;ot|=2;var v=G2(),y=K2();(yt!==a||Ke!==h)&&(yp=null,mc(a,h)),h=!1;var C=It;e:do try{if(ft!==0&&Ye!==null){var P=Ye,W=Wn;switch(ft){case 8:yv(),C=6;break e;case 3:case 2:case 9:case 6:Zn.current===null&&(h=!0);var te=ft;if(ft=0,Wn=null,gc(a,P,W,te),f&&fc){C=0;break e}break;default:te=ft,ft=0,Wn=null,gc(a,P,W,te)}}W8(),C=It;break}catch(re){H2(a,re)}while(!0);return h&&a.shellSuspendCounter++,Vs=Va=null,ot=m,$.H=v,$.A=y,Ye===null&&(yt=null,Ke=0,Vd()),C}function W8(){for(;Ye!==null;)J2(Ye)}function U8(a,h){var f=ot;ot|=2;var m=G2(),v=K2();yt!==a||Ke!==h?(yp=null,_p=cn()+500,mc(a,h)):fc=Mh(a,h);e:do try{if(ft!==0&&Ye!==null){h=Ye;var y=Wn;t:switch(ft){case 1:ft=0,Wn=null,gc(a,h,y,1);break;case 2:case 9:if(ck(y)){ft=0,Wn=null,e5(h);break}h=function(){ft!==2&&ft!==9||yt!==a||(ft=7),ns(a)},y.then(h,h);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:ck(y)?(ft=0,Wn=null,e5(h)):(ft=0,Wn=null,gc(a,h,y,7));break;case 5:var C=null;switch(Ye.tag){case 26:C=Ye.memoizedState;case 5:case 27:var P=Ye;if(C?N5(C):P.stateNode.complete){ft=0,Wn=null;var W=P.sibling;if(W!==null)Ye=W;else{var te=P.return;te!==null?(Ye=te,xp(te)):Ye=null}break t}}ft=0,Wn=null,gc(a,h,y,5);break;case 6:ft=0,Wn=null,gc(a,h,y,6);break;case 8:yv(),It=6;break e;default:throw Error(n(462))}}Y8();break}catch(re){H2(a,re)}while(!0);return Vs=Va=null,$.H=m,$.A=v,ot=f,Ye!==null?0:(yt=null,Ke=0,Vd(),It)}function Y8(){for(;Ye!==null&&!LO();)J2(Ye)}function J2(a){var h=x2(a.alternate,a,Ks);a.memoizedProps=a.pendingProps,h===null?xp(a):Ye=h}function e5(a){var h=a,f=h.alternate;switch(h.tag){case 15:case 0:h=O2(f,h,h.pendingProps,h.type,void 0,Ke);break;case 11:h=O2(f,h,h.pendingProps,h.type.render,h.ref,Ke);break;case 5:B0(h);default:C2(f,h),h=Ye=KC(h,Ks),h=x2(f,h,Ks)}a.memoizedProps=a.pendingProps,h===null?xp(a):Ye=h}function gc(a,h,f,m){Vs=Va=null,B0(h),sc=null,Uh=0;var v=h.return;try{if(B8(a,v,h,f,Ke)){It=1,hp(a,ur(f,a.current)),Ye=null;return}}catch(y){if(v!==null)throw Ye=v,y;It=1,hp(a,ur(f,a.current)),Ye=null;return}h.flags&32768?(tt||m===1?a=!0:fc||(Ke&536870912)!==0?a=!1:(Io=a=!0,(m===2||m===9||m===3||m===6)&&(m=Zn.current,m!==null&&m.tag===13&&(m.flags|=16384))),t5(h,a)):xp(h)}function xp(a){var h=a;do{if((h.flags&32768)!==0){t5(h,Io);return}a=h.return;var f=N8(h.alternate,h,Ks);if(f!==null){Ye=f;return}if(h=h.sibling,h!==null){Ye=h;return}Ye=h=a}while(h!==null);It===0&&(It=5)}function t5(a,h){do{var f=j8(a.alternate,a);if(f!==null){f.flags&=32767,Ye=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!h&&(a=a.sibling,a!==null)){Ye=a;return}Ye=a=f}while(a!==null);It=6,Ye=null}function i5(a,h,f,m,v,y,C,P,W){a.cancelPendingCommit=null;do wp();while(di!==0);if((ot&6)!==0)throw Error(n(327));if(h!==null){if(h===a.current)throw Error(n(177));if(y=h.lanes|h.childLanes,y|=c0,TN(a,f,y,C,P,W),a===yt&&(Ye=yt=null,Ke=0),pc=h,Zo=a,Js=f,Ov=y,vv=v,q2=m,(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,K8(De,function(){return a5(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(h.flags&13878)!==0,(h.subtreeFlags&13878)!==0||m){m=$.T,$.T=null,v=X.p,X.p=2,C=ot,ot|=4;try{I8(a,h,f)}finally{ot=C,X.p=v,$.T=m}}di=1,n5(),r5(),s5()}}function n5(){if(di===1){di=0;var a=Zo,h=pc,f=(h.flags&13878)!==0;if((h.subtreeFlags&13878)!==0||f){f=$.T,$.T=null;var m=X.p;X.p=2;var v=ot;ot|=4;try{$2(h,a);var y=Qv,C=XC(a.containerInfo),P=y.focusedElem,W=y.selectionRange;if(C!==P&&P&&P.ownerDocument&&VC(P.ownerDocument.documentElement,P)){if(W!==null&&r0(P)){var te=W.start,re=W.end;if(re===void 0&&(re=te),"selectionStart"in P)P.selectionStart=te,P.selectionEnd=Math.min(re,P.value.length);else{var le=P.ownerDocument||document,ie=le&&le.defaultView||window;if(ie.getSelection){var ne=ie.getSelection(),we=P.textContent.length,Qe=Math.min(W.start,we),gt=W.end===void 0?Qe:Math.min(W.end,we);!ne.extend&&Qe>gt&&(C=gt,gt=Qe,Qe=C);var G=IC(P,Qe),Y=IC(P,gt);if(G&&Y&&(ne.rangeCount!==1||ne.anchorNode!==G.node||ne.anchorOffset!==G.offset||ne.focusNode!==Y.node||ne.focusOffset!==Y.offset)){var ee=le.createRange();ee.setStart(G.node,G.offset),ne.removeAllRanges(),Qe>gt?(ne.addRange(ee),ne.extend(Y.node,Y.offset)):(ee.setEnd(Y.node,Y.offset),ne.addRange(ee))}}}}for(le=[],ne=P;ne=ne.parentNode;)ne.nodeType===1&&le.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<le.length;P++){var ae=le[P];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Bp=!!Rv,Qv=Rv=null}finally{ot=v,X.p=m,$.T=f}}a.current=h,di=2}}function r5(){if(di===2){di=0;var a=Zo,h=pc,f=(h.flags&8772)!==0;if((h.subtreeFlags&8772)!==0||f){f=$.T,$.T=null;var m=X.p;X.p=2;var v=ot;ot|=4;try{R2(a,h.alternate,h)}finally{ot=v,X.p=m,$.T=f}}di=3}}function s5(){if(di===4||di===3){di=0,DO();var a=Zo,h=pc,f=Js,m=q2;(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?di=5:(di=0,pc=Zo=null,o5(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(Xo=null),NO(f),h=h.stateNode,fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(hn,h,void 0,(h.current.flags&128)===128)}catch{}if(m!==null){h=$.T,v=X.p,X.p=2,$.T=null;try{for(var y=a.onRecoverableError,C=0;C<m.length;C++){var P=m[C];y(P.value,{componentStack:P.stack})}}finally{$.T=h,X.p=v}}(Js&3)!==0&&wp(),ns(a),v=a.pendingLanes,(f&261930)!==0&&(v&42)!==0?a===_v?hu++:(hu=0,_v=a):hu=0,uu(0)}}function o5(a,h){(a.pooledCacheLanes&=h)===0&&(h=a.pooledCache,h!=null&&(a.pooledCache=null,qh(h)))}function wp(){return n5(),r5(),s5(),a5()}function a5(){if(di!==5)return!1;var a=Zo,h=Ov;Ov=0;var f=NO(Js),m=$.T,v=X.p;try{X.p=32>f?32:f,$.T=null,f=vv,vv=null;var y=Zo,C=Js;if(di=0,pc=Zo=null,Js=0,(ot&6)!==0)throw Error(n(331));var P=ot;if(ot|=4,V2(y.current),N2(y,y.current,C,f),ot=P,uu(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(hn,y)}catch{}return!0}finally{X.p=v,$.T=m,o5(a,h)}}function l5(a,h,f){h=ur(f,h),h=G0(a.stateNode,h,2),a=$o(a,h,2),a!==null&&(Ph(a,2),ns(a))}function dt(a,h,f){if(a.tag===3)l5(a,a,f);else for(;h!==null;){if(h.tag===3){l5(h,a,f);break}else if(h.tag===1){var m=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Xo===null||!Xo.has(m))){a=ur(f,a),f=c2(2),m=$o(h,f,2),m!==null&&(h2(f,m,h,a),Ph(m,2),ns(m));break}}h=h.return}}function Sv(a,h,f){var m=a.pingCache;if(m===null){m=a.pingCache=new Z8;var v=new Set;m.set(h,v)}else v=m.get(h),v===void 0&&(v=new Set,m.set(h,v));v.has(f)||(pv=!0,v.add(f),a=H8.bind(null,a,h,f),h.then(a,a))}function H8(a,h,f){var m=a.pingCache;m!==null&&m.delete(h),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,yt===a&&(Ke&f)===f&&(It===4||It===3&&(Ke&62914560)===Ke&&300>cn()-vp?(ot&2)===0&&mc(a,0):mv|=f,dc===Ke&&(dc=0)),ns(a)}function c5(a,h){h===0&&(h=nC()),a=Na(a,h),a!==null&&(Ph(a,h),ns(a))}function F8(a){var h=a.memoizedState,f=0;h!==null&&(f=h.retryLane),c5(a,f)}function G8(a,h){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,v=a.memoizedState;v!==null&&(f=v.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(h),c5(a,f)}function K8(a,h){return To(a,h)}var Cp=null,Oc=null,xv=!1,kp=!1,wv=!1,Wo=0;function ns(a){a!==Oc&&a.next===null&&(Oc===null?Cp=Oc=a:Oc=Oc.next=a),kp=!0,xv||(xv=!0,ej())}function uu(a,h){if(!wv&&kp){wv=!0;do for(var f=!1,m=Cp;m!==null;){if(a!==0){var v=m.pendingLanes;if(v===0)var y=0;else{var C=m.suspendedLanes,P=m.pingedLanes;y=(1<<31-_t(42|a)+1)-1,y&=v&~(C&~P),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(f=!0,d5(m,y))}else y=Ke,y=Md(m,m===yt?y:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(y&3)===0||Mh(m,y)||(f=!0,d5(m,y));m=m.next}while(f);wv=!1}}function J8(){h5()}function h5(){kp=xv=!1;var a=0;Wo!==0&&hj()&&(a=Wo);for(var h=cn(),f=null,m=Cp;m!==null;){var v=m.next,y=u5(m,h);y===0?(m.next=null,f===null?Cp=v:f.next=v,v===null&&(Oc=f)):(f=m,(a!==0||(y&3)!==0)&&(kp=!0)),m=v}di!==0&&di!==5||uu(a),Wo!==0&&(Wo=0)}function u5(a,h){for(var f=a.suspendedLanes,m=a.pingedLanes,v=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var C=31-_t(y),P=1<<C,W=v[C];W===-1?((P&f)===0||(P&m)!==0)&&(v[C]=kN(P,h)):W<=h&&(a.expiredLanes|=P),y&=~P}if(h=yt,f=Ke,f=Md(a,a===h?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===h&&(ft===2||ft===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Eh(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||Mh(a,f)){if(h=f&-f,h===a.callbackPriority)return h;switch(m!==null&&Eh(m),NO(f)){case 2:case 8:f=ge;break;case 32:f=De;break;case 268435456:f=ht;break;default:f=De}return m=f5.bind(null,a),f=To(f,m),a.callbackPriority=h,a.callbackNode=f,h}return m!==null&&m!==null&&Eh(m),a.callbackPriority=2,a.callbackNode=null,2}function f5(a,h){if(di!==0&&di!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(wp()&&a.callbackNode!==f)return null;var m=Ke;return m=Md(a,a===yt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(U2(a,m,h),u5(a,cn()),a.callbackNode!=null&&a.callbackNode===f?f5.bind(null,a):null)}function d5(a,h){if(wp())return null;U2(a,h,!0)}function ej(){fj(function(){(ot&6)!==0?To(oe,J8):h5()})}function Cv(){if(Wo===0){var a=ic;a===0&&(a=Td,Td<<=1,(Td&261888)===0&&(Td=256)),Wo=a}return Wo}function p5(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ld(""+a)}function m5(a,h){var f=h.ownerDocument.createElement("input");return f.name=h.name,f.value=h.value,a.id&&f.setAttribute("form",a.id),h.parentNode.insertBefore(f,h),a=new FormData(a),f.parentNode.removeChild(f),a}function tj(a,h,f,m,v){if(h==="submit"&&f&&f.stateNode===v){var y=p5((v[xn]||null).action),C=m.submitter;C&&(h=(h=C[xn]||null)?p5(h.formAction):C.getAttribute("formAction"),h!==null&&(y=h,C=null));var P=new zd("action","action",null,m,v);a.push({event:P,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Wo!==0){var W=C?m5(v,C):new FormData(v);q0(f,{pending:!0,data:W,method:v.method,action:y},null,W)}}else typeof y=="function"&&(P.preventDefault(),W=C?m5(v,C):new FormData(v),q0(f,{pending:!0,data:W,method:v.method,action:y},y,W))},currentTarget:v}]})}}for(var kv=0;kv<l0.length;kv++){var Tv=l0[kv],ij=Tv.toLowerCase(),nj=Tv[0].toUpperCase()+Tv.slice(1);$r(ij,"on"+nj)}$r(WC,"onAnimationEnd"),$r(UC,"onAnimationIteration"),$r(YC,"onAnimationStart"),$r("dblclick","onDoubleClick"),$r("focusin","onFocus"),$r("focusout","onBlur"),$r(_8,"onTransitionRun"),$r(y8,"onTransitionStart"),$r(b8,"onTransitionCancel"),$r(HC,"onTransitionEnd"),Vl("onMouseEnter",["mouseout","mouseover"]),Vl("onMouseLeave",["mouseout","mouseover"]),Vl("onPointerEnter",["pointerout","pointerover"]),Vl("onPointerLeave",["pointerout","pointerover"]),Da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Da("onBeforeInput",["compositionend","keypress","textInput","paste"]),Da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fu="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(" "),rj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fu));function g5(a,h){h=(h&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],v=m.event;m=m.listeners;e:{var y=void 0;if(h)for(var C=m.length-1;0<=C;C--){var P=m[C],W=P.instance,te=P.currentTarget;if(P=P.listener,W!==y&&v.isPropagationStopped())break e;y=P,v.currentTarget=te;try{y(v)}catch(re){Id(re)}v.currentTarget=null,y=W}else for(C=0;C<m.length;C++){if(P=m[C],W=P.instance,te=P.currentTarget,P=P.listener,W!==y&&v.isPropagationStopped())break e;y=P,v.currentTarget=te;try{y(v)}catch(re){Id(re)}v.currentTarget=null,y=W}}}}function He(a,h){var f=h[jO];f===void 0&&(f=h[jO]=new Set);var m=a+"__bubble";f.has(m)||(O5(h,a,2,!1),f.add(m))}function Av(a,h,f){var m=0;h&&(m|=4),O5(f,a,m,h)}var Tp="_reactListening"+Math.random().toString(36).slice(2);function Ev(a){if(!a[Tp]){a[Tp]=!0,hC.forEach(function(f){f!=="selectionchange"&&(rj.has(f)||Av(f,!1,a),Av(f,!0,a))});var h=a.nodeType===9?a:a.ownerDocument;h===null||h[Tp]||(h[Tp]=!0,Av("selectionchange",!1,h))}}function O5(a,h,f,m){switch(W5(h)){case 2:var v=Rj;break;case 8:v=Qj;break;default:v=Zv}f=v.bind(null,h,f,a),v=void 0,!HO||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(v=!0),m?v!==void 0?a.addEventListener(h,f,{capture:!0,passive:v}):a.addEventListener(h,f,!0):v!==void 0?a.addEventListener(h,f,{passive:v}):a.addEventListener(h,f,!1)}function Mv(a,h,f,m,v){var y=m;if((h&1)===0&&(h&2)===0&&m!==null)e:for(;;){if(m===null)return;var C=m.tag;if(C===3||C===4){var P=m.stateNode.containerInfo;if(P===v)break;if(C===4)for(C=m.return;C!==null;){var W=C.tag;if((W===3||W===4)&&C.stateNode.containerInfo===v)return;C=C.return}for(;P!==null;){if(C=Nl(P),C===null)return;if(W=C.tag,W===5||W===6||W===26||W===27){m=y=C;continue e}P=P.parentNode}}m=m.return}SC(function(){var te=y,re=UO(f),le=[];e:{var ie=FC.get(a);if(ie!==void 0){var ne=zd,we=a;switch(a){case"keypress":if(Bd(f)===0)break e;case"keydown":case"keyup":ne=GN;break;case"focusin":we="focus",ne=JO;break;case"focusout":we="blur",ne=JO;break;case"beforeblur":case"afterblur":ne=JO;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=CC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=NN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=e8;break;case WC:case UC:case YC:ne=VN;break;case HC:ne=i8;break;case"scroll":case"scrollend":ne=$N;break;case"wheel":ne=r8;break;case"copy":case"cut":case"paste":ne=ZN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=TC;break;case"toggle":case"beforetoggle":ne=o8}var Qe=(h&4)!==0,gt=!Qe&&(a==="scroll"||a==="scrollend"),G=Qe?ie!==null?ie+"Capture":null:ie;Qe=[];for(var Y=te,ee;Y!==null;){var ae=Y;if(ee=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||ee===null||G===null||(ae=Lh(Y,G),ae!=null&&Qe.push(du(Y,ae,ee))),gt)break;Y=Y.return}0<Qe.length&&(ie=new ne(ie,we,null,f,re),le.push({event:ie,listeners:Qe}))}}if((h&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",ne=a==="mouseout"||a==="pointerout",ie&&f!==WO&&(we=f.relatedTarget||f.fromElement)&&(Nl(we)||we[zl]))break e;if((ne||ie)&&(ie=re.window===re?re:(ie=re.ownerDocument)?ie.defaultView||ie.parentWindow:window,ne?(we=f.relatedTarget||f.toElement,ne=te,we=we?Nl(we):null,we!==null&&(gt=s(we),Qe=we.tag,we!==gt||Qe!==5&&Qe!==27&&Qe!==6)&&(we=null)):(ne=null,we=te),ne!==we)){if(Qe=CC,ae="onMouseLeave",G="onMouseEnter",Y="mouse",(a==="pointerout"||a==="pointerover")&&(Qe=TC,ae="onPointerLeave",G="onPointerEnter",Y="pointer"),gt=ne==null?ie:Qh(ne),ee=we==null?ie:Qh(we),ie=new Qe(ae,Y+"leave",ne,f,re),ie.target=gt,ie.relatedTarget=ee,ae=null,Nl(re)===te&&(Qe=new Qe(G,Y+"enter",we,f,re),Qe.target=ee,Qe.relatedTarget=gt,ae=Qe),gt=ae,ne&&we)t:{for(Qe=sj,G=ne,Y=we,ee=0,ae=G;ae;ae=Qe(ae))ee++;ae=0;for(var Re=Y;Re;Re=Qe(Re))ae++;for(;0<ee-ae;)G=Qe(G),ee--;for(;0<ae-ee;)Y=Qe(Y),ae--;for(;ee--;){if(G===Y||Y!==null&&G===Y.alternate){Qe=G;break t}G=Qe(G),Y=Qe(Y)}Qe=null}else Qe=null;ne!==null&&v5(le,ie,ne,Qe,!1),we!==null&>!==null&&v5(le,gt,we,Qe,!0)}}e:{if(ie=te?Qh(te):window,ne=ie.nodeName&&ie.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ie.type==="file")var rt=DC;else if(QC(ie))if(BC)rt=g8;else{rt=p8;var Ee=d8}else ne=ie.nodeName,!ne||ne.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?te&&qO(te.elementType)&&(rt=DC):rt=m8;if(rt&&(rt=rt(a,te))){LC(le,rt,f,re);break e}Ee&&Ee(a,ie,te),a==="focusout"&&te&&ie.type==="number"&&te.memoizedProps.value!=null&&ZO(ie,"number",ie.value)}switch(Ee=te?Qh(te):window,a){case"focusin":(QC(Ee)||Ee.contentEditable==="true")&&(Yl=Ee,s0=te,Vh=null);break;case"focusout":Vh=s0=Yl=null;break;case"mousedown":o0=!0;break;case"contextmenu":case"mouseup":case"dragend":o0=!1,ZC(le,f,re);break;case"selectionchange":if(v8)break;case"keydown":case"keyup":ZC(le,f,re)}var Ve;if(t0)e:{switch(a){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Ul?PC(a,f)&&(Je="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Je="onCompositionStart");Je&&(AC&&f.locale!=="ko"&&(Ul||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Ul&&(Ve=xC()):(Mo=re,FO="value"in Mo?Mo.value:Mo.textContent,Ul=!0)),Ee=Ap(te,Je),0<Ee.length&&(Je=new kC(Je,a,null,f,re),le.push({event:Je,listeners:Ee}),Ve?Je.data=Ve:(Ve=RC(f),Ve!==null&&(Je.data=Ve)))),(Ve=l8?c8(a,f):h8(a,f))&&(Je=Ap(te,"onBeforeInput"),0<Je.length&&(Ee=new kC("onBeforeInput","beforeinput",null,f,re),le.push({event:Ee,listeners:Je}),Ee.data=Ve)),tj(le,a,te,f,re)}g5(le,h)})}function du(a,h,f){return{instance:a,listener:h,currentTarget:f}}function Ap(a,h){for(var f=h+"Capture",m=[];a!==null;){var v=a,y=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||y===null||(v=Lh(a,f),v!=null&&m.unshift(du(a,v,y)),v=Lh(a,h),v!=null&&m.push(du(a,v,y))),a.tag===3)return m;a=a.return}return[]}function sj(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function v5(a,h,f,m,v){for(var y=h._reactName,C=[];f!==null&&f!==m;){var P=f,W=P.alternate,te=P.stateNode;if(P=P.tag,W!==null&&W===m)break;P!==5&&P!==26&&P!==27||te===null||(W=te,v?(te=Lh(f,y),te!=null&&C.unshift(du(f,te,W))):v||(te=Lh(f,y),te!=null&&C.push(du(f,te,W)))),f=f.return}C.length!==0&&a.push({event:h,listeners:C})}var oj=/\r\n?/g,aj=/\u0000|\uFFFD/g;function _5(a){return(typeof a=="string"?a:""+a).replace(oj,`
|
|
49
|
+
`).replace(aj,"")}function y5(a,h){return h=_5(h),_5(a)===h}function mt(a,h,f,m,v,y){switch(f){case"children":typeof m=="string"?h==="body"||h==="textarea"&&m===""||Zl(a,m):(typeof m=="number"||typeof m=="bigint")&&h!=="body"&&Zl(a,""+m);break;case"className":Rd(a,"class",m);break;case"tabIndex":Rd(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Rd(a,f,m);break;case"style":yC(a,m,y);break;case"data":if(h!=="object"){Rd(a,"data",m);break}case"src":case"href":if(m===""&&(h!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ld(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"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 y=="function"&&(f==="formAction"?(h!=="input"&&mt(a,h,"name",v.name,v,null),mt(a,h,"formEncType",v.formEncType,v,null),mt(a,h,"formMethod",v.formMethod,v,null),mt(a,h,"formTarget",v.formTarget,v,null)):(mt(a,h,"encType",v.encType,v,null),mt(a,h,"method",v.method,v,null),mt(a,h,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ld(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=zs);break;case"onScroll":m!=null&&He("scroll",a);break;case"onScrollEnd":m!=null&&He("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Ld(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":He("beforetoggle",a),He("toggle",a),Pd(a,"popover",m);break;case"xlinkActuate":$s(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":$s(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":$s(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":$s(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":$s(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":$s(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":$s(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":$s(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":$s(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Pd(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=DN.get(f)||f,Pd(a,f,m))}}function Pv(a,h,f,m,v,y){switch(f){case"style":yC(a,m,y);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"children":typeof m=="string"?Zl(a,m):(typeof m=="number"||typeof m=="bigint")&&Zl(a,""+m);break;case"onScroll":m!=null&&He("scroll",a);break;case"onScrollEnd":m!=null&&He("scrollend",a);break;case"onClick":m!=null&&(a.onclick=zs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uC.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),h=f.slice(2,v?f.length-7:void 0),y=a[xn]||null,y=y!=null?y[f]:null,typeof y=="function"&&a.removeEventListener(h,y,v),typeof m=="function")){typeof y!="function"&&y!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(h,m,v);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):Pd(a,f,m)}}}function Vi(a,h,f){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",a),He("load",a);var m=!1,v=!1,y;for(y in f)if(f.hasOwnProperty(y)){var C=f[y];if(C!=null)switch(y){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,h));default:mt(a,h,y,C,f,null)}}v&&mt(a,h,"srcSet",f.srcSet,f,null),m&&mt(a,h,"src",f.src,f,null);return;case"input":He("invalid",a);var P=y=C=v=null,W=null,te=null;for(m in f)if(f.hasOwnProperty(m)){var re=f[m];if(re!=null)switch(m){case"name":v=re;break;case"type":C=re;break;case"checked":W=re;break;case"defaultChecked":te=re;break;case"value":y=re;break;case"defaultValue":P=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(n(137,h));break;default:mt(a,h,m,re,f,null)}}gC(a,y,P,W,te,C,v,!1);return;case"select":He("invalid",a),m=C=y=null;for(v in f)if(f.hasOwnProperty(v)&&(P=f[v],P!=null))switch(v){case"value":y=P;break;case"defaultValue":C=P;break;case"multiple":m=P;default:mt(a,h,v,P,f,null)}h=y,f=C,a.multiple=!!m,h!=null?Xl(a,!!m,h,!1):f!=null&&Xl(a,!!m,f,!0);return;case"textarea":He("invalid",a),y=v=m=null;for(C in f)if(f.hasOwnProperty(C)&&(P=f[C],P!=null))switch(C){case"value":m=P;break;case"defaultValue":v=P;break;case"children":y=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(n(91));break;default:mt(a,h,C,P,f,null)}vC(a,m,v,y);return;case"option":for(W in f)if(f.hasOwnProperty(W)&&(m=f[W],m!=null))switch(W){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:mt(a,h,W,m,f,null)}return;case"dialog":He("beforetoggle",a),He("toggle",a),He("cancel",a),He("close",a);break;case"iframe":case"object":He("load",a);break;case"video":case"audio":for(m=0;m<fu.length;m++)He(fu[m],a);break;case"image":He("error",a),He("load",a);break;case"details":He("toggle",a);break;case"embed":case"source":case"link":He("error",a),He("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in f)if(f.hasOwnProperty(te)&&(m=f[te],m!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,h));default:mt(a,h,te,m,f,null)}return;default:if(qO(h)){for(re in f)f.hasOwnProperty(re)&&(m=f[re],m!==void 0&&Pv(a,h,re,m,f,void 0));return}}for(P in f)f.hasOwnProperty(P)&&(m=f[P],m!=null&&mt(a,h,P,m,f,null))}function lj(a,h,f,m){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,y=null,C=null,P=null,W=null,te=null,re=null;for(ne in f){var le=f[ne];if(f.hasOwnProperty(ne)&&le!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":W=le;default:m.hasOwnProperty(ne)||mt(a,h,ne,null,m,le)}}for(var ie in m){var ne=m[ie];if(le=f[ie],m.hasOwnProperty(ie)&&(ne!=null||le!=null))switch(ie){case"type":y=ne;break;case"name":v=ne;break;case"checked":te=ne;break;case"defaultChecked":re=ne;break;case"value":C=ne;break;case"defaultValue":P=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(n(137,h));break;default:ne!==le&&mt(a,h,ie,ne,m,le)}}XO(a,C,P,W,te,re,y,v);return;case"select":ne=C=P=ie=null;for(y in f)if(W=f[y],f.hasOwnProperty(y)&&W!=null)switch(y){case"value":break;case"multiple":ne=W;default:m.hasOwnProperty(y)||mt(a,h,y,null,m,W)}for(v in m)if(y=m[v],W=f[v],m.hasOwnProperty(v)&&(y!=null||W!=null))switch(v){case"value":ie=y;break;case"defaultValue":P=y;break;case"multiple":C=y;default:y!==W&&mt(a,h,v,y,m,W)}h=P,f=C,m=ne,ie!=null?Xl(a,!!f,ie,!1):!!m!=!!f&&(h!=null?Xl(a,!!f,h,!0):Xl(a,!!f,f?[]:"",!1));return;case"textarea":ne=ie=null;for(P in f)if(v=f[P],f.hasOwnProperty(P)&&v!=null&&!m.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:mt(a,h,P,null,m,v)}for(C in m)if(v=m[C],y=f[C],m.hasOwnProperty(C)&&(v!=null||y!=null))switch(C){case"value":ie=v;break;case"defaultValue":ne=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(n(91));break;default:v!==y&&mt(a,h,C,v,m,y)}OC(a,ie,ne);return;case"option":for(var we in f)if(ie=f[we],f.hasOwnProperty(we)&&ie!=null&&!m.hasOwnProperty(we))switch(we){case"selected":a.selected=!1;break;default:mt(a,h,we,null,m,ie)}for(W in m)if(ie=m[W],ne=f[W],m.hasOwnProperty(W)&&ie!==ne&&(ie!=null||ne!=null))switch(W){case"selected":a.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:mt(a,h,W,ie,m,ne)}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 Qe in f)ie=f[Qe],f.hasOwnProperty(Qe)&&ie!=null&&!m.hasOwnProperty(Qe)&&mt(a,h,Qe,null,m,ie);for(te in m)if(ie=m[te],ne=f[te],m.hasOwnProperty(te)&&ie!==ne&&(ie!=null||ne!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(n(137,h));break;default:mt(a,h,te,ie,m,ne)}return;default:if(qO(h)){for(var gt in f)ie=f[gt],f.hasOwnProperty(gt)&&ie!==void 0&&!m.hasOwnProperty(gt)&&Pv(a,h,gt,void 0,m,ie);for(re in m)ie=m[re],ne=f[re],!m.hasOwnProperty(re)||ie===ne||ie===void 0&&ne===void 0||Pv(a,h,re,ie,m,ne);return}}for(var G in f)ie=f[G],f.hasOwnProperty(G)&&ie!=null&&!m.hasOwnProperty(G)&&mt(a,h,G,null,m,ie);for(le in m)ie=m[le],ne=f[le],!m.hasOwnProperty(le)||ie===ne||ie==null&&ne==null||mt(a,h,le,ie,m,ne)}function b5(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cj(){if(typeof performance.getEntriesByType=="function"){for(var a=0,h=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var v=f[m],y=v.transferSize,C=v.initiatorType,P=v.duration;if(y&&P&&b5(C)){for(C=0,P=v.responseEnd,m+=1;m<f.length;m++){var W=f[m],te=W.startTime;if(te>P)break;var re=W.transferSize,le=W.initiatorType;re&&b5(le)&&(W=W.responseEnd,C+=re*(W<P?1:(P-te)/(W-te)))}if(--m,h+=8*(y+C)/(v.duration/1e3),a++,10<a)break}}if(0<a)return h/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Rv=null,Qv=null;function Ep(a){return a.nodeType===9?a:a.ownerDocument}function S5(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function x5(a,h){if(a===0)switch(h){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&h==="foreignObject"?0:a}function Lv(a,h){return a==="textarea"||a==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.children=="bigint"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var Dv=null;function hj(){var a=window.event;return a&&a.type==="popstate"?a===Dv?!1:(Dv=a,!0):(Dv=null,!1)}var w5=typeof setTimeout=="function"?setTimeout:void 0,uj=typeof clearTimeout=="function"?clearTimeout:void 0,C5=typeof Promise=="function"?Promise:void 0,fj=typeof queueMicrotask=="function"?queueMicrotask:typeof C5<"u"?function(a){return C5.resolve(null).then(a).catch(dj)}:w5;function dj(a){setTimeout(function(){throw a})}function Uo(a){return a==="head"}function k5(a,h){var f=h,m=0;do{var v=f.nextSibling;if(a.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(v),bc(h);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")pu(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,pu(f);for(var y=f.firstChild;y;){var C=y.nextSibling,P=y.nodeName;y[Rh]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&y.rel.toLowerCase()==="stylesheet"||f.removeChild(y),y=C}}else f==="body"&&pu(a.ownerDocument.body);f=v}while(f);bc(h)}function T5(a,h){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?h?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(h?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function Bv(a){var h=a.firstChild;for(h&&h.nodeType===10&&(h=h.nextSibling);h;){var f=h;switch(h=h.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Bv(f),IO(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function pj(a,h,f,m){for(;a.nodeType===1;){var v=f;if(a.nodeName.toLowerCase()!==h.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Rh])switch(h){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(h==="input"&&a.type==="hidden"){var y=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=gr(a.nextSibling),a===null)break}return null}function mj(a,h,f){if(h==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=gr(a.nextSibling),a===null))return null;return a}function A5(a,h){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=gr(a.nextSibling),a===null))return null;return a}function $v(a){return a.data==="$?"||a.data==="$~"}function zv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function gj(a,h){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=h;else if(a.data!=="$?"||f.readyState!=="loading")h();else{var m=function(){h(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function gr(a){for(;a!=null;a=a.nextSibling){var h=a.nodeType;if(h===1||h===3)break;if(h===8){if(h=a.data,h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"||h==="F!"||h==="F")break;if(h==="/$"||h==="/&")return null}}return a}var Nv=null;function E5(a){a=a.nextSibling;for(var h=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(h===0)return gr(a.nextSibling);h--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||h++}a=a.nextSibling}return null}function M5(a){a=a.previousSibling;for(var h=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(h===0)return a;h--}else f!=="/$"&&f!=="/&"||h++}a=a.previousSibling}return null}function P5(a,h,f){switch(h=Ep(f),a){case"html":if(a=h.documentElement,!a)throw Error(n(452));return a;case"head":if(a=h.head,!a)throw Error(n(453));return a;case"body":if(a=h.body,!a)throw Error(n(454));return a;default:throw Error(n(451))}}function pu(a){for(var h=a.attributes;h.length;)a.removeAttributeNode(h[0]);IO(a)}var Or=new Map,R5=new Set;function Mp(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var eo=X.d;X.d={f:Oj,r:vj,D:_j,C:yj,L:bj,m:Sj,X:wj,S:xj,M:Cj};function Oj(){var a=eo.f(),h=bp();return a||h}function vj(a){var h=jl(a);h!==null&&h.tag===5&&h.type==="form"?Hk(h):eo.r(a)}var vc=typeof document>"u"?null:document;function Q5(a,h,f){var m=vc;if(m&&typeof h=="string"&&h){var v=cr(h);v='link[rel="'+a+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),R5.has(v)||(R5.add(v),a={rel:a,crossOrigin:f,href:h},m.querySelector(v)===null&&(h=m.createElement("link"),Vi(h,"link",a),bi(h),m.head.appendChild(h)))}}function _j(a){eo.D(a),Q5("dns-prefetch",a,null)}function yj(a,h){eo.C(a,h),Q5("preconnect",a,h)}function bj(a,h,f){eo.L(a,h,f);var m=vc;if(m&&a&&h){var v='link[rel="preload"][as="'+cr(h)+'"]';h==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+cr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+cr(f.imageSizes)+'"]')):v+='[href="'+cr(a)+'"]';var y=v;switch(h){case"style":y=_c(a);break;case"script":y=yc(a)}Or.has(y)||(a=p({rel:"preload",href:h==="image"&&f&&f.imageSrcSet?void 0:a,as:h},f),Or.set(y,a),m.querySelector(v)!==null||h==="style"&&m.querySelector(mu(y))||h==="script"&&m.querySelector(gu(y))||(h=m.createElement("link"),Vi(h,"link",a),bi(h),m.head.appendChild(h)))}}function Sj(a,h){eo.m(a,h);var f=vc;if(f&&a){var m=h&&typeof h.as=="string"?h.as:"script",v='link[rel="modulepreload"][as="'+cr(m)+'"][href="'+cr(a)+'"]',y=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yc(a)}if(!Or.has(y)&&(a=p({rel:"modulepreload",href:a},h),Or.set(y,a),f.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(gu(y)))return}m=f.createElement("link"),Vi(m,"link",a),bi(m),f.head.appendChild(m)}}}function xj(a,h,f){eo.S(a,h,f);var m=vc;if(m&&a){var v=Il(m).hoistableStyles,y=_c(a);h=h||"default";var C=v.get(y);if(!C){var P={loading:0,preload:null};if(C=m.querySelector(mu(y)))P.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":h},f),(f=Or.get(y))&&jv(a,f);var W=C=m.createElement("link");bi(W),Vi(W,"link",a),W._p=new Promise(function(te,re){W.onload=te,W.onerror=re}),W.addEventListener("load",function(){P.loading|=1}),W.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Pp(C,h,m)}C={type:"stylesheet",instance:C,count:1,state:P},v.set(y,C)}}}function wj(a,h){eo.X(a,h);var f=vc;if(f&&a){var m=Il(f).hoistableScripts,v=yc(a),y=m.get(v);y||(y=f.querySelector(gu(v)),y||(a=p({src:a,async:!0},h),(h=Or.get(v))&&Iv(a,h),y=f.createElement("script"),bi(y),Vi(y,"link",a),f.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(v,y))}}function Cj(a,h){eo.M(a,h);var f=vc;if(f&&a){var m=Il(f).hoistableScripts,v=yc(a),y=m.get(v);y||(y=f.querySelector(gu(v)),y||(a=p({src:a,async:!0,type:"module"},h),(h=Or.get(v))&&Iv(a,h),y=f.createElement("script"),bi(y),Vi(y,"link",a),f.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(v,y))}}function L5(a,h,f,m){var v=(v=fe.current)?Mp(v):null;if(!v)throw Error(n(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(h=_c(f.href),f=Il(v).hoistableStyles,m=f.get(h),m||(m={type:"style",instance:null,count:0,state:null},f.set(h,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=_c(f.href);var y=Il(v).hoistableStyles,C=y.get(a);if(C||(v=v.ownerDocument||v,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,C),(y=v.querySelector(mu(a)))&&!y._p&&(C.instance=y,C.state.loading=5),Or.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Or.set(a,f),y||kj(v,a,f,C.state))),h&&m===null)throw Error(n(528,""));return C}if(h&&m!==null)throw Error(n(529,""));return null;case"script":return h=f.async,f=f.src,typeof f=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=yc(f),f=Il(v).hoistableScripts,m=f.get(h),m||(m={type:"script",instance:null,count:0,state:null},f.set(h,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,a))}}function _c(a){return'href="'+cr(a)+'"'}function mu(a){return'link[rel="stylesheet"]['+a+"]"}function D5(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function kj(a,h,f,m){a.querySelector('link[rel="preload"][as="style"]['+h+"]")?m.loading=1:(h=a.createElement("link"),m.preload=h,h.addEventListener("load",function(){return m.loading|=1}),h.addEventListener("error",function(){return m.loading|=2}),Vi(h,"link",f),bi(h),a.head.appendChild(h))}function yc(a){return'[src="'+cr(a)+'"]'}function gu(a){return"script[async]"+a}function B5(a,h,f){if(h.count++,h.instance===null)switch(h.type){case"style":var m=a.querySelector('style[data-href~="'+cr(f.href)+'"]');if(m)return h.instance=m,bi(m),m;var v=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),bi(m),Vi(m,"style",v),Pp(m,f.precedence,a),h.instance=m;case"stylesheet":v=_c(f.href);var y=a.querySelector(mu(v));if(y)return h.state.loading|=4,h.instance=y,bi(y),y;m=D5(f),(v=Or.get(v))&&jv(m,v),y=(a.ownerDocument||a).createElement("link"),bi(y);var C=y;return C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),Vi(y,"link",m),h.state.loading|=4,Pp(y,f.precedence,a),h.instance=y;case"script":return y=yc(f.src),(v=a.querySelector(gu(y)))?(h.instance=v,bi(v),v):(m=f,(v=Or.get(y))&&(m=p({},f),Iv(m,v)),a=a.ownerDocument||a,v=a.createElement("script"),bi(v),Vi(v,"link",m),a.head.appendChild(v),h.instance=v);case"void":return null;default:throw Error(n(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(m=h.instance,h.state.loading|=4,Pp(m,f.precedence,a));return h.instance}function Pp(a,h,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,y=v,C=0;C<m.length;C++){var P=m[C];if(P.dataset.precedence===h)y=P;else if(y!==v)break}y?y.parentNode.insertBefore(a,y.nextSibling):(h=f.nodeType===9?f.head:f,h.insertBefore(a,h.firstChild))}function jv(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.title==null&&(a.title=h.title)}function Iv(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.integrity==null&&(a.integrity=h.integrity)}var Rp=null;function $5(a,h,f){if(Rp===null){var m=new Map,v=Rp=new Map;v.set(f,m)}else v=Rp,m=v.get(f),m||(m=new Map,v.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),v=0;v<f.length;v++){var y=f[v];if(!(y[Rh]||y[zi]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var C=y.getAttribute(h)||"";C=a+C;var P=m.get(C);P?P.push(y):m.set(C,[y])}}return m}function z5(a,h,f){a=a.ownerDocument||a,a.head.insertBefore(f,h==="title"?a.querySelector("head > title"):null)}function Tj(a,h,f){if(f===1||h.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return a=h.disabled,typeof h.precedence=="string"&&a==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function N5(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function Aj(a,h,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=_c(m.href),y=h.querySelector(mu(v));if(y){h=y._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(a.count++,a=Qp.bind(a),h.then(a,a)),f.state.loading|=4,f.instance=y,bi(y);return}y=h.ownerDocument||h,m=D5(m),(v=Or.get(v))&&jv(m,v),y=y.createElement("link"),bi(y);var C=y;C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),Vi(y,"link",m),f.instance=y}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,h),(h=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Qp.bind(a),h.addEventListener("load",f),h.addEventListener("error",f))}}var Vv=0;function Ej(a,h){return a.stylesheets&&a.count===0&&Dp(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend){var y=a.unsuspend;a.unsuspend=null,y()}},6e4+h);0<a.imgBytes&&Vv===0&&(Vv=62500*cj());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend)){var y=a.unsuspend;a.unsuspend=null,y()}},(a.imgBytes>Vv?50:800)+h);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(v)}}:null}function Qp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dp(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Lp=null;function Dp(a,h){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Lp=new Map,h.forEach(Mj,a),Lp=null,Qp.call(a))}function Mj(a,h){if(!(h.state.loading&4)){var f=Lp.get(a);if(f)var m=f.get(null);else{f=new Map,Lp.set(a,f);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<v.length;y++){var C=v[y];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(f.set(C.dataset.precedence,C),m=C)}m&&f.set(null,m)}v=h.instance,C=v.getAttribute("data-precedence"),y=f.get(C)||m,y===m&&f.set(null,v),f.set(C,v),this.count++,m=Qp.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),y?y.parentNode.insertBefore(v,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),h.state.loading|=4}}var Ou={$$typeof:T,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function Pj(a,h,f,m,v,y,C,P,W){this.tag=1,this.containerInfo=a,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=$O(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$O(0),this.hiddenUpdates=$O(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=y,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function j5(a,h,f,m,v,y,C,P,W,te,re,le){return a=new Pj(a,h,f,C,W,te,re,le,P),h=1,y===!0&&(h|=24),y=Xn(3,null,null,h),a.current=y,y.stateNode=a,h=b0(),h.refCount++,a.pooledCache=h,h.refCount++,y.memoizedState={element:m,isDehydrated:f,cache:h},C0(y),a}function I5(a){return a?(a=Gl,a):Gl}function V5(a,h,f,m,v,y){v=I5(v),m.context===null?m.context=v:m.pendingContext=v,m=Bo(h),m.payload={element:f},y=y===void 0?null:y,y!==null&&(m.callback=y),f=$o(a,m,h),f!==null&&(En(f,a,h),Hh(f,a,h))}function X5(a,h){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<h?f:h}}function Xv(a,h){X5(a,h),(a=a.alternate)&&X5(a,h)}function Z5(a){if(a.tag===13||a.tag===31){var h=Na(a,67108864);h!==null&&En(h,a,67108864),Xv(a,67108864)}}function q5(a){if(a.tag===13||a.tag===31){var h=Yn();h=zO(h);var f=Na(a,h);f!==null&&En(f,a,h),Xv(a,h)}}var Bp=!0;function Rj(a,h,f,m){var v=$.T;$.T=null;var y=X.p;try{X.p=2,Zv(a,h,f,m)}finally{X.p=y,$.T=v}}function Qj(a,h,f,m){var v=$.T;$.T=null;var y=X.p;try{X.p=8,Zv(a,h,f,m)}finally{X.p=y,$.T=v}}function Zv(a,h,f,m){if(Bp){var v=qv(m);if(v===null)Mv(a,h,m,$p,f),U5(a,m);else if(Dj(v,a,h,f,m))m.stopPropagation();else if(U5(a,m),h&4&&-1<Lj.indexOf(a)){for(;v!==null;){var y=jl(v);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var C=La(y.pendingLanes);if(C!==0){var P=y;for(P.pendingLanes|=2,P.entangledLanes|=2;C;){var W=1<<31-_t(C);P.entanglements[1]|=W,C&=~W}ns(y),(ot&6)===0&&(_p=cn()+500,uu(0))}}break;case 31:case 13:P=Na(y,2),P!==null&&En(P,y,2),bp(),Xv(y,2)}if(y=qv(m),y===null&&Mv(a,h,m,$p,f),y===v)break;v=y}v!==null&&m.stopPropagation()}else Mv(a,h,m,null,f)}}function qv(a){return a=UO(a),Wv(a)}var $p=null;function Wv(a){if($p=null,a=Nl(a),a!==null){var h=s(a);if(h===null)a=null;else{var f=h.tag;if(f===13){if(a=o(h),a!==null)return a;a=null}else if(f===31){if(a=l(h),a!==null)return a;a=null}else if(f===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;a=null}else h!==a&&(a=null)}}return $p=a,null}function W5(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(BO()){case oe:return 2;case ge:return 8;case De:case Ue:return 32;case ht:return 268435456;default:return 32}default:return 32}}var Uv=!1,Yo=null,Ho=null,Fo=null,vu=new Map,_u=new Map,Go=[],Lj="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 U5(a,h){switch(a){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":Fo=null;break;case"pointerover":case"pointerout":vu.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":_u.delete(h.pointerId)}}function yu(a,h,f,m,v,y){return a===null||a.nativeEvent!==y?(a={blockedOn:h,domEventName:f,eventSystemFlags:m,nativeEvent:y,targetContainers:[v]},h!==null&&(h=jl(h),h!==null&&Z5(h)),a):(a.eventSystemFlags|=m,h=a.targetContainers,v!==null&&h.indexOf(v)===-1&&h.push(v),a)}function Dj(a,h,f,m,v){switch(h){case"focusin":return Yo=yu(Yo,a,h,f,m,v),!0;case"dragenter":return Ho=yu(Ho,a,h,f,m,v),!0;case"mouseover":return Fo=yu(Fo,a,h,f,m,v),!0;case"pointerover":var y=v.pointerId;return vu.set(y,yu(vu.get(y)||null,a,h,f,m,v)),!0;case"gotpointercapture":return y=v.pointerId,_u.set(y,yu(_u.get(y)||null,a,h,f,m,v)),!0}return!1}function Y5(a){var h=Nl(a.target);if(h!==null){var f=s(h);if(f!==null){if(h=f.tag,h===13){if(h=o(f),h!==null){a.blockedOn=h,lC(a.priority,function(){q5(f)});return}}else if(h===31){if(h=l(f),h!==null){a.blockedOn=h,lC(a.priority,function(){q5(f)});return}}else if(h===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function zp(a){if(a.blockedOn!==null)return!1;for(var h=a.targetContainers;0<h.length;){var f=qv(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);WO=m,f.target.dispatchEvent(m),WO=null}else return h=jl(f),h!==null&&Z5(h),a.blockedOn=f,!1;h.shift()}return!0}function H5(a,h,f){zp(a)&&f.delete(h)}function Bj(){Uv=!1,Yo!==null&&zp(Yo)&&(Yo=null),Ho!==null&&zp(Ho)&&(Ho=null),Fo!==null&&zp(Fo)&&(Fo=null),vu.forEach(H5),_u.forEach(H5)}function Np(a,h){a.blockedOn===h&&(a.blockedOn=null,Uv||(Uv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bj)))}var jp=null;function F5(a){jp!==a&&(jp=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===a&&(jp=null);for(var h=0;h<a.length;h+=3){var f=a[h],m=a[h+1],v=a[h+2];if(typeof m!="function"){if(Wv(m||f)===null)continue;break}var y=jl(f);y!==null&&(a.splice(h,3),h-=3,q0(y,{pending:!0,data:v,method:f.method,action:m},m,v))}}))}function bc(a){function h(W){return Np(W,a)}Yo!==null&&Np(Yo,a),Ho!==null&&Np(Ho,a),Fo!==null&&Np(Fo,a),vu.forEach(h),_u.forEach(h);for(var f=0;f<Go.length;f++){var m=Go[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Go.length&&(f=Go[0],f.blockedOn===null);)Y5(f),f.blockedOn===null&&Go.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var v=f[m],y=f[m+1],C=v[xn]||null;if(typeof y=="function")C||F5(f);else if(C){var P=null;if(y&&y.hasAttribute("formAction")){if(v=y,C=y[xn]||null)P=C.formAction;else if(Wv(v)!==null)continue}else P=C.action;typeof P=="function"?f[m+1]=P:(f.splice(m,3),m-=3),F5(f)}}}function G5(){function a(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(C){return v=C})},focusReset:"manual",scroll:"manual"})}function h(){v!==null&&(v(),v=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",h),navigation.addEventListener("navigateerror",h),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",h),navigation.removeEventListener("navigateerror",h),v!==null&&(v(),v=null)}}}function Yv(a){this._internalRoot=a}Ip.prototype.render=Yv.prototype.render=function(a){var h=this._internalRoot;if(h===null)throw Error(n(409));var f=h.current,m=Yn();V5(f,m,a,h,null,null)},Ip.prototype.unmount=Yv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var h=a.containerInfo;V5(a.current,2,null,a,null,null),bp(),h[zl]=null}};function Ip(a){this._internalRoot=a}Ip.prototype.unstable_scheduleHydration=function(a){if(a){var h=aC();a={blockedOn:null,target:a,priority:h};for(var f=0;f<Go.length&&h!==0&&h<Go[f].priority;f++);Go.splice(f,0,a),f===0&&Y5(a)}};var K5=e.version;if(K5!=="19.2.4")throw Error(n(527,K5,"19.2.4"));X.findDOMNode=function(a){var h=a._reactInternals;if(h===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=u(h),a=a!==null?d(a):null,a=a===null?null:a.stateNode,a};var $j={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{hn=Vp.inject($j),fi=Vp}catch{}}return Su.createRoot=function(a,h){if(!r(a))throw Error(n(299));var f=!1,m="",v=s2,y=o2,C=a2;return h!=null&&(h.unstable_strictMode===!0&&(f=!0),h.identifierPrefix!==void 0&&(m=h.identifierPrefix),h.onUncaughtError!==void 0&&(v=h.onUncaughtError),h.onCaughtError!==void 0&&(y=h.onCaughtError),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),h=j5(a,1,!1,null,null,f,m,null,v,y,C,G5),a[zl]=h.current,Ev(a),new Yv(h)},Su.hydrateRoot=function(a,h,f){if(!r(a))throw Error(n(299));var m=!1,v="",y=s2,C=o2,P=a2,W=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(y=f.onUncaughtError),f.onCaughtError!==void 0&&(C=f.onCaughtError),f.onRecoverableError!==void 0&&(P=f.onRecoverableError),f.formState!==void 0&&(W=f.formState)),h=j5(a,1,!0,h,f??null,m,v,W,y,C,P,G5),h.context=I5(null),f=h.current,m=Yn(),m=zO(m),v=Bo(m),v.callback=null,$o(f,v,m),f=m,h.current.lanes=f,Ph(h,f),ns(h),a[zl]=h.current,Ev(a),new Ip(h)},Su.version="19.2.4",Su}var lT;function Uj(){if(lT)return Gv.exports;lT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Gv.exports=Wj(),Gv.exports}var Yj=Uj();const iL=q.createContext({connected:!1,lastChange:0}),cT=2e3,Hj=3e4,Fj=1.5;function Gj({children:t}){const[e,i]=q.useState(!1),[n,r]=q.useState(0),s=q.useRef(null),o=q.useRef(null),l=q.useRef(cT);return q.useEffect(()=>{function c(){const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws`,p=new WebSocket(d);s.current=p,p.onopen=()=>{i(!0),l.current=cT},p.onclose=()=>{i(!1),s.current=null;const g=l.current;l.current=Math.min(g*Fj,Hj),o.current=setTimeout(c,g)},p.onmessage=g=>{try{const O=JSON.parse(g.data);O.type==="file-changes"&&typeof O.timestamp=="number"&&r(O.timestamp)}catch{}},p.onerror=()=>{console.warn("[ws-provider] WebSocket error occurred")}}return c(),()=>{o.current!==null&&(clearTimeout(o.current),o.current=null),s.current&&(s.current.onclose=null,s.current.close(),s.current=null)}},[]),S.jsx(iL.Provider,{value:{connected:e,lastChange:n},children:t})}function sd(){return q.useContext(iL)}function Kj(t,e){switch(e.type){case"SET_TAB":return{...t,activeTab:e.tab,expandedCardId:null};case"SET_EXPANDED":return{...t,expandedCardId:e.cardId};case"SET_INPUT":return{...t,inputValues:{...t.inputValues,[e.cardId]:e.value}};case"RESET":return{activeTab:"plan",expandedCardId:null,inputValues:{}};default:return t}}const Jj={activeTab:"plan",expandedCardId:null,inputValues:{}},nL=q.createContext(null);function e7({children:t}){const[e,i]=q.useReducer(Kj,Jj),n=q.useCallback(l=>i({type:"SET_TAB",tab:l}),[]),r=q.useCallback(l=>i({type:"SET_EXPANDED",cardId:l}),[]),s=q.useCallback((l,c)=>i({type:"SET_INPUT",cardId:l,value:c}),[]),o=q.useCallback(()=>i({type:"RESET"}),[]);return S.jsx(nL.Provider,{value:{...e,setTab:n,setExpanded:r,setInput:s,reset:o},children:t})}function oO(){const t=q.useContext(nL);if(!t)throw new Error("useSimpleMode must be used within SimpleModeProvider");return t}const rL={phase:"idle",questions:[],currentQuestion:null,answeredQuestions:[],answerCount:0};function t7(t,e){switch(e.type){case"START_DISCUSSION":return{...t,phase:"loading"};case"QUESTIONS_RECEIVED":{const[i,...n]=e.questions;return{...t,phase:i?"active":t.phase,currentQuestion:i??null,questions:[...t.questions,...n]}}case"SUBMIT_ANSWER":return{...t,phase:"submitting",answeredQuestions:[...t.answeredQuestions,e.answer],answerCount:t.answerCount+1};case"ANSWER_ACCEPTED":{const[i,...n]=t.questions;return{...t,phase:i?"active":"loading",currentQuestion:i??null,questions:n}}case"ASK_MORE":return{...t,phase:"loading"};case"DONE_EXECUTE":return{...t,phase:"complete",currentQuestion:null,questions:[]};case"RESET":return rL;default:return t}}const sL=q.createContext(null);function i7({children:t}){const[e,i]=q.useReducer(t7,rL),n=q.useRef(null),r=q.useRef(null),s=q.useCallback(()=>{i({type:"START_DISCUSSION"})},[]),o=q.useCallback(p=>{i({type:"QUESTIONS_RECEIVED",questions:p})},[]),l=q.useCallback(p=>{i({type:"SUBMIT_ANSWER",answer:p}),i({type:"ANSWER_ACCEPTED"})},[]),c=q.useCallback(()=>{i({type:"ASK_MORE"})},[]),u=q.useCallback(()=>{var p;i({type:"DONE_EXECUTE"}),(p=r.current)==null||p.call(r)},[]),d=q.useCallback(()=>{i({type:"RESET"})},[]);return S.jsx(sL.Provider,{value:{...e,startDiscussion:s,receiveQuestions:o,submitAnswer:l,askMore:c,doneExecute:u,resetDiscussion:d,onQuestionReceived:n,onExecutionQueued:r},children:t})}function YS(){const t=q.useContext(sL);if(!t)throw new Error("useDiscussion must be used within DiscussionProvider");return t}function Pl(){const{lastChange:t}=sd(),[e,i]=q.useState(null),[n,r]=q.useState(null),[s,o]=q.useState(null),[l,c]=q.useState(!0),[u,d]=q.useState(null),p=q.useCallback(async()=>{try{d(null);const[g,O,_]=await Promise.all([fetch("/api/roadmap"),fetch("/api/state"),fetch("/api/todos")]);if(!g.ok&&g.status!==404)throw new Error(`Roadmap fetch failed: ${g.status}`);if(!O.ok&&O.status!==404)throw new Error(`State fetch failed: ${O.status}`);if(!_.ok)throw new Error(`Todos fetch failed: ${_.status}`);const b=g.ok?await g.json():null,x=O.ok?await O.json():null,w=_.ok?await _.json():{pending:[],completed:[]};i(b),r(x),o(w)}catch(g){const O=g instanceof Error?g.message:"Failed to fetch dashboard data";d(O),console.error("[use-dashboard-data]",O)}finally{c(!1)}},[]);return q.useEffect(()=>{p()},[p]),q.useEffect(()=>{t>0&&p()},[t,p]),{roadmap:e,state:n,todos:s,loading:l,error:u}}const Xp="maxsim_dashboard_mode";function n7(){const[t,e]=q.useState(()=>{try{const s=localStorage.getItem(Xp);if(s==="simple"||s==="advanced")return s}catch{}return null}),[i,n]=q.useState(()=>{try{const s=localStorage.getItem(Xp);return s==="simple"||s==="advanced"}catch{return!1}});return q.useEffect(()=>{i||fetch("/api/simple-mode-config").then(s=>s.json()).then(s=>{if(s.default_mode==="simple"||s.default_mode==="advanced"){e(s.default_mode);try{localStorage.setItem(Xp,s.default_mode)}catch{}}}).catch(()=>{}).finally(()=>n(!0))},[i]),{mode:t,setMode:s=>{e(s),i||n(!0);try{localStorage.setItem(Xp,s)}catch{}fetch("/api/simple-mode-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({default_mode:s})}).catch(()=>{})},initialized:i}}const HS=q.createContext({});function FS(t){const e=q.useRef(null);return e.current===null&&(e.current=t()),e.current}const oL=typeof window<"u",aL=oL?q.useLayoutEffect:q.useEffect,aO=q.createContext(null);function GS(t,e){t.indexOf(e)===-1&&t.push(e)}function hg(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}const As=(t,e,i)=>i>e?e:i<t?t:i;let KS=()=>{};const Oo={},lL=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function cL(t){return typeof t=="object"&&t!==null}const hL=t=>/^0[^.\s]+$/u.test(t);function uL(t){let e;return()=>(e===void 0&&(e=t()),e)}const Pr=t=>t,r7=(t,e)=>i=>e(t(i)),od=(...t)=>t.reduce(r7),wf=(t,e,i)=>{const n=e-t;return n===0?1:(i-t)/n};class JS{constructor(){this.subscriptions=[]}add(e){return GS(this.subscriptions,e),()=>hg(this.subscriptions,e)}notify(e,i,n){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,i,n);else for(let s=0;s<r;s++){const o=this.subscriptions[s];o&&o(e,i,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Wr=t=>t*1e3,Cr=t=>t/1e3;function fL(t,e){return e?t*(1e3/e):0}const dL=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t,s7=1e-7,o7=12;function a7(t,e,i,n,r){let s,o,l=0;do o=e+(i-e)/2,s=dL(o,n,r)-t,s>0?i=o:e=o;while(Math.abs(s)>s7&&++l<o7);return o}function ad(t,e,i,n){if(t===e&&i===n)return Pr;const r=s=>a7(s,0,1,t,i);return s=>s===0||s===1?s:dL(r(s),e,n)}const pL=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mL=t=>e=>1-t(1-e),gL=ad(.33,1.53,.69,.99),ex=mL(gL),OL=pL(ex),vL=t=>(t*=2)<1?.5*ex(t):.5*(2-Math.pow(2,-10*(t-1))),tx=t=>1-Math.sin(Math.acos(t)),_L=mL(tx),yL=pL(tx),l7=ad(.42,0,1,1),c7=ad(0,0,.58,1),bL=ad(.42,0,.58,1),h7=t=>Array.isArray(t)&&typeof t[0]!="number",SL=t=>Array.isArray(t)&&typeof t[0]=="number",u7={linear:Pr,easeIn:l7,easeInOut:bL,easeOut:c7,circIn:tx,circInOut:yL,circOut:_L,backIn:ex,backInOut:OL,backOut:gL,anticipate:vL},f7=t=>typeof t=="string",hT=t=>{if(SL(t)){KS(t.length===4);const[e,i,n,r]=t;return ad(e,i,n,r)}else if(f7(t))return u7[t];return t},Zp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function d7(t,e){let i=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),t()),d(l)}const u={schedule:(d,p=!1,g=!1)=>{const _=g&&r?i:n;return p&&o.add(d),_.has(d)||_.add(d),d},cancel:d=>{n.delete(d),o.delete(d)},process:d=>{if(l=d,r){s=!0;return}r=!0,[i,n]=[n,i],i.forEach(c),i.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const p7=40;function xL(t,e){let i=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>i=!0,o=Zp.reduce((T,A)=>(T[A]=d7(s),T),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:p,preRender:g,render:O,postRender:_}=o,b=()=>{const T=Oo.useManualTiming?r.timestamp:performance.now();i=!1,Oo.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(T-r.timestamp,p7),1)),r.timestamp=T,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),p.process(r),g.process(r),O.process(r),_.process(r),r.isProcessing=!1,i&&e&&(n=!1,t(b))},x=()=>{i=!0,n=!0,r.isProcessing||t(b)};return{schedule:Zp.reduce((T,A)=>{const L=o[A];return T[A]=(E,N=!1,z=!1)=>(i||x(),L.schedule(E,N,z)),T},{}),cancel:T=>{for(let A=0;A<Zp.length;A++)o[Zp[A]].cancel(T)},state:r,steps:o}}const{schedule:Tt,cancel:ba,state:qi,steps:t_}=xL(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pr,!0);let Dm;function m7(){Dm=void 0}const On={now:()=>(Dm===void 0&&On.set(qi.isProcessing||Oo.useManualTiming?qi.timestamp:performance.now()),Dm),set:t=>{Dm=t,queueMicrotask(m7)}},wL=t=>e=>typeof e=="string"&&e.startsWith(t),CL=wL("--"),g7=wL("var(--"),ix=t=>g7(t)?O7.test(t.split("/*")[0].trim()):!1,O7=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function uT(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const mh={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Cf={...mh,transform:t=>As(0,1,t)},qp={...mh,default:1},af=t=>Math.round(t*1e5)/1e5,nx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function v7(t){return t==null}const _7=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rx=(t,e)=>i=>!!(typeof i=="string"&&_7.test(i)&&i.startsWith(t)||e&&!v7(i)&&Object.prototype.hasOwnProperty.call(i,e)),kL=(t,e,i)=>n=>{if(typeof n!="string")return n;const[r,s,o,l]=n.match(nx);return{[t]:parseFloat(r),[e]:parseFloat(s),[i]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},y7=t=>As(0,255,t),i_={...mh,transform:t=>Math.round(y7(t))},fl={test:rx("rgb","red"),parse:kL("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+i_.transform(t)+", "+i_.transform(e)+", "+i_.transform(i)+", "+af(Cf.transform(n))+")"};function b7(t){let e="",i="",n="",r="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),r=t.substring(4,5),e+=e,i+=i,n+=n,r+=r),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}}const v1={test:rx("#"),parse:b7,transform:fl.transform},ld=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),la=ld("deg"),ws=ld("%"),Te=ld("px"),S7=ld("vh"),x7=ld("vw"),fT={...ws,parse:t=>ws.parse(t)/100,transform:t=>ws.transform(t*100)},Qc={test:rx("hsl","hue"),parse:kL("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+ws.transform(af(e))+", "+ws.transform(af(i))+", "+af(Cf.transform(n))+")"},ai={test:t=>fl.test(t)||v1.test(t)||Qc.test(t),parse:t=>fl.test(t)?fl.parse(t):Qc.test(t)?Qc.parse(t):v1.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?fl.transform(t):Qc.transform(t),getAnimatableNone:t=>{const e=ai.parse(t);return e.alpha=0,ai.transform(e)}},w7=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function C7(t){var e,i;return isNaN(t)&&typeof t=="string"&&(((e=t.match(nx))==null?void 0:e.length)||0)+(((i=t.match(w7))==null?void 0:i.length)||0)>0}const TL="number",AL="color",k7="var",T7="var(",dT="${}",A7=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function kf(t){const e=t.toString(),i=[],n={color:[],number:[],var:[]},r=[];let s=0;const l=e.replace(A7,c=>(ai.test(c)?(n.color.push(s),r.push(AL),i.push(ai.parse(c))):c.startsWith(T7)?(n.var.push(s),r.push(k7),i.push(c)):(n.number.push(s),r.push(TL),i.push(parseFloat(c))),++s,dT)).split(dT);return{values:i,split:l,indexes:n,types:r}}function EL(t){return kf(t).values}function ML(t){const{split:e,types:i}=kf(t),n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],r[o]!==void 0){const l=i[o];l===TL?s+=af(r[o]):l===AL?s+=ai.transform(r[o]):s+=r[o]}return s}}const E7=t=>typeof t=="number"?0:ai.test(t)?ai.getAnimatableNone(t):t;function M7(t){const e=EL(t);return ML(t)(e.map(E7))}const Ur={test:C7,parse:EL,createTransformer:ML,getAnimatableNone:M7};function n_(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function P7({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,e/=100,i/=100;let r=0,s=0,o=0;if(!e)r=s=o=i;else{const l=i<.5?i*(1+e):i+e-i*e,c=2*i-l;r=n_(c,l,t+1/3),s=n_(c,l,t),o=n_(c,l,t-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function ug(t,e){return i=>i>0?e:t}const Nt=(t,e,i)=>t+(e-t)*i,r_=(t,e,i)=>{const n=t*t,r=i*(e*e-n)+n;return r<0?0:Math.sqrt(r)},R7=[v1,fl,Qc],Q7=t=>R7.find(e=>e.test(t));function pT(t){const e=Q7(t);if(!e)return!1;let i=e.parse(t);return e===Qc&&(i=P7(i)),i}const mT=(t,e)=>{const i=pT(t),n=pT(e);if(!i||!n)return ug(t,e);const r={...i};return s=>(r.red=r_(i.red,n.red,s),r.green=r_(i.green,n.green,s),r.blue=r_(i.blue,n.blue,s),r.alpha=Nt(i.alpha,n.alpha,s),fl.transform(r))},_1=new Set(["none","hidden"]);function L7(t,e){return _1.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}function D7(t,e){return i=>Nt(t,e,i)}function sx(t){return typeof t=="number"?D7:typeof t=="string"?ix(t)?ug:ai.test(t)?mT:z7:Array.isArray(t)?PL:typeof t=="object"?ai.test(t)?mT:B7:ug}function PL(t,e){const i=[...t],n=i.length,r=t.map((s,o)=>sx(s)(s,e[o]));return s=>{for(let o=0;o<n;o++)i[o]=r[o](s);return i}}function B7(t,e){const i={...t,...e},n={};for(const r in i)t[r]!==void 0&&e[r]!==void 0&&(n[r]=sx(t[r])(t[r],e[r]));return r=>{for(const s in n)i[s]=n[s](r);return i}}function $7(t,e){const i=[],n={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const s=e.types[r],o=t.indexes[s][n[s]],l=t.values[o]??0;i[r]=l,n[s]++}return i}const z7=(t,e)=>{const i=Ur.createTransformer(e),n=kf(t),r=kf(e);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?_1.has(t)&&!r.values.length||_1.has(e)&&!n.values.length?L7(t,e):od(PL($7(n,r),r.values),i):ug(t,e)};function RL(t,e,i){return typeof t=="number"&&typeof e=="number"&&typeof i=="number"?Nt(t,e,i):sx(t)(t,e)}const N7=t=>{const e=({timestamp:i})=>t(i);return{start:(i=!0)=>Tt.update(e,i),stop:()=>ba(e),now:()=>qi.isProcessing?qi.timestamp:On.now()}},QL=(t,e,i=10)=>{let n="";const r=Math.max(Math.round(e/i),2);for(let s=0;s<r;s++)n+=Math.round(t(s/(r-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},fg=2e4;function ox(t){let e=0;const i=50;let n=t.next(e);for(;!n.done&&e<fg;)e+=i,n=t.next(e);return e>=fg?1/0:e}function j7(t,e=100,i){const n=i({...t,keyframes:[0,e]}),r=Math.min(ox(n),fg);return{type:"keyframes",ease:s=>n.next(r*s).value/e,duration:Cr(r)}}const I7=5;function LL(t,e,i){const n=Math.max(e-I7,0);return fL(i-t(n),e-n)}const Xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},s_=.001;function V7({duration:t=Xt.duration,bounce:e=Xt.bounce,velocity:i=Xt.velocity,mass:n=Xt.mass}){let r,s,o=1-e;o=As(Xt.minDamping,Xt.maxDamping,o),t=As(Xt.minDuration,Xt.maxDuration,Cr(t)),o<1?(r=u=>{const d=u*o,p=d*t,g=d-i,O=y1(u,o),_=Math.exp(-p);return s_-g/O*_},s=u=>{const p=u*o*t,g=p*i+i,O=Math.pow(o,2)*Math.pow(u,2)*t,_=Math.exp(-p),b=y1(Math.pow(u,2),o);return(-r(u)+s_>0?-1:1)*((g-O)*_)/b}):(r=u=>{const d=Math.exp(-u*t),p=(u-i)*t+1;return-s_+d*p},s=u=>{const d=Math.exp(-u*t),p=(i-u)*(t*t);return d*p});const l=5/t,c=Z7(r,s,l);if(t=Wr(t),isNaN(c))return{stiffness:Xt.stiffness,damping:Xt.damping,duration:t};{const u=Math.pow(c,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const X7=12;function Z7(t,e,i){let n=i;for(let r=1;r<X7;r++)n=n-t(n)/e(n);return n}function y1(t,e){return t*Math.sqrt(1-e*e)}const q7=["duration","bounce"],W7=["stiffness","damping","mass"];function gT(t,e){return e.some(i=>t[i]!==void 0)}function U7(t){let e={velocity:Xt.velocity,stiffness:Xt.stiffness,damping:Xt.damping,mass:Xt.mass,isResolvedFromDuration:!1,...t};if(!gT(t,W7)&&gT(t,q7))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(i*1.2),r=n*n,s=2*As(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Xt.mass,stiffness:r,damping:s}}else{const i=V7({...t,velocity:0});e={...e,...i,mass:Xt.mass},e.isResolvedFromDuration=!0}return e}function dg(t=Xt.visualDuration,e=Xt.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:r}=i;const s=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:p,velocity:g,isResolvedFromDuration:O}=U7({...i,velocity:-Cr(i.velocity||0)}),_=g||0,b=u/(2*Math.sqrt(c*d)),x=o-s,w=Cr(Math.sqrt(c/d)),k=Math.abs(x)<5;n||(n=k?Xt.restSpeed.granular:Xt.restSpeed.default),r||(r=k?Xt.restDelta.granular:Xt.restDelta.default);let T;if(b<1){const L=y1(w,b);T=E=>{const N=Math.exp(-b*w*E);return o-N*((_+b*w*x)/L*Math.sin(L*E)+x*Math.cos(L*E))}}else if(b===1)T=L=>o-Math.exp(-w*L)*(x+(_+w*x)*L);else{const L=w*Math.sqrt(b*b-1);T=E=>{const N=Math.exp(-b*w*E),z=Math.min(L*E,300);return o-N*((_+b*w*x)*Math.sinh(z)+L*x*Math.cosh(z))/L}}const A={calculatedDuration:O&&p||null,next:L=>{const E=T(L);if(O)l.done=L>=p;else{let N=L===0?_:0;b<1&&(N=L===0?Wr(_):LL(T,L,E));const z=Math.abs(N)<=n,Z=Math.abs(o-E)<=r;l.done=z&&Z}return l.value=l.done?o:E,l},toString:()=>{const L=Math.min(ox(A),fg),E=QL(N=>A.next(L*N).value,L,30);return L+"ms "+E},toTransition:()=>{}};return A}dg.applyToOptions=t=>{const e=j7(t,100,dg);return t.ease=e.ease,t.duration=Wr(e.duration),t.type="keyframes",t};function b1({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=t[0],g={done:!1,value:p},O=z=>l!==void 0&&z<l||c!==void 0&&z>c,_=z=>l===void 0?c:c===void 0||Math.abs(l-z)<Math.abs(c-z)?l:c;let b=i*e;const x=p+b,w=o===void 0?x:o(x);w!==x&&(b=w-p);const k=z=>-b*Math.exp(-z/n),T=z=>w+k(z),A=z=>{const Z=k(z),J=T(z);g.done=Math.abs(Z)<=u,g.value=g.done?w:J};let L,E;const N=z=>{O(g.value)&&(L=z,E=dg({keyframes:[g.value,_(g.value)],velocity:LL(T,z,g.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:z=>{let Z=!1;return!E&&L===void 0&&(Z=!0,A(z),N(z)),L!==void 0&&z>=L?E.next(z-L):(!Z&&A(z),g)}}}function Y7(t,e,i){const n=[],r=i||Oo.mix||RL,s=t.length-1;for(let o=0;o<s;o++){let l=r(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Pr:e;l=od(c,l)}n.push(l)}return n}function H7(t,e,{clamp:i=!0,ease:n,mixer:r}={}){const s=t.length;if(KS(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=Y7(e,n,r),c=l.length,u=d=>{if(o&&d<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(d<t[p+1]);p++);const g=wf(t[p],t[p+1],d);return l[p](g)};return i?d=>u(As(t[0],t[s-1],d)):u}function F7(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const r=wf(0,e,n);t.push(Nt(i,1,r))}}function G7(t){const e=[0];return F7(e,t.length-1),e}function K7(t,e){return t.map(i=>i*e)}function J7(t,e){return t.map(()=>e||bL).splice(0,t.length-1)}function lf({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const r=h7(n)?n.map(hT):hT(n),s={done:!1,value:e[0]},o=K7(i&&i.length===e.length?i:G7(e),t),l=H7(o,e,{ease:Array.isArray(r)?r:J7(e,r)});return{calculatedDuration:t,next:c=>(s.value=l(c),s.done=c>=t,s)}}const eI=t=>t!==null;function ax(t,{repeat:e,repeatType:i="loop"},n,r=1){const s=t.filter(eI),l=r<0||e&&i!=="loop"&&e%2===1?0:s.length-1;return!l||n===void 0?s[l]:n}const tI={decay:b1,inertia:b1,tween:lf,keyframes:lf,spring:dg};function DL(t){typeof t.type=="string"&&(t.type=tI[t.type])}class lx{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,i){return this.finished.then(e,i)}}const iI=t=>t/100;class cx extends lx{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,r;const{motionValue:i}=this.options;i&&i.updatedAt!==On.now()&&this.tick(On.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(n=this.options).onStop)==null||r.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;DL(e);const{type:i=lf,repeat:n=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=e;let{keyframes:l}=e;const c=i||lf;c!==lf&&typeof l[0]!="number"&&(this.mixKeyframes=od(iI,RL(l[0],l[1])),l=[0,100]);const u=c({...e,keyframes:l});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ox(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=u}updateTime(e){const i=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(e,i=!1){const{generator:n,totalDuration:r,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:d,repeat:p,repeatType:g,repeatDelay:O,type:_,onUpdate:b,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),i?this.currentTime=e:this.updateTime(e);const w=this.currentTime-u*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?w<0:w>r;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let T=this.currentTime,A=n;if(p){const z=Math.min(this.currentTime,r)/l;let Z=Math.floor(z),J=z%1;!J&&z>=1&&(J=1),J===1&&Z--,Z=Math.min(Z,p+1),!!(Z%2)&&(g==="reverse"?(J=1-J,O&&(J-=O/l)):g==="mirror"&&(A=o)),T=As(0,1,J)*l}const L=k?{done:!1,value:d[0]}:A.next(T);s&&(L.value=s(L.value));let{done:E}=L;!k&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return N&&_!==b1&&(L.value=ax(d,this.options,x,this.speed)),b&&b(L.value),N&&this.finish(),L}then(e,i){return this.finished.then(e,i)}get duration(){return Cr(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Cr(e)}get time(){return Cr(this.currentTime)}set time(e){var i;e=Wr(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(i=this.driver)==null||i.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(On.now());const i=this.playbackSpeed!==e;this.playbackSpeed=e,i&&(this.time=Cr(this.currentTime))}play(){var r,s;if(this.isStopped)return;const{driver:e=N7,startTime:i}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(s=(r=this.options).onPlay)==null||s.call(r);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=i??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(On.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,i;this.notifyFinished(),this.teardown(),this.state="finished",(i=(e=this.options).onComplete)==null||i.call(e)}cancel(){var e,i;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(i=(e=this.options).onCancel)==null||i.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var i;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(i=this.driver)==null||i.stop(),e.observe(this)}}function nI(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const dl=t=>t*180/Math.PI,S1=t=>{const e=dl(Math.atan2(t[1],t[0]));return x1(e)},rI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:S1,rotateZ:S1,skewX:t=>dl(Math.atan(t[1])),skewY:t=>dl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},x1=t=>(t=t%360,t<0&&(t+=360),t),OT=S1,vT=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),_T=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sI={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vT,scaleY:_T,scale:t=>(vT(t)+_T(t))/2,rotateX:t=>x1(dl(Math.atan2(t[6],t[5]))),rotateY:t=>x1(dl(Math.atan2(-t[2],t[0]))),rotateZ:OT,rotate:OT,skewX:t=>dl(Math.atan(t[4])),skewY:t=>dl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function w1(t){return t.includes("scale")?1:0}function C1(t,e){if(!t||t==="none")return w1(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,r;if(i)n=sI,r=i;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=rI,r=l}if(!r)return w1(e);const s=n[e],o=r[1].split(",").map(aI);return typeof s=="function"?s(o):o[s]}const oI=(t,e)=>{const{transform:i="none"}=getComputedStyle(t);return C1(i,e)};function aI(t){return parseFloat(t.trim())}const gh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Oh=new Set(gh),yT=t=>t===mh||t===Te,lI=new Set(["x","y","z"]),cI=gh.filter(t=>!lI.has(t));function hI(t){const e=[];return cI.forEach(i=>{const n=t.getValue(i);n!==void 0&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}const ga={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>C1(e,"x"),y:(t,{transform:e})=>C1(e,"y")};ga.translateX=ga.x;ga.translateY=ga.y;const yl=new Set;let k1=!1,T1=!1,A1=!1;function BL(){if(T1){const t=Array.from(yl).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),i=new Map;e.forEach(n=>{const r=hI(n);r.length&&(i.set(n,r),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const r=i.get(n);r&&r.forEach(([s,o])=>{var l;(l=n.getValue(s))==null||l.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}T1=!1,k1=!1,yl.forEach(t=>t.complete(A1)),yl.clear()}function $L(){yl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(T1=!0)})}function uI(){A1=!0,$L(),BL(),A1=!1}class hx{constructor(e,i,n,r,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=i,this.name=n,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(yl.add(this),k1||(k1=!0,Tt.read($L),Tt.resolveKeyframes(BL))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:i,element:n,motionValue:r}=this;if(e[0]===null){const s=r==null?void 0:r.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(n&&i){const l=n.readValue(i,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),r&&s===void 0&&r.set(e[0])}nI(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yl.delete(this)}cancel(){this.state==="scheduled"&&(yl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fI=t=>t.startsWith("--");function dI(t,e,i){fI(e)?t.style.setProperty(e,i):t.style[e]=i}const pI={};function zL(t,e){const i=uL(t);return()=>pI[e]??i()}const mI=zL(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),NL=zL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Yu=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,bT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yu([0,.65,.55,1]),circOut:Yu([.55,0,1,.45]),backIn:Yu([.31,.01,.66,-.59]),backOut:Yu([.33,1.53,.69,.99])};function jL(t,e){if(t)return typeof t=="function"?NL()?QL(t,e):"ease-out":SL(t)?Yu(t):Array.isArray(t)?t.map(i=>jL(i,e)||bT.easeOut):bT[t]}function gI(t,e,i,{delay:n=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[e]:i};c&&(d.offset=c);const p=jL(l,r);Array.isArray(p)&&(d.easing=p);const g={delay:n,duration:r,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(g.pseudoElement=u),t.animate(d,g)}function IL(t){return typeof t=="function"&&"applyToOptions"in t}function OI({type:t,...e}){return IL(t)&&NL()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class VL extends lx{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:i,name:n,keyframes:r,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,KS(typeof e.type!="string");const u=OI(e);this.animation=gI(i,n,r,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=ax(r,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):dI(i,n,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,i;(i=(e=this.animation).finish)==null||i.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var i,n,r;const e=(i=this.options)==null?void 0:i.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((r=(n=this.animation).commitStyles)==null||r.call(n))}get duration(){var i,n;const e=((n=(i=this.animation.effect)==null?void 0:i.getComputedTiming)==null?void 0:n.call(i).duration)||0;return Cr(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Cr(e)}get time(){return Cr(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Wr(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:i}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&mI()?(this.animation.timeline=e,Pr):i(this)}}const XL={anticipate:vL,backInOut:OL,circInOut:yL};function vI(t){return t in XL}function _I(t){typeof t.ease=="string"&&vI(t.ease)&&(t.ease=XL[t.ease])}const o_=10;class yI extends VL{constructor(e){_I(e),DL(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:i,onUpdate:n,onComplete:r,element:s,...o}=this.options;if(!i)return;if(e!==void 0){i.set(e);return}const l=new cx({...o,autoplay:!1}),c=Math.max(o_,On.now()-this.startTime),u=As(0,o_,c-o_);i.setWithVelocity(l.sample(Math.max(0,c-u)).value,l.sample(c).value,u),l.stop()}}const ST=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ur.test(t)||t==="0")&&!t.startsWith("url("));function bI(t){const e=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}function SI(t,e,i,n){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=ST(r,e),l=ST(s,e);return!o||!l?!1:bI(t)||(i==="spring"||IL(i))&&n}function E1(t){t.duration=0,t.type="keyframes"}const xI=new Set(["opacity","clipPath","filter","transform"]),wI=uL(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function CI(t){var d;const{motionValue:e,name:i,repeatDelay:n,repeatType:r,damping:s,type:o}=t;if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return wI()&&i&&xI.has(i)&&(i!=="transform"||!u)&&!c&&!n&&r!=="mirror"&&s!==0&&o!=="inertia"}const kI=40;class TI extends lx{constructor({autoplay:e=!0,delay:i=0,type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...p}){var _;super(),this.stop=()=>{var b,x;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=On.now();const g={autoplay:e,delay:i,type:n,repeat:r,repeatDelay:s,repeatType:o,name:c,motionValue:u,element:d,...p},O=(d==null?void 0:d.KeyframeResolver)||hx;this.keyframeResolver=new O(l,(b,x,w)=>this.onKeyframesResolved(b,x,g,!w),c,u,d),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(e,i,n,r){var x,w;this.keyframeResolver=void 0;const{name:s,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=n;this.resolvedAt=On.now(),SI(e,s,o,l)||((Oo.instantAnimations||!c)&&(d==null||d(ax(e,n,i))),e[0]=e[e.length-1],E1(n),n.repeat=0);const g={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>kI?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},O=!u&&CI(g),_=(w=(x=g.motionValue)==null?void 0:x.owner)==null?void 0:w.current,b=O?new yI({...g,element:_}):new cx(g);b.finished.then(()=>{this.notifyFinished()}).catch(Pr),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,i){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),uI()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function ZL(t,e,i,n=0,r=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,l=(o-1)*n;return typeof i=="function"?i(s,o):r===1?s*n:l-s*n}const AI=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function EI(t){const e=AI.exec(t);if(!e)return[,];const[,i,n,r]=e;return[`--${i??n}`,r]}function qL(t,e,i=1){const[n,r]=EI(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const o=s.trim();return lL(o)?parseFloat(o):o}return ix(r)?qL(r,e,i+1):r}const MI={type:"spring",stiffness:500,damping:25,restSpeed:10},PI=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),RI={type:"keyframes",duration:.8},QI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LI=(t,{keyframes:e})=>e.length>2?RI:Oh.has(t)?t.startsWith("scale")?PI(e[1]):MI:QI,DI=t=>t!==null;function BI(t,{repeat:e,repeatType:i="loop"},n){const r=t.filter(DI),s=e&&i!=="loop"&&e%2===1?0:r.length-1;return r[s]}function WL(t,e){if(t!=null&&t.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function ux(t,e){const i=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return i!==t?WL(i,t):i}function $I({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const fx=(t,e,i,n={},r,s)=>o=>{const l=ux(n,t)||{},c=l.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Wr(c);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:s?void 0:r};$I(l)||Object.assign(d,LI(t,d)),d.duration&&(d.duration=Wr(d.duration)),d.repeatDelay&&(d.repeatDelay=Wr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(E1(d),d.delay===0&&(p=!0)),(Oo.instantAnimations||Oo.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(p=!0,E1(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,p&&!s&&e.get()!==void 0){const g=BI(d.keyframes,l);if(g!==void 0){Tt.update(()=>{d.onUpdate(g),d.onComplete()});return}}return l.isSync?new cx(d):new TI(d)};function xT(t){const e=[{},{}];return t==null||t.values.forEach((i,n)=>{e[0][n]=i.get(),e[1][n]=i.getVelocity()}),e}function dx(t,e,i,n){if(typeof e=="function"){const[r,s]=xT(n);e=e(i!==void 0?i:t.custom,r,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,s]=xT(n);e=e(i!==void 0?i:t.custom,r,s)}return e}function Zc(t,e,i){const n=t.getProps();return dx(n,e,i!==void 0?i:n.custom,t)}const UL=new Set(["width","height","top","left","right","bottom",...gh]),wT=30,zI=t=>!isNaN(parseFloat(t));class NI{constructor(e,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var s;const r=On.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=i.owner}setCurrent(e){this.current=e,this.updatedAt=On.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=zI(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,i){this.events[e]||(this.events[e]=new JS);const n=this.events[e].add(i);return e==="change"?()=>{n(),Tt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,i){this.passiveEffect=e,this.stopPassiveEffect=i}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,i,n){this.set(i),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,i=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=On.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>wT)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,wT);return fL(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(e){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=e(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,i;(e=this.dependents)==null||e.clear(),(i=this.events.destroy)==null||i.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ih(t,e){return new NI(t,e)}const M1=t=>Array.isArray(t);function jI(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,ih(i))}function II(t){return M1(t)?t[t.length-1]||0:t}function VI(t,e){const i=Zc(t,e);let{transitionEnd:n={},transition:r={},...s}=i||{};s={...s,...n};for(const o in s){const l=II(s[o]);jI(t,o,l)}}const sn=t=>!!(t&&t.getVelocity);function XI(t){return!!(sn(t)&&t.add)}function P1(t,e){const i=t.getValue("willChange");if(XI(i))return i.add(e);if(!i&&Oo.WillChange){const n=new Oo.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function px(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ZI="framerAppearId",YL="data-"+px(ZI);function HL(t){return t.props[YL]}function qI({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&e[i]!==!0;return e[i]=!1,n}function FL(t,e,{delay:i=0,transitionOverride:n,type:r}={}){let{transition:s,transitionEnd:o,...l}=e;const c=t.getDefaultTransition();s=s?WL(s,c):c;const u=s==null?void 0:s.reduceMotion;n&&(s=n);const d=[],p=r&&t.animationState&&t.animationState.getState()[r];for(const g in l){const O=t.getValue(g,t.latestValues[g]??null),_=l[g];if(_===void 0||p&&qI(p,g))continue;const b={delay:i,...ux(s||{},g)},x=O.get();if(x!==void 0&&!O.isAnimating&&!Array.isArray(_)&&_===x&&!b.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const A=HL(t);if(A){const L=window.MotionHandoffAnimation(A,g,Tt);L!==null&&(b.startTime=L,w=!0)}}P1(t,g);const k=u??t.shouldReduceMotion;O.start(fx(g,O,_,k&&UL.has(g)?{type:!1}:b,t,w));const T=O.animation;T&&d.push(T)}if(o){const g=()=>Tt.update(()=>{o&&VI(t,o)});d.length?Promise.all(d).then(g):g()}return d}function R1(t,e,i={}){var c;const n=Zc(t,e,i.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(r=i.transitionOverride);const s=n?()=>Promise.all(FL(t,n,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:g}=r;return WI(t,e,u,d,p,g,i)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,d]=l==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(i.delay)])}function WI(t,e,i=0,n=0,r=0,s=1,o){const l=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),l.push(R1(c,e,{...o,delay:i+(typeof n=="function"?0:n)+ZL(t.variantChildren,c,n,r,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function UI(t,e,i={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const r=e.map(s=>R1(t,s,i));n=Promise.all(r)}else if(typeof e=="string")n=R1(t,e,i);else{const r=typeof e=="function"?Zc(t,e,i.custom):e;n=Promise.all(FL(t,r,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}const YI={test:t=>t==="auto",parse:t=>t},GL=t=>e=>e.test(t),KL=[mh,Te,ws,la,x7,S7,YI],CT=t=>KL.find(GL(t));function HI(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||hL(t):!0}const FI=new Set(["brightness","contrast","saturate","opacity"]);function GI(t){const[e,i]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=i.match(nx)||[];if(!n)return t;const r=i.replace(n,"");let s=FI.has(e)?1:0;return n!==i&&(s*=100),e+"("+s+r+")"}const KI=/\b([a-z-]*)\(.*?\)/gu,Q1={...Ur,getAnimatableNone:t=>{const e=t.match(KI);return e?e.map(GI).join(" "):t}},L1={...Ur,getAnimatableNone:t=>{const e=Ur.parse(t);return Ur.createTransformer(t)(e.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},kT={...mh,transform:Math.round},JI={rotate:la,rotateX:la,rotateY:la,rotateZ:la,scale:qp,scaleX:qp,scaleY:qp,scaleZ:qp,skew:la,skewX:la,skewY:la,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:Cf,originX:fT,originY:fT,originZ:Te},mx={borderWidth:Te,borderTopWidth:Te,borderRightWidth:Te,borderBottomWidth:Te,borderLeftWidth:Te,borderRadius:Te,borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomRightRadius:Te,borderBottomLeftRadius:Te,width:Te,maxWidth:Te,height:Te,maxHeight:Te,top:Te,right:Te,bottom:Te,left:Te,inset:Te,insetBlock:Te,insetBlockStart:Te,insetBlockEnd:Te,insetInline:Te,insetInlineStart:Te,insetInlineEnd:Te,padding:Te,paddingTop:Te,paddingRight:Te,paddingBottom:Te,paddingLeft:Te,paddingBlock:Te,paddingBlockStart:Te,paddingBlockEnd:Te,paddingInline:Te,paddingInlineStart:Te,paddingInlineEnd:Te,margin:Te,marginTop:Te,marginRight:Te,marginBottom:Te,marginLeft:Te,marginBlock:Te,marginBlockStart:Te,marginBlockEnd:Te,marginInline:Te,marginInlineStart:Te,marginInlineEnd:Te,fontSize:Te,backgroundPositionX:Te,backgroundPositionY:Te,...JI,zIndex:kT,fillOpacity:Cf,strokeOpacity:Cf,numOctaves:kT},eV={...mx,color:ai,backgroundColor:ai,outlineColor:ai,fill:ai,stroke:ai,borderColor:ai,borderTopColor:ai,borderRightColor:ai,borderBottomColor:ai,borderLeftColor:ai,filter:Q1,WebkitFilter:Q1,mask:L1,WebkitMask:L1},JL=t=>eV[t],tV=new Set([Q1,L1]);function e3(t,e){let i=JL(t);return tV.has(i)||(i=Ur),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const iV=new Set(["auto","none","0"]);function nV(t,e,i){let n=0,r;for(;n<t.length&&!r;){const s=t[n];typeof s=="string"&&!iV.has(s)&&kf(s).values.length&&(r=t[n]),n++}if(r&&i)for(const s of e)t[s]=e3(i,r)}class rV extends hx{constructor(e,i,n,r,s){super(e,i,n,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:i,name:n}=this;if(!i||!i.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let p=e[d];if(typeof p=="string"&&(p=p.trim(),ix(p))){const g=qL(p,i.current);g!==void 0&&(e[d]=g),d===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!UL.has(n)||e.length!==2)return;const[r,s]=e,o=CT(r),l=CT(s),c=uT(r),u=uT(s);if(c!==u&&ga[n]){this.needsMeasurement=!0;return}if(o!==l)if(yT(o)&&yT(l))for(let d=0;d<e.length;d++){const p=e[d];typeof p=="string"&&(e[d]=parseFloat(p))}else ga[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:i}=this,n=[];for(let r=0;r<e.length;r++)(e[r]===null||HI(e[r]))&&n.push(r);n.length&&nV(e,n,i)}measureInitialState(){const{element:e,unresolvedKeyframes:i,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ga[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){var l;const{element:e,name:i,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const r=e.getValue(i);r&&r.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=ga[i](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const sV=new Set(["opacity","clipPath","filter","transform"]);function t3(t,e,i){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let n=document;const r=(i==null?void 0:i[t])??n.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(n=>n!=null)}const i3=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function D1(t){return cL(t)&&"offsetHeight"in t}const{schedule:gx}=xL(queueMicrotask,!1),Xr={x:!1,y:!1};function n3(){return Xr.x||Xr.y}function oV(t){return t==="x"||t==="y"?Xr[t]?null:(Xr[t]=!0,()=>{Xr[t]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}function r3(t,e){const i=t3(t),n=new AbortController,r={passive:!0,...e,signal:n.signal};return[i,r,()=>n.abort()]}function aV(t){return!(t.pointerType==="touch"||n3())}function lV(t,e,i={}){const[n,r,s]=r3(t,i);return n.forEach(o=>{let l=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",_)},p=x=>{u&&(u(x),u=void 0),d()},g=x=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),c&&(c=!1,p(x))},O=()=>{l=!0,window.addEventListener("pointerup",g,r),window.addEventListener("pointercancel",g,r)},_=x=>{if(x.pointerType!=="touch"){if(l){c=!0;return}p(x)}},b=x=>{if(!aV(x))return;c=!1;const w=e(o,x);typeof w=="function"&&(u=w,o.addEventListener("pointerleave",_,r))};o.addEventListener("pointerenter",b,r),o.addEventListener("pointerdown",O,r)}),s}const s3=(t,e)=>e?t===e?!0:s3(t,e.parentElement):!1,Ox=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,cV=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function hV(t){return cV.has(t.tagName)||t.isContentEditable===!0}const uV=new Set(["INPUT","SELECT","TEXTAREA"]);function fV(t){return uV.has(t.tagName)||t.isContentEditable===!0}const Bm=new WeakSet;function TT(t){return e=>{e.key==="Enter"&&t(e)}}function a_(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const dV=(t,e)=>{const i=t.currentTarget;if(!i)return;const n=TT(()=>{if(Bm.has(i))return;a_(i,"down");const r=TT(()=>{a_(i,"up")}),s=()=>a_(i,"cancel");i.addEventListener("keyup",r,e),i.addEventListener("blur",s,e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)};function AT(t){return Ox(t)&&!n3()}const ET=new WeakSet;function pV(t,e,i={}){const[n,r,s]=r3(t,i),o=l=>{const c=l.currentTarget;if(!AT(l)||ET.has(l))return;Bm.add(c),i.stopPropagation&&ET.add(l);const u=e(c,l),d=(O,_)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",g),Bm.has(c)&&Bm.delete(c),AT(O)&&typeof u=="function"&&u(O,{success:_})},p=O=>{d(O,c===window||c===document||i.useGlobalTarget||s3(c,O.target))},g=O=>{d(O,!1)};window.addEventListener("pointerup",p,r),window.addEventListener("pointercancel",g,r)};return n.forEach(l=>{(i.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),D1(l)&&(l.addEventListener("focus",u=>dV(u,r)),!hV(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),s}function vx(t){return cL(t)&&"ownerSVGElement"in t}const $m=new WeakMap;let ca;const o3=(t,e,i)=>(n,r)=>r&&r[0]?r[0][t+"Size"]:vx(n)&&"getBBox"in n?n.getBBox()[e]:n[i],mV=o3("inline","width","offsetWidth"),gV=o3("block","height","offsetHeight");function OV({target:t,borderBoxSize:e}){var i;(i=$m.get(t))==null||i.forEach(n=>{n(t,{get width(){return mV(t,e)},get height(){return gV(t,e)}})})}function vV(t){t.forEach(OV)}function _V(){typeof ResizeObserver>"u"||(ca=new ResizeObserver(vV))}function yV(t,e){ca||_V();const i=t3(t);return i.forEach(n=>{let r=$m.get(n);r||(r=new Set,$m.set(n,r)),r.add(e),ca==null||ca.observe(n)}),()=>{i.forEach(n=>{const r=$m.get(n);r==null||r.delete(e),r!=null&&r.size||ca==null||ca.unobserve(n)})}}const zm=new Set;let Lc;function bV(){Lc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};zm.forEach(e=>e(t))},window.addEventListener("resize",Lc)}function SV(t){return zm.add(t),Lc||bV(),()=>{zm.delete(t),!zm.size&&typeof Lc=="function"&&(window.removeEventListener("resize",Lc),Lc=void 0)}}function MT(t,e){return typeof t=="function"?SV(t):yV(t,e)}function xV(t){return vx(t)&&t.tagName==="svg"}const wV=[...KL,ai,Ur],CV=t=>wV.find(GL(t)),PT=()=>({translate:0,scale:1,origin:0,originPoint:0}),Dc=()=>({x:PT(),y:PT()}),RT=()=>({min:0,max:0}),Oi=()=>({x:RT(),y:RT()}),kV=new WeakMap;function lO(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Tf(t){return typeof t=="string"||Array.isArray(t)}const _x=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yx=["initial",..._x];function cO(t){return lO(t.animate)||yx.some(e=>Tf(t[e]))}function a3(t){return!!(cO(t)||t.variants)}function TV(t,e,i){for(const n in e){const r=e[n],s=i[n];if(sn(r))t.addValue(n,r);else if(sn(s))t.addValue(n,ih(r,{owner:t}));else if(s!==r)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=t.getStaticValue(n);t.addValue(n,ih(o!==void 0?o:r,{owner:t}))}}for(const n in i)e[n]===void 0&&t.removeValue(n);return e}const B1={current:null},l3={current:!1},AV=typeof window<"u";function EV(){if(l3.current=!0,!!AV)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>B1.current=t.matches;t.addEventListener("change",e),e()}else B1.current=!1}const QT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let pg={};function c3(t){pg=t}function MV(){return pg}class PV{scrapeMotionValuesFromProps(e,i,n){return{}}constructor({parent:e,props:i,presenceContext:n,reducedMotionConfig:r,skipAnimations:s,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=hx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const O=On.now();this.renderScheduledAt<O&&(this.renderScheduledAt=O,Tt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=l;this.latestValues=u,this.baseTarget={...u},this.initialValues=i.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=i,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=cO(i),this.isVariantNode=a3(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...g}=this.scrapeMotionValuesFromProps(i,{},this);for(const O in g){const _=g[O];u[O]!==void 0&&sn(_)&&_.set(u[O])}}mount(e){var i,n;if(this.hasBeenMounted)for(const r in this.initialValues)(i=this.values.get(r))==null||i.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=e,kV.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(l3.current||EV(),this.shouldReduceMotion=B1.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),ba(this.notifyUpdate),ba(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const n=this.features[i];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,i){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),i.accelerate&&sV.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:u,duration:d}=i.accelerate,p=new VL({element:this.current,name:e,keyframes:l,times:c,ease:u,duration:Wr(d)}),g=o(p);this.valueSubscriptions.set(e,()=>{g(),p.cancel()});return}const n=Oh.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=i.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Tt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,i)),this.valueSubscriptions.set(e,()=>{r(),s&&s(),i.owner&&i.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in pg){const i=pg[e];if(!i)continue;const{isEnabled:n,Feature:r}=i;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Oi()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,i){this.latestValues[e]=i}update(e,i){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let n=0;n<QT.length;n++){const r=QT[n];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s="on"+r,o=e[s];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=TV(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(e),()=>i.variantChildren.delete(e)}addValue(e,i){const n=this.values.get(e);i!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,i),this.values.set(e,i),this.latestValues[e]=i.get())}removeValue(e){this.values.delete(e);const i=this.valueSubscriptions.get(e);i&&(i(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,i){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&i!==void 0&&(n=ih(i===null?void 0:i,{owner:this}),this.addValue(e,n)),n}readValue(e,i){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(lL(n)||hL(n))?n=parseFloat(n):!CV(n)&&Ur.test(i)&&(n=e3(e,i)),this.setBaseTarget(e,sn(n)?n.get():n)),sn(n)?n.get():n}setBaseTarget(e,i){this.baseTarget[e]=i}getBaseTarget(e){var s;const{initial:i}=this.props;let n;if(typeof i=="string"||typeof i=="object"){const o=dx(this.props,i,(s=this.presenceContext)==null?void 0:s.custom);o&&(n=o[e])}if(i&&n!==void 0)return n;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!sn(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,i){return this.events[e]||(this.events[e]=new JS),this.events[e].add(i)}notify(e,...i){this.events[e]&&this.events[e].notify(...i)}scheduleRenderMicrotask(){gx.render(this.render)}}class h3 extends PV{constructor(){super(...arguments),this.KeyframeResolver=rV}sortInstanceNodePosition(e,i){return e.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(e,i){const n=e.style;return n?n[i]:void 0}removeValueFromRenderState(e,{vars:i,style:n}){delete i[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;sn(e)&&(this.childSubscription=e.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Ea{constructor(e){this.isMounted=!1,this.node=e}update(){}}function u3({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function RV({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function QV(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}function l_(t){return t===void 0||t===1}function $1({scale:t,scaleX:e,scaleY:i}){return!l_(t)||!l_(e)||!l_(i)}function sl(t){return $1(t)||f3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function f3(t){return LT(t.x)||LT(t.y)}function LT(t){return t&&t!=="0%"}function mg(t,e,i){const n=t-i,r=e*n;return i+r}function DT(t,e,i,n,r){return r!==void 0&&(t=mg(t,r,n)),mg(t,i,n)+e}function z1(t,e=0,i=1,n,r){t.min=DT(t.min,e,i,n,r),t.max=DT(t.max,e,i,n,r)}function d3(t,{x:e,y:i}){z1(t.x,e.translate,e.scale,e.originPoint),z1(t.y,i.translate,i.scale,i.originPoint)}const BT=.999999999999,$T=1.0000000000001;function LV(t,e,i,n=!1){const r=i.length;if(!r)return;e.x=e.y=1;let s,o;for(let l=0;l<r;l++){s=i[l],o=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&$c(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,d3(t,o)),n&&sl(s.latestValues)&&$c(t,s.latestValues))}e.x<$T&&e.x>BT&&(e.x=1),e.y<$T&&e.y>BT&&(e.y=1)}function Bc(t,e){t.min=t.min+e,t.max=t.max+e}function zT(t,e,i,n,r=.5){const s=Nt(t.min,t.max,r);z1(t,e,i,s,n)}function $c(t,e){zT(t.x,e.x,e.scaleX,e.scale,e.originX),zT(t.y,e.y,e.scaleY,e.scale,e.originY)}function p3(t,e){return u3(QV(t.getBoundingClientRect(),e))}function DV(t,e,i){const n=p3(t,i),{scroll:r}=e;return r&&(Bc(n.x,r.offset.x),Bc(n.y,r.offset.y)),n}const BV={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$V=gh.length;function zV(t,e,i){let n="",r=!0;for(let s=0;s<$V;s++){const o=gh[s],l=t[o];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(o.startsWith("scale")?1:0);else{const u=parseFloat(l);c=o.startsWith("scale")?u===1:u===0}if(!c||i){const u=i3(l,mx[o]);if(!c){r=!1;const d=BV[o]||o;n+=`${d}(${u}) `}i&&(e[o]=u)}}return n=n.trim(),i?n=i(e,r?"":n):r&&(n="none"),n}function bx(t,e,i){const{style:n,vars:r,transformOrigin:s}=t;let o=!1,l=!1;for(const c in e){const u=e[c];if(Oh.has(c)){o=!0;continue}else if(CL(c)){r[c]=u;continue}else{const d=i3(u,mx[c]);c.startsWith("origin")?(l=!0,s[c]=d):n[c]=d}}if(e.transform||(o||i?n.transform=zV(e,t.transform,i):n.transform&&(n.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;n.transformOrigin=`${c} ${u} ${d}`}}function m3(t,{style:e,vars:i},n,r){const s=t.style;let o;for(o in e)s[o]=e[o];r==null||r.applyProjectionStyles(s,n);for(o in i)s.setProperty(o,i[o])}function NT(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const xu={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Te.test(t))t=parseFloat(t);else return t;const i=NT(t,e.target.x),n=NT(t,e.target.y);return`${i}% ${n}%`}},NV={correct:(t,{treeScale:e,projectionDelta:i})=>{const n=t,r=Ur.parse(t);if(r.length>5)return n;const s=Ur.createTransformer(t),o=typeof r[0]!="number"?1:0,l=i.x.scale*e.x,c=i.y.scale*e.y;r[0+o]/=l,r[1+o]/=c;const u=Nt(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}},N1={borderRadius:{...xu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xu,borderTopRightRadius:xu,borderBottomLeftRadius:xu,borderBottomRightRadius:xu,boxShadow:NV};function g3(t,{layout:e,layoutId:i}){return Oh.has(t)||t.startsWith("origin")||(e||i!==void 0)&&(!!N1[t]||t==="opacity")}function Sx(t,e,i){var o;const n=t.style,r=e==null?void 0:e.style,s={};if(!n)return s;for(const l in n)(sn(n[l])||r&&sn(r[l])||g3(l,t)||((o=i==null?void 0:i.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(s[l]=n[l]);return s}function jV(t){return window.getComputedStyle(t)}class IV extends h3{constructor(){super(...arguments),this.type="html",this.renderInstance=m3}readValueFromInstance(e,i){var n;if(Oh.has(i))return(n=this.projection)!=null&&n.isProjecting?w1(i):oI(e,i);{const r=jV(e),s=(CL(i)?r.getPropertyValue(i):r[i])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:i}){return p3(e,i)}build(e,i,n){bx(e,i,n.transformTemplate)}scrapeMotionValuesFromProps(e,i,n){return Sx(e,i,n)}}const VV={offset:"stroke-dashoffset",array:"stroke-dasharray"},XV={offset:"strokeDashoffset",array:"strokeDasharray"};function ZV(t,e,i=1,n=0,r=!0){t.pathLength=1;const s=r?VV:XV;t[s.offset]=`${-n}`,t[s.array]=`${e} ${i}`}const qV=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function O3(t,{attrX:e,attrY:i,attrScale:n,pathLength:r,pathSpacing:s=1,pathOffset:o=0,...l},c,u,d){if(bx(t,l,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g}=t;p.transform&&(g.transform=p.transform,delete p.transform),(g.transform||p.transformOrigin)&&(g.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),g.transform&&(g.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete p.transformBox);for(const O of qV)p[O]!==void 0&&(g[O]=p[O],delete p[O]);e!==void 0&&(p.x=e),i!==void 0&&(p.y=i),n!==void 0&&(p.scale=n),r!==void 0&&ZV(p,r,s,o,!1)}const v3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),_3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function WV(t,e,i,n){m3(t,e,void 0,n);for(const r in e.attrs)t.setAttribute(v3.has(r)?r:px(r),e.attrs[r])}function y3(t,e,i){const n=Sx(t,e,i);for(const r in t)if(sn(t[r])||sn(e[r])){const s=gh.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[s]=t[r]}return n}class UV extends h3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Oi}getBaseTargetFromProps(e,i){return e[i]}readValueFromInstance(e,i){if(Oh.has(i)){const n=JL(i);return n&&n.default||0}return i=v3.has(i)?i:px(i),e.getAttribute(i)}scrapeMotionValuesFromProps(e,i,n){return y3(e,i,n)}build(e,i,n){O3(e,i,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,i,n,r){WV(e,i,n,r)}mount(e){this.isSVGTag=_3(e.tagName),super.mount(e)}}const YV=yx.length;function b3(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?b3(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const e={};for(let i=0;i<YV;i++){const n=yx[i],r=t.props[n];(Tf(r)||r===!1)&&(e[n]=r)}return e}function S3(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}const HV=[..._x].reverse(),FV=_x.length;function GV(t){return e=>Promise.all(e.map(({animation:i,options:n})=>UI(t,i,n)))}function KV(t){let e=GV(t),i=jT(),n=!0;const r=c=>(u,d)=>{var g;const p=Zc(t,d,c==="exit"?(g=t.presenceContext)==null?void 0:g.custom:void 0);if(p){const{transition:O,transitionEnd:_,...b}=p;u={...u,...b,..._}}return u};function s(c){e=c(t)}function o(c){const{props:u}=t,d=b3(t.parent)||{},p=[],g=new Set;let O={},_=1/0;for(let x=0;x<FV;x++){const w=HV[x],k=i[w],T=u[w]!==void 0?u[w]:d[w],A=Tf(T),L=w===c?k.isActive:null;L===!1&&(_=x);let E=T===d[w]&&T!==u[w]&&A;if(E&&n&&t.manuallyAnimateOnMount&&(E=!1),k.protectedKeys={...O},!k.isActive&&L===null||!T&&!k.prevProp||lO(T)||typeof T=="boolean")continue;if(w==="exit"&&k.isActive&&L!==!0){k.prevResolvedValues&&(O={...O,...k.prevResolvedValues});continue}const N=JV(k.prevProp,T);let z=N||w===c&&k.isActive&&!E&&A||x>_&&A,Z=!1;const J=Array.isArray(T)?T:[T];let U=J.reduce(r(w),{});L===!1&&(U={});const{prevResolvedValues:R={}}=k,B={...R,...U},D=X=>{z=!0,g.has(X)&&(Z=!0,g.delete(X)),k.needsAnimating[X]=!0;const H=t.getValue(X);H&&(H.liveStyle=!1)};for(const X in B){const H=U[X],F=R[X];if(O.hasOwnProperty(X))continue;let M=!1;M1(H)&&M1(F)?M=!S3(H,F):M=H!==F,M?H!=null?D(X):g.add(X):H!==void 0&&g.has(X)?D(X):k.protectedKeys[X]=!0}k.prevProp=T,k.prevResolvedValues=U,k.isActive&&(O={...O,...U}),n&&t.blockInitialAnimation&&(z=!1);const j=E&&N;z&&(!j||Z)&&p.push(...J.map(X=>{const H={type:w};if(typeof X=="string"&&n&&!j&&t.manuallyAnimateOnMount&&t.parent){const{parent:F}=t,M=Zc(F,X);if(F.enteringChildren&&M){const{delayChildren:I}=M.transition||{};H.delay=ZL(F.enteringChildren,t,I)}}return{animation:X,options:H}}))}if(g.size){const x={};if(typeof u.initial!="boolean"){const w=Zc(t,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(x.transition=w.transition)}g.forEach(w=>{const k=t.getBaseTarget(w),T=t.getValue(w);T&&(T.liveStyle=!0),x[w]=k??null}),p.push({animation:x})}let b=!!p.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(p):Promise.resolve()}function l(c,u){var p;if(i[c].isActive===u)return Promise.resolve();(p=t.variantChildren)==null||p.forEach(g=>{var O;return(O=g.animationState)==null?void 0:O.setActive(c,u)}),i[c].isActive=u;const d=o(c);for(const g in i)i[g].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>i,reset:()=>{i=jT()}}}function JV(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!S3(e,t):!1}function Ka(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jT(){return{animate:Ka(!0),whileInView:Ka(),whileHover:Ka(),whileTap:Ka(),whileDrag:Ka(),whileFocus:Ka(),exit:Ka()}}function IT(t,e){t.min=e.min,t.max=e.max}function jr(t,e){IT(t.x,e.x),IT(t.y,e.y)}function VT(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const x3=1e-4,eX=1-x3,tX=1+x3,w3=.01,iX=0-w3,nX=0+w3;function vn(t){return t.max-t.min}function rX(t,e,i){return Math.abs(t-e)<=i}function XT(t,e,i,n=.5){t.origin=n,t.originPoint=Nt(e.min,e.max,t.origin),t.scale=vn(i)/vn(e),t.translate=Nt(i.min,i.max,t.origin)-t.originPoint,(t.scale>=eX&&t.scale<=tX||isNaN(t.scale))&&(t.scale=1),(t.translate>=iX&&t.translate<=nX||isNaN(t.translate))&&(t.translate=0)}function cf(t,e,i,n){XT(t.x,e.x,i.x,n?n.originX:void 0),XT(t.y,e.y,i.y,n?n.originY:void 0)}function ZT(t,e,i){t.min=i.min+e.min,t.max=t.min+vn(e)}function sX(t,e,i){ZT(t.x,e.x,i.x),ZT(t.y,e.y,i.y)}function qT(t,e,i){t.min=e.min-i.min,t.max=t.min+vn(e)}function gg(t,e,i){qT(t.x,e.x,i.x),qT(t.y,e.y,i.y)}function WT(t,e,i,n,r){return t-=e,t=mg(t,1/i,n),r!==void 0&&(t=mg(t,1/r,n)),t}function oX(t,e=0,i=1,n=.5,r,s=t,o=t){if(ws.test(e)&&(e=parseFloat(e),e=Nt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Nt(s.min,s.max,n);t===s&&(l-=e),t.min=WT(t.min,e,i,l,r),t.max=WT(t.max,e,i,l,r)}function UT(t,e,[i,n,r],s,o){oX(t,e[i],e[n],e[r],e.scale,s,o)}const aX=["x","scaleX","originX"],lX=["y","scaleY","originY"];function YT(t,e,i,n){UT(t.x,e,aX,i?i.x:void 0,n?n.x:void 0),UT(t.y,e,lX,i?i.y:void 0,n?n.y:void 0)}function HT(t){return t.translate===0&&t.scale===1}function C3(t){return HT(t.x)&&HT(t.y)}function FT(t,e){return t.min===e.min&&t.max===e.max}function cX(t,e){return FT(t.x,e.x)&&FT(t.y,e.y)}function GT(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function k3(t,e){return GT(t.x,e.x)&>(t.y,e.y)}function KT(t){return vn(t.x)/vn(t.y)}function JT(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ds(t){return[t("x"),t("y")]}function hX(t,e,i){let n="";const r=t.x.translate/e.x,s=t.y.translate/e.y,o=(i==null?void 0:i.z)||0;if((r||s||o)&&(n=`translate3d(${r}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:g,skewX:O,skewY:_}=i;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),p&&(n+=`rotateX(${p}deg) `),g&&(n+=`rotateY(${g}deg) `),O&&(n+=`skewX(${O}deg) `),_&&(n+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(n+=`scale(${l}, ${c})`),n||"none"}const T3=["TopLeft","TopRight","BottomLeft","BottomRight"],uX=T3.length,eA=t=>typeof t=="string"?parseFloat(t):t,tA=t=>typeof t=="number"||Te.test(t);function fX(t,e,i,n,r,s){r?(t.opacity=Nt(0,i.opacity??1,dX(n)),t.opacityExit=Nt(e.opacity??1,0,pX(n))):s&&(t.opacity=Nt(e.opacity??1,i.opacity??1,n));for(let o=0;o<uX;o++){const l=`border${T3[o]}Radius`;let c=iA(e,l),u=iA(i,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||tA(c)===tA(u)?(t[l]=Math.max(Nt(eA(c),eA(u),n),0),(ws.test(u)||ws.test(c))&&(t[l]+="%")):t[l]=u}(e.rotate||i.rotate)&&(t.rotate=Nt(e.rotate||0,i.rotate||0,n))}function iA(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const dX=A3(0,.5,_L),pX=A3(.5,.95,Pr);function A3(t,e,i){return n=>n<t?0:n>e?1:i(wf(t,e,n))}function mX(t,e,i){const n=sn(t)?t:ih(t);return n.start(fx("",n,e,i)),n.animation}function Af(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}const gX=(t,e)=>t.depth-e.depth;class OX{constructor(){this.children=[],this.isDirty=!1}add(e){GS(this.children,e),this.isDirty=!0}remove(e){hg(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(gX),this.isDirty=!1,this.children.forEach(e)}}function vX(t,e){const i=On.now(),n=({timestamp:r})=>{const s=r-i;s>=e&&(ba(n),t(s-e))};return Tt.setup(n,!0),()=>ba(n)}function Nm(t){return sn(t)?t.get():t}class _X{constructor(){this.members=[]}add(e){GS(this.members,e);for(let i=this.members.length-1;i>=0;i--){const n=this.members[i];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&r.isConnected===!1&&n.isPresent!==!1&&!n.snapshot&&hg(this.members,n)}e.scheduleRender()}remove(e){if(hg(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(e){const i=this.members.findIndex(r=>e===r);if(i===0)return!1;let n;for(let r=i;r>=0;r--){const s=this.members[r],o=s.instance;if(s.isPresent!==!1&&(!o||o.isConnected!==!1)){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,i){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender();const r=n.options.layoutDependency,s=e.options.layoutDependency;if(!(r!==void 0&&s!==void 0&&r===s)){const c=n.instance;c&&c.isConnected===!1&&!n.snapshot||(e.resumeFrom=n,i&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:l}=e.options;l===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:i,resumingFrom:n}=e;i.onExitComplete&&i.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const jm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},c_=["","X","Y","Z"],yX=1e3;let bX=0;function h_(t,e,i,n){const{latestValues:r}=e;r[t]&&(i[t]=r[t],e.setStaticValue(t,0),n&&(n[t]=0))}function E3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=HL(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Tt,!(r||s))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&E3(n)}function M3({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:n,resetTransform:r}){return class{constructor(o={},l=e==null?void 0:e()){this.id=bX++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(wX),this.nodes.forEach(AX),this.nodes.forEach(EX),this.nodes.forEach(CX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new OX)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new JS),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=vx(o)&&!xV(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),t){let d,p=0;const g=()=>this.root.updateBlockedByResize=!1;Tt.read(()=>{p=window.innerWidth}),t(o,()=>{const O=window.innerWidth;O!==p&&(p=O,this.root.updateBlockedByResize=!0,d&&d(),d=vX(g,250),jm.hasAnimatedSinceResize&&(jm.hasAnimatedSinceResize=!1,this.nodes.forEach(sA)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:g,layout:O})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||u.getDefaultTransition()||LX,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=u.getProps(),w=!this.targetLayout||!k3(this.targetLayout,O),k=!p&&g;if(this.options.layoutRoot||this.resumeFrom||k||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...ux(_,"layout"),onPlay:b,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(d,k)}else p||sA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=O})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ba(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(MX),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&E3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(rA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(TX),this.nodes.forEach(SX),this.nodes.forEach(xX)):this.nodes.forEach(rA),this.clearAllSnapshots();const l=On.now();qi.delta=As(0,1e3/60,l-qi.timestamp),qi.timestamp=l,qi.isProcessing=!0,t_.update.process(qi),t_.preRender.process(qi),t_.render.process(qi),qi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,gx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(kX),this.sharedNodes.forEach(PX)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Oi(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!C3(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||sl(this.latestValues)||d)&&(r(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),DX(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Oi();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(BX))){const{scroll:d}=this.root;d&&(Bc(l.x,d.offset.x),Bc(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=Oi();if(jr(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:p,options:g}=d;d!==this.root&&p&&g.layoutScroll&&(p.wasRoot&&jr(l,o),Bc(l.x,p.offset.x),Bc(l.y,p.offset.y))}return l}applyTransform(o,l=!1){const c=Oi();jr(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&$c(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),sl(d.latestValues)&&$c(c,d.latestValues)}return sl(this.latestValues)&&$c(c,this.latestValues),c}removeTransform(o){const l=Oi();jr(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!sl(u.latestValues))continue;$1(u.latestValues)&&u.updateSnapshot();const d=Oi(),p=u.measurePageBox();jr(d,p),YT(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return sl(this.latestValues)&&YT(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var O;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(O=this.parent)!=null&&O.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:p}=this.options;if(!this.layout||!(d||p))return;this.resolvedRelativeTargetAt=qi.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Oi(),this.targetWithTransforms=Oi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sX(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jr(this.target,this.layout.layoutBox),d3(this.target,this.targetDelta)):jr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||$1(this.parent.latestValues)||f3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Oi(),this.relativeTargetOrigin=Oi(),gg(this.relativeTargetOrigin,l,c),jr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var _;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===qi.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;jr(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;LV(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Oi());const{target:O}=o;if(!O){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(VT(this.prevProjectionDelta.x,this.projectionDelta.x),VT(this.prevProjectionDelta.y,this.projectionDelta.y)),cf(this.projectionDelta,this.layoutCorrected,O,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!JT(this.projectionDelta.x,this.prevProjectionDelta.x)||!JT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",O))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Dc(),this.projectionDelta=Dc(),this.projectionDeltaWithTransform=Dc()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},p=Dc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const g=Oi(),O=c?c.source:void 0,_=this.layout?this.layout.source:void 0,b=O!==_,x=this.getStack(),w=!x||x.members.length<=1,k=!!(b&&!w&&this.options.crossfade===!0&&!this.path.some(QX));this.animationProgress=0;let T;this.mixTargetDelta=A=>{const L=A/1e3;oA(p.x,o.x,L),oA(p.y,o.y,L),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gg(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),RX(this.relativeTarget,this.relativeTargetOrigin,g,L),T&&cX(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Oi()),jr(T,this.relativeTarget)),b&&(this.animationValues=d,fX(d,u,this.latestValues,L,k,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(ba(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{jm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ih(0)),this.motionValue.jump(0,!1),this.currentAnimation=mX(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yX),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&P3(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Oi();const p=vn(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const g=vn(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+g}jr(l,c),$c(l,d),cf(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new _X),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&h_("z",o,u,this.animationValues);for(let d=0;d<c_.length;d++)h_(`rotate${c_[d]}`,o,u,this.animationValues),h_(`skew${c_[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Nm(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Nm(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!sl(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let p=hX(this.projectionDeltaWithTransform,this.treeScale,d);c&&(p=c(d,p)),o.transform=p;const{x:g,y:O}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${O.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const _ in N1){if(d[_]===void 0)continue;const{correct:b,applyTo:x,isCSSVariable:w}=N1[_],k=p==="none"?d[_]:b(d[_],u);if(x){const T=x.length;for(let A=0;A<T;A++)o[x[A]]=k}else w?this.options.visualElement.renderState.vars[_]=k:o[_]=k}this.options.layoutId&&(o.pointerEvents=u===this?Nm(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(nA),this.root.sharedNodes.clear()}}}function SX(t){t.updateLayout()}function xX(t){var i;const e=((i=t.resumeFrom)==null?void 0:i.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;s==="size"?ds(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],O=vn(g);g.min=n[p].min,g.max=g.min+O}):P3(s,e.layoutBox,n)&&ds(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],O=vn(n[p]);g.max=g.min+O,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+O)});const l=Dc();cf(l,n,e.layoutBox);const c=Dc();o?cf(c,t.applyTransform(r,!0),e.measuredBox):cf(c,n,e.layoutBox);const u=!C3(l);let d=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:O}=p;if(g&&O){const _=Oi();gg(_,e.layoutBox,g.layoutBox);const b=Oi();gg(b,n,O.layoutBox),k3(_,b)||(d=!0),p.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function wX(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function CX(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function kX(t){t.clearSnapshot()}function nA(t){t.clearMeasurements()}function rA(t){t.isLayoutDirty=!1}function TX(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function sA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function AX(t){t.resolveTargetDelta()}function EX(t){t.calcProjection()}function MX(t){t.resetSkewAndRotation()}function PX(t){t.removeLeadSnapshot()}function oA(t,e,i){t.translate=Nt(e.translate,0,i),t.scale=Nt(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function aA(t,e,i,n){t.min=Nt(e.min,i.min,n),t.max=Nt(e.max,i.max,n)}function RX(t,e,i,n){aA(t.x,e.x,i.x,n),aA(t.y,e.y,i.y,n)}function QX(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const LX={duration:.45,ease:[.4,0,.1,1]},lA=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),cA=lA("applewebkit/")&&!lA("chrome/")?Math.round:Pr;function hA(t){t.min=cA(t.min),t.max=cA(t.max)}function DX(t){hA(t.x),hA(t.y)}function P3(t,e,i){return t==="position"||t==="preserve-aspect"&&!rX(KT(e),KT(i),.2)}function BX(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const $X=M3({attachResizeListener:(t,e)=>Af(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),u_={current:void 0},R3=M3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!u_.current){const t=new $X({});t.mount(window),t.setOptions({layoutScroll:!0}),u_.current=t}return u_.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xx=q.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function uA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function zX(...t){return e=>{let i=!1;const n=t.map(r=>{const s=uA(r,e);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let r=0;r<n.length;r++){const s=n[r];typeof s=="function"?s():uA(t[r],null)}}}}function NX(...t){return q.useCallback(zX(...t),t)}class jX extends q.Component{getSnapshotBeforeUpdate(e){const i=this.props.childRef.current;if(i&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const n=i.offsetParent,r=D1(n)&&n.offsetWidth||0,s=D1(n)&&n.offsetHeight||0,o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft,o.right=r-o.width-o.left,o.bottom=s-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function IX({children:t,isPresent:e,anchorX:i,anchorY:n,root:r,pop:s}){var g;const o=q.useId(),l=q.useRef(null),c=q.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=q.useContext(xx),d=((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref),p=NX(l,d);return q.useInsertionEffect(()=>{const{width:O,height:_,top:b,left:x,right:w,bottom:k}=c.current;if(e||s===!1||!l.current||!O||!_)return;const T=i==="left"?`left: ${x}`:`right: ${w}`,A=n==="bottom"?`bottom: ${k}`:`top: ${b}`;l.current.dataset.motionPopId=o;const L=document.createElement("style");u&&(L.nonce=u);const E=r??document.head;return E.appendChild(L),L.sheet&&L.sheet.insertRule(`
|
|
50
|
+
[data-motion-pop-id="${o}"] {
|
|
51
|
+
position: absolute !important;
|
|
52
|
+
width: ${O}px !important;
|
|
53
|
+
height: ${_}px !important;
|
|
54
|
+
${T}px !important;
|
|
55
|
+
${A}px !important;
|
|
56
|
+
}
|
|
57
|
+
`),()=>{E.contains(L)&&E.removeChild(L)}},[e]),S.jsx(jX,{isPresent:e,childRef:l,sizeRef:c,pop:s,children:s===!1?t:q.cloneElement(t,{ref:p})})}const VX=({children:t,initial:e,isPresent:i,onExitComplete:n,custom:r,presenceAffectsLayout:s,mode:o,anchorX:l,anchorY:c,root:u})=>{const d=FS(XX),p=q.useId();let g=!0,O=q.useMemo(()=>(g=!1,{id:p,initial:e,isPresent:i,custom:r,onExitComplete:_=>{d.set(_,!0);for(const b of d.values())if(!b)return;n&&n()},register:_=>(d.set(_,!1),()=>d.delete(_))}),[i,d,n]);return s&&g&&(O={...O}),q.useMemo(()=>{d.forEach((_,b)=>d.set(b,!1))},[i]),q.useEffect(()=>{!i&&!d.size&&n&&n()},[i]),t=S.jsx(IX,{pop:o==="popLayout",isPresent:i,anchorX:l,anchorY:c,root:u,children:t}),S.jsx(aO.Provider,{value:O,children:t})};function XX(){return new Map}function Q3(t=!0){const e=q.useContext(aO);if(e===null)return[!0,null];const{isPresent:i,onExitComplete:n,register:r}=e,s=q.useId();q.useEffect(()=>{if(t)return r(s)},[t]);const o=q.useCallback(()=>t&&n&&n(s),[s,n,t]);return!i&&n?[!1,o]:[!0]}const Wp=t=>t.key||"";function fA(t){const e=[];return q.Children.forEach(t,i=>{q.isValidElement(i)&&e.push(i)}),e}const wx=({children:t,custom:e,initial:i=!0,onExitComplete:n,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[d,p]=Q3(o),g=q.useMemo(()=>fA(t),[t]),O=o&&!d?[]:g.map(Wp),_=q.useRef(!0),b=q.useRef(g),x=FS(()=>new Map),w=q.useRef(new Set),[k,T]=q.useState(g),[A,L]=q.useState(g);aL(()=>{_.current=!1,b.current=g;for(let z=0;z<A.length;z++){const Z=Wp(A[z]);O.includes(Z)?(x.delete(Z),w.current.delete(Z)):x.get(Z)!==!0&&x.set(Z,!1)}},[A,O.length,O.join("-")]);const E=[];if(g!==k){let z=[...g];for(let Z=0;Z<A.length;Z++){const J=A[Z],U=Wp(J);O.includes(U)||(z.splice(Z,0,J),E.push(J))}return s==="wait"&&E.length&&(z=E),L(fA(z)),T(g),null}const{forceRender:N}=q.useContext(HS);return S.jsx(S.Fragment,{children:A.map(z=>{const Z=Wp(z),J=o&&!d?!1:g===A||O.includes(Z),U=()=>{if(w.current.has(Z))return;if(w.current.add(Z),x.has(Z))x.set(Z,!0);else return;let R=!0;x.forEach(B=>{B||(R=!1)}),R&&(N==null||N(),L(b.current),o&&(p==null||p()),n&&n())};return S.jsx(VX,{isPresent:J,initial:!_.current||i?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:u,onExitComplete:J?void 0:U,anchorX:l,anchorY:c,children:z},Z)})})},L3=q.createContext({strict:!1}),dA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let pA=!1;function ZX(){if(pA)return;const t={};for(const e in dA)t[e]={isEnabled:i=>dA[e].some(n=>!!i[n])};c3(t),pA=!0}function D3(){return ZX(),MV()}function qX(t){const e=D3();for(const i in t)e[i]={...e[i],...t[i]};c3(e)}const WX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Og(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||WX.has(t)}let B3=t=>!Og(t);function UX(t){typeof t=="function"&&(B3=e=>e.startsWith("on")?!Og(e):t(e))}try{UX(require("@emotion/is-prop-valid").default)}catch{}function YX(t,e,i){const n={};for(const r in t)r==="values"&&typeof t.values=="object"||(B3(r)||i===!0&&Og(r)||!e&&!Og(r)||t.draggable&&r.startsWith("onDrag"))&&(n[r]=t[r]);return n}const hO=q.createContext({});function HX(t,e){if(cO(t)){const{initial:i,animate:n}=t;return{initial:i===!1||Tf(i)?i:void 0,animate:Tf(n)?n:void 0}}return t.inherit!==!1?e:{}}function FX(t){const{initial:e,animate:i}=HX(t,q.useContext(hO));return q.useMemo(()=>({initial:e,animate:i}),[mA(e),mA(i)])}function mA(t){return Array.isArray(t)?t.join(" "):t}const Cx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $3(t,e,i){for(const n in e)!sn(e[n])&&!g3(n,i)&&(t[n]=e[n])}function GX({transformTemplate:t},e){return q.useMemo(()=>{const i=Cx();return bx(i,e,t),Object.assign({},i.vars,i.style)},[e])}function KX(t,e){const i=t.style||{},n={};return $3(n,i,t),Object.assign(n,GX(t,e)),n}function JX(t,e){const i={},n=KX(t,e);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=n,i}const z3=()=>({...Cx(),attrs:{}});function e9(t,e,i,n){const r=q.useMemo(()=>{const s=z3();return O3(s,e,_3(n),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};$3(s,t.style,t),r.style={...s,...r.style}}return r}const t9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function kx(t){return typeof t!="string"||t.includes("-")?!1:!!(t9.indexOf(t)>-1||/[A-Z]/u.test(t))}function i9(t,e,i,{latestValues:n},r,s=!1,o){const c=(o??kx(t)?e9:JX)(e,n,r,t),u=YX(e,typeof t=="string",s),d=t!==q.Fragment?{...u,...c,ref:i}:{},{children:p}=e,g=q.useMemo(()=>sn(p)?p.get():p,[p]);return q.createElement(t,{...d,children:g})}function n9({scrapeMotionValuesFromProps:t,createRenderState:e},i,n,r){return{latestValues:r9(i,n,r,t),renderState:e()}}function r9(t,e,i,n){const r={},s=n(t,{});for(const g in s)r[g]=Nm(s[g]);let{initial:o,animate:l}=t;const c=cO(t),u=a3(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let d=i?i.initial===!1:!1;d=d||o===!1;const p=d?l:o;if(p&&typeof p!="boolean"&&!lO(p)){const g=Array.isArray(p)?p:[p];for(let O=0;O<g.length;O++){const _=dx(t,g[O]);if(_){const{transitionEnd:b,transition:x,...w}=_;for(const k in w){let T=w[k];if(Array.isArray(T)){const A=d?T.length-1:0;T=T[A]}T!==null&&(r[k]=T)}for(const k in b)r[k]=b[k]}}}return r}const N3=t=>(e,i)=>{const n=q.useContext(hO),r=q.useContext(aO),s=()=>n9(t,e,n,r);return i?s():FS(s)},s9=N3({scrapeMotionValuesFromProps:Sx,createRenderState:Cx}),o9=N3({scrapeMotionValuesFromProps:y3,createRenderState:z3}),a9=Symbol.for("motionComponentSymbol");function l9(t,e,i){const n=q.useRef(i);q.useInsertionEffect(()=>{n.current=i});const r=q.useRef(null);return q.useCallback(s=>{var l;s&&((l=t.onMount)==null||l.call(t,s)),e&&(s?e.mount(s):e.unmount());const o=n.current;if(typeof o=="function")if(s){const c=o(s);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(s);else o&&(o.current=s)},[e])}const j3=q.createContext({});function Ec(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function c9(t,e,i,n,r,s){var T,A;const{visualElement:o}=q.useContext(hO),l=q.useContext(L3),c=q.useContext(aO),u=q.useContext(xx),d=u.reducedMotion,p=u.skipAnimations,g=q.useRef(null),O=q.useRef(!1);n=n||l.renderer,!g.current&&n&&(g.current=n(t,{visualState:e,parent:o,props:i,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:p,isSVG:s}),O.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const _=g.current,b=q.useContext(j3);_&&!_.projection&&r&&(_.type==="html"||_.type==="svg")&&h9(g.current,i,r,b);const x=q.useRef(!1);q.useInsertionEffect(()=>{_&&x.current&&_.update(i,c)});const w=i[YL],k=q.useRef(!!w&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,w))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,w)));return aL(()=>{O.current=!0,_&&(x.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),k.current&&_.animationState&&_.animationState.animateChanges())}),q.useEffect(()=>{_&&(!k.current&&_.animationState&&_.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var L;(L=window.MotionHandoffMarkAsComplete)==null||L.call(window,w)}),k.current=!1),_.enteringChildren=void 0)}),_}function h9(t,e,i,n){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:I3(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&Ec(l),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:u})}function I3(t){if(t)return t.options.allowProjection!==!1?t.projection:I3(t.parent)}function f_(t,{forwardMotionProps:e=!1,type:i}={},n,r){n&&qX(n);const s=i?i==="svg":kx(t),o=s?o9:s9;function l(u,d){let p;const g={...q.useContext(xx),...u,layoutId:u9(u)},{isStatic:O}=g,_=FX(u),b=o(u,O);if(!O&&oL){f9();const x=d9(g);p=x.MeasureLayout,_.visualElement=c9(t,b,g,r,x.ProjectionNode,s)}return S.jsxs(hO.Provider,{value:_,children:[p&&_.visualElement?S.jsx(p,{visualElement:_.visualElement,...g}):null,i9(t,u,l9(b,_.visualElement,d),b,O,e,s)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=q.forwardRef(l);return c[a9]=t,c}function u9({layoutId:t}){const e=q.useContext(HS).id;return e&&t!==void 0?e+"-"+t:t}function f9(t,e){q.useContext(L3).strict}function d9(t){const e=D3(),{drag:i,layout:n}=e;if(!i&&!n)return{};const r={...i,...n};return{MeasureLayout:i!=null&&i.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function p9(t,e){if(typeof Proxy>"u")return f_;const i=new Map,n=(s,o)=>f_(s,o,t,e),r=(s,o)=>n(s,o);return new Proxy(r,{get:(s,o)=>o==="create"?n:(i.has(o)||i.set(o,f_(o,void 0,t,e)),i.get(o))})}const m9=(t,e)=>e.isSVG??kx(t)?new UV(e):new IV(e,{allowProjection:t!==q.Fragment});class g9 extends Ea{constructor(e){super(e),e.animationState||(e.animationState=KV(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();lO(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:i}=this.node.prevProps||{};e!==i&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let O9=0;class v9 extends Ea{constructor(){super(...arguments),this.id=O9++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:i}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);i&&!e&&r.then(()=>{i(this.id)})}mount(){const{register:e,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const _9={animation:{Feature:g9},exit:{Feature:v9}};function cd(t){return{point:{x:t.pageX,y:t.pageY}}}const y9=t=>e=>Ox(e)&&t(e,cd(e));function hf(t,e,i,n){return Af(t,e,y9(i),n)}const V3=({current:t})=>t?t.ownerDocument.defaultView:null,gA=(t,e)=>Math.abs(t-e);function b9(t,e){const i=gA(t.x,e.x),n=gA(t.y,e.y);return Math.sqrt(i**2+n**2)}const OA=new Set(["auto","scroll"]);class X3{constructor(e,i,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=O=>{this.handleScroll(O.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=p_(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=b9(O.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:x}=O,{timestamp:w}=qi;this.history.push({...x,timestamp:w});const{onStart:k,onMove:T}=this.handlers;_||(k&&k(this.lastMoveEvent,O),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,O)},this.handlePointerMove=(O,_)=>{this.lastMoveEvent=O,this.lastMoveEventInfo=d_(_,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(O,_)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=p_(O.type==="pointercancel"?this.lastMoveEventInfo:d_(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(O,k),x&&x(O,k)},!Ox(e))return;this.dragSnapToOrigin=s,this.handlers=i,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=r||window;const c=cd(e),u=d_(c,this.transformPagePoint),{point:d}=u,{timestamp:p}=qi;this.history=[{...d,timestamp:p}];const{onSessionStart:g}=i;g&&g(e,p_(u,this.history)),this.removeListeners=od(hf(this.contextWindow,"pointermove",this.handlePointerMove),hf(this.contextWindow,"pointerup",this.handlePointerUp),hf(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(e){let i=e.parentElement;for(;i;){const n=getComputedStyle(i);(OA.has(n.overflowX)||OA.has(n.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const i=this.scrollPositions.get(e);if(!i)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-i.x,y:r.y-i.y};s.x===0&&s.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),Tt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ba(this.updatePoint)}}function d_(t,e){return e?{point:e(t.point)}:t}function vA(t,e){return{x:t.x-e.x,y:t.y-e.y}}function p_({point:t},e){return{point:t,delta:vA(t,Z3(e)),offset:vA(t,S9(e)),velocity:x9(e,.1)}}function S9(t){return t[0]}function Z3(t){return t[t.length-1]}function x9(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const r=Z3(t);for(;i>=0&&(n=t[i],!(r.timestamp-n.timestamp>Wr(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&r.timestamp-n.timestamp>Wr(e)*2&&(n=t[1]);const s=Cr(r.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-n.x)/s,y:(r.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function w9(t,{min:e,max:i},n){return e!==void 0&&t<e?t=n?Nt(e,t,n.min):Math.max(t,e):i!==void 0&&t>i&&(t=n?Nt(i,t,n.max):Math.min(t,i)),t}function _A(t,e,i){return{min:e!==void 0?t.min+e:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function C9(t,{top:e,left:i,bottom:n,right:r}){return{x:_A(t.x,i,r),y:_A(t.y,e,n)}}function yA(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}function k9(t,e){return{x:yA(t.x,e.x),y:yA(t.y,e.y)}}function T9(t,e){let i=.5;const n=vn(t),r=vn(e);return r>n?i=wf(e.min,e.max-n,t.min):n>r&&(i=wf(t.min,t.max-r,e.min)),As(0,1,i)}function A9(t,e){const i={};return e.min!==void 0&&(i.min=e.min-t.min),e.max!==void 0&&(i.max=e.max-t.min),i}const j1=.35;function E9(t=j1){return t===!1?t=0:t===!0&&(t=j1),{x:bA(t,"left","right"),y:bA(t,"top","bottom")}}function bA(t,e,i){return{min:SA(t,e),max:SA(t,i)}}function SA(t,e){return typeof t=="number"?t:t[e]||0}const M9=new WeakMap;class P9{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Oi(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:i=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=p=>{i&&this.snapToCursor(cd(p).point),this.stopAnimation()},o=(p,g)=>{const{drag:O,dragPropagation:_,onDragStart:b}=this.getProps();if(O&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=oV(O),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ds(w=>{let k=this.getAxisMotionValue(w).get()||0;if(ws.test(k)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[w];A&&(k=vn(A)*(parseFloat(k)/100))}}this.originPoint[w]=k}),b&&Tt.update(()=>b(p,g),!1,!0),P1(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:O,dragDirectionLock:_,onDirectionLock:b,onDrag:x}=this.getProps();if(!O&&!this.openDragLock)return;const{offset:w}=g;if(_&&this.currentDirection===null){this.currentDirection=Q9(w),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",g.point,w),this.updateAxis("y",g.point,w),this.visualElement.render(),x&&Tt.update(()=>x(p,g),!1,!0)},c=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g,this.stop(p,g),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new X3(e,{onSessionStart:s,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:V3(this.visualElement),element:this.visualElement.current})}stop(e,i){const n=e||this.latestPointerEvent,r=i||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!n)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Tt.postRender(()=>l(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:i}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,i,n){const{drag:r}=this.getProps();if(!n||!Up(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=w9(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:i}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,r=this.constraints;e&&Ec(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=C9(n.layoutBox,e):this.constraints=!1,this.elastic=E9(i),r!==this.constraints&&!Ec(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&ds(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=A9(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!Ec(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=DV(n,r.root,this.visualElement.getTransformPagePoint());let o=k9(r.layout.layoutBox,s);if(i){const l=i(RV(o));this.hasMutatedConstraints=!!l,l&&(o=u3(l))}return o}startAnimation(e){const{drag:i,dragMomentum:n,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=ds(d=>{if(!Up(d,i,this.currentDirection))return;let p=c&&c[d]||{};o&&(p={min:0,max:0});const g=r?200:1e6,O=r?40:1e7,_={type:"inertia",velocity:n?e[d]:0,bounceStiffness:g,bounceDamping:O,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(d,_)});return Promise.all(u).then(l)}startAxisValueAnimation(e,i){const n=this.getAxisMotionValue(e);return P1(this.visualElement,e),n.start(fx(e,n,0,i,this.visualElement,!1))}stopAnimation(){ds(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const i=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[i];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){ds(i=>{const{drag:n}=this.getProps();if(!Up(i,n,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(i);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[i],c=s.get()||0;s.set(e[i]-Nt(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!Ec(i)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ds(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=T9({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ds(o=>{if(!Up(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Nt(c,u,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;M9.set(this.visualElement,this);const e=this.visualElement.current,i=hf(e,"pointerdown",u=>{const{drag:d,dragListener:p=!0}=this.getProps(),g=u.target,O=g!==e&&fV(g);d&&p&&!O&&this.start(u)});let n;const r=()=>{const{dragConstraints:u}=this.getProps();Ec(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=R9(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Tt.read(r);const l=Af(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(ds(p=>{const g=this.getAxisMotionValue(p);g&&(this.originPoint[p]+=u[p].translate,g.set(g.get()+u[p].translate))}),this.visualElement.render())}));return()=>{l(),i(),o(),c&&c(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=j1,dragMomentum:l=!0}=e;return{...e,drag:i,dragDirectionLock:n,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function xA(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function R9(t,e,i){const n=MT(t,xA(i)),r=MT(e,xA(i));return()=>{n(),r()}}function Up(t,e,i){return(e===!0||e===t)&&(i===null||i===t)}function Q9(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}class L9 extends Ea{constructor(e){super(e),this.removeGroupControls=Pr,this.removeListeners=Pr,this.controls=new P9(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Pr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};e!==i&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const m_=t=>(e,i)=>{t&&Tt.update(()=>t(e,i),!1,!0)};class D9 extends Ea{constructor(){super(...arguments),this.removePointerDownListener=Pr}onPointerDown(e){this.session=new X3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:i,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:m_(e),onStart:m_(i),onMove:m_(n),onEnd:(s,o)=>{delete this.session,r&&Tt.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=hf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let g_=!1;class B9 extends q.Component{componentDidMount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:n,layoutId:r}=this.props,{projection:s}=e;s&&(i.group&&i.group.add(s),n&&n.register&&r&&n.register(s),g_&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:i,visualElement:n,drag:r,isPresent:s}=this.props,{projection:o}=n;return o&&(o.isPresent=s,e.layoutDependency!==i&&o.setOptions({...o.options,layoutDependency:i}),g_=!0,r||e.layoutDependency!==i||i===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Tt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),gx.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:n}=this.props,{projection:r}=e;g_=!0,r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function q3(t){const[e,i]=Q3(),n=q.useContext(HS);return S.jsx(B9,{...t,layoutGroup:n,switchLayoutGroup:q.useContext(j3),isPresent:e,safeToRemove:i})}const $9={pan:{Feature:D9},drag:{Feature:L9,ProjectionNode:R3,MeasureLayout:q3}};function wA(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,s=n[r];s&&Tt.postRender(()=>s(e,cd(e)))}class z9 extends Ea{mount(){const{current:e}=this.node;e&&(this.unmount=lV(e,(i,n)=>(wA(this.node,n,"Start"),r=>wA(this.node,r,"End"))))}unmount(){}}class N9 extends Ea{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=od(Af(this.node.current,"focus",()=>this.onFocus()),Af(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function CA(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),s=n[r];s&&Tt.postRender(()=>s(e,cd(e)))}class j9 extends Ea{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:i,propagate:n}=this.node.props;this.unmount=pV(e,(r,s)=>(CA(this.node,s,"Start"),(o,{success:l})=>CA(this.node,o,l?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const I1=new WeakMap,O_=new WeakMap,I9=t=>{const e=I1.get(t.target);e&&e(t)},V9=t=>{t.forEach(I9)};function X9({root:t,...e}){const i=t||document;O_.has(i)||O_.set(i,{});const n=O_.get(i),r=JSON.stringify(e);return n[r]||(n[r]=new IntersectionObserver(V9,{root:t,...e})),n[r]}function Z9(t,e,i){const n=X9(e);return I1.set(t,i),n.observe(t),()=>{I1.delete(t),n.unobserve(t)}}const q9={some:0,all:1};class W9 extends Ea{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:i,margin:n,amount:r="some",once:s}=e,o={root:i?i.current:void 0,rootMargin:n,threshold:typeof r=="number"?r:q9[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),g=u?d:p;g&&g(c)};return Z9(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:i}=this.node;["amount","margin","root"].some(U9(e,i))&&this.startObserver()}unmount(){}}function U9({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}const Y9={inView:{Feature:W9},tap:{Feature:j9},focus:{Feature:N9},hover:{Feature:z9}},H9={layout:{ProjectionNode:R3,MeasureLayout:q3}},F9={..._9,...Y9,...$9,...H9},vo=p9(F9,m9);function G9({roadmap:t,state:e,todos:i}){var p;const{connected:n}=sd(),r=(t==null?void 0:t.progress_percent)??0,s=(t==null?void 0:t.current_phase)??(e==null?void 0:e.currentPhase)??"--",o=((p=t==null?void 0:t.phases.find(g=>g.number===t.current_phase))==null?void 0:p.name)??"",l=(e==null?void 0:e.blockers.filter(g=>!g.includes("RESOLVED")).length)??0,c=(i==null?void 0:i.pending.length)??0,u=(t==null?void 0:t.completed_phases)??0,d=(t==null?void 0:t.phase_count)??0;return S.jsxs("div",{className:"border-b border-border pb-6",children:[S.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[S.jsx("span",{className:"block w-6 h-px bg-accent"}),S.jsx("span",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Milestone Progress"}),S.jsxs("span",{className:"ml-auto flex items-center gap-3",children:[S.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[u,"/",d," phases"]}),S.jsx("span",{className:`inline-block h-1.5 w-1.5 ${n?"bg-success":"bg-danger"}`,title:n?"Connected":"Disconnected"})]})]}),S.jsx("div",{className:"h-1 w-full bg-muted mb-5",children:S.jsx(vo.div,{className:"h-full bg-accent",initial:{width:0},animate:{width:`${r}%`},transition:{duration:.6,ease:"easeOut"}})}),S.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-end sm:gap-10",children:[S.jsxs("div",{className:"flex items-end gap-4 sm:gap-10",children:[S.jsxs("div",{children:[S.jsx("span",{className:"font-mono text-3xl font-bold tabular-nums text-foreground leading-none",children:r}),S.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:"%"})]}),S.jsxs("div",{className:"border-l border-border pl-4 sm:pl-10",children:[S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Current"}),S.jsxs("div",{className:"flex items-baseline gap-2",children:[S.jsx("span",{className:"font-mono text-sm font-bold text-accent",children:s}),S.jsx("span",{className:"truncate text-sm text-foreground/80 max-w-[140px] sm:max-w-none",children:o})]})]})]}),S.jsxs("div",{className:"flex items-end gap-6 sm:ml-auto sm:gap-8",children:[S.jsxs("div",{children:[S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Blockers"}),S.jsx("span",{className:`font-mono text-xl font-bold tabular-nums ${l>0?"text-danger":"text-muted-foreground"}`,children:l})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Todos"}),S.jsx("span",{className:`font-mono text-xl font-bold tabular-nums ${c>0?"text-warning":"text-muted-foreground"}`,children:c})]})]})]})]})}function K9(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function J9(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function eZ({phaseName:t,phaseNumber:e,completedPlans:i,totalPlans:n,status:r,roadmapComplete:s,isCurrent:o,onClick:l,onToggleComplete:c}){const u=n>0?Math.round(i/n*100):0;return S.jsxs("button",{type:"button",onClick:()=>l(e),className:`group relative w-full text-left transition-colors duration-200 bg-background ${o?"border-l-2 border-l-accent":"border-l-2 border-l-transparent hover:border-l-accent/40"}`,children:[S.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-200 bg-card-hover"}),S.jsxs("div",{className:"relative flex items-center gap-3 px-4 py-3",children:[c?S.jsx("input",{type:"checkbox",checked:s,onChange:d=>{d.stopPropagation(),c(e,d.target.checked)},onClick:d=>d.stopPropagation(),className:"h-3 w-3 shrink-0 cursor-pointer accent-accent",title:s?"Mark incomplete":"Mark complete"}):S.jsx("span",{className:`inline-block h-1.5 w-1.5 shrink-0 ${J9(r)}`}),S.jsx("span",{className:`font-mono text-xs font-bold tabular-nums shrink-0 ${o?"text-accent":"text-muted-foreground"}`,children:e}),S.jsx("span",{className:"truncate text-sm text-foreground/90",children:t}),S.jsxs("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground tabular-nums",children:[i,"/",n]})]}),S.jsx("div",{className:"h-px w-full bg-muted/50",children:S.jsx(vo.div,{className:`h-full ${K9(r)}`,initial:{width:0},animate:{width:`${u}%`},transition:{duration:.5,ease:"easeOut"}})})]})}function tZ({phases:t,currentPhase:e,onPhaseClick:i,onToggleComplete:n}){return S.jsxs("div",{className:"flex flex-col gap-4",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:"block w-6 h-px bg-accent"}),S.jsx("span",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Phases"})]}),S.jsx("span",{className:"text-xs text-muted-foreground",children:t.length})]}),t.length===0?S.jsxs("div",{className:"flex flex-col items-center gap-3 border border-border px-4 py-10 text-center",children:[S.jsx("span",{className:"text-sm text-muted-foreground",children:"No project initialized yet."}),S.jsxs("span",{className:"text-sm text-muted-foreground",children:["Run"," ",S.jsx("code",{className:"bg-muted px-1.5 py-0.5 font-mono text-accent text-xs",children:"/maxsim:new-project"})," ","in Claude Code to get started."]})]}):S.jsx("div",{className:"flex flex-col gap-px bg-border",children:t.map(r=>S.jsx(eZ,{phaseNumber:r.number,phaseName:r.name,completedPlans:r.summaryCount,totalPlans:r.planCount,status:r.diskStatus,roadmapComplete:r.roadmapComplete,isCurrent:r.number===e,onClick:i,onToggleComplete:n},r.number))})]})}function W3(t){var e,i,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=W3(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function iZ(){for(var t,e,i=0,n="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=W3(t))&&(n&&(n+=" "),n+=e);return n}const nZ=(t,e)=>{const i=new Array(t.length+e.length);for(let n=0;n<t.length;n++)i[n]=t[n];for(let n=0;n<e.length;n++)i[t.length+n]=e[n];return i},rZ=(t,e)=>({classGroupId:t,validator:e}),U3=(t=new Map,e=null,i)=>({nextPart:t,validators:e,classGroupId:i}),vg="-",kA=[],sZ="arbitrary..",oZ=t=>{const e=lZ(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return aZ(o);const l=o.split(vg),c=l[0]===""&&l.length>1?1:0;return Y3(l,c,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=n[o],u=i[o];return c?u?nZ(u,c):c:u||kA}return i[o]||kA}}},Y3=(t,e,i)=>{if(t.length-e===0)return i.classGroupId;const r=t[e],s=i.nextPart.get(r);if(s){const u=Y3(t,e+1,s);if(u)return u}const o=i.validators;if(o===null)return;const l=e===0?t.join(vg):t.slice(e).join(vg),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(l))return d.classGroupId}},aZ=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),i=e.indexOf(":"),n=e.slice(0,i);return n?sZ+n:void 0})(),lZ=t=>{const{theme:e,classGroups:i}=t;return cZ(i,e)},cZ=(t,e)=>{const i=U3();for(const n in t){const r=t[n];Tx(r,i,n,e)}return i},Tx=(t,e,i,n)=>{const r=t.length;for(let s=0;s<r;s++){const o=t[s];hZ(o,e,i,n)}},hZ=(t,e,i,n)=>{if(typeof t=="string"){uZ(t,e,i);return}if(typeof t=="function"){fZ(t,e,i,n);return}dZ(t,e,i,n)},uZ=(t,e,i)=>{const n=t===""?e:H3(e,t);n.classGroupId=i},fZ=(t,e,i,n)=>{if(pZ(t)){Tx(t(n),e,i,n);return}e.validators===null&&(e.validators=[]),e.validators.push(rZ(i,t))},dZ=(t,e,i,n)=>{const r=Object.entries(t),s=r.length;for(let o=0;o<s;o++){const[l,c]=r[o];Tx(c,H3(e,l),i,n)}},H3=(t,e)=>{let i=t;const n=e.split(vg),r=n.length;for(let s=0;s<r;s++){const o=n[s];let l=i.nextPart.get(o);l||(l=U3(),i.nextPart.set(o,l)),i=l}return i},pZ=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,mZ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,i=Object.create(null),n=Object.create(null);const r=(s,o)=>{i[s]=o,e++,e>t&&(e=0,n=i,i=Object.create(null))};return{get(s){let o=i[s];if(o!==void 0)return o;if((o=n[s])!==void 0)return r(s,o),o},set(s,o){s in i?i[s]=o:r(s,o)}}},V1="!",TA=":",gZ=[],AA=(t,e,i,n,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:i,maybePostfixModifierPosition:n,isExternal:r}),OZ=t=>{const{prefix:e,experimentalParseClassName:i}=t;let n=r=>{const s=[];let o=0,l=0,c=0,u;const d=r.length;for(let b=0;b<d;b++){const x=r[b];if(o===0&&l===0){if(x===TA){s.push(r.slice(c,b)),c=b+1;continue}if(x==="/"){u=b;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const p=s.length===0?r:r.slice(c);let g=p,O=!1;p.endsWith(V1)?(g=p.slice(0,-1),O=!0):p.startsWith(V1)&&(g=p.slice(1),O=!0);const _=u&&u>c?u-c:void 0;return AA(s,O,g,_)};if(e){const r=e+TA,s=n;n=o=>o.startsWith(r)?s(o.slice(r.length)):AA(gZ,!1,o,void 0,!0)}if(i){const r=n;n=s=>i({className:s,parseClassName:r})}return n},vZ=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((i,n)=>{e.set(i,1e6+n)}),i=>{const n=[];let r=[];for(let s=0;s<i.length;s++){const o=i[s],l=o[0]==="[",c=e.has(o);l||c?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},_Z=t=>({cache:mZ(t.cacheSize),parseClassName:OZ(t),sortModifiers:vZ(t),...oZ(t)}),yZ=/\s+/,bZ=(t,e)=>{const{parseClassName:i,getClassGroupId:n,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],l=t.trim().split(yZ);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:g,hasImportantModifier:O,baseClassName:_,maybePostfixModifierPosition:b}=i(d);if(p){c=d+(c.length>0?" "+c:c);continue}let x=!!b,w=n(x?_.substring(0,b):_);if(!w){if(!x){c=d+(c.length>0?" "+c:c);continue}if(w=n(_),!w){c=d+(c.length>0?" "+c:c);continue}x=!1}const k=g.length===0?"":g.length===1?g[0]:s(g).join(":"),T=O?k+V1:k,A=T+w;if(o.indexOf(A)>-1)continue;o.push(A);const L=r(w,x);for(let E=0;E<L.length;++E){const N=L[E];o.push(T+N)}c=d+(c.length>0?" "+c:c)}return c},SZ=(...t)=>{let e=0,i,n,r="";for(;e<t.length;)(i=t[e++])&&(n=F3(i))&&(r&&(r+=" "),r+=n);return r},F3=t=>{if(typeof t=="string")return t;let e,i="";for(let n=0;n<t.length;n++)t[n]&&(e=F3(t[n]))&&(i&&(i+=" "),i+=e);return i},xZ=(t,...e)=>{let i,n,r,s;const o=c=>{const u=e.reduce((d,p)=>p(d),t());return i=_Z(u),n=i.cache.get,r=i.cache.set,s=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=bZ(c,i);return r(c,d),d};return s=o,(...c)=>s(SZ(...c))},wZ=[],pi=t=>{const e=i=>i[t]||wZ;return e.isThemeGetter=!0,e},G3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,CZ=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kZ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TZ=/\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$/,AZ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EZ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MZ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jo=t=>CZ.test(t),qe=t=>!!t&&!Number.isNaN(Number(t)),ea=t=>!!t&&Number.isInteger(Number(t)),v_=t=>t.endsWith("%")&&qe(t.slice(0,-1)),to=t=>kZ.test(t),J3=()=>!0,PZ=t=>TZ.test(t)&&!AZ.test(t),Ax=()=>!1,RZ=t=>EZ.test(t),QZ=t=>MZ.test(t),LZ=t=>!ke(t)&&!Ae(t),DZ=t=>Ma(t,iD,Ax),ke=t=>G3.test(t),Ja=t=>Ma(t,nD,PZ),EA=t=>Ma(t,XZ,qe),BZ=t=>Ma(t,sD,J3),$Z=t=>Ma(t,rD,Ax),MA=t=>Ma(t,eD,Ax),zZ=t=>Ma(t,tD,QZ),Yp=t=>Ma(t,oD,RZ),Ae=t=>K3.test(t),wu=t=>Rl(t,nD),NZ=t=>Rl(t,rD),PA=t=>Rl(t,eD),jZ=t=>Rl(t,iD),IZ=t=>Rl(t,tD),Hp=t=>Rl(t,oD,!0),VZ=t=>Rl(t,sD,!0),Ma=(t,e,i)=>{const n=G3.exec(t);return n?n[1]?e(n[1]):i(n[2]):!1},Rl=(t,e,i=!1)=>{const n=K3.exec(t);return n?n[1]?e(n[1]):i:!1},eD=t=>t==="position"||t==="percentage",tD=t=>t==="image"||t==="url",iD=t=>t==="length"||t==="size"||t==="bg-size",nD=t=>t==="length",XZ=t=>t==="number",rD=t=>t==="family-name",sD=t=>t==="number"||t==="weight",oD=t=>t==="shadow",ZZ=()=>{const t=pi("color"),e=pi("font"),i=pi("text"),n=pi("font-weight"),r=pi("tracking"),s=pi("leading"),o=pi("breakpoint"),l=pi("container"),c=pi("spacing"),u=pi("radius"),d=pi("shadow"),p=pi("inset-shadow"),g=pi("text-shadow"),O=pi("drop-shadow"),_=pi("blur"),b=pi("perspective"),x=pi("aspect"),w=pi("ease"),k=pi("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...A(),Ae,ke],E=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],z=()=>[Ae,ke,c],Z=()=>[Jo,"full","auto",...z()],J=()=>[ea,"none","subgrid",Ae,ke],U=()=>["auto",{span:["full",ea,Ae,ke]},ea,Ae,ke],R=()=>[ea,"auto",Ae,ke],B=()=>["auto","min","max","fr",Ae,ke],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...z()],X=()=>[Jo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],H=()=>[Jo,"screen","full","dvw","lvw","svw","min","max","fit",...z()],F=()=>[Jo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],M=()=>[t,Ae,ke],I=()=>[...A(),PA,MA,{position:[Ae,ke]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",jZ,DZ,{size:[Ae,ke]}],ue=()=>[v_,wu,Ja],he=()=>["","none","full",u,Ae,ke],fe=()=>["",qe,wu,Ja],Oe=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[qe,v_,PA,MA],nt=()=>["","none",_,Ae,ke],Qt=()=>["none",qe,Ae,ke],Yt=()=>["none",qe,Ae,ke],ei=()=>[qe,Ae,ke],Le=()=>[Jo,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[to],breakpoint:[to],color:[J3],container:[to],"drop-shadow":[to],ease:["in","out","in-out"],font:[LZ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[to],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[to],shadow:[to],spacing:["px",qe],text:[to],"text-shadow":[to],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jo,ke,Ae,x]}],container:["container"],columns:[{columns:[qe,ke,Ae,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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"],sr:["sr-only","not-sr-only"],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:L()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[ea,"auto",Ae,ke]}],basis:[{basis:[Jo,"full","auto",l,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Jo,"auto","initial","none",ke]}],grow:[{grow:["",qe,Ae,ke]}],shrink:[{shrink:["",qe,Ae,ke]}],order:[{order:[ea,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[l,"screen",...X()]}],"min-w":[{"min-w":[l,"screen","none",...X()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",i,wu,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,VZ,BZ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",v_,ke]}],"font-family":[{font:[NZ,$Z,e]}],"font-features":[{"font-features":[ke]}],"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:[r,Ae,ke]}],"line-clamp":[{"line-clamp":[qe,"none",Ae,EA]}],leading:[{leading:[s,...z()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Ae,Ja]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[qe,"auto",Ae,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ea,Ae,ke],radial:["",Ae,ke],conic:[ea,Ae,ke]},IZ,zZ]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Oe(),"hidden","none"]}],"divide-style":[{divide:[...Oe(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Ae,ke]}],"outline-w":[{outline:["",qe,wu,Ja]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,Hp,Yp]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,Hp,Yp]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[qe,Ja]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",g,Hp,Yp]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[qe,Ae,ke]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Ae,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:nt()}],brightness:[{brightness:[qe,Ae,ke]}],contrast:[{contrast:[qe,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",O,Hp,Yp]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",qe,Ae,ke]}],"hue-rotate":[{"hue-rotate":[qe,Ae,ke]}],invert:[{invert:["",qe,Ae,ke]}],saturate:[{saturate:[qe,Ae,ke]}],sepia:[{sepia:["",qe,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":nt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Ae,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Ae,ke]}],ease:[{ease:["linear","initial",w,Ae,ke]}],delay:[{delay:[qe,Ae,ke]}],animate:[{animate:["none",k,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ae,ke]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Qt()}],"rotate-x":[{"rotate-x":Qt()}],"rotate-y":[{"rotate-y":Qt()}],"rotate-z":[{"rotate-z":Qt()}],scale:[{scale:Yt()}],"scale-x":[{"scale-x":Yt()}],"scale-y":[{"scale-y":Yt()}],"scale-z":[{"scale-z":Yt()}],"scale-3d":["scale-3d"],skew:[{skew:ei()}],"skew-x":[{"skew-x":ei()}],"skew-y":[{"skew-y":ei()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Ae,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",Ae,ke]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[qe,wu,Ja,EA]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},qZ=xZ(ZZ);function Fe(...t){return qZ(iZ(t))}function WZ(t){const[e,i]=q.useState(null),[n,r]=q.useState(!1),[s,o]=q.useState(null),{lastChange:l}=sd(),c=q.useCallback(async()=>{if(!t){i(null),r(!1),o(null);return}r(!0),o(null);try{const u=await fetch(`/api/phase/${encodeURIComponent(t)}`);if(!u.ok){const p=await u.json().catch(()=>({}));throw new Error(p.error||`Failed to fetch phase ${t} (${u.status})`)}const d=await u.json();i(d)}catch(u){o(u instanceof Error?u.message:"Unknown error")}finally{r(!1)}},[t]);return q.useEffect(()=>{c()},[c]),q.useEffect(()=>{l>0&&c()},[l,c]),{plans:(e==null?void 0:e.plans)??[],context:(e==null?void 0:e.context)??null,research:(e==null?void 0:e.research)??null,loading:n,error:s,refetch:c}}function UZ({tasks:t,planPath:e,planContent:i,onContentChange:n}){const r=q.useCallback(async s=>{const o=t[s];if(!o)return;let l=i;const c=o.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(`<name>\\s*${c}\\s*</name>`).exec(l);if(d){const p=l.slice(d.index),g=p.match(/<done>([\s\S]*?)<\/done>/);if(g){const O=g[1],_=d.index+p.indexOf(g[0]),b=_+g[0].length,x=/^\s*\[x\]/i.test(O);let w;x?w=O.replace(/^\s*\[x\]\s*/i,""):w=`[x] ${O.trim()}`,l=l.slice(0,_)+`<done>${w}</done>`+l.slice(b)}}if(l!==i){n(l);try{const g=e.replace(/^\.planning[\\/]/,"").split(/[\\/]/);await fetch(`/api/plan/${g.join("/")}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:l})})}catch(p){console.error("[task-list] Failed to write checkbox change:",p)}}},[t,e,i,n]);return t.length===0?S.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No tasks defined"}):S.jsx("div",{className:"space-y-1",children:t.map((s,o)=>S.jsxs("div",{className:Fe("flex items-start gap-2 py-1 px-2 rounded-md transition-colors","hover:bg-muted/50",s.completed&&"opacity-60"),children:[S.jsx("button",{type:"button",onClick:()=>r(o),className:Fe("mt-0.5 flex-shrink-0 w-4 h-4 rounded-sm border transition-colors","focus:outline-none focus:ring-2 focus:ring-accent/50",s.completed?"bg-success border-success text-background":"border-muted-foreground hover:border-accent"),"aria-label":`Toggle ${s.name}`,children:s.completed&&S.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M3 8l3 3 7-7"})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:Fe("text-sm font-sans",s.completed&&"line-through text-muted-foreground"),children:s.name}),S.jsx("span",{className:Fe("text-xs px-1.5 py-0.5 rounded-sm font-mono",s.type.startsWith("checkpoint")?"bg-warning/20 text-warning":"bg-muted text-muted-foreground"),children:s.type})]}),s.files.length>0&&S.jsx("div",{className:"mt-0.5",children:s.files.map((l,c)=>S.jsx("span",{className:"text-xs font-mono text-muted-foreground mr-2",children:l},c))})]})]},o))})}function YZ({plan:t,onEdit:e}){const[i,n]=q.useState(t.content),r=t.frontmatter,s=r.plan??"?",o=r.wave,l=r.autonomous,c=r.depends_on??[],u=r.files_modified??[];let d="";const p=t.content.match(/<objective>([\s\S]*?)<\/objective>/);if(p){const _=p[1].trim().split(`
|
|
58
|
+
`)[0];d=_.length>120?_.slice(0,117)+"...":_}const g=q.useCallback(O=>{n(O)},[]);return S.jsxs("div",{className:"border border-border bg-card transition-colors hover:bg-card-hover",children:[S.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("span",{className:"font-mono text-sm font-bold text-accent tabular-nums",children:["#",String(s).padStart(2,"0")]}),o!==void 0&&S.jsxs("span",{className:"font-mono text-[9px] uppercase tracking-widest px-1.5 py-0.5 border border-accent/20 text-accent/70",children:["Wave ",o]}),l&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-1.5 py-0.5 border border-success/20 text-success",children:"Auto"})]}),S.jsx("button",{type:"button",onClick:()=>e(t.path),className:Fe("font-mono text-[10px] uppercase tracking-widest px-3 py-1","border border-border text-muted-foreground","hover:border-accent hover:text-accent","transition-colors"),children:"Edit"})]}),S.jsxs("div",{className:"px-4 py-3",children:[d&&S.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed",children:d}),S.jsxs("div",{className:"flex gap-4 mb-3 font-mono text-[10px] text-muted-foreground",children:[c.length>0&&S.jsxs("span",{children:["deps: ",c.join(", ")]}),u.length>0&&S.jsxs("span",{children:[u.length," file",u.length!==1?"s":""]}),S.jsxs("span",{children:[t.tasks.length," task",t.tasks.length!==1?"s":""]})]}),S.jsx(UZ,{tasks:t.tasks,planPath:t.path,planContent:i,onContentChange:g})]})]})}function X1(){return X1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},X1.apply(null,arguments)}function HZ(t,e){if(t==null)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;i[n]=t[n]}return i}let Z1=[],aD=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,i=0;e<t.length;e++)(e%2?aD:Z1).push(i=i+t[e])})();function FZ(t){if(t<768)return!1;for(let e=0,i=Z1.length;;){let n=e+i>>1;if(t<Z1[n])i=n;else if(t>=aD[n])e=n+1;else return!0;if(e==i)return!1}}function RA(t){return t>=127462&&t<=127487}const QA=8205;function GZ(t,e,i=!0,n=!0){return(i?lD:KZ)(t,e,n)}function lD(t,e,i){if(e==t.length)return e;e&&cD(t.charCodeAt(e))&&hD(t.charCodeAt(e-1))&&e--;let n=__(t,e);for(e+=LA(n);e<t.length;){let r=__(t,e);if(n==QA||r==QA||i&&FZ(r))e+=LA(r),n=r;else if(RA(r)){let s=0,o=e-2;for(;o>=0&&RA(__(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function KZ(t,e,i){for(;e>0;){let n=lD(t,e-2,i);if(n<e)return n;e--}return 0}function __(t,e){let i=t.charCodeAt(e);if(!hD(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return cD(n)?(i-55296<<10)+(n-56320)+65536:i}function cD(t){return t>=56320&&t<57344}function hD(t){return t>=55296&&t<56320}function LA(t){return t<65536?1:2}let at=class uD{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,i,n){[e,i]=nh(this,e,i);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(i,this.length,r,1),ms.from(r,this.length-(i-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=nh(this,e,i);let n=[];return this.decompose(e,i,n,0),ms.from(n,i-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let i=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new uf(this),s=new uf(e);for(let o=i,l=i;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new uf(this,e)}iterRange(e,i=this.length){return new fD(this,e,i)}iterLines(e,i){let n;if(e==null)n=this.iter();else{i==null&&(i=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new dD(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?uD.empty:e.length<=32?new Kt(e):ms.from(Kt.split(e,[]))}};class Kt extends at{constructor(e,i=JZ(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((i?n:l)>=e)return new eq(r,l,n,o);r=l+1,n++}}decompose(e,i,n,r){let s=e<=0&&i>=this.length?this:new Kt(DA(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=Im(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new Kt(l,o.length+s.length));else{let c=l.length>>1;n.push(new Kt(l.slice(0,c)),new Kt(l.slice(c)))}}else n.push(s)}replace(e,i,n){if(!(n instanceof Kt))return super.replace(e,i,n);[e,i]=nh(this,e,i);let r=Im(this.text,Im(n.text,DA(this.text,0,e)),i),s=this.length+n.length-(i-e);return r.length<=32?new Kt(r,s):ms.from(Kt.split(r,[]),s)}sliceString(e,i=this.length,n=`
|
|
59
|
+
`){[e,i]=nh(this,e,i);let r="";for(let s=0,o=0;s<=i&&o<this.text.length;o++){let l=this.text[o],c=s+l.length;s>e&&o&&(r+=n),e<c&&i>s&&(r+=l.slice(Math.max(0,e-s),i-s)),s=c+1}return r}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(i.push(new Kt(n,r)),n=[],r=-1);return r>-1&&i.push(new Kt(n,r)),i}}class ms extends at{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,i,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,c=n+o.lines-1;if((i?c:l)>=e)return o.lineInner(e,i,n,r);r=l+1,n=c+1}}decompose(e,i,n,r){for(let s=0,o=0;o<=i&&s<this.children.length;s++){let l=this.children[s],c=o+l.length;if(e<=c&&i>=o){let u=r&((o<=e?1:0)|(c>=i?2:0));o>=e&&c<=i&&!u?n.push(l):l.decompose(e-o,i-o,n,u)}o=c+1}}replace(e,i,n){if([e,i]=nh(this,e,i),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&i<=l){let c=o.replace(e-s,i-s,n),u=this.lines-o.lines+c.lines;if(c.lines<u>>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new ms(d,this.length-(i-e)+n.length)}return super.replace(s,l,c)}s=l+1}return super.replace(e,i,n)}sliceString(e,i=this.length,n=`
|
|
60
|
+
`){[e,i]=nh(this,e,i);let r="";for(let s=0,o=0;s<this.children.length&&o<=i;s++){let l=this.children[s],c=o+l.length;o>e&&s&&(r+=n),e<c&&i>o&&(r+=l.sliceString(e-o,i-o,n)),o=c+1}return r}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof ms))return 0;let n=0,[r,s,o,l]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=i,s+=i){if(r==o||s==l)return n;let c=this.children[r],u=e.children[s];if(c!=u)return n+c.scanIdentical(u,i);n+=c.length+1}}static from(e,i=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let O of e)n+=O.lines;if(n<32){let O=[];for(let _ of e)_.flatten(O);return new Kt(O,i)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function p(O){let _;if(O.lines>s&&O instanceof ms)for(let b of O.children)p(b);else O.lines>o&&(c>o||!c)?(g(),l.push(O)):O instanceof Kt&&c&&(_=d[d.length-1])instanceof Kt&&O.lines+_.lines<=32?(c+=O.lines,u+=O.length+1,d[d.length-1]=new Kt(_.text.concat(O.text),_.length+1+O.length)):(c+O.lines>r&&g(),c+=O.lines,u+=O.length+1,d.push(O))}function g(){c!=0&&(l.push(d.length==1?d[0]:ms.from(d,u)),u=-1,c=d.length=0)}for(let O of e)p(O);return g(),l.length==1?l[0]:new ms(l,i)}}at.empty=new Kt([""],0);function JZ(t){let e=-1;for(let i of t)e+=i.length+1;return e}function Im(t,e,i=0,n=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=n;s++){let l=t[s],c=r+l.length;c>=i&&(c>n&&(l=l.slice(0,n-r)),r<i&&(l=l.slice(i-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=c+1}return e}function DA(t,e,i){return Im(t,[""],e,i)}class uf{constructor(e,i=1){this.dir=i,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[i>0?1:(e instanceof Kt?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof Kt?r.text.length:r.children.length;if(o==(i>0?l:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=`
|
|
61
|
+
`,this;e--}else if(r instanceof Kt){let c=r.text[o+(i<0?-1:0)];if(this.offsets[n]+=i,c.length>Math.max(0,e))return this.value=e==0?c:i>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=r.children[o+(i<0?-1:0)];e>c.length?(e-=c.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(c),this.offsets.push(i>0?1:(c instanceof Kt?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class fD{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new uf(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*i,this.value=r.length<=n?r:i<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class dD{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:r}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(at.prototype[Symbol.iterator]=function(){return this.iter()},uf.prototype[Symbol.iterator]=fD.prototype[Symbol.iterator]=dD.prototype[Symbol.iterator]=function(){return this});let eq=class{constructor(e,i,n,r){this.from=e,this.to=i,this.number=n,this.text=r}get length(){return this.to-this.from}};function nh(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function Di(t,e,i=!0,n=!0){return GZ(t,e,i,n)}function tq(t){return t>=56320&&t<57344}function iq(t){return t>=55296&&t<56320}function Ln(t,e){let i=t.charCodeAt(e);if(!iq(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return tq(n)?(i-55296<<10)+(n-56320)+65536:i}function Ex(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function gs(t){return t<65536?1:2}const q1=/\r\n?|\n/;var Fi=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Fi||(Fi={}));class Cs{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;i<this.sections.length;i+=2)e+=this.sections[i];return e}get newLength(){let e=0;for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i+1];e+=n<0?this.sections[i]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,n=0,r=0;i<this.sections.length;){let s=this.sections[i++],o=this.sections[i++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,i=!1){W1(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];r<0?e.push(n,r):e.push(r,n)}return new Cs(e)}composeDesc(e){return this.empty?e:e.empty?this:pD(this,e)}mapDesc(e,i=!1){return e.empty?this:U1(this,e,i)}mapPos(e,i=-1,n=Fi.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],c=this.sections[o++],u=r+l;if(c<0){if(u>e)return s+(e-r);s+=l}else{if(n!=Fi.Simple&&u>=e&&(n==Fi.TrackDel&&r<e&&u>e||n==Fi.TrackBefore&&r<e||n==Fi.TrackAfter&&u>e))return null;if(u>e||u==e&&i<0&&!l)return e==r||i<0?s:s+c;s+=c}r=u}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,i=e){for(let n=0,r=0;n<this.sections.length&&r<=i;){let s=this.sections[n++],o=this.sections[n++],l=r+s;if(o>=0&&r<=i&&l>=e)return r<e&&l>i?"cover":!0;r=l}return!1}toString(){let e="";for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Cs(e)}static create(e){return new Cs(e)}}class vi extends Cs{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return W1(this,(i,n,r,s,o)=>e=e.replace(r,r+(n-i),o),!1),e}mapDesc(e,i=!1){return U1(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let r=0,s=0;r<i.length;r+=2){let o=i[r],l=i[r+1];if(l>=0){i[r]=l,i[r+1]=o;let c=r>>1;for(;n.length<c;)n.push(at.empty);n.push(o?e.slice(s,s+o):at.empty)}s+=o}return new vi(i,n)}compose(e){return this.empty?e:e.empty?this:pD(this,e,!0)}map(e,i=!1){return e.empty?this:U1(this,e,i,!0)}iterChanges(e,i=!1){W1(this,e,i)}get desc(){return Cs.create(this.sections)}filter(e){let i=[],n=[],r=[],s=new Ef(this);e:for(let o=0,l=0;;){let c=o==e.length?1e9:e[o++];for(;l<c||l==c&&s.len==0;){if(s.done)break e;let d=Math.min(s.len,c-l);tn(r,d,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;tn(i,d,p),p>0&&Oa(n,i,s.text),s.forward(d),l+=d}let u=e[o++];for(;l<u;){if(s.done)break e;let d=Math.min(s.len,u-l);tn(i,d,-1),tn(r,d,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(d),l+=d}}return{changes:new vi(i,n),filtered:Cs.create(r)}}toJSON(){let e=[];for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i],r=this.sections[i+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[i>>1].toJSON()))}return e}static of(e,i,n){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;o<i&&tn(r,i-o,-1);let p=new vi(r,s);l=l?l.compose(p.map(l)):p,r=[],s=[],o=0}function u(d){if(Array.isArray(d))for(let p of d)u(p);else if(d instanceof vi){if(d.length!=i)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${i})`);c(),l=l?l.compose(d.map(l)):d}else{let{from:p,to:g=p,insert:O}=d;if(p>g||p<0||g>i)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${i})`);let _=O?typeof O=="string"?at.of(O.split(n||q1)):O:at.empty,b=_.length;if(p==g&&b==0)return;p<o&&c(),p>o&&tn(r,p-o,-1),tn(r,g-p,b),Oa(s,r,_),o=g}}return u(e),c(!l),l}static empty(e){return new vi(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let i=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")i.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)i.push(s[0],0);else{for(;n.length<r;)n.push(at.empty);n[r]=at.of(s.slice(1)),i.push(s[0],n[r].length)}}}return new vi(i,n)}static createSet(e,i){return new vi(e,i)}}function tn(t,e,i,n=!1){if(e==0&&i<=0)return;let r=t.length-2;r>=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=i:n?(t[r]+=e,t[r+1]+=i):t.push(e,i)}function Oa(t,e,i){if(i.length==0)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(at.empty);t.push(i)}}function W1(t,e,i){let n=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],c=t.sections[o++];if(c<0)r+=l,s+=l;else{let u=r,d=s,p=at.empty;for(;u+=l,d+=c,c&&n&&(p=p.append(n[o-2>>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],c=t.sections[o++];e(r,u,s,d,p),r=u,s=d}}}function U1(t,e,i,n=!1){let r=[],s=n?[]:null,o=new Ef(t),l=new Ef(e);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);tn(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!i))){let u=l.len;for(tn(r,l.ins,-1);u;){let d=Math.min(o.len,u);o.ins>=0&&c<o.i&&o.len<=d&&(tn(r,0,o.ins),s&&Oa(s,r,o.text),c=o.i),o.forward(d),u-=d}l.next()}else if(o.ins>=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let p=Math.min(d,l.len);u+=p,d-=p,l.forward(p)}else if(l.ins==0&&l.len<d)d-=l.len,l.next();else break;tn(r,u,c<o.i?o.ins:0),s&&c<o.i&&Oa(s,r,o.text),c=o.i,o.forward(o.len-d)}else{if(o.done&&l.done)return s?vi.createSet(r,s):Cs.create(r);throw new Error("Mismatched change set lengths")}}}function pD(t,e,i=!1){let n=[],r=i?[]:null,s=new Ef(t),o=new Ef(e);for(let l=!1;;){if(s.done&&o.done)return r?vi.createSet(n,r):Cs.create(n);if(s.ins==0)tn(n,s.len,0,l),s.next();else if(o.len==0&&!o.done)tn(n,0,o.ins,l),r&&Oa(r,n,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let c=Math.min(s.len2,o.len),u=n.length;if(s.ins==-1){let d=o.ins==-1?-1:o.off?0:o.ins;tn(n,c,d,l),r&&d&&Oa(r,n,o.text)}else o.ins==-1?(tn(n,s.off?0:s.len,c,l),r&&Oa(r,n,s.textBit(c))):(tn(n,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&Oa(r,n,o.text));l=(s.ins>c||o.ins>=0&&o.len>c)&&(l||n.length>u),s.forward2(c),o.forward(c)}}}}class Ef{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length?at.empty:e[i]}textBit(e){let{inserted:i}=this.set,n=this.i-2>>1;return n>=i.length&&!e?at.empty:i[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class pl{constructor(e,i,n){this.from=e,this.to=i,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,i=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,i):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new pl(n,r,this.flags)}extend(e,i=e){if(e<=this.anchor&&i>=this.anchor)return se.range(e,i);let n=Math.abs(e-this.anchor)>Math.abs(i-this.anchor)?e:i;return se.range(this.anchor,n)}eq(e,i=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!i||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return se.range(e.anchor,e.head)}static create(e,i,n){return new pl(e,i,n)}}class se{constructor(e,i){this.ranges=e,this.mainIndex=i}map(e,i=-1){return e.empty?this:se.create(this.ranges.map(n=>n.map(e,i)),this.mainIndex)}eq(e,i=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],i))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new se([this.main],0)}addRange(e,i=!0){return se.create([e].concat(this.ranges),i?0:this.mainIndex+1)}replaceRange(e,i=this.mainIndex){let n=this.ranges.slice();return n[i]=e,se.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new se(e.ranges.map(i=>pl.fromJSON(i)),e.main)}static single(e,i=e){return new se([se.range(e,i)],0)}static create(e,i=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=n:s.from<n)return se.normalized(e.slice(),i);n=s.to}return new se(e,i)}static cursor(e,i=0,n,r){return pl.create(e,e,(i==0?0:i<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,i,n,r){let s=(n??16777215)<<6|(r==null?7:Math.min(6,r));return i<e?pl.create(i,e,48|s):pl.create(e,i,(i>e?8:0)|s)}static normalized(e,i=0){let n=e[i];e.sort((r,s)=>r.from-s.from),i=e.indexOf(n);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,c=Math.max(s.to,o.to);r<=i&&i--,e.splice(--r,2,s.anchor>s.head?se.range(c,l):se.range(l,c))}}return new se(e,i)}}function mD(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let Mx=0;class Se{constructor(e,i,n,r,s){this.combine=e,this.compareInput=i,this.compare=n,this.isStatic=r,this.id=Mx++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Se(e.combine||(i=>i),e.compareInput||((i,n)=>i===n),e.compare||(e.combine?(i,n)=>i===n:Px),!!e.static,e.enables)}of(e){return new Vm([],this,0,e)}compute(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vm(e,this,1,i)}computeN(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vm(e,this,2,i)}from(e,i){return i||(i=n=>n),this.compute([e],n=>i(n.field(e)))}}function Px(t,e){return t==e||t.length==e.length&&t.every((i,n)=>i===e[n])}class Vm{constructor(e,i,n,r){this.dependencies=e,this.facet=i,this.type=n,this.value=r,this.id=Mx++}dynamicSlot(e){var i;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let p of this.dependencies)p=="doc"?c=!0:p=="selection"?u=!0:(((i=e[p.id])!==null&&i!==void 0?i:1)&1)==0&&d.push(e[p.id]);return{create(p){return p.values[o]=n(p),1},update(p,g){if(c&&g.docChanged||u&&(g.docChanged||g.selection)||Y1(p,d)){let O=n(p);if(l?!BA(O,p.values[o],r):!r(O,p.values[o]))return p.values[o]=O,1}return 0},reconfigure:(p,g)=>{let O,_=g.config.address[s];if(_!=null){let b=yg(g,_);if(this.dependencies.every(x=>x instanceof Se?g.facet(x)===p.facet(x):x instanceof Bi?g.field(x,!1)==p.field(x,!1):!0)||(l?BA(O=n(p),b,r):r(O=n(p),b)))return p.values[o]=b,0}else O=n(p);return p.values[o]=O,1}}}}function BA(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function Y1(t,e){let i=!1;for(let n of e)ff(t,n)&1&&(i=!0);return i}function nq(t,e,i){let n=i.map(c=>t[c.id]),r=i.map(c=>c.type),s=n.filter(c=>!(c&1)),o=t[e.id]>>1;function l(c){let u=[];for(let d=0;d<n.length;d++){let p=yg(c,n[d]);if(r[d]==2)for(let g of p)u.push(g);else u.push(p)}return e.combine(u)}return{create(c){for(let u of n)ff(c,u);return c.values[o]=l(c),1},update(c,u){if(!Y1(c,s))return 0;let d=l(c);return e.compare(d,c.values[o])?0:(c.values[o]=d,1)},reconfigure(c,u){let d=Y1(c,n),p=u.config.facets[e.id],g=u.facet(e);if(p&&!d&&Px(i,p))return c.values[o]=g,0;let O=l(c);return e.compare(O,g)?(c.values[o]=g,0):(c.values[o]=O,1)}}}const Fp=Se.define({static:!0});class Bi{constructor(e,i,n,r,s){this.id=e,this.createF=i,this.updateF=n,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let i=new Bi(Mx++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(i.provides=e.provide(i)),i}create(e){let i=e.facet(Fp).find(n=>n.field==this);return((i==null?void 0:i.create)||this.createF)(e)}slot(e){let i=e[this.id]>>1;return{create:n=>(n.values[i]=this.create(n),1),update:(n,r)=>{let s=n.values[i],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[i]=o,1)},reconfigure:(n,r)=>{let s=n.facet(Fp),o=r.facet(Fp),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(n.values[i]=l.create(n),1):r.config.address[this.id]!=null?(n.values[i]=r.field(this),0):(n.values[i]=this.create(n),1)}}}init(e){return[this,Fp.of({field:this,create:e})]}get extension(){return this}}const cl={lowest:4,low:3,default:2,high:1,highest:0};function Cu(t){return e=>new gD(e,t)}const So={highest:Cu(cl.highest),high:Cu(cl.high),default:Cu(cl.default),low:Cu(cl.low),lowest:Cu(cl.lowest)};class gD{constructor(e,i){this.inner=e,this.prec=i}}class uO{of(e){return new H1(this,e)}reconfigure(e){return uO.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class H1{constructor(e,i){this.compartment=e,this.inner=i}}class _g{constructor(e,i,n,r,s,o){for(this.base=e,this.compartments=i,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let i=this.address[e.id];return i==null?e.default:this.staticValues[i>>1]}static resolve(e,i,n){let r=[],s=Object.create(null),o=new Map;for(let g of rq(e,i,o))g instanceof Bi?r.push(g):(s[g.facet.id]||(s[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],u=[];for(let g of r)l[g.id]=u.length<<1,u.push(O=>g.slot(O));let d=n==null?void 0:n.config.facets;for(let g in s){let O=s[g],_=O[0].facet,b=d&&d[g]||[];if(O.every(x=>x.type==0))if(l[_.id]=c.length<<1|1,Px(b,O))c.push(n.facet(_));else{let x=_.combine(O.map(w=>w.value));c.push(n&&_.compare(x,n.facet(_))?n.facet(_):x)}else{for(let x of O)x.type==0?(l[x.id]=c.length<<1|1,c.push(x.value)):(l[x.id]=u.length<<1,u.push(w=>x.dynamicSlot(w)));l[_.id]=u.length<<1,u.push(x=>nq(x,_,O))}}let p=u.map(g=>g(l));return new _g(e,o,p,l,c,s)}}function rq(t,e,i){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=n[c].indexOf(o);u>-1&&n[c].splice(u,1),o instanceof H1&&i.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof H1){if(i.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;i.set(o.compartment,u),s(u,l)}else if(o instanceof gD)s(o.inner,o.prec);else if(o instanceof Bi)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Vm)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,cl.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(t,cl.default),n.reduce((o,l)=>o.concat(l))}function ff(t,e){if(e&1)return 2;let i=e>>1,n=t.status[i];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[i]=4;let r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r}function yg(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const OD=Se.define(),F1=Se.define({combine:t=>t.some(e=>e),static:!0}),vD=Se.define({combine:t=>t.length?t[0]:void 0,static:!0}),_D=Se.define(),yD=Se.define(),bD=Se.define(),SD=Se.define({combine:t=>t.length?t[0]:!1});class Rs{constructor(e,i){this.type=e,this.value=i}static define(){return new sq}}class sq{of(e){return new Rs(this,e)}}class oq{constructor(e){this.map=e}of(e){return new ze(this,e)}}class ze{constructor(e,i){this.type=e,this.value=i}map(e){let i=this.type.map(this.value,e);return i===void 0?void 0:i==this.value?this:new ze(this.type,i)}is(e){return this.type==e}static define(e={}){return new oq(e.map||(i=>i))}static mapEffects(e,i){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(i);s&&n.push(s)}return n}}ze.reconfigure=ze.define();ze.appendConfig=ze.define();class hi{constructor(e,i,n,r,s,o){this.startState=e,this.changes=i,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&mD(n,i.newLength),s.some(l=>l.type==hi.time)||(this.annotations=s.concat(hi.time.of(Date.now())))}static create(e,i,n,r,s,o){return new hi(e,i,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let i of this.annotations)if(i.type==e)return i.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let i=this.annotation(hi.userEvent);return!!(i&&(i==e||i.length>e.length&&i.slice(0,e.length)==e&&i[e.length]=="."))}}hi.time=Rs.define();hi.userEvent=Rs.define();hi.addToHistory=Rs.define();hi.remote=Rs.define();function aq(t,e){let i=[];for(let n=0,r=0;;){let s,o;if(n<t.length&&(r==e.length||e[r]>=t[n]))s=t[n++],o=t[n++];else if(r<e.length)s=e[r++],o=e[r++];else return i;!i.length||i[i.length-1]<s?i.push(s,o):i[i.length-1]<o&&(i[i.length-1]=o)}}function xD(t,e,i){var n;let r,s,o;return i?(r=e.changes,s=vi.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(n=t.selection)===null||n===void 0?void 0:n.map(r),effects:ze.mapEffects(t.effects,r).concat(ze.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function G1(t,e,i){let n=e.selection,r=qc(e.annotations);return e.userEvent&&(r=r.concat(hi.userEvent.of(e.userEvent))),{changes:e.changes instanceof vi?e.changes:vi.of(e.changes||[],i,t.facet(vD)),selection:n&&(n instanceof se?n:se.single(n.anchor,n.head)),effects:qc(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function wD(t,e,i){let n=G1(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(i=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(i=!1);let o=!!e[s].sequential;n=xD(n,G1(t,e[s],o?n.changes.newLength:t.doc.length),o)}let r=hi.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return cq(i?lq(r):r)}function lq(t){let e=t.startState,i=!0;for(let r of e.facet(_D)){let s=r(t);if(s===!1){i=!1;break}Array.isArray(s)&&(i=i===!0?s:aq(i,s))}if(i!==!0){let r,s;if(i===!1)s=t.changes.invertedDesc,r=vi.empty(e.doc.length);else{let o=t.changes.filter(i);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=hi.create(e,r,t.selection&&t.selection.map(s),ze.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let n=e.facet(yD);for(let r=n.length-1;r>=0;r--){let s=n[r](t);s instanceof hi?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof hi?t=s[0]:t=wD(e,qc(s),!1)}return t}function cq(t){let e=t.startState,i=e.facet(bD),n=t;for(let r=i.length-1;r>=0;r--){let s=i[r](t);s&&Object.keys(s).length&&(n=xD(n,G1(e,s,t.changes.newLength),!0))}return n==t?t:hi.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const hq=[];function qc(t){return t==null?hq:Array.isArray(t)?t:[t]}var Dt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Dt||(Dt={}));const uq=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let K1;try{K1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function fq(t){if(K1)return K1.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>""&&(i.toUpperCase()!=i.toLowerCase()||uq.test(i)))return!0}return!1}function dq(t){return e=>{if(!/\S/.test(e))return Dt.Space;if(fq(e))return Dt.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return Dt.Word;return Dt.Other}}class et{constructor(e,i,n,r,s,o){this.config=e,this.doc=i,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)ff(this,l<<1);this.computeSlot=null}field(e,i=!0){let n=this.config.address[e.id];if(n==null){if(i)throw new RangeError("Field is not present in this state");return}return ff(this,n),yg(this,n)}update(...e){return wD(this,e,!0)}applyTransaction(e){let i=this.config,{base:n,compartments:r}=i;for(let l of e.effects)l.is(uO.reconfigure)?(i&&(r=new Map,i.compartments.forEach((c,u)=>r.set(u,c)),i=null),r.set(l.value.compartment,l.value.extension)):l.is(ze.reconfigure)?(i=null,n=l.value):l.is(ze.appendConfig)&&(i=null,n=qc(n).concat(l.value));let s;i?s=e.startState.values.slice():(i=_g.resolve(n,r,this),s=new et(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=e.startState.facet(F1)?e.newSelection:e.newSelection.asSingle();new et(i,e.newDoc,o,s,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:e},range:se.cursor(i.from+e.length)}))}changeByRange(e){let i=this.selection,n=e(i.ranges[0]),r=this.changes(n.changes),s=[n.range],o=qc(n.effects);for(let l=1;l<i.ranges.length;l++){let c=e(i.ranges[l]),u=this.changes(c.changes),d=u.map(r);for(let g=0;g<l;g++)s[g]=s[g].map(d);let p=r.mapDesc(u,!0);s.push(c.range.map(p)),r=r.compose(d),o=ze.mapEffects(o,d).concat(ze.mapEffects(qc(c.effects),p))}return{changes:r,selection:se.create(s,i.mainIndex),effects:o}}changes(e=[]){return e instanceof vi?e:vi.of(e,this.doc.length,this.facet(et.lineSeparator))}toText(e){return at.of(e.split(this.facet(et.lineSeparator)||q1))}sliceDoc(e=0,i=this.doc.length){return this.doc.sliceString(e,i,this.lineBreak)}facet(e){let i=this.config.address[e.id];return i==null?e.default:(ff(this,i),yg(this,i))}toJSON(e){let i={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Bi&&this.config.address[r.id]!=null&&(i[n]=r.spec.toJSON(this.field(e[n]),this))}return i}static fromJSON(e,i={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let o=n[s],l=e[s];r.push(o.init(c=>o.spec.fromJSON(l,c)))}}return et.create({doc:e.doc,selection:se.fromJSON(e.selection),extensions:i.extensions?r.concat([i.extensions]):r})}static create(e={}){let i=_g.resolve(e.extensions||[],new Map),n=e.doc instanceof at?e.doc:at.of((e.doc||"").split(i.staticFacet(et.lineSeparator)||q1)),r=e.selection?e.selection instanceof se?e.selection:se.single(e.selection.anchor,e.selection.head):se.single(0);return mD(r,n.length),i.staticFacet(F1)||(r=r.asSingle()),new et(i,n,r,i.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(et.tabSize)}get lineBreak(){return this.facet(et.lineSeparator)||`
|
|
62
|
+
`}get readOnly(){return this.facet(SD)}phrase(e,...i){for(let n of this.facet(et.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>i.length?n:i[s-1]})),e}languageDataAt(e,i,n=-1){let r=[];for(let s of this.facet(OD))for(let o of s(this,i,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let i=this.languageDataAt("wordChars",e);return dq(i.length?i[0]:"")}wordAt(e){let{text:i,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let c=Di(i,o,!1);if(s(i.slice(c,o))!=Dt.Word)break;o=c}for(;l<r;){let c=Di(i,l);if(s(i.slice(l,c))!=Dt.Word)break;l=c}return o==l?null:se.range(o+n,l+n)}}et.allowMultipleSelections=F1;et.tabSize=Se.define({combine:t=>t.length?t[0]:4});et.lineSeparator=vD;et.readOnly=SD;et.phrases=Se.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(r=>t[r]==e[r])}});et.languageData=OD;et.changeFilter=_D;et.transactionFilter=yD;et.transactionExtender=bD;uO.reconfigure=ze.define();function Qs(t,e,i={}){let n={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(i,s))n[s]=i[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class Sa{eq(e){return this==e}range(e,i=e){return J1.create(e,i,this)}}Sa.prototype.startSide=Sa.prototype.endSide=0;Sa.prototype.point=!1;Sa.prototype.mapMode=Fi.TrackDel;function Rx(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let J1=class CD{constructor(e,i,n){this.from=e,this.to=i,this.value=n}static create(e,i,n){return new CD(e,i,n)}};function eb(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Qx{constructor(e,i,n,r){this.from=e,this.to=i,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,i,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-e||(n?this.value[c].endSide:this.value[c].startSide)-i;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(e,i,n,r){for(let s=this.findIndex(i,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,i){let n=[],r=[],s=[],o=-1,l=-1;for(let c=0;c<this.value.length;c++){let u=this.value[c],d=this.from[c]+e,p=this.to[c]+e,g,O;if(d==p){let _=i.mapPos(d,u.startSide,u.mapMode);if(_==null||(g=O=_,u.startSide!=u.endSide&&(O=i.mapPos(d,u.endSide),O<g)))continue}else if(g=i.mapPos(d,u.startSide),O=i.mapPos(p,u.endSide),g>O||g==O&&u.startSide>0&&u.endSide<=0)continue;(O-g||u.endSide-u.startSide)<0||(o<0&&(o=g),u.point&&(l=Math.max(l,O-g)),n.push(u),r.push(g-o),s.push(O-o))}return{mapped:n.length?new Qx(r,s,n,l):null,pos:o}}}class Ge{constructor(e,i,n,r){this.chunkPos=e,this.chunk=i,this.nextLayer=n,this.maxPoint=r}static create(e,i,n,r){return new Ge(e,i,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let i of this.chunk)e+=i.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:i=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(i.length==0&&!o)return this;if(n&&(i=i.slice().sort(eb)),this.isEmpty)return i.length?Ge.of(i):this;let l=new kD(this,null,-1).goto(0),c=0,u=[],d=new _o;for(;l.value||c<i.length;)if(c<i.length&&(l.from-i[c].from||l.startSide-i[c].value.startSide)>=0){let p=i[c++];d.addInner(p.from,p.to,p.value)||u.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(c==i.length||this.chunkEnd(l.chunkIndex)<i[c].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&d.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(d.addInner(l.from,l.to,l.value)||u.push(J1.create(l.from,l.to,l.value))),l.next());return d.finishInner(this.nextLayer.isEmpty&&!u.length?Ge.empty:this.nextLayer.update({add:u,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let i=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],c=this.chunk[o],u=e.touchesRange(l,l+c.length);if(u===!1)r=Math.max(r,c.maxPoint),i.push(c),n.push(e.mapPos(l));else if(u===!0){let{mapped:d,pos:p}=c.map(l,e);d&&(r=Math.max(r,d.maxPoint),i.push(d),n.push(p))}}let s=this.nextLayer.map(e);return i.length==0?s:new Ge(n,i,s||Ge.empty,r)}between(e,i,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(i>=s&&e<=s+o.length&&o.between(s,e-s,i-s,n)===!1)return}this.nextLayer.between(e,i,n)}}iter(e=0){return Mf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return Mf.from(e).goto(i)}static compare(e,i,n,r,s=-1){let o=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),l=i.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),c=$A(o,l,n),u=new ku(o,c,s),d=new ku(l,c,s);n.iterGaps((p,g,O)=>zA(u,p,d,g,O,r)),n.empty&&n.length==0&&zA(u,0,d,0,0,r)}static eq(e,i,n=0,r){r==null&&(r=999999999);let s=e.filter(d=>!d.isEmpty&&i.indexOf(d)<0),o=i.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=$A(s,o),c=new ku(s,l,0).goto(n),u=new ku(o,l,0).goto(n);for(;;){if(c.to!=u.to||!tb(c.active,u.active)||c.point&&(!u.point||!Rx(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(e,i,n,r,s=-1){let o=new ku(e,null,s).goto(i),l=i,c=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let d=o.activeForPoint(o.to),p=o.pointFrom<i?d.length+1:o.point.startSide<0?d.length:Math.min(d.length,c);r.point(l,u,o.point,d,p,o.pointRank),c=Math.min(o.openEnd(u),d.length)}else u>l&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>n)return c+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,i=!1){let n=new _o;for(let r of e instanceof J1?[e]:i?pq(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return Ge.empty;let i=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=Ge.empty;r=r.nextLayer)i=new Ge(r.chunkPos,r.chunk,i,Math.max(r.maxPoint,i.maxPoint));return i}}Ge.empty=new Ge([],[],null,-1);function pq(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let n=t[i];if(eb(e,n)>0)return t.slice().sort(eb);e=n}return t}Ge.empty.nextLayer=Ge.empty;class _o{finishChunk(e){this.chunks.push(new Qx(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,i,n){this.addInner(e,i,n)||(this.nextLayer||(this.nextLayer=new _o)).add(e,i,n)}addInner(e,i,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(i-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=i,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,i-e)),!0)}addChunk(e,i){if((e-this.lastTo||i.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,i.maxPoint),this.chunks.push(i),this.chunkPos.push(e);let n=i.value.length-1;return this.last=i.value[n],this.lastFrom=i.from[n]+e,this.lastTo=i.to[n]+e,!0}finish(){return this.finishInner(Ge.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let i=Ge.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,i}}function $A(t,e,i){let n=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&n.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=n.get(s.chunk[o]);l!=null&&(i?i.mapPos(l):l)==s.chunkPos[o]&&!(i!=null&&i.touchesRange(l,l+s.chunk[o].length))&&r.add(s.chunk[o])}return r}class kD{constructor(e,i,n,r=0){this.layer=e,this.skip=i,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,i=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,i,!1),this}gotoInner(e,i,n){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],i,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,i){(this.to-e||this.endSide-i)<0&&this.gotoInner(e,i,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],i=this.layer.chunk[this.chunkIndex],n=e+i.from[this.rangeIndex];if(this.from=n,this.to=e+i.to[this.rangeIndex],this.value=i.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Mf{constructor(e){this.heap=e}static from(e,i=null,n=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new kD(o,i,n,s));return r.length==1?r[0]:new Mf(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,i=-1e9){for(let n of this.heap)n.goto(e,i);for(let n=this.heap.length>>1;n>=0;n--)y_(this.heap,n);return this.next(),this}forward(e,i){for(let n of this.heap)n.forward(e,i);for(let n=this.heap.length>>1;n>=0;n--)y_(this.heap,n);(this.to-e||this.value.endSide-i)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),y_(this.heap,0)}}}function y_(t,e){for(let i=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let r=t[n];if(n+1<t.length&&r.compare(t[n+1])>=0&&(r=t[n+1],n++),i.compare(r)<0)break;t[n]=i,t[e]=r,e=n}}class ku{constructor(e,i,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Mf.from(e,i,n)}goto(e,i=-1e9){return this.cursor.goto(e,i),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=i,this.openStart=-1,this.next(),this}forward(e,i){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-i)<0;)this.removeActive(this.minActive);this.cursor.forward(e,i)}removeActive(e){Gp(this.active,e),Gp(this.activeTo,e),Gp(this.activeRank,e),this.minActive=NA(this.active,this.activeTo)}addActive(e){let i=0,{value:n,to:r,rank:s}=this.cursor;for(;i<this.activeRank.length&&(s-this.activeRank[i]||r-this.activeTo[i])>0;)i++;Kp(this.active,i,n),Kp(this.activeTo,i,r),Kp(this.activeRank,i,s),e&&Kp(e,i,this.cursor.from),this.minActive=NA(this.active,this.activeTo)}next(){let e=this.to,i=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Gp(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(i&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let r=n.length-1;r>=0&&n[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let i=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&i.push(this.active[n]);return i.reverse()}openEnd(e){let i=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)i++;return i}}function zA(t,e,i,n,r,s){t.goto(e),i.goto(n);let o=n+r,l=n,c=n-e,u=!!s.boundChange;for(let d=!1;;){let p=t.to+c-i.to,g=p||t.endSide-i.endSide,O=g<0?t.to+c:i.to,_=Math.min(O,o);if(t.point||i.point?(t.point&&i.point&&Rx(t.point,i.point)&&tb(t.activeForPoint(t.to),i.activeForPoint(i.to))||s.comparePoint(l,_,t.point,i.point),d=!1):(d&&s.boundChange(l),_>l&&!tb(t.active,i.active)&&s.compareRange(l,_,t.active,i.active),u&&_<o&&(p||t.openEnd(O)!=i.openEnd(O))&&(d=!0)),O>o)break;l=O,g<=0&&t.next(),g>=0&&i.next()}}function tb(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!Rx(t[i],e[i]))return!1;return!0}function Gp(t,e){for(let i=e,n=t.length-1;i<n;i++)t[i]=t[i+1];t.pop()}function Kp(t,e,i){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=i}function NA(t,e){let i=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||t[r].endSide-t[i].endSide)<0&&(i=r,n=e[r]);return i}function Yr(t,e,i=t.length){let n=0;for(let r=0;r<i&&r<t.length;)t.charCodeAt(r)==9?(n+=e-n%e,r++):(n++,r=Di(t,r));return n}function ib(t,e,i,n){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?i-s%i:1,r=Di(t,r)}return n===!0?-1:t.length}const nb="ͼ",jA=typeof Symbol>"u"?"__"+nb:Symbol.for(nb),rb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),IA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class xa{constructor(e,i){this.rules=[];let{finish:n}=i||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],p=/^@(\w+)\b/.exec(o[0]),g=p&&p[1]=="keyframes";if(p&&l==null)return c.push(o[0]+";");for(let O in l){let _=l[O];if(/&/.test(O))s(O.split(/,\s*/).map(b=>o.map(x=>b.replace(/&/,x))).reduce((b,x)=>b.concat(x)),_,c);else if(_&&typeof _=="object"){if(!p)throw new RangeError("The value of a property ("+O+") should be a primitive value.");s(r(O),_,d,g)}else _!=null&&d.push(O.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+_+";")}(d.length||g)&&c.push((n&&!p&&!u?o.map(n):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
63
|
+
`)}static newName(){let e=IA[jA]||1;return IA[jA]=e+1,nb+e.toString(36)}static mount(e,i,n){let r=e[rb],s=n&&n.nonce;r?s&&r.setNonce(s):r=new mq(e,s),r.mount(Array.isArray(i)?i:[i],e)}}let VA=new Map;class mq{constructor(e,i){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=VA.get(n);if(s)return e[rb]=s;this.sheet=new r.CSSStyleSheet,VA.set(n,this)}else this.styleTag=n.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[rb]=this}mount(e,i){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],c=this.modules.indexOf(l);if(c<s&&c>-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),n)for(let u=0;u<l.rules.length;u++)n.insertRule(l.rules[u],r++)}else{for(;s<c;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)i.adoptedStyleSheets.indexOf(this.sheet)<0&&(i.adoptedStyleSheets=[this.sheet,...i.adoptedStyleSheets]);else{let o="";for(let c=0;c<this.modules.length;c++)o+=this.modules[c].getRules()+`
|
|
64
|
+
`;this.styleTag.textContent=o;let l=i.head||i;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var wa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Pf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},gq=typeof navigator<"u"&&/Mac/.test(navigator.platform),Oq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Hi=0;Hi<10;Hi++)wa[48+Hi]=wa[96+Hi]=String(Hi);for(var Hi=1;Hi<=24;Hi++)wa[Hi+111]="F"+Hi;for(var Hi=65;Hi<=90;Hi++)wa[Hi]=String.fromCharCode(Hi+32),Pf[Hi]=String.fromCharCode(Hi);for(var b_ in wa)Pf.hasOwnProperty(b_)||(Pf[b_]=wa[b_]);function vq(t){var e=gq&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Oq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?Pf:wa)[t.keyCode]||t.key||"Unidentified";return i=="Esc"&&(i="Escape"),i=="Del"&&(i="Delete"),i=="Left"&&(i="ArrowLeft"),i=="Up"&&(i="ArrowUp"),i=="Right"&&(i="ArrowRight"),i=="Down"&&(i="ArrowDown"),i}function vt(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];typeof r=="string"?t.setAttribute(n,r):r!=null&&(t[n]=r)}e++}for(;e<arguments.length;e++)TD(t,arguments[e]);return t}function TD(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var i=0;i<e.length;i++)TD(t,e[i]);else throw new RangeError("Unsupported child node: "+e)}let mn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},sb=typeof document<"u"?document:{documentElement:{style:{}}};const ob=/Edge\/(\d+)/.exec(mn.userAgent),AD=/MSIE \d/.test(mn.userAgent),ab=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mn.userAgent),fO=!!(AD||ab||ob),XA=!fO&&/gecko\/(\d+)/i.test(mn.userAgent),S_=!fO&&/Chrome\/(\d+)/.exec(mn.userAgent),_q="webkitFontSmoothing"in sb.documentElement.style,lb=!fO&&/Apple Computer/.test(mn.vendor),ZA=lb&&(/Mobile\/\w+/.test(mn.userAgent)||mn.maxTouchPoints>2);var xe={mac:ZA||/Mac/.test(mn.platform),windows:/Win/.test(mn.platform),linux:/Linux|X11/.test(mn.platform),ie:fO,ie_version:AD?sb.documentMode||6:ab?+ab[1]:ob?+ob[1]:0,gecko:XA,gecko_version:XA?+(/Firefox\/(\d+)/.exec(mn.userAgent)||[0,0])[1]:0,chrome:!!S_,chrome_version:S_?+S_[1]:0,ios:ZA,android:/Android\b/.test(mn.userAgent),webkit_version:_q?+(/\bAppleWebKit\/(\d+)/.exec(mn.userAgent)||[0,0])[1]:0,safari:lb,safari_version:lb?+(/\bVersion\/(\d+(\.\d+)?)/.exec(mn.userAgent)||[0,0])[1]:0,tabSize:sb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Lx(t,e){for(let i in t)i=="class"&&e.class?e.class+=" "+t.class:i=="style"&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}const bg=Object.create(null);function Dx(t,e,i){if(t==e)return!0;t||(t=bg),e||(e=bg);let n=Object.keys(t),r=Object.keys(e);if(n.length-0!=r.length-0)return!1;for(let s of n)if(s!=i&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function yq(t,e){for(let i=t.attributes.length-1;i>=0;i--){let n=t.attributes[i].name;e[n]==null&&t.removeAttribute(n)}for(let i in e){let n=e[i];i=="style"?t.style.cssText=n:t.getAttribute(i)!=n&&t.setAttribute(i,n)}}function qA(t,e,i){let n=!1;if(e)for(let r in e)i&&r in i||(n=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(i)for(let r in i)e&&e[r]==i[r]||(n=!0,r=="style"?t.style.cssText=i[r]:t.setAttribute(r,i[r]));return n}function bq(t){let e=Object.create(null);for(let i=0;i<t.attributes.length;i++){let n=t.attributes[i];e[n.name]=n.value}return e}class Gr{eq(e){return!1}updateDOM(e,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,i,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Ki=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Ki||(Ki={}));class Pe extends Sa{constructor(e,i,n,r){super(),this.startSide=e,this.endSide=i,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new hd(e)}static widget(e){let i=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return i+=n&&!e.inlineOrder?i>0?3e8:-4e8:i>0?1e8:-1e8,new Cl(e,i,i,n,e.widget||null,!1)}static replace(e){let i=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=ED(e,i);n=(s?i?-3e8:-1:5e8)-1,r=(o?i?2e8:1:-6e8)+1}return new Cl(e,n,r,i,e.widget||null,!0)}static line(e){return new ud(e)}static set(e,i=!1){return Ge.of(e,i)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Pe.none=Ge.empty;class hd extends Pe{constructor(e){let{start:i,end:n}=ED(e);super(i?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Lx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||bg}eq(e){return this==e||e instanceof hd&&this.tagName==e.tagName&&Dx(this.attrs,e.attrs)}range(e,i=e){if(e>=i)throw new RangeError("Mark decorations may not be empty");return super.range(e,i)}}hd.prototype.point=!1;class ud extends Pe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ud&&this.spec.class==e.spec.class&&Dx(this.spec.attributes,e.spec.attributes)}range(e,i=e){if(i!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,i)}}ud.prototype.mapMode=Fi.TrackBefore;ud.prototype.point=!0;class Cl extends Pe{constructor(e,i,n,r,s,o){super(i,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?i<=0?Fi.TrackBefore:Fi.TrackAfter:Fi.TrackDel}get type(){return this.startSide!=this.endSide?Ki.WidgetRange:this.startSide<=0?Ki.WidgetBefore:Ki.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Cl&&Sq(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,i=e){if(this.isReplace&&(e>i||e==i&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&i!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,i)}}Cl.prototype.point=!0;function ED(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return i==null&&(i=t.inclusive),n==null&&(n=t.inclusive),{start:i??e,end:n??e}}function Sq(t,e){return t==e||!!(t&&e&&t.compare(e))}function Wc(t,e,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=t?i[r]=Math.max(i[r],e):i.push(t,e)}class Rf extends Sa{constructor(e,i){super(),this.tagName=e,this.attributes=i}eq(e){return e==this||e instanceof Rf&&this.tagName==e.tagName&&Dx(this.attributes,e.attributes)}static create(e){return new Rf(e.tagName,e.attributes||bg)}static set(e,i=!1){return Ge.of(e,i)}}Rf.prototype.startSide=Rf.prototype.endSide=-1;function Qf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function cb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function df(t,e){if(!e.anchorNode)return!1;try{return cb(t,e.anchorNode)}catch{return!1}}function pf(t){return t.nodeType==3?Df(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function mf(t,e,i,n){return i?WA(t,e,i,n,-1)||WA(t,e,i,n,1):!1}function Ca(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Sg(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function WA(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:yo(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Ca(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?yo(t):0}else return!1}}function yo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Lf(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function xq(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function MD(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function wq(t,e,i,n,r,s,o,l){let c=t.ownerDocument,u=c.defaultView||window;for(let d=t,p=!1;d&&!p;)if(d.nodeType==1){let g,O=d==c.body,_=1,b=1;if(O)g=xq(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(p=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let k=d.getBoundingClientRect();({scaleX:_,scaleY:b}=MD(d,k)),g={left:k.left,right:k.left+d.clientWidth*_,top:k.top,bottom:k.top+d.clientHeight*b}}let x=0,w=0;if(r=="nearest")e.top<g.top?(w=e.top-(g.top+o),i>0&&e.bottom>g.bottom+w&&(w=e.bottom-g.bottom+o)):e.bottom>g.bottom&&(w=e.bottom-g.bottom+o,i<0&&e.top-w<g.top&&(w=e.top-(g.top+o)));else{let k=e.bottom-e.top,T=g.bottom-g.top;w=(r=="center"&&k<=T?e.top+k/2-T/2:r=="start"||r=="center"&&i<0?e.top-o:e.bottom-T+o)-g.top}if(n=="nearest"?e.left<g.left?(x=e.left-(g.left+s),i>0&&e.right>g.right+x&&(x=e.right-g.right+s)):e.right>g.right&&(x=e.right-g.right+s,i<0&&e.left<g.left+x&&(x=e.left-(g.left+s))):x=(n=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:n=="start"==l?e.left-s:e.right-(g.right-g.left)+s)-g.left,x||w)if(O)u.scrollBy(x,w);else{let k=0,T=0;if(w){let A=d.scrollTop;d.scrollTop+=w/b,T=(d.scrollTop-A)*b}if(x){let A=d.scrollLeft;d.scrollLeft+=x/_,k=(d.scrollLeft-A)*_}e={left:e.left-k,top:e.top-T,right:e.right-k,bottom:e.bottom-T},k&&Math.abs(k-x)<1&&(n="nearest"),T&&Math.abs(T-w)<1&&(r="nearest")}if(O)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function Cq(t){let e=t.ownerDocument,i,n;for(let r=t.parentNode;r&&!(r==e.body||i&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!i&&r.scrollWidth>r.clientWidth&&(i=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:i,y:n}}class kq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:i,focusNode:n}=e;this.set(i,Math.min(e.anchorOffset,i?yo(i):0),n,Math.min(e.focusOffset,n?yo(n):0))}set(e,i,n,r){this.anchorNode=e,this.anchorOffset=i,this.focusNode=n,this.focusOffset=r}}let ol=null;xe.safari&&xe.safari_version>=26&&(ol=!1);function PD(t){if(t.setActive)return t.setActive();if(ol)return t.focus(ol);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(ol==null?{get preventScroll(){return ol={preventScroll:!0},!0}}:void 0),!ol){ol=!1;for(let i=0;i<e.length;){let n=e[i++],r=e[i++],s=e[i++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let UA;function Df(t,e,i=e){let n=UA||(UA=document.createRange());return n.setEnd(t,i),n.setStart(t,e),n}function Uc(t,e,i,n){let r={key:e,code:e,keyCode:i,which:i,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function Tq(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Aq(t,e){let i=e.focusNode,n=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=n)return!1;for(n=Math.min(n,yo(i));;)if(n){if(i.nodeType!=1)return!1;let r=i.childNodes[n-1];r.contentEditable=="false"?n--:(i=r,n=yo(i))}else{if(i==t)return!0;n=Ca(i),i=i.parentNode}}function RD(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function QD(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n>0)return{node:i,offset:n};if(i.nodeType==1&&n>0){if(i.contentEditable=="false")return null;i=i.childNodes[n-1],n=yo(i)}else if(i.parentNode&&!Sg(i))n=Ca(i),i=i.parentNode;else return null}}function LD(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n<i.nodeValue.length)return{node:i,offset:n};if(i.nodeType==1&&n<i.childNodes.length){if(i.contentEditable=="false")return null;i=i.childNodes[n],n=0}else if(i.parentNode&&!Sg(i))n=Ca(i)+1,i=i.parentNode;else return null}}class qr{constructor(e,i,n=!0){this.node=e,this.offset=i,this.precise=n}static before(e,i){return new qr(e.parentNode,Ca(e),i)}static after(e,i){return new qr(e.parentNode,Ca(e)+1,i)}}var St=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(St||(St={}));const kl=St.LTR,Bx=St.RTL;function DD(t){let e=[];for(let i=0;i<t.length;i++)e.push(1<<+t[i]);return e}const Eq=DD("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Mq=DD("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),hb=Object.create(null),rs=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),i=t.charCodeAt(1);hb[e]=i,hb[i]=-e}function BD(t){return t<=247?Eq[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Mq[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Pq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class _s{get dir(){return this.level%2?Bx:kl}constructor(e,i,n){this.from=e,this.to=i,this.level=n}side(e,i){return this.dir==i==e?this.to:this.from}forward(e,i){return e==(this.dir==i)}static find(e,i,n,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=i&&l.to>=i){if(l.level==n)return o;(s<0||(r!=0?r<0?l.from<i:l.to>i:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function $D(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],r=e[i];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!$D(n.inner,r.inner))return!1}return!0}const bt=[];function Rq(t,e,i,n,r){for(let s=0;s<=n.length;s++){let o=s?n[s-1].to:e,l=s<n.length?n[s].from:i,c=s?256:r;for(let u=o,d=c,p=c;u<l;u++){let g=BD(t.charCodeAt(u));g==512?g=d:g==8&&p==4&&(g=16),bt[u]=g==4?2:g,g&7&&(p=g),d=g}for(let u=o,d=c,p=c;u<l;u++){let g=bt[u];if(g==128)u<l-1&&d==bt[u+1]&&d&24?g=bt[u]=d:bt[u]=256;else if(g==64){let O=u+1;for(;O<l&&bt[O]==64;)O++;let _=u&&d==8||O<i&&bt[O]==8?p==1?1:8:256;for(let b=u;b<O;b++)bt[b]=_;u=O-1}else g==8&&p==1&&(bt[u]=1);d=g,g&7&&(p=g)}}}function Qq(t,e,i,n,r){let s=r==1?2:1;for(let o=0,l=0,c=0;o<=n.length;o++){let u=o?n[o-1].to:e,d=o<n.length?n[o].from:i;for(let p=u,g,O,_;p<d;p++)if(O=hb[g=t.charCodeAt(p)])if(O<0){for(let b=l-3;b>=0;b-=3)if(rs[b+1]==-O){let x=rs[b+2],w=x&2?r:x&4?x&1?s:r:0;w&&(bt[p]=bt[rs[b]]=w),l=b;break}}else{if(rs.length==189)break;rs[l++]=p,rs[l++]=g,rs[l++]=c}else if((_=bt[p])==2||_==1){let b=_==r;c=b?0:1;for(let x=l-3;x>=0;x-=3){let w=rs[x+2];if(w&2)break;if(b)rs[x+2]|=2;else{if(w&4)break;rs[x+2]|=4}}}}}function Lq(t,e,i,n){for(let r=0,s=n;r<=i.length;r++){let o=r?i[r-1].to:t,l=r<i.length?i[r].from:e;for(let c=o;c<l;){let u=bt[c];if(u==256){let d=c+1;for(;;)if(d==l){if(r==i.length)break;d=i[r++].to,l=r<i.length?i[r].from:e}else if(bt[d]==256)d++;else break;let p=s==1,g=(d<e?bt[d]:n)==1,O=p==g?p?1:2:n;for(let _=d,b=r,x=b?i[b-1].to:t;_>c;)_==x&&(_=i[--b].from,x=b?i[b-1].to:t),bt[--_]=O;c=d}else s=u,c++}}}function ub(t,e,i,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let c=e,u=0;c<i;){let d=!0,p=!1;if(u==s.length||c<s[u].from){let b=bt[c];b!=l&&(d=!1,p=b==16)}let g=!d&&l==1?[]:null,O=d?n:n+1,_=c;e:for(;;)if(u<s.length&&_==s[u].from){if(p)break e;let b=s[u];if(!d)for(let x=b.to,w=u+1;;){if(x==i)break e;if(w<s.length&&s[w].from==x)x=s[w++].to;else{if(bt[x]==l)break e;break}}if(u++,g)g.push(b);else{b.from>c&&o.push(new _s(c,b.from,O));let x=b.direction==kl!=!(O%2);fb(t,x?n+1:n,r,b.inner,b.from,b.to,o),c=b.to}_=b.to}else{if(_==i||(d?bt[_]!=l:bt[_]==l))break;_++}g?ub(t,c,_,n+1,r,g,o):c<_&&o.push(new _s(c,_,O)),c=_}else for(let c=i,u=s.length;c>e;){let d=!0,p=!1;if(!u||c>s[u-1].to){let b=bt[c-1];b!=l&&(d=!1,p=b==16)}let g=!d&&l==1?[]:null,O=d?n:n+1,_=c;e:for(;;)if(u&&_==s[u-1].to){if(p)break e;let b=s[--u];if(!d)for(let x=b.from,w=u;;){if(x==e)break e;if(w&&s[w-1].to==x)x=s[--w].from;else{if(bt[x-1]==l)break e;break}}if(g)g.push(b);else{b.to<c&&o.push(new _s(b.to,c,O));let x=b.direction==kl!=!(O%2);fb(t,x?n+1:n,r,b.inner,b.from,b.to,o),c=b.from}_=b.from}else{if(_==e||(d?bt[_-1]!=l:bt[_-1]==l))break;_--}g?ub(t,_,c,n+1,r,g,o):_<c&&o.push(new _s(_,c,O)),c=_}}function fb(t,e,i,n,r,s,o){let l=e%2?2:1;Rq(t,r,s,n,l),Qq(t,r,s,n,l),Lq(r,s,n,l),ub(t,r,s,e,i,n,o)}function Dq(t,e,i){if(!t)return[new _s(0,0,e==Bx?1:0)];if(e==kl&&!i.length&&!Pq.test(t))return zD(t.length);if(i.length)for(;t.length>bt.length;)bt[bt.length]=256;let n=[],r=e==kl?0:1;return fb(t,r,r,i,0,t.length,n),n}function zD(t){return[new _s(0,t,0)]}let ND="";function Bq(t,e,i,n,r){var s;let o=n.head-t.from,l=_s.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),c=e[l],u=c.side(r,i);if(o==u){let g=l+=r?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],o=c.side(!r,i),u=c.side(r,i)}let d=Di(t.text,o,c.forward(r,i));(d<c.from||d>c.to)&&(d=u),ND=t.text.slice(Math.min(o,d),Math.max(o,d));let p=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return p&&d==u&&p.level+(r?0:1)<c.level?se.cursor(p.side(!r,i)+t.from,p.forward(r,i)?1:-1,p.level):se.cursor(d+t.from,c.forward(r,i)?-1:1,c.level)}function $q(t,e,i){for(let n=e;n<i;n++){let r=BD(t.charCodeAt(n));if(r==1)return kl;if(r==2||r==4)return Bx}return kl}const jD=Se.define(),ID=Se.define(),VD=Se.define(),XD=Se.define(),db=Se.define(),ZD=Se.define(),qD=Se.define(),$x=Se.define(),zx=Se.define(),WD=Se.define({combine:t=>t.some(e=>e)}),UD=Se.define({combine:t=>t.some(e=>e)}),YD=Se.define();class Yc{constructor(e,i="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=i,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Yc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Yc(se.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Jp=ze.define({map:(t,e)=>t.map(e)}),HD=ze.define();function $n(t,e,i){let n=t.facet(XD);n.length?n[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const uo=Se.define({combine:t=>t.length?t[0]:!0});let zq=0;const zc=Se.define({combine(t){return t.filter((e,i)=>{for(let n=0;n<i;n++)if(t[n].plugin==e.plugin)return!1;return!0})}});class Jt{constructor(e,i,n,r,s){this.id=e,this.create=i,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(zc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(zc.of({plugin:this,arg:e}))}static define(e,i){const{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=i||{};return new Jt(zq++,e,n,r,l=>{let c=[];return o&&c.push(dO.of(u=>{let d=u.plugin(l);return d?o(d):Pe.none})),s&&c.push(s(l)),c})}static fromClass(e,i){return Jt.define((n,r)=>new e(n,r),i)}}class x_{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let i=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(i)}catch(n){if($n(i.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(i){$n(e.state,i,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var i;if(!((i=this.value)===null||i===void 0)&&i.destroy)try{this.value.destroy()}catch(n){$n(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const FD=Se.define(),Nx=Se.define(),dO=Se.define(),GD=Se.define(),jx=Se.define(),fd=Se.define(),KD=Se.define();function YA(t,e){let i=t.state.facet(KD);if(!i.length)return i;let n=i.map(s=>s instanceof Function?s(t):s),r=[];return Ge.spans(n,e.from,e.to,{point(){},span(s,o,l,c){let u=s-e.from,d=o-e.from,p=r;for(let g=l.length-1;g>=0;g--,c--){let O=l[g].spec.bidiIsolate,_;if(O==null&&(O=$q(e.text,u,d)),c>0&&p.length&&(_=p[p.length-1]).to==u&&_.direction==O)_.to=d,p=_.inner;else{let b={from:u,to:d,direction:O,inner:[]};p.push(b),p=b.inner}}}}),r}const JD=Se.define();function Ix(t){let e=0,i=0,n=0,r=0;for(let s of t.state.facet(JD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(i=Math.max(i,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:i,top:n,bottom:r}}const Hu=Se.define();class kr{constructor(e,i,n,r){this.fromA=e,this.toA=i,this.fromB=n,this.toB=r}join(e){return new kr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let i=e.length,n=this;for(;i>0;i--){let r=e[i-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(i-1,1)}}return e.splice(i,0,n),e}static extendWithRanges(e,i){if(i.length==0)return e;let n=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,c=s<i.length?i[s]:1e9,u=Math.min(l,c);if(u==1e9)break;let d=u+o,p=u,g=d;for(;;)if(s<i.length&&i[s]<=p){let O=i[s+1];s+=2,p=Math.max(p,O);for(let _=r;_<e.length&&e[_].fromB<=p;_++)o=e[_].toA-e[_].toB;g=Math.max(g,O+o)}else if(r<e.length&&e[r].fromB<=p){let O=e[r++];p=Math.max(p,O.toB),g=Math.max(g,O.toA),o=O.toA-O.toB}else break;n.push(new kr(d,g,u,p))}return n}}class xg{constructor(e,i,n){this.view=e,this.state=i,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=vi.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,c)=>r.push(new kr(s,o,l,c))),this.changedRanges=r}static create(e,i,n){return new xg(e,i,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const Nq=[];class ui{constructor(e,i,n=0){this.dom=e,this.length=i,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Nq}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let i=this.domAttrs;i&&yq(this.dom,i)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,i=this.posAtStart){let n=i;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,i){return null}domPosFor(e,i){let n=Ca(this.dom),r=this.length?e>0:i>0;return new qr(this.parent.dom,n+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof mO)return e;return null}static get(e){return e.cmTile}}class pO extends ui{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let i=this.dom,n=null,r,s=(e==null?void 0:e.node)==i?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=n?n.nextSibling:i.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==i)for(;r&&r!=l.dom;)r=HA(r);else i.insertBefore(l.dom,r);n=l.dom}for(r=n?n.nextSibling:i.firstChild,s&&r&&(s.written=!0);r;)r=HA(r);this.length=o}}function HA(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class mO extends pO{constructor(e,i){super(i),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let i=ui.get(e);if(i&&this.owns(i))return i;e=e.parentNode}}blockTiles(e){for(let i=[],n=this,r=0,s=0;;)if(r==n.children.length){if(!i.length)return;n=n.parent,n.breakAfter&&s++,r=i.pop()}else{let o=n.children[r++];if(o instanceof mo)i.push(r),n=o,r=0;else{let l=s+o.length,c=e(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(e,i){let n,r=-1,s,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(e>=c&&e<=u){if(l.isWidget()&&i>=-1&&i<=1){if(l.flags&32)return!0;l.flags&16&&(n=void 0)}(c<e||e==u&&(i<-1?l.length:l.covers(1)))&&(!n||!l.isWidget()&&n.isWidget())&&(n=l,r=e-c),(u>e||e==c&&(i>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-c)}}),!n&&!s)throw new Error("No tile at position "+e);return n&&i<0||!s?{tile:n,offset:r}:{tile:s,offset:o}}}class mo extends pO{constructor(e,i){super(e),this.wrapper=i}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,i){let n=new mo(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class rh extends pO{constructor(e,i){super(e),this.attrs=i}isLine(){return!0}static start(e,i,n){let r=new rh(i||document.createElement("div"),e);return(!i||!n)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,i,n){let r=null,s=-1,o=null,l=-1;function c(d,p){for(let g=0,O=0;g<d.children.length&&O<=p;g++){let _=d.children[g],b=O+_.length;b>=p&&(_.isComposite()?c(_,p-O):(!o||o.isHidden&&(i>0||n&&Iq(o,_)))&&(b>p||_.flags&32)?(o=_,l=p-O):(O<p||_.flags&16&&!_.isHidden)&&(r=_,s=p-O)),O=b}}c(this,e);let u=(i<0?r:o)||r||o;return u?{tile:u,offset:u==r?s:l}:null}coordsIn(e,i){let n=this.resolveInline(e,i,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),i):jq(this)}domIn(e,i){let n=this.resolveInline(e,i);if(n){let{tile:r,offset:s}=n;if(this.dom.contains(r.dom))return r.isText()?new qr(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:i);let o=n.tile.parent,l=!1;for(let c of o.children){if(l)return new qr(c.dom,0);c==n.tile&&(l=!0)}}return new qr(this.dom,0)}}function jq(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=pf(e);return i[i.length-1]||null}function Iq(t,e){let i=t.coordsIn(0,1),n=e.coordsIn(0,1);return i&&n&&n.top<i.bottom}class Bn extends pO{constructor(e,i){super(e),this.mark=i}get domAttrs(){return this.mark.attrs}static of(e,i){let n=new Bn(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class ml extends ui{constructor(e,i){super(e,i.length),this.text=i}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,i){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&i<0||e==n&&i>=0?xe.chrome||xe.gecko||(e?(r--,o=1):s<n&&(s++,o=-1)):i<0?r--:s<n&&s++;let l=Df(this.dom,r,s).getClientRects();if(!l.length)return null;let c=l[(o?o<0:i>=0)?0:l.length-1];return xe.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(l,u=>u.width)||c),o?Lf(c,o<0):c||null}static of(e,i){let n=new ml(i||document.createTextNode(e),e);return i||(n.flags|=2),n}}class Tl extends ui{constructor(e,i,n,r){super(e,i,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,i){return this.coordsInWidget(e,i,!1)}coordsInWidget(e,i,n){let r=this.widget.coordsAt(this.dom,e,i);if(r)return r;if(n)return Lf(this.dom.getBoundingClientRect(),this.length?e==0:i<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let c=l?s.length-1:0;o=s[c],!(e>0?c==0:c==s.length-1||o.top<o.bottom);c+=l?-1:1);return Lf(o,!l)}}get overrideDOMText(){if(!this.length)return at.empty;let{root:e}=this;if(!e)return at.empty;let i=this.posAtStart;return e.view.state.doc.slice(i,i+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,i,n,r,s){return s||(s=e.toDOM(i),e.editable||(s.contentEditable="false")),new Tl(s,n,e,r)}}class wg extends ui{constructor(e){let i=document.createElement("img");i.className="cm-widgetBuffer",i.setAttribute("aria-hidden","true"),super(i,0,e)}get isHidden(){return!0}get overrideDOMText(){return at.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Vq{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,i,n){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||i>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;n&&n.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(i>0?c.length<=e:c.length<e)&&(!n||n.skip(c,0,c.length)!==!1||!c.isComposite)?(o=!!u,s++,e-=c.length):(l.push({tile:r,index:s}),r=c,s=0,n&&c.isComposite()&&n.enter(c))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let c=Math.min(e,r.length-s);n&&n.skip(r,s,s+c),e-=c,s+=c}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Xq{constructor(e,i,n,r){this.from=e,this.to=i,this.wrapper=n,this.rank=r}}class Zq{constructor(e,i,n){this.cache=e,this.root=i,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,i,n,r){var s;this.flushBuffer();let o=this.ensureMarks(i,n),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let c=o.children[o.children.length-1]=new ml(l.dom,l.text+e);c.parent=o}else o.append(r||ml.of(e,(s=this.cache.find(ml))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,i){let n=this.curLine;n.dom!=i.line.dom&&(n.setDOM(this.cache.reused.has(i.line)?w_(i.line.dom):i.line.dom),this.cache.reused.set(i.line,2));let r=n;for(let l=i.marks.length-1;l>=0;l--){let c=i.marks[l],u=r.lastChild;if(u instanceof Bn&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(w_(c.dom)),r=u;else{if(this.cache.reused.get(c)){let p=ui.get(c.dom);p&&p.setDOM(w_(c.dom))}let d=Bn.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=ui.get(e.text);s&&this.cache.reused.set(s,2);let o=new ml(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,i,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(i,n);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,i,n){this.flushBuffer(),this.ensureMarks(i,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let i=this.afterWidget||this.lastBlock;i.length+=e,this.pos+=e}addLineStart(e,i){var n;e||(e=eB);let r=rh.start(e,i||((n=this.cache.find(rh))===null||n===void 0?void 0:n.dom),!!i);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,i){var n;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(i>0&&(l=r.lastChild)&&l instanceof Bn&&l.mark.eq(o))r=l,i--;else{let c=Bn.of(o,(n=this.cache.find(Bn,u=>u.mark.eq(o)))===null||n===void 0?void 0:n.dom);r.append(c),r=c,i=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!FA(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(xe.ios&&FA(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(C_,0,32)||new Tl(C_.toDOM(),0,C_,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let i=new Xq(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let i=this.root;for(let n of this.wrappers){let r=i.lastChild;if(n.from<this.pos&&r instanceof mo&&r.wrapper.eq(n.wrapper))i=r;else{let s=mo.of(n.wrapper,(e=this.cache.find(mo,o=>o.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);i.append(s),i=s}}return i}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let i=2|(e<0?16:32),n=this.cache.find(wg,void 0,1);return n&&(n.flags=i),n||new wg(i)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class qq{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let i=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,i);return this.textOff=i,n}}const Cg=[Tl,rh,ml,Bn,wg,mo,mO];for(let t=0;t<Cg.length;t++)Cg[t].bucket=t;class Wq{constructor(e){this.view=e,this.buckets=Cg.map(()=>[]),this.index=Cg.map(()=>0),this.reused=new Map}add(e){let i=e.constructor.bucket,n=this.buckets[i];n.length<6?n.push(e):n[this.index[i]=(this.index[i]+1)%6]=e}find(e,i,n=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=s.length-1;l>=0;l--){let c=(l+o)%s.length,u=s[c];if((!i||i(u))&&!this.reused.has(u))return s.splice(c,1),c<o&&this.index[r]--,this.reused.set(u,n),u}return null}findWidget(e,i,n){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==i&&(l.flags&497)==n?(this.reused.set(l,1),l):(this.reused.set(l,2),new Tl(l.dom,i,e,l.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,i=2){if(!this.reused.has(e))return this.reused.set(e,i),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Uq{constructor(e,i,n,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Wq(e),this.text=new qq(e.state.doc),this.builder=new Zq(this.cache,new mO(e,e.contentDOM),Ge.iter(n)),this.cache.reused.set(i,2),this.old=new Vq(i),this.reuseWalker={skip:(o,l,c)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,i){let n=i&&this.getCompositionContext(i.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,c=l?l.fromA:this.old.root.length;if(c>r){let u=c-r;this.preserve(u,!o,!l),r=c,s+=u}if(!l)break;i&&l.fromA<=i.range.fromA&&l.toA>=i.range.toA?(this.forward(l.fromA,i.range.fromA,i.range.fromA<i.range.toA?1:-1),this.emit(s,i.range.fromB),this.cache.clear(),this.builder.addComposition(i,n),this.text.skip(i.range.toB-i.range.fromB),this.forward(i.range.fromA,l.toA),this.emit(i.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,i,n){let r=Fq(this.old),s=this.openMarks;this.old.advance(e,n?1:-1,{skip:(o,l,c)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l<o.length?Tl.of(o.widget,this.view,c-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);u.flags&256?(u.flags&=-2,this.builder.addBlockWidget(u)):(this.builder.ensureLine(null),this.builder.addInlineWidget(u,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&c==o.length?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,c),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof wg)this.cache.add(o);else if(o instanceof Bn)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Bn&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Bn&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,i){let n=null,r=this.builder,s=0,o=Ge.spans(this.decorations,e,i,{point:(l,c,u,d,p,g)=>{if(u instanceof Cl){if(this.disallowBlockEffectsFor[g]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,p>d.length)r.continueWidget(c-l);else{let O=u.widget||(u.block?sh.block:sh.inline),_=Yq(u),b=this.cache.findWidget(O,c-l,_)||Tl.of(O,this.view,c-l,_);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(b)):(r.ensureLine(n),r.addInlineWidget(b,d,p))}n=null}else n=Hq(n,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let p=l;p<c;){let g=this.text.next(Math.min(512,c-p));g==null?(r.addLineStartIfNotCovered(n),r.addBreak(),p++):(r.ensureLine(n),r.addText(g,u,p==l?d:u.length),p+=g.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=o>s,this.openMarks=o}forward(e,i,n=1){i-e<=10?this.old.advance(i-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(i-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let i=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let s=ui.get(r);if(r==this.view.contentDOM)break;s instanceof Bn?i.push(s):s!=null&&s.isLine()?n=s:s instanceof mo||(r.nodeName=="DIV"&&!n&&r!=this.view.contentDOM?n=new rh(r,eB):n||i.push(Bn.of(new hd({tagName:r.nodeName.toLowerCase(),attributes:bq(r)}),r)))}return{line:n,marks:i}}}function FA(t,e){let i=n=>{for(let r of n.children)if((e?r.isText():r.length)||i(r))return!0;return!1};return i(t)}function Yq(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const eB={class:"cm-line"};function Hq(t,e){let i=e.spec.attributes,n=e.spec.class;return!i&&!n||(t||(t={class:"cm-line"}),i&&Lx(i,t),n&&(t.class+=" "+n)),t}function Fq(t){let e=[];for(let i=t.parents.length;i>1;i--){let n=i==t.parents.length?t.tile:t.parents[i].tile;n instanceof Bn&&e.push(n.mark)}return e}function w_(t){let e=ui.get(t);return e&&e.setDOM(t.cloneNode()),t}class sh extends Gr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sh.inline=new sh("span");sh.block=new sh("div");const C_=new class extends Gr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class GA{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Pe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new mO(e,e.contentDOM),this.updateInner([new kr(0,0,0,e.state.doc.length)],null)}update(e){var i;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:d,toA:p})=>p<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((i=this.domChanged)===null||i===void 0)&&i.newSel?r=this.domChanged.newSel.head:!sW(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?Kq(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;n=new kr(d,p,e.changes.mapPos(d,-1),e.changes.mapPos(p,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(xe.ie||xe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=tW(o,this.decorations,e.changes);c.length&&(n=kr.extendWithRanges(n,c));let u=nW(l,this.blockWrappers,e.changes);return u.length&&(n=kr.extendWithRanges(n,u)),s&&!n.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(n=s.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,i){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(i||e.length){let o=this.tile,l=new Uq(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=l.run(e,i),pb(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=xe.chrome||xe.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||n.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof k_&&r.push(s.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let i of e.transactions)for(let n of i.effects)n.is(HD)&&(this.editContextFormatting=n.value)}updateSelection(e=!1,i=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,s=r==n,o=!s&&!(this.view.state.facet(uo)||n.tabIndex>-1)&&df(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(s||i||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),xe.gecko&&c.empty&&!this.hasComposition&&Gq(u)){let g=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(g,u.node.childNodes[u.offset]||null)),u=d=new qr(g,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!mf(u.node,u.offset,p.anchorNode,p.anchorOffset)||!mf(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{xe.android&&xe.chrome&&n.contains(p.focusNode)&&rW(p.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let g=Qf(this.view.root);if(g)if(c.empty){if(xe.gecko){let O=Jq(u.node,u.offset);if(O&&O!=3){let _=(O==1?QD:LD)(u.node,u.offset);_&&(u=new qr(_.node,_.offset))}}g.collapse(u.node,u.offset),c.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=c.bidiLevel)}else if(g.extend){g.collapse(u.node,u.offset);try{g.extend(d.node,d.offset)}catch{}}else{let O=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),O.setEnd(d.node,d.offset),O.setStart(u.node,u.offset),g.removeAllRanges(),g.addRange(O)}o&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new qr(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new qr(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,i){return this.hasComposition&&i.empty&&mf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==i.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,i=e.state.selection.main,n=Qf(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!i.empty||!i.assoc||!n.modify)return;let o=this.lineAt(i.head,i.assoc);if(!o)return;let l=o.posAtStart;if(i.head==l||i.head==l+o.length)return;let c=this.coordsAt(i.head,-1),u=this.coordsAt(i.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(i.head+i.assoc,i.assoc);n.collapse(d.node,d.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=i.from&&n.collapse(r,s)}posFromDOM(e,i){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let s;if(e==n.dom)s=n.dom.childNodes[i];else{let o=yo(e)==0?0:i==0?-1:1;for(;;){let l=e.parentNode;if(l==n.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==n.dom.firstChild)return r;for(;s&&!ui.get(s);)s=s.nextSibling;if(!s)return r+n.length;for(let o=0,l=r;;o++){let c=n.children[o];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return n.isText()?e==n.dom?r+i:r+(i?n.length:0):r}domAtPos(e,i){let{tile:n,offset:r}=this.tile.resolveBlock(e,i);return n.isWidget()?n.domPosFor(e,i):n.domIn(r,i)}inlineDOMNearPos(e,i){let n,r=-1,s=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=e)return!0;u.flags&16&&(s=!0)}else{let p=d+u.length;if(d<=e&&(n=u,r=e-d,s=p<e),p>=e&&!o&&(o=u,l=e-d,c=d>e),d>e&&o)return!0}}),!n&&!o?this.domAtPos(e,i):(s&&o?n=null:c&&n&&(o=null),n&&i<0||!o?n.domIn(r,i):o.domIn(l,i))}coordsAt(e,i){let{tile:n,offset:r}=this.tile.resolveBlock(e,i);return n.isWidget()?n.widget instanceof k_?null:n.coordsInWidget(r,i,!0):n.coordsIn(r,i)}lineAt(e,i){let{tile:n}=this.tile.resolveBlock(e,i);return n.isLine()?n:null}coordsForChar(e){let{tile:i,offset:n}=this.tile.resolveBlock(e,1);if(!i.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=Di(s.text,o);if(l==o)return null;let c=Df(s.dom,o,l).getClientRects();for(let u=0;u<c.length;u++){let d=c[u];if(u==c.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return r(i,n)}measureVisibleLineHeights(e){let i=[],{from:n,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==St.LTR,u=0,d=(p,g,O)=>{for(let _=0;_<p.children.length&&!(g>r);_++){let b=p.children[_],x=g+b.length,w=b.dom.getBoundingClientRect(),{height:k}=w;if(O&&!_&&(u+=w.top-O.top),b instanceof mo)x>n&&d(b,g,w);else if(g>=n&&(u>0&&i.push(-u),i.push(k+u),u=0,o)){let T=b.dom.lastChild,A=T?pf(T):[];if(A.length){let L=A[A.length-1],E=c?L.right-w.left:w.right-L.left;E>l&&(l=E,this.minWidth=s,this.minWidthFrom=g,this.minWidthTo=x)}}O&&_==p.children.length-1&&(u+=O.bottom-w.bottom),g=x+b.breakAfter}};return d(this.tile,0,null),i}textDirectionAt(e){let{tile:i}=this.tile.resolveBlock(e,1);return getComputedStyle(i.dom).direction=="rtl"?St.RTL:St.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=pf(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(e)return e;let i=document.createElement("div"),n,r,s;return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(i);let o=pf(i.firstChild)[0];n=i.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:n,i.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],i=this.view.viewState;for(let n=0,r=0;;r++){let s=r==i.viewports.length?null:i.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>n){let l=(i.lineBlockAt(o).bottom-i.lineBlockAt(n).top)/this.view.scaleY;e.push(Pe.replace({widget:new k_(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return Pe.set(e)}updateDeco(){let e=1,i=this.view.state.facet(dO).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(jx).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,i.push(Ge.join(r))),this.decorations=[this.editContextFormatting,...i,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(GD).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(YD))try{if(u(this.view,e.range,e))return!0}catch(d){$n(this.view.state,d,"scroll handler")}let{range:i}=e,n=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1),r;if(!n)return;!i.empty&&(r=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=Ix(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(wq(this.view.scrollDOM,o,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==St.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let u=this.view.docView.lineAt(i.head,1);u&&u.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let i=n=>n.isWidget()||n.children.some(i);return i(this.tile.resolveBlock(e,1).tile)}destroy(){pb(this.tile)}}function pb(t,e){let i=e==null?void 0:e.get(t);if(i!=1){i==null&&t.destroy();for(let n of t.children)pb(n,e)}}function Gq(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function tB(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let n=QD(i.focusNode,i.focusOffset),r=LD(i.focusNode,i.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=ui.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let c=ui.get(n.node);!c||c.isText()&&c.text!=n.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function Kq(t,e,i){let n=tB(t,i);if(!n)return null;let{node:r,from:s,to:o}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(n.from,n.to)!=l)return null;let c=e.invertedDesc;return{range:new kr(c.mapPos(s),c.mapPos(o),s,o),text:r}}function Jq(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let eW=class{constructor(){this.changes=[]}compareRange(e,i){Wc(e,i,this.changes)}comparePoint(e,i){Wc(e,i,this.changes)}boundChange(e){Wc(e,e,this.changes)}};function tW(t,e,i){let n=new eW;return Ge.compare(t,e,i,n),n.changes}class iW{constructor(){this.changes=[]}compareRange(e,i){Wc(e,i,this.changes)}comparePoint(){}boundChange(e){Wc(e,e,this.changes)}}function nW(t,e,i){let n=new iW;return Ge.compare(t,e,i,n),n.changes}function rW(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(i.nodeType==1&&i.contentEditable=="false")return!0;return!1}function sW(t,e){let i=!1;return e&&t.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(i=!0)}),i}class k_ extends Gr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function oW(t,e,i=1){let n=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return se.cursor(e);s==0?i=1:s==r.length&&(i=-1);let o=s,l=s;i<0?o=Di(r.text,s,!1):l=Di(r.text,s);let c=n(r.text.slice(o,l));for(;o>0;){let u=Di(r.text,o,!1);if(n(r.text.slice(u,o))!=c)break;o=u}for(;l<r.length;){let u=Di(r.text,l);if(n(r.text.slice(l,u))!=c)break;l=u}return se.range(o+r.from,l+r.from)}function aW(t,e,i,n,r){let s=Math.round((n-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,c=Math.floor((r-i.top-(t.defaultLineHeight-l)*.5)/l);s+=c*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+ib(o,s,t.state.tabSize)}function mb(t,e,i){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==Ki.Text&&(r.type!=s.type||(i<0?s.from<e:s.to>e)))&&(r=s)}}return r||n}return n}function lW(t,e,i,n){let r=mb(t,e.head,e.assoc||-1),s=!n||r.type!=Ki.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),c=t.posAtCoords({x:i==(l==St.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return se.cursor(c,i?-1:1)}return se.cursor(i?r.to:r.from,i?-1:1)}function KA(t,e,i,n){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,c=null;;){let u=Bq(r,s,o,l,i),d=ND;if(!u){if(r.number==(i?t.state.doc.lines:1))return l;d=`
|
|
65
|
+
`,r=t.state.doc.line(r.number+(i?1:-1)),s=t.bidiSpans(r),u=t.visualLineSide(r,!i)}if(c){if(!c(d))return l}else{if(!n)return u;c=n(d)}l=u}}function cW(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return s=>{let o=n(s);return r==Dt.Space&&(r=o),r==o}}function hW(t,e,i,n){let r=e.head,s=i?1:-1;if(r==(i?t.state.doc.length:0))return se.cursor(r,e.assoc);let o=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(r,(e.empty?e.assoc:0)||(i?1:-1)),d=t.documentTop;if(u)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let _=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,t.defaultCharacterWidth*(r-_.from))),l=(s<0?_.top:_.bottom)+d}let p=c.left+o,g=n??t.viewState.heightOracle.textHeight>>1,O=gb(t,{x:p,y:l+g*s},!1,s);return se.cursor(O.pos,O.assoc,void 0,o)}function gf(t,e,i){for(;;){let n=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let c=n||i||(e-s<o-e?-1:1);e=c<0?s:o,n=c}});if(!n)return e}}function iB(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=gf(t,r.from,0);o!=r.from&&(s=se.cursor(o,-1))}else{let o=gf(t,r.from,-1),l=gf(t,r.to,1);(o!=r.from||l!=r.to)&&(s=se.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(i||(i=e.ranges.slice()),i[n]=s)}return i?se.create(i,e.mainIndex):e}function T_(t,e,i){let n=gf(t.state.facet(fd).map(r=>r(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:se.cursor(n,n<i.from?1:-1)}class Os{constructor(e,i){this.pos=e,this.assoc=i}}function gb(t,e,i,n){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,c=l-s,u;for(;;){if(c<0)return new Os(0,1);if(c>t.viewState.docHeight)return new Os(t.state.doc.length,-1);if(u=t.elementAtHeight(c),n==null)break;if(u.type==Ki.Text){if(n<0?u.to<t.viewport.from:u.from>t.viewport.to)break;let g=t.docView.coordsAt(n<0?u.from:u.to,n>0?-1:1);if(g&&(n<0?g.top<=c+s:g.bottom>=c+s))break}let p=t.viewState.heightOracle.textHeight/2;c=n>0?u.bottom+p:u.top-p}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(i)return null;if(u.type==Ki.Text){let p=aW(t,r,u,o,l);return new Os(p,p==u.from?1:-1)}}if(u.type!=Ki.Text)return c<(u.top+u.bottom)/2?new Os(u.from,1):new Os(u.to,-1);let d=t.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=t.docView.lineAt(u.from,-2)),new uW(t,o,l,t.textDirectionAt(u.from)).scanTile(d,u.from)}class uW{constructor(e,i,n,r){this.view=e,this.x=i,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,i){let{line:n,spans:r}=this.bidiSpansAt(e);return r[_s.find(r,e-n.from,-1,i)].level==this.baseDir}dirAt(e,i){let{line:n,spans:r}=this.bidiSpansAt(e);return r[_s.find(r,e-n.from,-1,i)].dir}bidiIn(e,i){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<i)}scan(e,i){let n=0,r=e.length-1,s=new Set,o=this.bidiIn(e[0],e[r]),l,c,u=-1,d=1e9,p;e:for(;n<r;){let O=r-n,_=n+r>>1;t:if(s.has(_)){let x=n+Math.floor(Math.random()*O);for(let w=0;w<O;w++){if(!s.has(x)){_=x;break t}x++,x==r&&(x=n)}break e}s.add(_);let b=i(_);if(b)for(let x=0;x<b.length;x++){let w=b[x],k=0;if(w.bottom<this.y)(!l||l.bottom<w.bottom)&&(l=w),k=1;else if(w.top>this.y)(!c||c.top>w.top)&&(c=w),k=-1;else{let T=w.left>this.x?this.x-w.left:w.right<this.x?this.x-w.right:0,A=Math.abs(T);A<d&&(u=_,d=A,p=w),T&&(k=T<0==(this.baseDir==St.LTR)?-1:1)}k==-1&&(!o||this.baseDirAt(e[_],1))?r=_:k==1&&(!o||this.baseDirAt(e[_+1],-1))&&(n=_+1)}}if(!p){let O=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(O.top+O.bottom)/2,this.scan(e,i)}let g=(o?this.dirAt(e[u],1):this.baseDir)==St.LTR;return{i:u,after:this.x>(p.left+p.right)/2==g}}scanText(e,i){let n=[];for(let s=0;s<e.length;s=Di(e.text,s))n.push(i+s);n.push(i+e.length);let r=this.scan(n,s=>{let o=n[s]-i,l=n[s+1]-i;return Df(e.dom,o,l).getClientRects()});return r.after?new Os(n[r.i+1],-1):new Os(n[r.i],1)}scanTile(e,i){if(!e.length)return new Os(i,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,i);if(l.isComposite())return this.scanTile(l,i)}let n=[i];for(let l=0,c=i;l<e.children.length;l++)n.push(c+=e.children[l].length);let r=this.scan(n,l=>{let c=e.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:Df(c.dom,0,c.length)).getClientRects()}),s=e.children[r.i],o=n[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new Os(n[r.i+1],-1):new Os(o,1)}}const Fu="";class fW{constructor(e,i){this.points=e,this.view=i,this.text="",this.lineSeparator=i.state.facet(et.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Fu}readRange(e,i){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=ui.get(r),l=r.nextSibling;if(l==i){o!=null&&o.breakAfter&&!l&&n!=this.view.contentDOM&&this.lineBreak();break}let c=ui.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:Sg(r))||Sg(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!pW(l,i)&&this.lineBreak(),r=l}return this.findPointBefore(n,i),this}readTextNode(e){let i=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,i.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=i.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(i))&&(s=l.index,o=l[0].length),this.append(i.slice(n,s<0?i.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=o-1);n=s+o}}readNode(e){let i=ui.get(e),n=i&&i.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,i){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==i&&(n.pos=this.text.length)}findPointInside(e,i){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(dW(e,n.node,n.offset)?i:0))}}function dW(t,e,i){for(;;){if(!e||i<yo(e))return!1;if(e==t)return!0;i=Ca(e)+1,e=e.parentNode}}function pW(t,e){let i;for(;!(t==e||!t);t=t.nextSibling){let n=ui.get(t);if(!(n!=null&&n.isWidget()))return!1;n&&(i||(i=[])).push(n)}if(i)for(let n of i){let r=n.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class JA{constructor(e,i){this.node=e,this.offset=i,this.pos=-1}}class mW{constructor(e,i,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=i>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=nB(e.docView.tile,i,n,0))){let l=s||o?[]:OW(e),c=new fW(l,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=vW(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!cb(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!cb(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((xe.ios||xe.chrome)&&e.state.selection.main.empty&&c!=u&&(d.from>0||d.to<e.state.doc.length)){let p=Math.min(c,u),g=Math.max(c,u),O=d.from-p,_=d.to-g;(O==0||O==1||p==0)&&(_==0||_==-1||g==e.state.doc.length)&&(c=0,u=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(se.range(u,c)):this.newSel=se.single(u,c)}}}function nB(t,e,i,n){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=n,d=n;c<t.children.length;c++){let p=t.children[c],g=u+p.length;if(u<e&&g>i)return nB(p,e,i,u);if(g>=e&&r==-1&&(r=c,s=u),u>i&&p.dom.parentNode==t.dom){o=c,l=d;break}d=g,u=g+p.breakAfter}return{from:s,to:l<0?n+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function rB(t,e){let i,{newSel:n}=e,r=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,c=r.from,u=null;(s===8||xe.android&&e.text.length<l-o)&&(c=r.to,u="end");let d=sB(t.state.doc.sliceString(o,l,Fu),e.text,c-o,u);d&&(xe.chrome&&s==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Fu+Fu&&d.toB--,i={from:o+d.from,to:o+d.toA,insert:at.of(e.text.slice(d.from,d.toB).split(Fu))})}else n&&(!t.hasFocus&&t.state.facet(uo)||kg(n,r))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!r.empty&&n&&n.main.empty?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(xe.mac||xe.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&i.insert.length==2&&(n=se.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:at.of([i.insert.toString().replace("."," ")])}):i&&i.from>=r.from&&i.to<=r.to&&(i.from!=r.from||i.to!=r.to)&&r.to-r.from-(i.to-i.from)<=4?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,r.to))}:t.state.doc.lineAt(r.from).to<r.to&&t.docView.lineHasWidget(r.to)&&t.inputState.insertingTextAt>Date.now()-50?i={from:r.from,to:r.to,insert:t.state.toText(t.inputState.insertingText)}:xe.chrome&&i&&i.from==i.to&&i.from==r.head&&i.insert.toString()==`
|
|
66
|
+
`&&t.lineWrapping&&(n&&(n=se.single(n.main.anchor-1,n.main.head-1)),i={from:r.from,to:r.to,insert:at.of([" "])}),i)return Vx(t,i,n,s);if(n&&!kg(n,r)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=iB(t.state.facet(fd).map(c=>c(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function Vx(t,e,i,n=-1){if(xe.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(xe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Uc(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Uc(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Uc(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=gW(t,e,i));return t.state.facet(ZD).some(c=>c(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function gW(t,e,i){let n,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let c=e.from<s.from?-1:1,u=c<0?s.from:s.to,d=gf(r.facet(fd).map(p=>p(t)),u,c);e.from==d&&(o=d)}if(o>-1)n={changes:e,selection:se.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=s.from<e.from?r.sliceDoc(s.from,e.from):"",u=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let c=r.changes(e),u=i&&i.main.to<=c.newLength?i.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let d=t.state.sliceDoc(e.from,e.to),p,g=i&&tB(t,i.main.head);if(g){let _=e.insert.length-(e.to-e.from);p={from:g.from,to:g.to-_}}else p=t.state.doc.lineAt(s.head);let O=s.to-e.to;n=r.changeByRange(_=>{if(_.from==s.from&&_.to==s.to)return{changes:c,range:u||_.map(c)};let b=_.to-O,x=b-d.length;if(t.state.sliceDoc(x,b)!=d||b>=p.from&&x<=p.to)return{range:_};let w=r.changes({from:x,to:b,insert:e.insert}),k=_.to-s.to;return{changes:w,range:u?se.range(Math.max(0,u.anchor+k),Math.max(0,u.head+k)):_.map(w)}})}else n={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:l,scrollIntoView:!0})}function sB(t,e,i,n){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let c=Math.max(0,s-Math.min(o,l));i-=o+c-s}if(o<s&&t.length<e.length){let c=i<=s&&i>=o?s-i:0;s-=c,l=s+(l-o),o=s}else if(l<s){let c=i<=s&&i>=l?s-i:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function OW(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=t.observer.selectionRange;return i&&(e.push(new JA(i,n)),(r!=i||s!=n)&&e.push(new JA(r,s))),e}function vW(t,e){if(t.length==0)return null;let i=t[0].pos,n=t.length==2?t[1].pos:i;return i>-1&&n>-1?se.single(i+e,n+e):null}function kg(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class _W{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,xe.safari&&e.contentDOM.addEventListener("input",()=>null),xe.gecko&&LW(e.contentDOM.ownerDocument)}handleEvent(e){!TW(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,i){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,i);for(let r of n.handlers){if(i.defaultPrevented)break;if(r(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=yW(e),n=this.handlers,r=this.view.contentDOM;for(let s in i)if(s!="scroll"){let o=!i[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!i[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=i}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&aB.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),xe.android&&xe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let i;return xe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((i=oB.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||bW.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=i||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let i=this.pendingIOSKey;return!i||i.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Uc(this.view.contentDOM,i.key,i.keyCode,i instanceof KeyboardEvent?i:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:xe.safari&&!xe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function eE(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(r){$n(i.state,r)}}}function yW(t){let e=Object.create(null);function i(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&i(l).handlers.push(eE(n.value,c))}if(o)for(let l in o){let c=o[l];c&&i(l).observers.push(eE(n.value,c))}}for(let n in Hr)i(n).handlers.push(Hr[n]);for(let n in Qr)i(n).observers.push(Qr[n]);return e}const oB=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],bW="dthko",aB=[16,17,18,20,91,92,224,225],em=6;function tm(t){return Math.max(0,t)*.7+8}function SW(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class xW{constructor(e,i,n,r){this.view=e,this.startEvent=i,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=i,this.scrollParents=Cq(e.contentDOM),this.atoms=e.state.facet(fd).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=i.shiftKey,this.multiple=e.state.facet(et.allowMultipleSelections)&&wW(e,i),this.dragging=kW(e,i)&&hB(i)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&SW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Ix(this.view);e.clientX-c.left<=r+em?i=-tm(r-e.clientX):e.clientX+c.right>=o-em&&(i=tm(e.clientX-o)),e.clientY-c.top<=s+em?n=-tm(s-e.clientY):e.clientY+c.bottom>=l-em&&(n=tm(e.clientY-l)),this.setScrollSpeed(i,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,i){this.scrollSpeed={x:e,y:i},e||i?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:i}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),i&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=i,i=0),(e||i)&&this.view.win.scrollBy(e,i),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:i}=this,n=iB(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(i.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(i=>i.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function wW(t,e){let i=t.state.facet(jD);return i.length?i[0](e):xe.mac?e.metaKey:e.ctrlKey}function CW(t,e){let i=t.state.facet(ID);return i.length?i[0](e):xe.mac?!e.altKey:!e.ctrlKey}function kW(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=Qf(t.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function TW(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,n;i!=t.contentDOM;i=i.parentNode)if(!i||i.nodeType==11||(n=ui.get(i))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const Hr=Object.create(null),Qr=Object.create(null),lB=xe.ie&&xe.ie_version<15||xe.ios&&xe.webkit_version<604;function AW(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),cB(t,i.value)},50)}function gO(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function cB(t,e){e=gO(t.state,$x,e);let{state:i}=t,n,r=1,s=i.toText(e),o=s.lines==i.selection.ranges.length;if(Ob!=null&&i.selection.ranges.every(c=>c.empty)&&Ob==s.toString()){let c=-1;n=i.changeByRange(u=>{let d=i.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let p=i.toText((o?s.line(r++).text:e)+i.lineBreak);return{changes:{from:d.from,insert:p},range:se.cursor(u.from+p.length)}})}else o?n=i.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:se.cursor(c.from+u.length)}}):n=i.replaceSelection(s);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Qr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Hr.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Qr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Qr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Hr.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(VD))if(i=n(t,e),i)break;if(!i&&e.button==0&&(i=MW(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new xW(t,e,i,n)),n&&t.observer.ignore(()=>{PD(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function tE(t,e,i,n){if(n==1)return se.cursor(e,i);if(n==2)return oW(t.state,e,i);{let r=t.docView.lineAt(e,i),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,se.range(o,l)}}const EW=xe.ie&&xe.ie_version<=11;let iE=null,nE=0,rE=0;function hB(t){if(!EW)return t.detail;let e=iE,i=rE;return iE=t,rE=Date.now(),nE=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(nE+1)%3:1}function MW(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=hB(e),r=t.state.selection;return{update(s){s.docChanged&&(i.pos=s.changes.mapPos(i.pos),r=r.map(s.changes))},get(s,o,l){let c=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=tE(t,c.pos,c.assoc,n);if(i.pos!=c.pos&&!o){let p=tE(t,i.pos,i.assoc,n),g=Math.min(p.from,d.from),O=Math.max(p.to,d.to);d=g<d.from?se.range(g,O):se.range(O,g)}return o?r.replaceRange(r.main.extend(d.from,d.to)):l&&n==1&&r.ranges.length>1&&(u=PW(r,c.pos))?u:l?r.addRange(d):se.create([d])}}}function PW(t,e){for(let i=0;i<t.ranges.length;i++){let{from:n,to:r}=t.ranges[i];if(n<=e&&r>=e)return se.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}Hr.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=i.to||o<=i.from)&&(i=se.range(s,o))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",gO(t.state,zx,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Hr.dragend=t=>(t.inputState.draggedContent=null,!1);function sE(t,e,i,n){if(i=gO(t.state,$x,i),!i)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=n&&s&&CW(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:i},c=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Hr.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),r=0,s=()=>{++r==i.length&&sE(t,e,n.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<i.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(i[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return sE(t,e,n,!0),!0}return!1};Hr.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=lB?null:e.clipboardData;return i?(cB(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(AW(t),!1)};function RW(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function QW(t){let e=[],i=[],n=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),i.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),i.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}n=!0}return{text:gO(t,zx,e.join(t.lineBreak)),ranges:i,linewise:n}}let Ob=null;Hr.copy=Hr.cut=(t,e)=>{if(!df(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:n,linewise:r}=QW(t.state);if(!i&&!r)return!1;Ob=r?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=lB?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",i),!0):(RW(t,i),!1)};const uB=Rs.define();function fB(t,e){let i=[];for(let n of t.facet(qD)){let r=n(t,e);r&&i.push(r)}return i.length?t.update({effects:i,annotations:uB.of(!0)}):null}function dB(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=fB(t.state,e);i?t.dispatch(i):t.update([])}},10)}Qr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),dB(t)};Qr.blur=t=>{t.observer.clearSelectionRange(),dB(t)};Qr.compositionstart=Qr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Qr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,xe.chrome&&xe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Qr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Hr.beforeinput=(t,e)=>{var i,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(i=e.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],c=t.posAtDOM(l.startContainer,l.startOffset),u=t.posAtDOM(l.endContainer,l.endOffset);return Vx(t,{from:c,to:u,insert:t.state.toText(s)},null),!0}}let r;if(xe.chrome&&xe.android&&(r=oB.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return xe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),xe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Qr.compositionend(t,e),20),!1};const oE=new Set;function LW(t){oE.has(t)||(oE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const aE=["pre-wrap","normal","pre-line","break-spaces"];let oh=!1;function lE(){oh=!1}class DW{constructor(e){this.lineWrapping=e,this.doc=at.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,i){let n=this.doc.lineAt(i).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((i-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return aE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let i=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(i=!0,this.heightSamples[Math.floor(r*10)]=!0)}return i}refresh(e,i,n,r,s,o){let l=aE.indexOf(e)>-1,c=Math.abs(i-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=i,this.charWidth=n,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u<o.length;u++){let d=o[u];d<0?u++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class BW{constructor(e,i){this.from=e,this.heights=i,this.index=0}get more(){return this.index<this.heights.length}}class Zr{constructor(e,i,n,r,s){this.from=e,this.length=i,this.top=n,this.height=r,this._content=s}get type(){return typeof this._content=="number"?Ki.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Cl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let i=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Zr(this.from,this.length+e.length,this.top,this.height+e.height,i)}}var Ct=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Ct||(Ct={}));const Xm=.001;class _n{constructor(e,i,n=2){this.length=e,this.height=i,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Xm&&(oh=!0),this.height=e)}replace(e,i,n){return _n.of(n)}decomposeLeft(e,i){i.push(this)}decomposeRight(e,i){i.push(this)}applyChanges(e,i,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:p}=r[l],g=s.lineAt(c,Ct.ByPosNoHeight,n.setDoc(i),0,0),O=g.to>=u?g:s.lineAt(u,Ct.ByPosNoHeight,n,0,0);for(p+=O.to-u,u=O.to;l>0&&g.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,c<g.from&&(g=s.lineAt(c,Ct.ByPosNoHeight,n,0,0));d+=g.from-c,c=g.from;let _=Xx.build(n.setDoc(o),e,d,p);s=Tg(s,s.replace(c,u,_))}return s.updateHeight(n,0)}static empty(){return new tr(0,0,0)}static of(e){if(e.length==1)return e[0];let i=0,n=e.length,r=0,s=0;for(;;)if(i==n)if(r>s*2){let l=e[i-1];l.break?e.splice(--i,1,l.left,null,l.right):e.splice(--i,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[i++];l&&(r+=l.size)}else{let l=e[--n];l&&(s+=l.size)}let o=0;return e[i-1]==null?(o=1,i--):e[i]==null&&(o=1,n++),new zW(_n.of(e.slice(0,i)),o,_n.of(e.slice(n)))}}function Tg(t,e){return t==e?t:(t.constructor!=e.constructor&&(oh=!0),e)}_n.prototype.size=1;const $W=Pe.replace({});class pB extends _n{constructor(e,i,n){super(e,i),this.deco=n,this.spaceAbove=0}mainBlock(e,i){return new Zr(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,i,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Zr(r,0,n,this.spaceAbove,$W):this.mainBlock(n,r)}lineAt(e,i,n,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,n,r,s).join(o):o}forEachLine(e,i,n,r,s,o){e<=s+this.length&&i>=s&&o(this.lineAt(0,Ct.ByPos,n,r,s))}setMeasuredHeight(e){let i=e.heights[e.index++];i<0?(this.spaceAbove=-i,i=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(i)}updateHeight(e,i=0,n=!1,r){return r&&r.from<=i&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class tr extends pB{constructor(e,i,n){super(e,i,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,i){return new Zr(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,i,n){let r=n[0];return n.length==1&&(r instanceof tr||r instanceof Wi&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Wi?r=new tr(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):_n.of(n)}updateHeight(e,i=0,n=!1,r){return r&&r.from<=i&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Wi extends _n{constructor(e){super(e,0)}heightMetrics(e,i){let n=e.doc.lineAt(i).number,r=e.doc.lineAt(i+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,i,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(i,r);if(i.lineWrapping){let u=r+(e<i.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),d=i.doc.lineAt(u),p=l+d.length*c,g=Math.max(n,e-p/2);return new Zr(d.from,d.length,g,p,0)}else{let u=Math.max(0,Math.min(o-s,Math.floor((e-n)/l))),{from:d,length:p}=i.doc.line(s+u);return new Zr(d,p,n+l*u,l,0)}}lineAt(e,i,n,r,s){if(i==Ct.ByHeight)return this.blockAt(e,n,r,s);if(i==Ct.ByPosNoHeight){let{from:O,to:_}=n.doc.lineAt(e);return new Zr(O,_-O,0,0,0)}let{firstLine:o,perLine:l,perChar:c}=this.heightMetrics(n,s),u=n.doc.lineAt(e),d=l+u.length*c,p=u.number-o,g=r+l*p+c*(u.from-s-p);return new Zr(u.from,u.length,Math.max(r,Math.min(g,r+this.height-d)),d,0)}forEachLine(e,i,n,r,s,o){e=Math.max(e,s),i=Math.min(i,s+this.length);let{firstLine:l,perLine:c,perChar:u}=this.heightMetrics(n,s);for(let d=e,p=r;d<=i;){let g=n.doc.lineAt(d);if(d==e){let _=g.number-l;p+=c*_+u*(e-s-_)}let O=c+u*g.length;o(new Zr(g.from,g.length,p,O,0)),p+=O,d=g.to+1}}replace(e,i,n){let r=this.length-i;if(r>0){let s=n[n.length-1];s instanceof Wi?n[n.length-1]=new Wi(s.length+r):n.push(null,new Wi(r-1))}if(e>0){let s=n[0];s instanceof Wi?n[0]=new Wi(e+s.length):n.unshift(new Wi(e-1),null)}return _n.of(n)}decomposeLeft(e,i){i.push(new Wi(e-1),null)}decomposeRight(e,i){i.push(null,new Wi(this.length-e-1))}updateHeight(e,i=0,n=!1,r){let s=i+this.length;if(r&&r.from<=i+this.length&&r.more){let o=[],l=Math.max(i,r.from),c=-1;for(r.from>i&&o.push(new Wi(r.from-i-1).updateHeight(e,i));l<=s&&r.more;){let d=e.doc.lineAt(l).length;o.length&&o.push(null);let p=r.heights[r.index++],g=0;p<0&&(g=-p,p=r.heights[r.index++]),c==-1?c=p:Math.abs(p-c)>=Xm&&(c=-2);let O=new tr(d,p,g);O.outdated=!1,o.push(O),l+=d+1}l<=s&&o.push(null,new Wi(s-l).updateHeight(e,l));let u=_n.of(o);return(c<0||Math.abs(u.height-this.height)>=Xm||Math.abs(c-this.heightMetrics(e,i).perLine)>=Xm)&&(oh=!0),Tg(this,u)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(i,i+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class zW extends _n{constructor(e,i,n){super(e.length+i+n.length,e.height+n.height,i|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,i,n,r){let s=n+this.left.height;return e<s?this.left.blockAt(e,i,n,r):this.right.blockAt(e,i,s,r+this.left.length+this.break)}lineAt(e,i,n,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,c=i==Ct.ByHeight?e<o:e<l,u=c?this.left.lineAt(e,i,n,r,s):this.right.lineAt(e,i,n,o,l);if(this.break||(c?u.to<l:u.from>l))return u;let d=i==Ct.ByPosNoHeight?Ct.ByPosNoHeight:Ct.ByPos;return c?u.join(this.right.lineAt(l,d,n,o,l)):this.left.lineAt(l,d,n,r,s).join(u)}forEachLine(e,i,n,r,s,o){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,i,n,r,s,o),i>=c&&this.right.forEachLine(e,i,n,l,c,o);else{let u=this.lineAt(c,Ct.ByPos,n,r,s);e<u.from&&this.left.forEachLine(e,u.from-1,n,r,s,o),u.to>=e&&u.from<=i&&o(u),i>u.to&&this.right.forEachLine(u.to+1,i,n,l,c,o)}}replace(e,i,n){let r=this.left.length+this.break;if(i<r)return this.balanced(this.left.replace(e,i,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,i-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&cE(s,o-1),i<this.length){let l=s.length;this.decomposeRight(i,s),cE(s,l)}return _n.of(s)}decomposeLeft(e,i){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,i);i.push(this.left),this.break&&(n++,e>=n&&i.push(null)),e>n&&this.right.decomposeLeft(e-n,i)}decomposeRight(e,i){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,i);e<n&&this.left.decomposeRight(e,i),this.break&&e<r&&i.push(null),i.push(this.right)}balanced(e,i){return e.size>2*i.size||i.size>2*e.size?_n.of(this.break?[e,null,i]:[e,i]):(this.left=Tg(this.left,e),this.right=Tg(this.right,i),this.setHeight(e.height+i.height),this.outdated=e.outdated||i.outdated,this.size=e.size+i.size,this.length=e.length+this.break+i.length,this)}updateHeight(e,i=0,n=!1,r){let{left:s,right:o}=this,l=i+s.length+this.break,c=null;return r&&r.from<=i+s.length&&r.more?c=s=s.updateHeight(e,i,n,r):s.updateHeight(e,i,n),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function cE(t,e){let i,n;t[e]==null&&(i=t[e-1])instanceof Wi&&(n=t[e+1])instanceof Wi&&t.splice(e-1,3,new Wi(i.length+1+n.length))}const NW=5;class Xx{constructor(e,i){this.pos=e,this.oracle=i,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,i){if(this.lineStart>-1){let n=Math.min(i,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof tr?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new tr(n-this.pos,-1,0)),this.writtenTo=n,i>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=i}point(e,i,n){if(e<i||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=i-e;n.block?this.addBlock(new pB(o,r,n)):(o||s||r>=NW)&&this.addLineDeco(r,s,o)}else i>e&&this.span(e,i);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:i}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=i,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new tr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,i){let n=new Wi(i-e);return this.oracle.doc.lineAt(e).to==i&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof tr)return e;let i=new tr(0,-1,0);return this.nodes.push(i),i}addBlock(e){this.enterLine();let i=e.deco;i&&i.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i&&i.endSide>0&&(this.covering=e)}addLineDeco(e,i,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=i,this.writtenTo=this.pos=this.pos+n}finish(e){let i=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(i instanceof tr)&&!this.isCovered?this.nodes.push(new tr(0,-1,0)):(this.writtenTo<this.pos||i==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let r of this.nodes)r instanceof tr&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,i,n,r){let s=new Xx(n,e);return Ge.spans(i,n,r,s,0),s.finish(n)}}function jW(t,e,i){let n=new IW;return Ge.compare(t,e,i,n,0),n.changes}class IW{constructor(){this.changes=[]}compareRange(){}comparePoint(e,i,n,r){(e<i||n&&n.heightRelevant||r&&r.heightRelevant)&&Wc(e,i,this.changes,5)}}function VW(t,e){let i=t.getBoundingClientRect(),n=t.ownerDocument,r=n.defaultView||window,s=Math.max(0,i.left),o=Math.min(r.innerWidth,i.right),l=Math.max(0,i.top),c=Math.min(r.innerHeight,i.bottom);for(let u=t.parentNode;u&&u!=n.body;)if(u.nodeType==1){let d=u,p=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&p.overflow!="visible"){let g=d.getBoundingClientRect();s=Math.max(s,g.left),o=Math.min(o,g.right),l=Math.max(l,g.top),c=Math.min(u==t.parentNode?r.innerHeight:c,g.bottom)}u=p.position=="absolute"||p.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-i.left,right:Math.max(s,o)-i.left,top:l-(i.top+e),bottom:Math.max(l,c)-(i.top+e)}}function XW(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0}function ZW(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class A_{constructor(e,i,n,r){this.from=e,this.to=i,this.size=n,this.displaySize=r}static same(e,i){if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=i[n];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,i){return Pe.replace({widget:new qW(this.displaySize*(i?e.scaleY:e.scaleX),i)}).range(this.from,this.to)}}class qW extends Gr{constructor(e,i){super(),this.size=e,this.vertical=i}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class hE{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=uE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=St.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=e.facet(Nx).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new DW(i),this.stateDeco=fE(e),this.heightMap=_n.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle.setDoc(e.doc),[new kr(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Pe.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:i}=this.state.selection;for(let n=0;n<=1;n++){let r=n?i.head:i.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new im(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?uE:new Zx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Gu(e,this.scaler))})}update(e,i=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=fE(this.state);let r=e.changedRanges,s=kr.extendWithRanges(r,jW(n,this.stateDeco,e?e.changes:vi.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);lE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||oh)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(i&&(i.range.head<c.from||i.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,i));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),i&&(this.scrollTarget=i),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(UD)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let i=e.contentDOM,n=window.getComputedStyle(i),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?St.RTL:St.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=i.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:A,scaleY:L}=MD(i,l);(A>.005&&Math.abs(this.scaleX-A)>.005||L>.005&&Math.abs(this.scaleY-L)>.005)&&(this.scaleX=A,this.scaleY=L,u|=16,o=c=!0)}let p=(parseInt(n.paddingTop)||0)*this.scaleY,g=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let O=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=O&&(this.scrollAnchorHeight=-1,this.scrollTop=O),this.scrolledToBottom=RD(e.scrollDOM);let _=(this.printing?ZW:VW)(i,this.paddingTop),b=_.top-this.pixelViewport.top,x=_.bottom-this.pixelViewport.bottom;this.pixelViewport=_;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!XW(e.dom))return 0;let k=l.width;if((this.contentDOMWidth!=k||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),c){let A=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(A)&&(o=!0),o||r.lineWrapping&&Math.abs(k-this.contentDOMWidth)>r.charWidth){let{lineHeight:L,charWidth:E,textHeight:N}=e.docView.measureTextSize();o=L>0&&r.refresh(s,L,E,N,Math.max(5,k/E),A),o&&(e.docView.minWidth=0,u|=16)}b>0&&x>0?d=Math.max(b,x):b<0&&x<0&&(d=Math.min(b,x)),lE();for(let L of this.viewports){let E=L.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(L);this.heightMap=(o?_n.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle,[new kr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new BW(L.from,E))}oh&&(u|=2)}let T=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,i){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new im(r.lineAt(o-n*1e3,Ct.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,Ct.ByHeight,s,0,0).to);if(i){let{head:u}=i.range;if(u<c.from||u>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(u,Ct.ByPos,s,0,0),g;i.y=="center"?g=(p.top+p.bottom)/2-d/2:i.y=="start"||i.y=="nearest"&&u<c.from?g=p.top:g=p.bottom-d,c=new im(r.lineAt(g-1e3/2,Ct.ByHeight,s,0,0).from,r.lineAt(g+d+1e3/2,Ct.ByHeight,s,0,0).to)}}return c}mapViewport(e,i){let n=i.mapPos(e.from,-1),r=i.mapPos(e.to,1);return new im(this.heightMap.lineAt(n,Ct.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Ct.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:i},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Ct.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(i,Ct.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-n,250)))&&(i==this.state.doc.length||s>=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,i){if(!e.length||i.empty)return e;let n=[];for(let r of e)i.touchesRange(r.from,r.to)||n.push(new A_(i.mapPos(r.from),i.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,i){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=St.LTR&&!n)return[];let l=[],c=(d,p,g,O)=>{if(p-d<s)return;let _=this.state.selection.main,b=[_.from];_.empty||b.push(_.to);for(let w of b)if(w>d&&w<p){c(d,w-10,g,O),c(w+10,p,g,O);return}let x=UW(e,w=>w.from>=g.from&&w.to<=g.to&&Math.abs(w.from-d)<s&&Math.abs(w.to-p)<s&&!b.some(k=>w.from<k&&w.to>k));if(!x){if(p<g.to&&i&&n&&i.visibleRanges.some(T=>T.from<=p&&T.to>=p)){let T=i.moveToLineBoundary(se.cursor(p),!1,!0).head;T>d&&(p=T)}let w=this.gapSize(g,d,p,O),k=n||w<2e6?w:2e6;x=new A_(d,p,w,k)}l.push(x)},u=d=>{if(d.length<o||d.type!=Ki.Text)return;let p=WW(d.from,d.to,this.stateDeco);if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,O,_;if(n){let b=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,x,w;if(g!=null){let k=rm(p,g),T=((this.visibleBottom-this.visibleTop)/2+b)/d.height;x=k-T,w=k+T}else x=(this.visibleTop-d.top-b)/d.height,w=(this.visibleBottom-d.top+b)/d.height;O=nm(p,x),_=nm(p,w)}else{let b=p.total*this.heightOracle.charWidth,x=r*this.heightOracle.charWidth,w=0;if(b>2e6)for(let E of e)E.from>=d.from&&E.from<d.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=E.size-E.displaySize);let k=this.pixelViewport.left+w,T=this.pixelViewport.right+w,A,L;if(g!=null){let E=rm(p,g),N=((T-k)/2+x)/b;A=E-N,L=E+N}else A=(k-x)/b,L=(T+x)/b;O=nm(p,A),_=nm(p,L)}O>d.from&&c(d.from,O,d,p),_<d.to&&c(_,d.to,d,p)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(u):u(d);return l}gapSize(e,i,n,r){let s=rm(r,n)-rm(r,i);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){A_.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Pe.set(e.map(i=>i.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let i=this.stateDeco;this.lineGaps.length&&(i=i.concat(this.lineGapDeco));let n=[];Ge.spans(i,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s<n.length&&!(r&8);s++){let o=this.visibleRanges[s],l=n[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(i=>i.from<=e&&i.to>=e)||Gu(this.heightMap.lineAt(e,Ct.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(i=>i.top<=e&&i.bottom>=e)||Gu(this.heightMap.lineAt(this.scaler.fromDOM(e),Ct.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let i=this.lineBlockAtHeight(e+8);return i.from>=this.viewport.from||this.viewportLines[0].top-e>200?i:this.viewportLines[0]}elementAtHeight(e){return Gu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class im{constructor(e,i){this.from=e,this.to=i}}function WW(t,e,i){let n=[],r=t,s=0;return Ge.spans(i,t,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(n.push({from:r,to:e}),s+=e-r),{total:s,ranges:n}}function nm({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function rm(t,e){let i=0;for(let{from:n,to:r}of t.ranges){if(e<=r){i+=e-n;break}i+=r-n}return i/t.total}function UW(t,e){for(let i of t)if(e(i))return i}const uE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function fE(t){let e=t.facet(dO).filter(n=>typeof n!="function"),i=t.facet(jx).filter(n=>typeof n!="function");return i.length&&e.push(Ge.join(i)),e}class Zx{constructor(e,i,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:c})=>{let u=i.lineAt(l,Ct.ByPos,e,0,0).top,d=i.lineAt(c,Ct.ByPos,e,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(i.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let i=0,n=0,r=0;;i++){let s=i<this.viewports.length?this.viewports[i]:null;if(!s||e<s.top)return r+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,r=s.domBottom}}fromDOM(e){for(let i=0,n=0,r=0;;i++){let s=i<this.viewports.length?this.viewports[i]:null;if(!s||e<s.domTop)return n+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,r=s.domBottom}}eq(e){return e instanceof Zx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((i,n)=>i.from==e.viewports[n].from&&i.to==e.viewports[n].to):!1}}function Gu(t,e){if(e.scale==1)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Zr(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map(r=>Gu(r,e)):t._content)}const sm=Se.define({combine:t=>t.join(" ")}),vb=Se.define({combine:t=>t.indexOf(!0)>-1}),_b=xa.newName(),mB=xa.newName(),gB=xa.newName(),OB={"&light":"."+mB,"&dark":"."+gB};function yb(t,e,i){return new xa(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return t;if(!i||!i[r])throw new RangeError(`Unsupported selector: ${r}`);return i[r]}):t+" "+n}})}const YW=yb("."+_b,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},OB),HW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},E_=xe.ie&&xe.ie_version<=11;class FW{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new kq,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(i=>{for(let n of i)this.queue.push(n);(xe.ie&&xe.ie_version<=11||xe.ios&&e.composing)&&i.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&xe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(xe.chrome&&xe.chrome_version<126)&&(this.editContext=new KW(e),e.state.facet(uo)&&(e.contentDOM.editContext=this.editContext.editContext)),E_&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var i;((i=this.view.docView)===null||i===void 0?void 0:i.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(i=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),i.length>0&&i[i.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(i=>{i.length>0&&i[i.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((i,n)=>i!=e[n]))){this.gapIntersection.disconnect();for(let i of e)this.gapIntersection.observe(i);this.gaps=e}}onSelectionChange(e){let i=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(uo)?n.root.activeElement!=this.dom:!df(this.dom,r))return;let s=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){i||(this.selectionChanged=!1);return}(xe.ie&&xe.ie_version<=11||xe.android&&xe.chrome)&&!n.state.selection.main.empty&&r.focusNode&&mf(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,i=Qf(e.root);if(!i)return!1;let n=xe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&GW(this.view,i)||i;if(!n||this.selectionRange.eq(n))return!1;let r=df(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Aq(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,i){this.selectionRange.set(e.node,e.offset,i.node,i.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,i=null;for(let n=this.dom;n;)if(n.nodeType==1)!i&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:i||(i=this.scrollTargets.slice(0,e)),i&&i.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!i&&(i=this.scrollTargets.slice(0,e)),i){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=i)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,HW),E_&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),E_&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,i){var n;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Uc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:i,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let i=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),i==-1?{from:i,to:n}=o:(i=Math.min(o.from,i),n=Math.max(o.to,n)))}return{from:i,to:n,typeOver:r}}readChange(){let{from:e,to:i,typeOver:n}=this.processRecords(),r=this.selectionChanged&&df(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new mW(this.view,e,i,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let n=this.view.state,r=rB(this.view,i);return this.view.state==n&&(i.domChanged||i.newSel&&!kg(this.view.state.selection,i.newSel.main))&&this.view.update([]),r}readMutation(e){let i=this.view.docView.tile.nearest(e.target);if(!i||i.isWidget())return null;if(i.markDirty(e.type=="attributes"),e.type=="childList"){let n=dE(i,e.previousSibling||e.target.previousSibling,-1),r=dE(i,e.nextSibling||e.target.nextSibling,1);return{from:n?i.posAfter(n):i.posAtStart,to:r?i.posBefore(r):i.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(uo)!=e.state.facet(uo)&&(e.view.contentDOM.editContext=e.state.facet(uo)?this.editContext.editContext:null))}destroy(){var e,i,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(i=this.gapIntersection)===null||i===void 0||i.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function dE(t,e,i){for(;e;){let n=ui.get(e);if(n&&n.parent==t)return n;let r=e.parentNode;e=r!=t.dom?r:i>0?e.nextSibling:e.previousSibling}return null}function pE(t,e){let i=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return mf(o.node,o.offset,r,s)&&([i,n,r,s]=[r,s,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}}function GW(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return pE(t,r)}let i=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),i=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?pE(t,i):null}class KW{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let i=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(n.updateRangeStart),c=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>n.text.length;l==this.from&&s<this.from?l=s:c==this.to&&s>this.to&&(c=s);let d=sB(e.state.sliceDoc(l,c),n.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let g=se.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));kg(g,r)||e.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+l,to:d.toA+l,insert:at.of(n.text.slice(d.from,d.toB).split(`
|
|
67
|
+
`))};if((xe.mac||xe.android)&&p.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:c,insert:at.of([n.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);Vx(e,p,se.single(this.toEditorPos(n.selectionStart,g),this.toEditorPos(n.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(i.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let c=e.coordsForChar(o);s=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||s||new DOMRect,r.push(s)}i.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c<u){let d=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(Pe.mark({attributes:{style:d}}).range(c,u))}}}e.dispatch({effects:HD.of(Pe.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)i.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=Qf(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,c,u)=>{if(n)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,i+=d,this.to+=d;return}else r=null,this.revertPending(e.state);if(s+=i,o+=i,o<=this.from)this.from+=d,this.to+=d;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+u.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}i+=d}),r&&!n&&this.revertPending(e.state),!n}update(e){let i=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||i)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:i}=e.selection.main;this.from=Math.max(0,i-1e4),this.to=Math.min(e.doc.length,i+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let i=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(i.from),this.toContextPos(i.from+i.insert.length),e.doc.sliceString(i.from,i.to))}setSelection(e){let{main:i}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),r=this.toContextPos(i.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:i}=e.selection.main;return!(this.from>0&&i-this.from<500||this.to<e.doc.length&&this.to-i<500||this.to-this.from>1e4*3)}toEditorPos(e,i=this.to-this.from){e=Math.min(e,i);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let i=this.composing;return i&&i.drifted?i.contextBase+(e-i.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ve{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var i;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Tq(e.parent)||document,this.viewState=new hE(e.state||et.create(e)),e.scrollTo&&e.scrollTo.is(Jp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(zc).map(r=>new x_(r));for(let r of this.plugins)r.update(this);this.observer=new FW(this),this.inputState=new _W(this),this.inputState.ensureHandlers(this.plugins),this.docView=new GA(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((i=document.fonts)===null||i===void 0)&&i.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let i=e.length==1&&e[0]instanceof hi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(i,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let i=!1,n=!1,r,s=this.state;for(let g of e){if(g.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=g.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(uB))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=fB(s,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(et.phrases)!=this.state.facet(et.phrases))return this.setState(s);r=xg.create(this,s,e),r.flags|=l;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:O}=g.state.selection;p=new Yc(O.empty?O:se.cursor(O.head,O.head>O.anchor?-1:1))}for(let O of g.effects)O.is(Jp)&&(p=O.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=Ag.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),i=this.docView.update(r),this.state.facet(Hu)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(sm)!=r.state.facet(sm)&&(this.viewState.mustMeasureContent=!0),(i||n||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!r.empty)for(let g of this.state.facet(db))try{g(r)}catch(O){$n(this.state,O,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!rB(this,d)&&u.force&&Uc(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let i=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new hE(e),this.plugins=e.facet(zc).map(n=>new x_(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new GA(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}i&&this.focus(),this.requestMeasure()}updatePlugins(e){let i=e.startState.facet(zc),n=e.state.facet(zc);if(i!=n){let r=[];for(let s of n){let o=i.indexOf(s);if(o<0)r.push(new x_(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);i!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let i=e.value;if(i&&i.docViewUpdate)try{i.docViewUpdate(this)}catch(n){$n(this.state,n,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let i=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(RD(n))s=-1,o=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(r);s=O.from,o=O.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(O=>{try{return O.read(this)}catch(_){return $n(this.state,_),mE}}),p=xg.create(this,this.state,[]),g=!1;p.flags|=c,i?i.flags|=c:i=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let O=0;O<u.length;O++)if(d[O]!=mE)try{let _=u[O];_.write&&_.write(d[O],this)}catch(_){$n(this.state,_)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let _=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(_>1||_<-1){r=r+_,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(i&&!i.empty)for(let l of this.state.facet(db))l(i)}get themeClasses(){return _b+" "+(this.state.facet(vb)?gB:mB)+" "+this.state.facet(sm)}updateAttrs(){let e=gE(this,FD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),i={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(uo)?"true":"false",class:"cm-content",style:`${xe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(i["aria-readonly"]="true"),gE(this,Nx,i);let n=this.observer.ignore(()=>{let r=qA(this.contentDOM,this.contentAttrs,i),s=qA(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=i,n}showAnnouncements(e){let i=!0;for(let n of e)for(let r of n.effects)if(r.is(ve.announce)){i&&(this.announceDOM.textContent=""),i=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Hu);let e=this.state.facet(ve.cspNonce);xa.mount(this.root,this.styleModules.concat(YW).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let i=0;i<this.measureRequests.length;i++)if(this.measureRequests[i].key===e.key){this.measureRequests[i]=e;return}}this.measureRequests.push(e)}}plugin(e){let i=this.pluginMap.get(e);return(i===void 0||i&&i.plugin!=e)&&this.pluginMap.set(e,i=this.plugins.find(n=>n.plugin==e)||null),i&&i.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,i,n){return T_(this,e,KA(this,e,i,n))}moveByGroup(e,i){return T_(this,e,KA(this,e,i,n=>cW(this,e.head,n)))}visualLineSide(e,i){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[i?n.length-1:0];return se.cursor(s.side(i,r)+e.from,s.forward(!i,r)?1:-1)}moveToLineBoundary(e,i,n=!0){return lW(this,e,i,n)}moveVertically(e,i,n){return T_(this,e,hW(this,e,i,n))}domAtPos(e,i=1){return this.docView.domAtPos(e,i)}posAtDOM(e,i=0){return this.docView.posFromDOM(e,i)}posAtCoords(e,i=!0){this.readMeasured();let n=gb(this,e,i);return n&&n.pos}posAndSideAtCoords(e,i=!0){return this.readMeasured(),gb(this,e,i)}coordsAtPos(e,i=1){this.readMeasured();let n=this.docView.coordsAt(e,i);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[_s.find(s,e-r.from,-1,i)];return Lf(n,o.dir==St.LTR==i>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(WD)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>JW)return zD(e.length);let i=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==i&&(s.fresh||$D(s.isolates,n=YA(this,e))))return s.order;n||(n=YA(this,e));let r=Dq(e.text,i,n);return this.bidiCache.push(new Ag(e.from,e.to,i,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||xe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{PD(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,i={}){return Jp.of(new Yc(typeof e=="number"?se.cursor(e):e,i.y,i.x,i.yMargin,i.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:i}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Jp.of(new Yc(se.cursor(n.from),"start","start",n.top-e,i,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Jt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Jt.define(()=>({}),{eventObservers:e})}static theme(e,i){let n=xa.newName(),r=[sm.of(n),Hu.of(yb(`.${n}`,e))];return i&&i.dark&&r.push(vb.of(!0)),r}static baseTheme(e){return So.lowest(Hu.of(yb("."+_b,e,OB)))}static findFromDOM(e){var i;let n=e.querySelector(".cm-content"),r=n&&ui.get(n)||ui.get(e);return((i=r==null?void 0:r.root)===null||i===void 0?void 0:i.view)||null}}ve.styleModule=Hu;ve.inputHandler=ZD;ve.clipboardInputFilter=$x;ve.clipboardOutputFilter=zx;ve.scrollHandler=YD;ve.focusChangeEffect=qD;ve.perLineTextDirection=WD;ve.exceptionSink=XD;ve.updateListener=db;ve.editable=uo;ve.mouseSelectionStyle=VD;ve.dragMovesSelection=ID;ve.clickAddsSelectionRange=jD;ve.decorations=dO;ve.blockWrappers=GD;ve.outerDecorations=jx;ve.atomicRanges=fd;ve.bidiIsolatedRanges=KD;ve.scrollMargins=JD;ve.darkTheme=vb;ve.cspNonce=Se.define({combine:t=>t.length?t[0]:""});ve.contentAttributes=Nx;ve.editorAttributes=FD;ve.lineWrapping=ve.contentAttributes.of({class:"cm-lineWrapping"});ve.announce=ze.define();const JW=4096,mE={};class Ag{constructor(e,i,n,r,s,o){this.from=e,this.to=i,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,i){if(i.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:St.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!i.touchesRange(o.from,o.to)&&n.push(new Ag(i.mapPos(o.from,1),i.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function gE(t,e,i){for(let n=t.state.facet(e),r=n.length-1;r>=0;r--){let s=n[r],o=typeof s=="function"?s(t):s;o&&Lx(o,i)}return i}const eU=xe.mac?"mac":xe.windows?"win":xe.linux?"linux":"key";function tU(t,e){const i=t.split(/-(?!$)/);let n=i[i.length-1];n=="Space"&&(n=" ");let r,s,o,l;for(let c=0;c<i.length-1;++c){const u=i[c];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))s=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),l&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function om(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),i!==!1&&e.shiftKey&&(t="Shift-"+t),t}const iU=So.default(ve.domEventHandlers({keydown(t,e){return _B(vB(e.state),t,e,"editor")}})),Ql=Se.define({enables:iU}),OE=new WeakMap;function vB(t){let e=t.facet(Ql),i=OE.get(e);return i||OE.set(e,i=sU(e.reduce((n,r)=>n.concat(r),[]))),i}function nU(t,e,i){return _B(vB(t.state),e,t,i)}let ma=null;const rU=4e3;function sU(t,e=eU){let i=Object.create(null),n=Object.create(null),r=(o,l)=>{let c=n[o];if(c==null)n[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var p,g;let O=i[o]||(i[o]=Object.create(null)),_=l.split(/ (?!$)/).map(w=>tU(w,e));for(let w=1;w<_.length;w++){let k=_.slice(0,w).join(" ");r(k,!0),O[k]||(O[k]={preventDefault:!0,stopPropagation:!1,run:[T=>{let A=ma={view:T,prefix:k,scope:o};return setTimeout(()=>{ma==A&&(ma=null)},rU),!0}]})}let b=_.join(" ");r(b,!1);let x=O[b]||(O[b]={preventDefault:!1,stopPropagation:!1,run:((g=(p=O._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});c&&x.run.push(c),u&&(x.preventDefault=!0),d&&(x.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=i[u]||(i[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=o;for(let g in d)d[g].run.push(O=>p(O,bb))}let c=o[e]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return i}let bb=null;function _B(t,e,i,n){bb=e;let r=vq(e),s=Ln(r,0),o=gs(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;ma&&ma.view==i&&ma.scope==n&&(l=ma.prefix+" ",aB.indexOf(e.keyCode)<0&&(u=!0,ma=null));let p=new Set,g=x=>{if(x){for(let w of x.run)if(!p.has(w)&&(p.add(w),w(i)))return x.stopPropagation&&(d=!0),!0;x.preventDefault&&(x.stopPropagation&&(d=!0),u=!0)}return!1},O=t[n],_,b;return O&&(g(O[l+om(r,e,!o)])?c=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(xe.windows&&e.ctrlKey&&e.altKey)&&!(xe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(_=wa[e.keyCode])&&_!=r?(g(O[l+om(_,e,!0)])||e.shiftKey&&(b=Pf[e.keyCode])!=r&&b!=_&&g(O[l+om(b,e,!1)]))&&(c=!0):o&&e.shiftKey&&g(O[l+om(r,e,!0)])&&(c=!0),!c&&g(O._any)&&(c=!0)),u&&(c=!0),c&&d&&e.stopPropagation(),bb=null,c}class dd{constructor(e,i,n,r,s){this.className=e,this.left=i,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,i){return i.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,i,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=yB(e);return[new dd(i,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return oU(e,i,n)}}function yB(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==St.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function vE(t,e,i,n){let r=t.coordsAtPos(e,i*2);if(!r)return n;let s=t.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=t.posAtCoords({x:s.left+1,y:o}),c=t.posAtCoords({x:s.right-1,y:o});return l==null||c==null?n:{from:Math.max(n.from,Math.min(l,c)),to:Math.min(n.to,Math.max(l,c))}}function oU(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),r=Math.min(i.to,t.viewport.to),s=t.textDirection==St.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),c=yB(t),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),p=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=l.right-(d?parseInt(d.paddingRight):0),O=mb(t,n,1),_=mb(t,r,-1),b=O.type==Ki.Text?O:null,x=_.type==Ki.Text?_:null;if(b&&(t.lineWrapping||O.widgetLineBreaks)&&(b=vE(t,n,1,b)),x&&(t.lineWrapping||_.widgetLineBreaks)&&(x=vE(t,r,-1,x)),b&&x&&b.from==x.from&&b.to==x.to)return k(T(i.from,i.to,b));{let L=b?T(i.from,null,b):A(O,!1),E=x?T(null,i.to,x):A(_,!0),N=[];return(b||O).to<(x||_).from-(b&&x?1:0)||O.widgetLineBreaks>1&&L.bottom+t.defaultLineHeight/2<E.top?N.push(w(p,L.bottom,g,E.top)):L.bottom<E.top&&t.elementAtHeight((L.bottom+E.top)/2).type==Ki.Text&&(L.bottom=E.top=(L.bottom+E.top)/2),k(L).concat(N).concat(k(E))}function w(L,E,N,z){return new dd(e,L-c.left,E-c.top,Math.max(0,N-L),z-E)}function k({top:L,bottom:E,horizontal:N}){let z=[];for(let Z=0;Z<N.length;Z+=2)z.push(w(N[Z],L,N[Z+1],E));return z}function T(L,E,N){let z=1e9,Z=-1e9,J=[];function U(D,j,$,X,H){let F=t.coordsAtPos(D,D==N.to?-2:2),M=t.coordsAtPos($,$==N.from?2:-2);!F||!M||(z=Math.min(F.top,M.top,z),Z=Math.max(F.bottom,M.bottom,Z),H==St.LTR?J.push(s&&j?p:F.left,s&&X?g:M.right):J.push(!s&&X?p:M.left,!s&&j?g:F.right))}let R=L??N.from,B=E??N.to;for(let D of t.visibleRanges)if(D.to>R&&D.from<B)for(let j=Math.max(D.from,R),$=Math.min(D.to,B);;){let X=t.state.doc.lineAt(j);for(let H of t.bidiSpans(X)){let F=H.from+X.from,M=H.to+X.from;if(F>=$)break;M>j&&U(Math.max(F,j),L==null&&F<=R,Math.min(M,$),E==null&&M>=B,H.dir)}if(j=X.to+1,j>=$)break}return J.length==0&&U(R,L==null,B,E==null,t.textDirection),{top:z,bottom:Z,horizontal:J}}function A(L,E){let N=l.top+(E?L.top:L.bottom);return{top:N,bottom:N,horizontal:[]}}}function aU(t,e){return t.constructor==e.constructor&&t.eq(e)}class lU{constructor(e,i){this.view=e,this.layer=i,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),i.above&&this.dom.classList.add("cm-layer-above"),i.class&&this.dom.classList.add(i.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),i.mount&&i.mount(this.dom,e)}update(e){e.startState.facet(Zm)!=e.state.facet(Zm)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let i=0,n=e.facet(Zm);for(;i<n.length&&n[i]!=this.layer;)i++;this.dom.style.zIndex=String((this.layer.above?150:-1)-i)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:i}=this.view;(e!=this.scaleX||i!=this.scaleY)&&(this.scaleX=e,this.scaleY=i,this.dom.style.transform=`scale(${1/e}, ${1/i})`)}draw(e){if(e.length!=this.drawn.length||e.some((i,n)=>!aU(i,this.drawn[n]))){let i=this.dom.firstChild,n=0;for(let r of e)r.update&&i&&r.constructor&&this.drawn[n].constructor&&r.update(i,this.drawn[n])?(i=i.nextSibling,n++):this.dom.insertBefore(r.draw(),i);for(;i;){let r=i.nextSibling;i.remove(),i=r}this.drawn=e,xe.safari&&xe.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Zm=Se.define();function bB(t){return[Jt.define(e=>new lU(e,t)),Zm.of(t)]}const Bf=Se.define({combine(t){return Qs(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,i)=>Math.min(e,i),drawRangeCursor:(e,i)=>e||i})}});function cU(t={}){return[Bf.of(t),hU,uU,fU,UD.of(!0)]}function SB(t){return t.startState.facet(Bf)!=t.state.facet(Bf)}const hU=bB({above:!0,markers(t){let{state:e}=t,i=e.facet(Bf),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||i.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:se.cursor(r.head,r.head>r.anchor?-1:1);for(let c of dd.forRange(t,o,l))n.push(c)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let i=SB(t);return i&&_E(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){_E(e.state,t)},class:"cm-cursorLayer"});function _E(t,e){e.style.animationDuration=t.facet(Bf).cursorBlinkRate+"ms"}const uU=bB({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:dd.forRange(t,"cm-selectionBackground",e)).reduce((e,i)=>e.concat(i))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||SB(t)},class:"cm-selectionLayer"}),fU=So.highest(ve.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),xB=ze.define({map(t,e){return t==null?null:e.mapPos(t)}}),Ku=Bi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((i,n)=>n.is(xB)?n.value:i,t)}}),dU=Jt.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(Ku);i==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Ku)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Ku),i=e!=null&&t.coordsAtPos(e);if(!i)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Ku)!=t&&this.view.dispatch({effects:xB.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function pU(){return[Ku,dU]}function yE(t,e,i,n,r){e.lastIndex=0;for(let s=t.iterRange(i,n),o=i,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(o+l.index,l)}function mU(t,e){let i=t.visibleRanges;if(i.length==1&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:r,to:s}of i)r=Math.max(t.state.doc.lineAt(r).from,r-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=s:n.push({from:r,to:s});return n}class gU{constructor(e){const{regexp:i,decoration:n,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!i.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=i,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof n=="function")this.addMatch=(l,c,u,d)=>{let p=n(l,c,u);p&&d(u,u+l[0].length,p)};else if(n)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let i=new _o,n=i.add.bind(i);for(let{from:r,to:s}of mU(e,this.maxLength))yE(e.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,e,o,n));return i.finish()}updateDeco(e,i){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),r=Math.max(c,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,i.map(e.changes),n,r):i}updateRange(e,i,n,r){for(let s of e.visibleRanges){let o=Math.max(s.from,n),l=Math.min(s.to,r);if(l>=o){let c=e.state.doc.lineAt(o),u=c.to<l?e.state.doc.lineAt(l):c,d=Math.max(s.from,c.from),p=Math.min(s.to,u.to);if(this.boundary){for(;o>c.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;l<u.to;l++)if(this.boundary.test(u.text[l-u.from])){p=l;break}}let g=[],O,_=(b,x,w)=>g.push(w.range(b,x));if(c==u)for(this.regexp.lastIndex=d-c.from;(O=this.regexp.exec(c.text))&&O.index<p-c.from;)this.addMatch(O,e,O.index+c.from,_);else yE(e.state.doc,this.regexp,d,p,(b,x)=>this.addMatch(x,e,b,_));i=i.update({filterFrom:d,filterTo:p,filter:(b,x)=>b<d||x>p,add:g})}}return i}}const Sb=/x/.unicode!=null?"gu":"g",OU=new RegExp(`[\0-\b
|
|
68
|
+
--\u2028\u2029\uFEFF-]`,Sb),vU={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let M_=null;function _U(){var t;if(M_==null&&typeof document<"u"&&document.body){let e=document.body.style;M_=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return M_||!1}const qm=Se.define({combine(t){let e=Qs(t,{render:null,specialChars:OU,addSpecialChars:null});return(e.replaceTabs=!_U())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Sb)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Sb)),e}});function yU(t={}){return[qm.of(t),bU()]}let bE=null;function bU(){return bE||(bE=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=Pe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(qm)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new gU({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:r}=i.state,s=Ln(e[0],0);if(s==9){let o=r.lineAt(n),l=i.state.tabSize,c=Yr(o.text,l,n-o.from);return Pe.replace({widget:new CU((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Pe.replace({widget:new wU(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(qm);t.startState.facet(qm)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const SU="•";function xU(t){return t>=32?SU:t==10?"":String.fromCharCode(9216+t)}class wU extends Gr{constructor(e,i){super(),this.options=e,this.code=i}eq(e){return e.code==this.code}toDOM(e){let i=xU(this.code),n=e.state.phrase("Control character")+" "+(vU[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,i);if(r)return r;let s=document.createElement("span");return s.textContent=i,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class CU extends Gr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function kU(){return AU}const TU=Pe.line({class:"cm-activeLine"}),AU=Jt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let r=t.lineBlockAt(n.head);r.from>e&&(i.push(TU.range(r.from)),e=r.from)}return Pe.set(i)}},{decorations:t=>t.decorations});class EU extends Gr{constructor(e){super(),this.content=e}toDOM(e){let i=document.createElement("span");return i.className="cm-placeholder",i.style.pointerEvents="none",i.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),i.setAttribute("aria-hidden","true"),i}coordsAt(e){let i=e.firstChild?pf(e.firstChild):[];if(!i.length)return null;let n=window.getComputedStyle(e.parentNode),r=Lf(i[0],n.direction!="rtl"),s=parseInt(n.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function MU(t){let e=Jt.fromClass(class{constructor(i){this.view=i,this.placeholder=t?Pe.set([Pe.widget({widget:new EU(t),side:1}).range(0)]):Pe.none}get decorations(){return this.view.state.doc.length?Pe.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,ve.contentAttributes.of({"aria-placeholder":t})]:e}const xb=2e3;function PU(t,e,i){let n=Math.min(e.line,i.line),r=Math.max(e.line,i.line),s=[];if(e.off>xb||i.off>xb||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let c=n;c<=r;c++){let u=t.doc.line(c);u.length<=l&&s.push(se.range(u.from+o,u.to+l))}}else{let o=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let c=n;c<=r;c++){let u=t.doc.line(c),d=ib(u.text,o,t.tabSize,!0);if(d<0)s.push(se.cursor(u.to));else{let p=ib(u.text,l,t.tabSize);s.push(se.range(u.from+d,u.from+p))}}}return s}function RU(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function SE(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),r=i-n.from,s=r>xb?-1:r==n.length?RU(t,e.clientX):Yr(n.text,t.state.tabSize,i-n.from);return{line:n.number,col:s,off:r}}function QU(t,e){let i=SE(t,e),n=t.state.selection;return i?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(i.line).from),o=r.state.doc.lineAt(s);i={line:o.number,col:i.col,off:Math.min(i.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let l=SE(t,r);if(!l)return n;let c=PU(t.state,i,l);return c.length?o?se.create(c.concat(n.ranges)):se.create(c):n}}:null}function LU(t){let e=(i=>i.altKey&&i.button==0);return ve.mouseSelectionStyle.of((i,n)=>e(n)?QU(i,n):null)}const DU={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},BU={style:"cursor: crosshair"};function $U(t={}){let[e,i]=DU[t.key||"Alt"],n=Jt.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||i(r))},keyup(r){(r.keyCode==e||!i(r))&&this.set(!1)},mousemove(r){this.set(i(r))}}});return[n,ve.contentAttributes.of(r=>{var s;return!((s=r.plugin(n))===null||s===void 0)&&s.isDown?BU:null})]}const am="-10000px";class wB{constructor(e,i,n,r){this.facet=i,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(i),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,i){var n;let r=e.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let o=[],l=i?[]:null;for(let c=0;c<s.length;c++){let u=s[c],d=-1;if(u){for(let p=0;p<this.tooltips.length;p++){let g=this.tooltips[p];g&&g.create==u.create&&(d=p)}if(d<0)o[c]=this.createTooltipView(u,c?o[c-1]:null),l&&(l[c]=!!u.above);else{let p=o[c]=this.tooltipViews[d];l&&(l[c]=i[d]),p.update&&p.update(e)}}}for(let c of this.tooltipViews)o.indexOf(c)<0&&(this.removeTooltipView(c),(n=c.destroy)===null||n===void 0||n.call(c));return i&&(l.forEach((c,u)=>i[u]=c),i.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function zU(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const P_=Se.define({combine:t=>{var e,i,n;return{position:xe.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((i=t.find(r=>r.parent))===null||i===void 0?void 0:i.parent)||null,tooltipSpace:((n=t.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||zU}}}),xE=new WeakMap,qx=Jt.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(P_);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new wB(t,Wx,(i,n)=>this.createTooltip(i,n),i=>{this.resizeObserver&&this.resizeObserver.unobserve(i.dom),i.dom.remove()}),this.above=this.manager.tooltips.map(i=>!!i.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(i=>{Date.now()>this.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(P_);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",i.dom.appendChild(r)}return i.dom.style.position=this.position,i.dom.style.top=am,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(i=this.intersectionObserver)===null||i===void 0||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(xe.safari){let o=s.getBoundingClientRect();i=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else i=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=Ix(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(P_).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:i,space:n,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let c=this.manager.tooltips[l],u=this.manager.tooltipViews[l],{dom:d}=u,p=t.pos[l],g=t.size[l];if(!p||c.clip!==!1&&(p.bottom<=Math.max(i.top,n.top)||p.top>=Math.min(i.bottom,n.bottom)||p.right<Math.max(i.left,n.left)-.1||p.left>Math.min(i.right,n.right)+.1)){d.style.top=am;continue}let O=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,_=O?7:0,b=g.right-g.left,x=(e=xE.get(u))!==null&&e!==void 0?e:g.bottom-g.top,w=u.offset||jU,k=this.view.textDirection==St.LTR,T=g.width>n.right-n.left?k?n.left:n.right-g.width:k?Math.max(n.left,Math.min(p.left-(O?14:0)+w.x,n.right-b)):Math.min(Math.max(n.left,p.left-b+(O?14:0)-w.x),n.right-b),A=this.above[l];!c.strictSide&&(A?p.top-x-_-w.y<n.top:p.bottom+x+_+w.y>n.bottom)&&A==n.bottom-p.bottom>p.top-n.top&&(A=this.above[l]=!A);let L=(A?p.top-n.top:n.bottom-p.bottom)-_;if(L<x&&u.resize!==!1){if(L<this.view.defaultLineHeight){d.style.top=am;continue}xE.set(u,x),d.style.height=(x=L)/s+"px"}else d.style.height&&(d.style.height="");let E=A?p.top-x-_-w.y:p.bottom+_+w.y,N=T+b;if(u.overlap!==!0)for(let z of o)z.left<N&&z.right>T&&z.top<E+x&&z.bottom>E&&(E=A?z.top-x-2-_:z.bottom+_+2);if(this.position=="absolute"?(d.style.top=(E-t.parent.top)/s+"px",wE(d,(T-t.parent.left)/r)):(d.style.top=E/s+"px",wE(d,T/r)),O){let z=p.left+(k?w.x:-w.x)-(T+14-7);O.style.left=z/r+"px"}u.overlap!==!0&&o.push({left:T,top:E,right:N,bottom:E+x}),d.classList.toggle("cm-tooltip-above",A),d.classList.toggle("cm-tooltip-below",!A),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=am}},{eventObservers:{scroll(){this.maybeMeasure()}}});function wE(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const NU=ve.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),jU={x:0,y:0},Wx=Se.define({enables:[qx,NU]}),Eg=Se.define({combine:t=>t.reduce((e,i)=>e.concat(i),[])});class OO{static create(e){return new OO(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new wB(e,Eg,(i,n)=>this.createHostedView(i,n),i=>i.dom.remove())}createHostedView(e,i){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,i?i.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let i of this.manager.tooltipViews)i.mount&&i.mount(e);this.mounted=!0}positioned(e){for(let i of this.manager.tooltipViews)i.positioned&&i.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let i of this.manager.tooltipViews)(e=i.destroy)===null||e===void 0||e.call(i)}passProp(e){let i;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(i===void 0)i=r;else if(i!==r)return}}return i}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const IU=Wx.compute([Eg],t=>{let e=t.facet(Eg);return e.length===0?null:{pos:Math.min(...e.map(i=>i.pos)),end:Math.max(...e.map(i=>{var n;return(n=i.end)!==null&&n!==void 0?n:i.pos})),create:OO.create,above:e[0].above,arrow:e.some(i=>i.arrow)}});class VU{constructor(e,i,n,r,s){this.view=e,this.source=i,this.field=n,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:i}=this,n=e.docView.tile.nearest(i.target);if(!n)return;let r,s=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(i),r==null)return;let l=e.coordsAtPos(r);if(!l||i.y<l.top||i.y>l.bottom||i.x<l.left-e.defaultCharacterWidth||i.x>l.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(r)).find(d=>d.from<=r&&d.to>=r),u=c&&c.dir==St.RTL?-1:1;s=i.x<l.left?-u:u}let o=this.source(e,r,s);if(o!=null&&o.then){let l=this.pending={pos:r};o.then(c=>{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>$n(e.state,c,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(qx),i=e?e.manager.tooltips.findIndex(n=>n.create==OO.create):-1;return i>-1?e.manager.tooltipViews[i]:null}mousemove(e){var i,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!XU(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(n=(i=r[0])===null||i===void 0?void 0:i.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!ZU(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:i}=this;if(i.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let i=n=>{e.removeEventListener("mouseleave",i),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",i)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const lm=4;function XU(t,e){let{left:i,right:n,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=i-lm&&e.clientX<=n+lm&&e.clientY>=r-lm&&e.clientY<=s+lm}function ZU(t,e,i,n,r,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>n||o.right<n||o.top>r||Math.min(o.bottom,l)<r)return!1;let c=t.posAtCoords({x:n,y:r},!1);return c>=e&&c<=i}function qU(t,e={}){let i=ze.define(),n=Bi.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let l of r){let c=s.changes.mapPos(l.pos,-1,Fi.TrackDel);if(c!=null){let u=Object.assign(Object.create(null),l);u.pos=c,u.end!=null&&(u.end=s.changes.mapPos(u.end)),o.push(u)}}r=o}for(let o of s.effects)o.is(i)&&(r=o.value),o.is(WU)&&(r=[]);return r},provide:r=>Eg.from(r)});return{active:n,extension:[n,Jt.define(r=>new VU(r,t,n,i,e.hoverTime||300)),IU]}}function CB(t,e){let i=t.plugin(qx);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}const WU=ze.define(),CE=Se.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}});function Ux(t,e){let i=t.plugin(kB),n=i?i.specs.indexOf(e):-1;return n>-1?i.panels[n]:null}const kB=Jt.fromClass(class{constructor(t){this.input=t.state.facet($f),this.specs=this.input.filter(i=>i),this.panels=this.specs.map(i=>i(t));let e=t.state.facet(CE);this.top=new cm(t,!0,e.topContainer),this.bottom=new cm(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(i=>i.top)),this.bottom.sync(this.panels.filter(i=>!i.top));for(let i of this.panels)i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(t){let e=t.state.facet(CE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new cm(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new cm(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet($f);if(i!=this.input){let n=i.filter(c=>c),r=[],s=[],o=[],l=[];for(let c of n){let u=this.specs.indexOf(c),d;u<0?(d=c(t.view),l.push(d)):(d=this.panels[u],d.update&&d.update(t)),r.push(d),(d.top?s:o).push(d)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ve.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class cm{constructor(e,i,n){this.view=e,this.top=i,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let i of this.panels)i.destroy&&e.indexOf(i)<0&&i.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let i=this.container||this.view.dom;i.insertBefore(this.dom,this.top?i.firstChild:null)}let e=this.dom.firstChild;for(let i of this.panels)if(i.dom.parentNode==this.dom){for(;e!=i.dom;)e=kE(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=kE(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function kE(t){let e=t.nextSibling;return t.remove(),e}const $f=Se.define({enables:kB});function UU(t,e){let i,n=new Promise(o=>i=o),r=o=>YU(o,e,i);t.state.field(R_,!1)?t.dispatch({effects:TB.of(r)}):t.dispatch({effects:ze.appendConfig.of(R_.init(()=>[r]))});let s=AB.of(r);return{close:s,result:n.then(o=>((t.win.queueMicrotask||(c=>t.win.setTimeout(c,10)))(()=>{t.state.field(R_).indexOf(r)>-1&&t.dispatch({effects:s})}),o))}}const R_=Bi.define({create(){return[]},update(t,e){for(let i of e.effects)i.is(TB)?t=[i.value].concat(t):i.is(AB)&&(t=t.filter(n=>n!=i.value));return t},provide:t=>$f.computeN([t],e=>e.field(t))}),TB=ze.define(),AB=ze.define();function YU(t,e,i){let n=e.content?e.content(t,()=>o(null)):null;if(!n){if(n=vt("form"),e.input){let l=vt("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),n.appendChild(vt("label",(e.label||"")+": ",l))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(vt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let l=0;l<r.length;l++){let c=r[l];c.addEventListener("keydown",u=>{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=vt("div",n,vt("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&t.focus(),i(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=n.querySelector(e.focus):l=n.querySelector("input")||n.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class bo extends Sa{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}bo.prototype.elementClass="";bo.prototype.toDOM=void 0;bo.prototype.mapMode=Fi.TrackBefore;bo.prototype.startSide=bo.prototype.endSide=-1;bo.prototype.point=!0;const Wm=Se.define(),HU=Se.define(),FU={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ge.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Of=Se.define();function GU(t){return[EB(),Of.of({...FU,...t})]}const TE=Se.define({combine:t=>t.some(e=>e)});function EB(t){return[KU]}const KU=Jt.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Of).map(e=>new EE(t,e)),this.fixed=!t.state.facet(TE);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<(i.to-i.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(TE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=Ge.iter(this.view.state.facet(Wm),this.view.viewport.from),n=[],r=this.gutters.map(s=>new JU(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==Ki.Text&&o){wb(i,n,l.from);for(let c of r)c.line(this.view,l,n);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==Ki.Text){wb(i,n,s.from);for(let o of r)o.line(this.view,s,n)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Of),i=t.state.facet(Of),n=t.docChanged||t.heightChanged||t.viewportChanged||!Ge.eq(t.startState.facet(Wm),t.state.facet(Wm),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let r of this.gutters)r.update(t)&&(n=!0);else{n=!0;let r=[];for(let s of i){let o=e.indexOf(s);o<0?r.push(new EE(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ve.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||i.gutters.length==0||!i.fixed)return null;let n=i.dom.offsetWidth*e.scaleX,r=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==St.LTR?{left:n,right:r}:{right:n,left:r}})});function AE(t){return Array.isArray(t)?t:[t]}function wb(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class JU{constructor(e,i,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ge.iter(e.markers,i.from)}addElement(e,i,n){let{gutter:r}=this,s=(i.top-this.height)/e.scaleY,o=i.height/e.scaleY;if(this.i==r.elements.length){let l=new MB(e,o,s,n);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,n);this.height=i.bottom,this.i++}line(e,i,n){let r=[];wb(this.cursor,r,i.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,i,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,i,r)}widget(e,i){let n=this.gutter.config.widgetMarker(e,i.widget,i),r=n?[n]:null;for(let s of e.state.facet(HU)){let o=s(e,i.widget,i);o&&(r||(r=[])).push(o)}r&&this.addElement(e,i,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let i=e.elements.pop();e.dom.removeChild(i.dom),i.destroy()}}}class EE{constructor(e,i){this.view=e,this.config=i,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in i.domEventHandlers)this.dom.addEventListener(n,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);i.domEventHandlers[n](e,l,r)&&r.preventDefault()});this.markers=AE(i.markers(e)),i.initialSpacer&&(this.spacer=new MB(e,0,0,[i.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let i=this.markers;if(this.markers=AE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!Ge.eq(this.markers,i,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class MB{constructor(e,i,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,i,n,r)}update(e,i,n,r){this.height!=i&&(this.height=i,this.dom.style.height=i+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),eY(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,i){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=s<i.length?i[s++]:null,u=!1;if(c){let d=c.elementClass;d&&(n+=" "+d);for(let p=o;p<this.markers.length;p++)if(this.markers[p].compare(c)){l=p,u=!0;break}}else l=this.markers.length;for(;o<l;){let d=this.markers[o++];if(d.toDOM){d.destroy(r);let p=r.nextSibling;r.remove(),r=p}}if(!c)break;c.toDOM&&(u?r=r.nextSibling:this.dom.insertBefore(c.toDOM(e),r)),u&&o++}this.dom.className=n,this.markers=i}destroy(){this.setMarkers(null,[])}}function eY(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].compare(e[i]))return!1;return!0}const tY=Se.define(),iY=Se.define(),Nc=Se.define({combine(t){return Qs(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,i){let n=Object.assign({},e);for(let r in i){let s=n[r],o=i[r];n[r]=s?(l,c,u)=>s(l,c,u)||o(l,c,u):o}return n}})}});class Q_ extends bo{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function L_(t,e){return t.state.facet(Nc).formatNumber(e,t.state)}const nY=Of.compute([Nc],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(tY)},lineMarker(e,i,n){return n.some(r=>r.toDOM)?null:new Q_(L_(e,e.state.doc.lineAt(i.from).number))},widgetMarker:(e,i,n)=>{for(let r of e.state.facet(iY)){let s=r(e,i,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Nc)!=e.state.facet(Nc),initialSpacer(e){return new Q_(L_(e,ME(e.state.doc.lines)))},updateSpacer(e,i){let n=L_(i.view,ME(i.view.state.doc.lines));return n==e.number?e:new Q_(n)},domEventHandlers:t.facet(Nc).domEventHandlers,side:"before"}));function rY(t={}){return[Nc.of(t),EB(),nY]}function ME(t){let e=9;for(;e<t;)e=e*10+9;return e}const sY=new class extends bo{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},oY=Wm.compute(["selection"],t=>{let e=[],i=-1;for(let n of t.selection.ranges){let r=t.doc.lineAt(n.head).from;r>i&&(i=r,e.push(sY.range(r)))}return Ge.of(e)});function aY(){return oY}const PB=1024;let lY=0;class Tr{constructor(e,i){this.from=e,this.to=i}}class Ne{constructor(e={}){this.id=lY++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=_i.match(e)),i=>{let n=e(i);return n===void 0?null:[this,n]}}}Ne.closedBy=new Ne({deserialize:t=>t.split(" ")});Ne.openedBy=new Ne({deserialize:t=>t.split(" ")});Ne.group=new Ne({deserialize:t=>t.split(" ")});Ne.isolate=new Ne({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Ne.contextHash=new Ne({perNode:!0});Ne.lookAhead=new Ne({perNode:!0});Ne.mounted=new Ne({perNode:!0});class Hc{constructor(e,i,n,r=!1){this.tree=e,this.overlay=i,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Ne.mounted.id]}}const cY=Object.create(null);class _i{constructor(e,i,n,r=0){this.name=e,this.props=i,this.id=n,this.flags=r}static define(e){let i=e.props&&e.props.length?Object.create(null):cY,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new _i(e.name||"",i,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let i=this.prop(Ne.group);return i?i.indexOf(e)>-1:!1}return this.id==e}static match(e){let i=Object.create(null);for(let n in e)for(let r of n.split(" "))i[r]=e[n];return n=>{for(let r=n.prop(Ne.group),s=-1;s<(r?r.length:0);s++){let o=i[s<0?n.name:r[s]];if(o)return o}}}}_i.none=new _i("",Object.create(null),0,8);class pd{constructor(e){this.types=e;for(let i=0;i<e.length;i++)if(e[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let i=[];for(let n of this.types){let r=null;for(let s of e){let o=s(n);if(o){r||(r=Object.assign({},n.props));let l=o[1],c=o[0];c.combine&&c.id in r&&(l=c.combine(r[c.id],l)),r[c.id]=l}}i.push(r?new _i(n.name,r,n.id,n.flags):n)}return new pd(i)}}const hm=new WeakMap,PE=new WeakMap;var ut;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(ut||(ut={}));class ct{constructor(e,i,n,r,s){if(this.type=e,this.children=i,this.positions=n,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=Hc.get(this);if(e&&!e.overlay)return e.tree.toString();let i="";for(let n of this.children){let r=n.toString();r&&(i&&(i+=","),i+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(e=0){return new Mg(this.topNode,e)}cursorAt(e,i=0,n=0){let r=hm.get(this)||this.topNode,s=new Mg(r);return s.moveTo(e,i),hm.set(this,s._tree),s}get topNode(){return new on(this,0,0,null)}resolve(e,i=0){let n=zf(hm.get(this)||this.topNode,e,i,!1);return hm.set(this,n),n}resolveInner(e,i=0){let n=zf(PE.get(this)||this.topNode,e,i,!0);return PE.set(this,n),n}resolveStack(e,i=0){return fY(this,e,i)}iterate(e){let{enter:i,leave:n,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&ut.IncludeAnonymous)>0;for(let c=this.cursor(o|ut.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||i(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&n&&(l||!c.type.isAnonymous)&&n(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let i in this.props)e.push([+i,this.props[i]]);return e}balance(e={}){return this.children.length<=8?this:Fx(_i.none,this.children,this.positions,0,this.children.length,0,this.length,(i,n,r)=>new ct(this.type,i,n,r,this.propValues),e.makeTree||((i,n,r)=>new ct(_i.none,i,n,r)))}static build(e){return dY(e)}}ct.empty=new ct(_i.none,[],[],0);class Yx{constructor(e,i){this.buffer=e,this.index=i}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Yx(this.buffer,this.index)}}class ka{constructor(e,i,n){this.buffer=e,this.length=i,this.set=n}get type(){return _i.none}toString(){let e=[];for(let i=0;i<this.buffer.length;)e.push(this.childString(i)),i=this.buffer[i+3];return e.join(",")}childString(e){let i=this.buffer[e],n=this.buffer[e+3],r=this.set.types[i],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,i,n,r,s){let{buffer:o}=this,l=-1;for(let c=e;c!=i&&!(RB(s,r,o[c+1],o[c+2])&&(l=c,n>0));c=o[c+3]);return l}slice(e,i,n){let r=this.buffer,s=new Uint16Array(i-e),o=0;for(let l=e,c=0;l<i;){s[c++]=r[l++],s[c++]=r[l++]-n;let u=s[c++]=r[l++]-n;s[c++]=r[l++]-e,o=Math.max(o,u)}return new ka(s,o,this.set)}}function RB(t,e,i,n){switch(t){case-2:return i<e;case-1:return n>=e&&i<e;case 0:return i<e&&n>e;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function zf(t,e,i,n){for(var r;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){let o=!n&&t instanceof on&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=n?0:ut.IgnoreOverlays;if(n)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof on&&o.index<0&&((r=l.enter(e,i,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,i,s);if(!o)return t;t=o}}class QB{cursor(e=0){return new Mg(this,e)}getChild(e,i=null,n=null){let r=RE(this,e,i,n);return r.length?r[0]:null}getChildren(e,i=null,n=null){return RE(this,e,i,n)}resolve(e,i=0){return zf(this,e,i,!1)}resolveInner(e,i=0){return zf(this,e,i,!0)}matchContext(e){return Cb(this.parent,e)}enterUnfinishedNodesBefore(e){let i=this.childBefore(e),n=this;for(;i;){let r=i.lastChild;if(!r||r.to!=i.to)break;r.type.isError&&r.from==r.to?(n=i,i=r.prevSibling):i=r}return n}get node(){return this}get next(){return this.parent}}class on extends QB{constructor(e,i,n,r){super(),this._tree=e,this.from=i,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,i,n,r,s=0){for(let o=this;;){for(let{children:l,positions:c}=o._tree,u=i>0?l.length:-1;e!=u;e+=i){let d=l[e],p=c[e]+o.from,g;if(!(!(s&ut.EnterBracketed&&d instanceof ct&&(g=Hc.get(d))&&!g.overlay&&g.bracketed&&n>=p&&n<=p+d.length)&&!RB(r,n,p,p+d.length))){if(d instanceof ka){if(s&ut.ExcludeBuffers)continue;let O=d.findChild(0,d.buffer.length,i,n-p,r);if(O>-1)return new ys(new hY(o,d,e,p),null,O)}else if(s&ut.IncludeAnonymous||!d.type.isAnonymous||Hx(d)){let O;if(!(s&ut.IgnoreMounts)&&(O=Hc.get(d))&&!O.overlay)return new on(O.tree,p,e,o);let _=new on(d,p,e,o);return s&ut.IncludeAnonymous||!_.type.isAnonymous?_:_.nextChild(i<0?d.children.length-1:0,i,n,r,s)}}}if(s&ut.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+i:e=i<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,i,n=0){let r;if(!(n&ut.IgnoreOverlays)&&(r=Hc.get(this._tree))&&r.overlay){let s=e-this.from,o=n&ut.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((i>0||o?l<=s:l<s)&&(i<0||o?c>=s:c>s))return new on(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,i,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function RE(t,e,i,n){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(i!=null){for(let o=!1;!o;)if(o=r.type.is(i),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Cb(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class hY{constructor(e,i,n,r){this.parent=e,this.buffer=i,this.index=n,this.start=r}}class ys extends QB{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,i,n){super(),this.context=e,this._parent=i,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,i,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.context.start,n);return s<0?null:new ys(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,i,n=0){if(n&ut.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],i>0?1:-1,e-this.context.start,i);return s<0?null:new ys(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,i=e.buffer[this.index+3];return i<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ys(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new ys(this.context,this._parent,e.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],i=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),i.push(0)}return new ct(this.type,e,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function LB(t){if(!t.length)return null;let e=0,i=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>i.from||o.to<i.to)&&(i=o,e=s)}let n=i instanceof on&&i.index<0?null:i.parent,r=t.slice();return n?r[e]=n:r.splice(e,1),new uY(r,i)}class uY{constructor(e,i){this.heads=e,this.node=i}get next(){return LB(this.heads)}}function fY(t,e,i){let n=t.resolveInner(e,i),r=null;for(let s=n instanceof on?n:n.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[n])).push(o.resolve(e,i)),s=o}else{let o=Hc.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new on(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(zf(l,e,i,!1))}}return r?LB(r):n}class Mg{get name(){return this.type.name}constructor(e,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~ut.EnterBracketed,e instanceof on)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,i){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=i||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof on?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,i,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,i,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,i,n=this.mode){return this.buffer?n&ut.ExcludeBuffers?!1:this.enterChild(1,e,i):this.yield(this._tree.enter(e,i,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ut.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ut.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:i}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(i.findChild(r,this.index,-1,0,4))}else{let r=i.buffer[this.index+3];if(r<(n<0?i.buffer.length:i.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let i,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:i,parent:n}=r)}else({index:i,_parent:n}=this._tree);for(;n;{index:i,_parent:n}=n)if(i>-1)for(let s=i+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&ut.IncludeAnonymous||l instanceof ka||!l.type.isAnonymous||Hx(l))return!1}return!0}move(e,i){if(i&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,i=0){for(;(this.from==this.to||(i<1?this.from>=e:this.from>e)||(i>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,i););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,i=null,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;i=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r<this.stack.length;r++)i=new ys(this.buffer,i,this.stack[r]);return this.bufferNode=new ys(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,i){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&i&&i(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Cb(this.node.parent,e);let{buffer:i}=this.buffer,{types:n}=i.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Cb(this._tree,e,r);let o=n[i.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function Hx(t){return t.children.some(e=>e instanceof ka||!e.type.isAnonymous||Hx(e))}function dY(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:r=PB,reused:s=[],minRepeatType:o=n.types.length}=t,l=Array.isArray(i)?new Yx(i,i.length):i,c=n.types,u=0,d=0;function p(L,E,N,z,Z,J){let{id:U,start:R,end:B,size:D}=l,j=d,$=u;if(D<0)if(l.next(),D==-1){let I=s[U];N.push(I),z.push(R-L);return}else if(D==-3){u=U;return}else if(D==-4){d=U;return}else throw new RangeError(`Unrecognized record size: ${D}`);let X=c[U],H,F,M=R-L;if(B-R<=r&&(F=x(l.pos-E,Z))){let I=new Uint16Array(F.size-F.skip),K=l.pos-F.size,Q=I.length;for(;l.pos>K;)Q=w(F.start,I,Q);H=new ka(I,B-F.start,n),M=F.start-L}else{let I=l.pos-D;l.next();let K=[],Q=[],ue=U>=o?U:-1,he=0,fe=B;for(;l.pos>I;)ue>=0&&l.id==ue&&l.size>=0?(l.end<=fe-r&&(_(K,Q,R,he,l.end,fe,ue,j,$),he=K.length,fe=l.end),l.next()):J>2500?g(R,I,K,Q):p(R,I,K,Q,ue,J+1);if(ue>=0&&he>0&&he<K.length&&_(K,Q,R,he,R,fe,ue,j,$),K.reverse(),Q.reverse(),ue>-1&&he>0){let Oe=O(X,$);H=Fx(X,K,Q,0,K.length,0,B-R,Oe,Oe)}else H=b(X,K,Q,B-R,j-B,$)}N.push(H),z.push(M)}function g(L,E,N,z){let Z=[],J=0,U=-1;for(;l.pos>E;){let{id:R,start:B,end:D,size:j}=l;if(j>4)l.next();else{if(U>-1&&B<U)break;U<0&&(U=D-r),Z.push(R,B,D),J++,l.next()}}if(J){let R=new Uint16Array(J*4),B=Z[Z.length-2];for(let D=Z.length-3,j=0;D>=0;D-=3)R[j++]=Z[D],R[j++]=Z[D+1]-B,R[j++]=Z[D+2]-B,R[j++]=j;N.push(new ka(R,Z[2]-B,n)),z.push(B-L)}}function O(L,E){return(N,z,Z)=>{let J=0,U=N.length-1,R,B;if(U>=0&&(R=N[U])instanceof ct){if(!U&&R.type==L&&R.length==Z)return R;(B=R.prop(Ne.lookAhead))&&(J=z[U]+R.length+B)}return b(L,N,z,Z,J,E)}}function _(L,E,N,z,Z,J,U,R,B){let D=[],j=[];for(;L.length>z;)D.push(L.pop()),j.push(E.pop()+N-Z);L.push(b(n.types[U],D,j,J-Z,R-J,B)),E.push(Z-N)}function b(L,E,N,z,Z,J,U){if(J){let R=[Ne.contextHash,J];U=U?[R].concat(U):[R]}if(Z>25){let R=[Ne.lookAhead,Z];U=U?[R].concat(U):[R]}return new ct(L,E,N,z,U)}function x(L,E){let N=l.fork(),z=0,Z=0,J=0,U=N.end-r,R={size:0,start:0,skip:0};e:for(let B=N.pos-L;N.pos>B;){let D=N.size;if(N.id==E&&D>=0){R.size=z,R.start=Z,R.skip=J,J+=4,z+=4,N.next();continue}let j=N.pos-D;if(D<0||j<B||N.start<U)break;let $=N.id>=o?4:0,X=N.start;for(N.next();N.pos>j;){if(N.size<0)if(N.size==-3||N.size==-4)$+=4;else break e;else N.id>=o&&($+=4);N.next()}Z=X,z+=D,J+=$}return(E<0||z==L)&&(R.size=z,R.start=Z,R.skip=J),R.size>4?R:void 0}function w(L,E,N){let{id:z,start:Z,end:J,size:U}=l;if(l.next(),U>=0&&z<o){let R=N;if(U>4){let B=l.pos-(U-4);for(;l.pos>B;)N=w(L,E,N)}E[--N]=R,E[--N]=J-L,E[--N]=Z-L,E[--N]=z}else U==-3?u=z:U==-4&&(d=z);return N}let k=[],T=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,k,T,-1,0);let A=(e=t.length)!==null&&e!==void 0?e:k.length?T[0]+k[0].length:0;return new ct(c[t.topID],k.reverse(),T.reverse(),A)}const QE=new WeakMap;function Um(t,e){if(!t.isAnonymous||e instanceof ka||e.type!=t)return 1;let i=QE.get(e);if(i==null){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof ct)){i=1;break}i+=Um(t,n)}QE.set(e,i)}return i}function Fx(t,e,i,n,r,s,o,l,c){let u=0;for(let _=n;_<r;_++)u+=Um(t,e[_]);let d=Math.ceil(u*1.5/8),p=[],g=[];function O(_,b,x,w,k){for(let T=x;T<w;){let A=T,L=b[T],E=Um(t,_[T]);for(T++;T<w;T++){let N=Um(t,_[T]);if(E+N>=d)break;E+=N}if(T==A+1){if(E>d){let N=_[A];O(N.children,N.positions,0,N.children.length,b[A]+k);continue}p.push(_[A])}else{let N=b[T-1]+_[T-1].length-L;p.push(Fx(t,_,b,A,T,L,N,null,c))}g.push(L+k-s)}}return O(e,i,n,r,0),(l||c)(p,g,o)}class DB{constructor(){this.map=new WeakMap}setBuffer(e,i,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(i,n)}getBuffer(e,i){let n=this.map.get(e);return n&&n.get(i)}set(e,i){e instanceof ys?this.setBuffer(e.context.buffer,e.index,i):e instanceof on&&this.map.set(e.tree,i)}get(e){return e instanceof ys?this.getBuffer(e.context.buffer,e.index):e instanceof on?this.map.get(e.tree):void 0}cursorSet(e,i){e.buffer?this.setBuffer(e.buffer.buffer,e.index,i):this.map.set(e.tree,i)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class go{constructor(e,i,n,r,s=!1,o=!1){this.from=e,this.to=i,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,i=[],n=!1){let r=[new go(0,e.length,e,0,!1,n)];for(let s of i)s.to>e.length&&r.push(s);return r}static applyChanges(e,i,n=128){if(!i.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,c=0,u=0;;l++){let d=l<i.length?i[l]:null,p=d?d.fromA:1e9;if(p-c>=n)for(;o&&o.from<p;){let g=o;if(c>=g.from||p<=g.to||u){let O=Math.max(g.from,c)-u,_=Math.min(g.to,p)-u;g=O>=_?null:new go(O,_,g.tree,g.offset+u,l>0,!!d)}if(g&&r.push(g),o.to>p)break;o=s<e.length?e[s++]:null}if(!d)break;c=d.toA,u=d.toA-d.toB}return r}}class Gx{startParse(e,i,n){return typeof e=="string"&&(e=new pY(e)),n=n?n.length?n.map(r=>new Tr(r.from,r.to)):[new Tr(0,0)]:[new Tr(0,e.length)],this.createParse(e,i||[],n)}parse(e,i,n){let r=this.startParse(e,i,n);for(;;){let s=r.advance();if(s)return s}}}class pY{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,i){return this.string.slice(e,i)}}function BB(t){return(e,i,n,r)=>new gY(e,t,i,n,r)}class LE{constructor(e,i,n,r,s,o){this.parser=e,this.parse=i,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function DE(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class mY{constructor(e,i,n,r,s,o,l,c){this.parser=e,this.predicate=i,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const kb=new Ne({perNode:!0});class gY{constructor(e,i,n,r,s){this.nest=i,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new ct(n.type,n.children,n.positions,n.length,n.propValues.concat([[kb,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],i=e.parse.advance();if(i){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Ne.mounted.id]=new Hc(i,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<e&&(e=Math.min(e,this.inner[i].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(e)}startInner(){let e=new _Y(this.fragments),i=null,n=null,r=new Mg(new on(this.baseTree,this.ranges[0].from,0,null),ut.IncludeAnonymous|ut.IgnoreMounts);e:for(let s,o;;){let l=!0,c;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(i){let u=i.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let p=d.from+u.pos,g=d.to+u.pos;p>=r.from&&g<=r.to&&!i.ranges.some(O=>O.from<g&&O.to>p)&&i.ranges.push({from:p,to:g})}}l=!1}else if(n&&(o=OY(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||(vY(r),i&&i.depth++,n&&n.depth++);let u=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")i=new mY(s.parser,s.overlay,u,this.inner.length,r.from,!!s.bracketed,r.tree,i);else{let d=zE(this.ranges,s.overlay||(r.from<r.to?[new Tr(r.from,r.to)]:[]));d.length&&DE(d),(d.length||!s.overlay)&&this.inner.push(new LE(s.parser,d.length?s.parser.startParse(this.input,NE(u,d),d):s.parser.startParse(""),s.overlay?s.overlay.map(p=>new Tr(p.from-r.from,p.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(n={ranges:d,depth:0,prev:n}):l=!1}}else if(i&&(c=i.predicate(r))&&(c===!0&&(c=new Tr(r.from,r.to)),c.from<c.to)){let u=i.ranges.length-1;u>=0&&i.ranges[u].to==c.from?i.ranges[u]={from:i.ranges[u].from,to:c.to}:i.ranges.push(c)}if(l&&r.firstChild())i&&i.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(i&&!--i.depth){let u=zE(this.ranges,i.ranges);u.length&&(DE(u),this.inner.splice(i.index,0,new LE(i.parser,i.parser.startParse(this.input,NE(i.mounts,u),u),i.ranges.map(d=>new Tr(d.from-i.start,d.to-i.start)),i.bracketed,i.target,u[0].from))),i=i.prev}n&&!--n.depth&&(n=n.prev)}}}}function OY(t,e,i){for(let n of t){if(n.from>=i)break;if(n.to>e)return n.from<=e&&n.to>=i?2:1}return 0}function BE(t,e,i,n,r,s){if(e<i){let o=t.buffer[e+1];n.push(t.slice(e,i,o)),r.push(o-s)}}function vY(t){let{node:e}=t,i=[],n=e.context.buffer;do i.push(t.index),t.parent();while(!t.tree);let r=t.tree,s=r.children.indexOf(n),o=r.children[s],l=o.buffer,c=[s];function u(d,p,g,O,_,b){let x=i[b],w=[],k=[];BE(o,d,x,w,k,O);let T=l[x+1],A=l[x+2];c.push(w.length);let L=b?u(x+4,l[x+3],o.set.types[l[x]],T,A-T,b-1):e.toTree();return w.push(L),k.push(T-O),BE(o,l[x+3],p,w,k,O),new ct(g,w,k,_)}r.children[s]=u(0,l.length,_i.none,0,o.length,i.length-1);for(let d of c){let p=t.tree.children[d],g=t.tree.positions[d];t.yield(new on(p,g+t.from,d,t._tree))}}class $E{constructor(e,i){this.offset=i,this.done=!1,this.cursor=e.cursor(ut.IncludeAnonymous|ut.IgnoreMounts)}moveTo(e){let{cursor:i}=this,n=e-this.offset;for(;!this.done&&i.from<n;)i.to>=e&&i.enter(n,1,ut.IgnoreOverlays|ut.ExcludeBuffers)||i.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==e.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof ct)i=i.children[0];else break}return!1}}let _Y=class{constructor(e){var i;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(i=n.tree.prop(kb))!==null&&i!==void 0?i:n.to,this.inner=new $E(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(e=i.tree.prop(kb))!==null&&e!==void 0?e:i.to,this.inner=new $E(i.tree,-i.offset)}}findMounts(e,i){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(Ne.mounted);if(o&&o.parser==i)for(let l=this.fragI;l<this.fragments.length;l++){let c=this.fragments[l];if(c.from>=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:o})}}}return r}};function zE(t,e){let i=null,n=e;for(let r=1,s=0;r<t.length;r++){let o=t[r-1].to,l=t[r].from;for(;s<n.length;s++){let c=n[s];if(c.from>=l)break;c.to<=o||(i||(n=i=e.slice()),c.from<o?(i[s]=new Tr(c.from,o),c.to>l&&i.splice(s+1,0,new Tr(l,c.to))):c.to>l?i[s--]=new Tr(l,c.to):i.splice(s--,1))}}return n}function yY(t,e,i,n){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==t.length?1e9:o?t[r].to:t[r].from,p=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let g=Math.max(c,i),O=Math.min(d,p,n);g<O&&u.push(new Tr(g,O))}if(c=Math.min(d,p),c==1e9)break;d==c&&(o?(o=!1,r++):o=!0),p==c&&(l?(l=!1,s++):l=!0)}return u}function NE(t,e){let i=[];for(let{pos:n,mount:r,frag:s}of t){let o=n+(r.overlay?r.overlay[0].from:0),l=o+r.tree.length,c=Math.max(s.from,o),u=Math.min(s.to,l);if(r.overlay){let d=r.overlay.map(g=>new Tr(g.from+n,g.to+n)),p=yY(e,d,c,u);for(let g=0,O=c;;g++){let _=g==p.length,b=_?u:p[g].from;if(b>O&&i.push(new go(O,b,r.tree,-o,s.from>=O||s.openStart,s.to<=b||s.openEnd)),_)break;O=p[g].to}}else i.push(new go(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return i}let bY=0;class nr{constructor(e,i,n,r){this.name=e,this.set=i,this.base=n,this.modified=r,this.id=bY++}toString(){let{name:e}=this;for(let i of this.modified)i.name&&(e=`${i.name}(${e})`);return e}static define(e,i){let n=typeof e=="string"?e:"?";if(e instanceof nr&&(i=e),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let r=new nr(n,[],null,[]);if(r.set.push(r),i)for(let s of i.set)r.set.push(s);return r}static defineModifier(e){let i=new Pg(e);return n=>n.modified.indexOf(i)>-1?n:Pg.get(n.base||n,n.modified.concat(i).sort((r,s)=>r.id-s.id))}}let SY=0;class Pg{constructor(e){this.name=e,this.instances=[],this.id=SY++}static get(e,i){if(!i.length)return e;let n=i[0].instances.find(l=>l.base==e&&xY(i,l.modified));if(n)return n;let r=[],s=new nr(e.name,r,e,i);for(let l of i)l.instances.push(s);let o=wY(i);for(let l of e.set)if(!l.modified.length)for(let c of o)r.push(Pg.get(l,c));return s}}function xY(t,e){return t.length==e.length&&t.every((i,n)=>i==e[n])}function wY(t){let e=[[]];for(let i=0;i<t.length;i++)for(let n=0,r=e.length;n<r;n++)e.push(e[n].concat(t[i]));return e.sort((i,n)=>n.length-i.length)}function vh(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let r of i.split(" "))if(r){let s=[],o=2,l=r;for(let p=0;;){if(l=="..."&&p>0&&p+3==r.length){o=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+r);if(s.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==r.length)break;let O=r[p++];if(p==r.length&&O=="!"){o=0;break}if(O!="/")throw new RangeError("Invalid path: "+r);l=r.slice(p)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new Nf(n,o,c>0?s.slice(0,c):null);e[u]=d.sort(e[u])}}return $B.add(e)}const $B=new Ne({combine(t,e){let i,n,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),i&&i.mode==r.mode&&!r.context&&!i.context)continue;let s=new Nf(r.tags,r.mode,r.context);i?i.next=s:n=s,i=s}return n}});class Nf{constructor(e,i,n,r){this.tags=e,this.mode=i,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Nf.empty=new Nf([],2,null);function zB(t,e){let i=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))i[s.tag.id]=s.class;else for(let o of s.tag)i[o.id]=s.class;let{scope:n,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let c of l.set){let u=i[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:n}}function CY(t,e){let i=null;for(let n of t){let r=n.style(e);r&&(i=i?i+" "+r:r)}return i}function kY(t,e,i,n=0,r=t.length){let s=new TY(n,Array.isArray(e)?e:[e],i);s.highlightRange(t.cursor(),n,r,"",s.highlighters),s.flush(r)}class TY{constructor(e,i,n){this.at=e,this.highlighters=i,this.span=n,this.class=""}startSpan(e,i){i!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=i)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,i,n,r,s){let{type:o,from:l,to:c}=e;if(l>=n||c<=i)return;o.isTop&&(s=this.highlighters.filter(O=>!O.scope||O.scope(o)));let u=r,d=AY(e)||Nf.empty,p=CY(s,d.tags);if(p&&(u&&(u+=" "),u+=p,d.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(i,l),u),d.opaque)return;let g=e.tree&&e.tree.prop(Ne.mounted);if(g&&g.overlay){let O=e.node.enter(g.overlay[0].from+l,1),_=this.highlighters.filter(x=>!x.scope||x.scope(g.tree.type)),b=e.firstChild();for(let x=0,w=l;;x++){let k=x<g.overlay.length?g.overlay[x]:null,T=k?k.from+l:c,A=Math.max(i,w),L=Math.min(n,T);if(A<L&&b)for(;e.from<L&&(this.highlightRange(e,A,L,r,s),this.startSpan(Math.min(L,e.to),u),!(e.to>=T||!e.nextSibling())););if(!k||T>n)break;w=k.to+l,w>i&&(this.highlightRange(O.cursor(),Math.max(i,k.from+l),Math.min(n,w),"",_),this.startSpan(Math.min(n,w),u))}b&&e.parent()}else if(e.firstChild()){g&&(r="");do if(!(e.to<=i)){if(e.from>=n)break;this.highlightRange(e,i,n,r,s),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}function AY(t){let e=t.type.prop($B);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const _e=nr.define,um=_e(),fa=_e(),jE=_e(fa),IE=_e(fa),da=_e(),fm=_e(da),D_=_e(da),us=_e(),el=_e(us),ss=_e(),os=_e(),Tb=_e(),Tu=_e(Tb),dm=_e(),V={comment:um,lineComment:_e(um),blockComment:_e(um),docComment:_e(um),name:fa,variableName:_e(fa),typeName:jE,tagName:_e(jE),propertyName:IE,attributeName:_e(IE),className:_e(fa),labelName:_e(fa),namespace:_e(fa),macroName:_e(fa),literal:da,string:fm,docString:_e(fm),character:_e(fm),attributeValue:_e(fm),number:D_,integer:_e(D_),float:_e(D_),bool:_e(da),regexp:_e(da),escape:_e(da),color:_e(da),url:_e(da),keyword:ss,self:_e(ss),null:_e(ss),atom:_e(ss),unit:_e(ss),modifier:_e(ss),operatorKeyword:_e(ss),controlKeyword:_e(ss),definitionKeyword:_e(ss),moduleKeyword:_e(ss),operator:os,derefOperator:_e(os),arithmeticOperator:_e(os),logicOperator:_e(os),bitwiseOperator:_e(os),compareOperator:_e(os),updateOperator:_e(os),definitionOperator:_e(os),typeOperator:_e(os),controlOperator:_e(os),punctuation:Tb,separator:_e(Tb),bracket:Tu,angleBracket:_e(Tu),squareBracket:_e(Tu),paren:_e(Tu),brace:_e(Tu),content:us,heading:el,heading1:_e(el),heading2:_e(el),heading3:_e(el),heading4:_e(el),heading5:_e(el),heading6:_e(el),contentSeparator:_e(us),list:_e(us),quote:_e(us),emphasis:_e(us),strong:_e(us),link:_e(us),monospace:_e(us),strikethrough:_e(us),inserted:_e(),deleted:_e(),changed:_e(),invalid:_e(),meta:dm,documentMeta:_e(dm),annotation:_e(dm),processingInstruction:_e(dm),definition:nr.defineModifier("definition"),constant:nr.defineModifier("constant"),function:nr.defineModifier("function"),standard:nr.defineModifier("standard"),local:nr.defineModifier("local"),special:nr.defineModifier("special")};for(let t in V){let e=V[t];e instanceof nr&&(e.name=t)}zB([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var B_;const gl=new Ne;function Kx(t){return Se.define({combine:t?e=>e.concat(t):void 0})}const Jx=new Ne;class Ar{constructor(e,i,n=[],r=""){this.data=e,this.name=r,et.prototype.hasOwnProperty("tree")||Object.defineProperty(et.prototype,"tree",{get(){return xt(this)}}),this.parser=i,this.extension=[Ta.of(this),et.languageData.of((s,o,l)=>{let c=VE(s,o,l),u=c.type.prop(gl);if(!u)return[];let d=s.facet(u),p=c.type.prop(Jx);if(p){let g=c.resolve(o-c.from,l);for(let O of p)if(O.test(g,s)){let _=s.facet(O.facet);return O.type=="replace"?_:_.concat(d)}}return d})].concat(n)}isActiveAt(e,i,n=-1){return VE(e,i,n).type.prop(gl)==this.data}findRegions(e){let i=e.facet(Ta);if((i==null?void 0:i.data)==this.data)return[{from:0,to:e.doc.length}];if(!i||!i.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(gl)==this.data){n.push({from:o,to:o+s.length});return}let l=s.prop(Ne.mounted);if(l){if(l.tree.prop(gl)==this.data){if(l.overlay)for(let c of l.overlay)n.push({from:c.from+o,to:c.to+o});else n.push({from:o,to:o+s.length});return}else if(l.overlay){let c=n.length;if(r(l.tree,l.overlay[0].from+o),n.length>c)return}}for(let c=0;c<s.children.length;c++){let u=s.children[c];u instanceof ct&&r(u,s.positions[c]+o)}};return r(xt(e),0),n}get allowsNesting(){return!0}}Ar.setState=ze.define();function VE(t,e,i){let n=t.facet(Ta),r=xt(t).topNode;if(!n||n.allowsNesting)for(let s=r;s;s=s.enter(e,i,ut.ExcludeBuffers|ut.EnterBracketed))s.type.isTop&&(r=s);return r}class ah extends Ar{constructor(e,i,n){super(e,i,[],n),this.parser=i}static define(e){let i=Kx(e.languageData);return new ah(i,e.parser.configure({props:[gl.add(n=>n.isTop?i:void 0)]}),e.name)}configure(e,i){return new ah(this.data,this.parser.configure(e),i||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function xt(t){let e=t.field(Ar.state,!1);return e?e.tree:ct.empty}class EY{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,i){let n=this.cursorPos-this.string.length;return e<n||i>=this.cursorPos?this.doc.sliceString(e,i):this.string.slice(e-n,i-n)}}let Au=null;class jf{constructor(e,i,n=[],r,s,o,l,c){this.parser=e,this.state=i,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,i,n){return new jf(e,i,[],ct.empty,0,n,[],null)}startParse(){return this.parser.startParse(new EY(this.state.doc),this.fragments)}work(e,i){return i!=null&&i>=this.state.doc.length&&(i=void 0),this.tree!=ct.empty&&this.isDone(i??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),i!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>i)&&i<this.state.doc.length&&this.parse.stopAt(i);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(go.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(i??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,i;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(i=this.parse.advance()););}),this.treeLen=e,this.tree=i,this.fragments=this.withoutTempSkipped(go.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let i=Au;Au=this;try{return e()}finally{Au=i}}withoutTempSkipped(e){for(let i;i=this.tempSkipped.pop();)e=XE(e,i.from,i.to);return e}changes(e,i){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((u,d,p,g)=>c.push({fromA:u,toA:d,fromB:p,toB:g})),n=go.applyChanges(n,c),r=ct.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=e.mapPos(u.from,1),p=e.mapPos(u.to,-1);d<p&&l.push({from:d,to:p})}}}return new jf(this.parser,i,n,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let i=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:r,to:s}=this.skipped[n];r<e.to&&s>e.from&&(this.fragments=XE(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=i?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,i){this.skipped.push({from:e,to:i})}static getSkippingParser(e){return new class extends Gx{createParse(i,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=Au;if(c){for(let u of r)c.tempSkipped.push(u);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=o,new ct(_i.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let i=this.fragments;return this.treeLen>=e&&i.length&&i[0].from==0&&i[0].to>=e}static get(){return Au}}function XE(t,e,i){return go.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class lh{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let i=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),i.viewport.to);return i.work(20,n)||i.takeTree(),new lh(i)}static init(e){let i=Math.min(3e3,e.doc.length),n=jf.create(e.facet(Ta).parser,e,{from:0,to:i});return n.work(20,i)||n.takeTree(),new lh(n)}}Ar.state=Bi.define({create:lh.init,update(t,e){for(let i of e.effects)if(i.is(Ar.setState))return i.value;return e.startState.facet(Ta)!=e.state.facet(Ta)?lh.init(e.state):t.apply(e)}});let NB=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(NB=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const $_=typeof navigator<"u"&&(!((B_=navigator.scheduling)===null||B_===void 0)&&B_.isInputPending)?()=>navigator.scheduling.isInputPending():null,MY=Jt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let i=this.view.state.field(Ar.state).context;(i.updateViewport(e.view.viewport)||this.view.viewport.to>i.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(i)}scheduleWork(){if(this.working)return;let{state:e}=this.view,i=e.field(Ar.state);(i.tree!=i.context.tree||!i.context.isDone(e.doc.length))&&(this.working=NB(this.work))}work(e){this.working=null;let i=Date.now();if(this.chunkEnd<i&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=i+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,s=n.field(Ar.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!$_?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&n.doc.length>r+1e3,c=s.context.work(()=>$_&&$_()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-i,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ar.setState.of(new lh(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(i=>$n(this.view.state,i)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ta=Se.define({combine(t){return t.length?t[0]:null},enables:t=>[Ar.state,MY,ve.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class If{constructor(e,i=[]){this.language=e,this.support=i,this.extension=[e,i]}}class Rg{constructor(e,i,n,r,s,o=void 0){this.name=e,this.alias=i,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:i,support:n}=e;if(!i){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");i=()=>Promise.resolve(n)}return new Rg(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,i,n)}static matchFilename(e,i){for(let r of e)if(r.filename&&r.filename.test(i))return r;let n=/\.([^.]+)$/.exec(i);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,i,n=!0){i=i.toLowerCase();for(let r of e)if(r.alias.some(s=>s==i))return r;if(n)for(let r of e)for(let s of r.alias){let o=i.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(i[o-1])&&!/\w/.test(i[o+s.length])))return r}return null}}const PY=Se.define(),_h=Se.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(i=>i!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Qg(t){let e=t.facet(_h);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Vf(t,e){let i="",n=t.tabSize,r=t.facet(_h)[0];if(r==" "){for(;e>=n;)i+=" ",e-=n;r=" "}for(let s=0;s<e;s++)i+=r;return i}function ew(t,e){t instanceof et&&(t=new vO(t));for(let n of t.state.facet(PY)){let r=n(t,e);if(r!==void 0)return r}let i=xt(t.state);return i.length>=e?RY(t,i,e):null}class vO{constructor(e,i={}){this.state=e,this.options=i,this.unit=Qg(e)}lineAt(e,i=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(i<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,i=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,i);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,i=1){let{text:n,from:r}=this.lineAt(e,i),s=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,i=e.length){return Yr(e,this.state.tabSize,i)}lineIndent(e,i=1){let{text:n,from:r}=this.lineAt(e,i),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const md=new Ne;function RY(t,e,i){let n=e.resolveStack(i),r=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=n.node){let s=[];for(let o=r;o&&!(o.from<n.node.from||o.to>n.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return jB(n,t,i)}function jB(t,e,i){for(let n=t;n;n=n.next){let r=LY(n.node);if(r)return r(tw.create(e,i,n))}return 0}function QY(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function LY(t){let e=t.type.prop(md);if(e)return e;let i=t.firstChild,n;if(i&&(n=i.type.prop(Ne.closedBy))){let r=t.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>IB(o,!0,1,void 0,s&&!QY(o)?r.from:void 0)}return t.parent==null?DY:null}function DY(){return 0}class tw extends vO{constructor(e,i,n){super(e.state,e.options),this.base=e,this.pos=i,this.context=n}get node(){return this.context.node}static create(e,i,n){return new tw(e,i,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let i=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(i.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(BY(n,e))break;i=this.state.doc.lineAt(n.from)}return this.lineIndent(i.from)}continue(){return jB(this.context.next,this.base,this.pos)}}function BY(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function $Y(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(i.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=i.to;;){let c=e.childAfter(l);if(!c||c==n)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(s.text.slice(i.to-s.from))[0].length;return{from:i.from,to:i.to+u}}l=c.to}}function zY({closing:t,align:e=!0,units:i=1}){return n=>IB(n,e,i,t)}function IB(t,e,i,n,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||r==t.pos+o,c=e?$Y(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*i)}const NY=t=>t.baseIndent;function Ym({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}const jY=200;function IY(){return et.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,r=i.lineAt(n);if(n>r.from+jY)return t;let s=i.sliceString(r.from,n);if(!e.some(u=>u.test(s)))return t;let{state:o}=t,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let p=ew(o,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],O=Vf(o,p);g!=O&&c.push({from:d.from,to:d.from+g.length,insert:O})}return c.length?[t,{changes:c,sequential:!0}]:t})}const VB=Se.define(),yh=new Ne;function XB(t){let e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null}function VY(t,e,i){let n=xt(t);if(n.length<i)return null;let r=n.resolveStack(i,1),s=null;for(let o=r;o;o=o.next){let l=o.node;if(l.to<=i||l.from>i)continue;if(s&&l.from<e)break;let c=l.type.prop(yh);if(c&&(l.to<n.length-50||n.length==t.doc.length||!XY(l))){let u=c(l,t);u&&u.from<=i&&u.from>=e&&u.to>i&&(s=u)}}return s}function XY(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Lg(t,e,i){for(let n of t.facet(VB)){let r=n(t,e,i);if(r)return r}return VY(t,e,i)}function ZB(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const _O=ze.define({map:ZB}),gd=ze.define({map:ZB});function qB(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(n=>n.from<=i&&n.to>=i)||e.push(t.lineBlockAt(i));return e}const Al=Bi.define({create(){return Pe.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,n)=>t=ZE(t,i,n)),t=t.map(e.changes);for(let i of e.effects)if(i.is(_O)&&!ZY(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(YB),r=n?Pe.replace({widget:new GY(n(e.state,i.value))}):qE;t=t.update({add:[r.range(i.value.from,i.value.to)]})}else i.is(gd)&&(t=t.update({filter:(n,r)=>i.value.from!=n||i.value.to!=r,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=ZE(t,e.selection.main.head)),t},provide:t=>ve.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(n,r)=>{i.push(n,r)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i<t.length;){let n=t[i++],r=t[i++];if(typeof n!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(qE.range(n,r))}return Pe.set(e,!0)}});function ZE(t,e,i=e){let n=!1;return t.between(e,i,(r,s)=>{r<i&&s>e&&(n=!0)}),n?t.update({filterFrom:e,filterTo:i,filter:(r,s)=>r>=i||s<=e}):t}function Dg(t,e,i){var n;let r=null;return(n=t.field(Al,!1))===null||n===void 0||n.between(e,i,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function ZY(t,e,i){let n=!1;return t.between(e,e,(r,s)=>{r==e&&s==i&&(n=!0)}),n}function WB(t,e){return t.field(Al,!1)?e:e.concat(ze.appendConfig.of(HB()))}const qY=t=>{for(let e of qB(t)){let i=Lg(t.state,e.from,e.to);if(i)return t.dispatch({effects:WB(t.state,[_O.of(i),UB(t,i)])}),!0}return!1},WY=t=>{if(!t.state.field(Al,!1))return!1;let e=[];for(let i of qB(t)){let n=Dg(t.state,i.from,i.to);n&&e.push(gd.of(n),UB(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function UB(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return ve.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${r}.`)}const UY=t=>{let{state:e}=t,i=[];for(let n=0;n<e.doc.length;){let r=t.lineBlockAt(n),s=Lg(e,r.from,r.to);s&&i.push(_O.of(s)),n=(s?t.lineBlockAt(s.to):r).to+1}return i.length&&t.dispatch({effects:WB(t.state,i)}),!!i.length},YY=t=>{let e=t.state.field(Al,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(n,r)=>{i.push(gd.of({from:n,to:r}))}),t.dispatch({effects:i}),!0},HY=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:qY},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:WY},{key:"Ctrl-Alt-[",run:UY},{key:"Ctrl-Alt-]",run:YY}],FY={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},YB=Se.define({combine(t){return Qs(t,FY)}});function HB(t){return[Al,eH]}function FB(t,e){let{state:i}=t,n=i.facet(YB),r=o=>{let l=t.lineBlockAt(t.posAtDOM(o.target)),c=Dg(t.state,l.from,l.to);c&&t.dispatch({effects:gd.of(c)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,r,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",i.phrase("folded code")),s.title=i.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const qE=Pe.replace({widget:new class extends Gr{toDOM(t){return FB(t,null)}}});class GY extends Gr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return FB(e,this.value)}}const KY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class z_ extends bo{constructor(e,i){super(),this.config=e,this.open=i}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let i=document.createElement("span");return i.textContent=this.open?this.config.openText:this.config.closedText,i.title=e.state.phrase(this.open?"Fold line":"Unfold line"),i}}function JY(t={}){let e={...KY,...t},i=new z_(e,!0),n=new z_(e,!1),r=Jt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ta)!=o.state.facet(Ta)||o.startState.field(Al,!1)!=o.state.field(Al,!1)||xt(o.startState)!=xt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new _o;for(let c of o.viewportLineBlocks){let u=Dg(o.state,c.from,c.to)?n:Lg(o.state,c.from,c.to)?i:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=e;return[r,GU({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Ge.empty},initialSpacer(){return new z_(e,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=Dg(o.state,l.from,l.to);if(u)return o.dispatch({effects:gd.of(u)}),!0;let d=Lg(o.state,l.from,l.to);return d?(o.dispatch({effects:_O.of(d)}),!0):!1}}}),HB()]}const eH=ve.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Od{constructor(e,i){this.specs=e;let n;function r(l){let c=xa.newName();return(n||(n=Object.create(null)))["."+c]=l,c}const s=typeof i.all=="string"?i.all:i.all?r(i.all):void 0,o=i.scope;this.scope=o instanceof Ar?l=>l.prop(gl)==o.data:o?l=>l==o:void 0,this.style=zB(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=n?new xa(n):null,this.themeType=i.themeType}static define(e,i){return new Od(e,i||{})}}const Ab=Se.define(),GB=Se.define({combine(t){return t.length?[t[0]]:null}});function N_(t){let e=t.facet(Ab);return e.length?e:t.facet(GB)}function KB(t,e){let i=[iH],n;return t instanceof Od&&(t.module&&i.push(ve.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?i.push(GB.of(t)):n?i.push(Ab.computeN([ve.darkTheme],r=>r.facet(ve.darkTheme)==(n=="dark")?[t]:[])):i.push(Ab.of(t)),i}class tH{constructor(e){this.markCache=Object.create(null),this.tree=xt(e.state),this.decorations=this.buildDeco(e,N_(e.state)),this.decoratedTo=e.viewport.to}update(e){let i=xt(e.state),n=N_(e.state),r=n!=N_(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);i.length<s.to&&!r&&i.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(i!=this.tree||e.viewportChanged||r)&&(this.tree=i,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,i){if(!i||!this.tree.length)return Pe.none;let n=new _o;for(let{from:r,to:s}of e.visibleRanges)kY(this.tree,i,(o,l,c)=>{n.add(o,l,this.markCache[c]||(this.markCache[c]=Pe.mark({class:c})))},r,s);return n.finish()}}const iH=So.high(Jt.fromClass(tH,{decorations:t=>t.decorations})),nH=Od.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),rH=ve.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),JB=1e4,e$="()[]{}",t$=Se.define({combine(t){return Qs(t,{afterCursor:!0,brackets:e$,maxScanDistance:JB,renderMatch:aH})}}),sH=Pe.mark({class:"cm-matchingBracket"}),oH=Pe.mark({class:"cm-nonmatchingBracket"});function aH(t){let e=[],i=t.matched?sH:oH;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}const lH=Bi.define({create(){return Pe.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],n=e.state.facet(t$);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=bs(e.state,r.head,-1,n)||r.head>0&&bs(e.state,r.head-1,1,n)||n.afterCursor&&(bs(e.state,r.head,1,n)||r.head<e.state.doc.length&&bs(e.state,r.head+1,-1,n));s&&(i=i.concat(n.renderMatch(s,e.state)))}return Pe.set(i,!0)},provide:t=>ve.decorations.from(t)}),cH=[lH,rH];function hH(t={}){return[t$.of(t),cH]}const i$=new Ne;function Eb(t,e,i){let n=t.prop(e<0?Ne.openedBy:Ne.closedBy);if(n)return n;if(t.name.length==1){let r=i.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[i[r+e]]}return null}function Mb(t){let e=t.type.prop(i$);return e?e(t.node):t}function bs(t,e,i,n={}){let r=n.maxScanDistance||JB,s=n.brackets||e$,o=xt(t),l=o.resolveInner(e,i);for(let c=l;c;c=c.parent){let u=Eb(c.type,i,s);if(u&&c.from<c.to){let d=Mb(c);if(d&&(i>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return uH(t,e,i,c,d,u,s)}}return fH(t,e,i,o,l.type,r,s)}function uH(t,e,i,n,r,s,o){let l=n.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(i<0?d.childBefore(n.from):d.childAfter(n.to)))do if(i<0?d.to<=n.from:d.from>=n.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from<d.to){let p=Mb(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(Eb(d.type,i,o))u++;else if(Eb(d.type,-i,o)){if(u==0){let p=Mb(d);return{start:c,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}u--}}while(i<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function fH(t,e,i,n,r,s,o){let l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),c=o.indexOf(l);if(c<0||c%2==0!=i>0)return null;let u={from:i<0?e-1:e,to:i>0?e+1:e},d=t.doc.iterRange(e,i>0?t.doc.length:0),p=0;for(let g=0;!d.next().done&&g<=s;){let O=d.value;i<0&&(g+=O.length);let _=e+g*i;for(let b=i>0?0:O.length-1,x=i>0?O.length:-1;b!=x;b+=i){let w=o.indexOf(O[b]);if(!(w<0||n.resolveInner(_+b,1).type!=r))if(w%2==0==i>0)p++;else{if(p==1)return{start:u,end:{from:_+b,to:_+b+1},matched:w>>1==c>>1};p--}}i>0&&(g+=O.length)}return d.done?{start:u,matched:!1}:null}const dH=Object.create(null),WE=[_i.none],UE=[],YE=Object.create(null),pH=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])pH[t]=mH(dH,e);function j_(t,e){UE.indexOf(t)>-1||(UE.push(t),console.warn(e))}function mH(t,e){let i=[];for(let l of e.split(" ")){let c=[];for(let u of l.split(".")){let d=t[u]||V[u];d?typeof d=="function"?c.length?c=c.map(d):j_(u,`Modifier ${u} used at start of tag`):c.length?j_(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:j_(u,`Unknown highlighting tag ${u}`)}for(let u of c)i.push(u)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+i.map(l=>l.id),s=YE[r];if(s)return s.id;let o=YE[r]=_i.define({id:WE.length,name:n,props:[vh({[n]:i})]});return WE.push(o),o.id}St.RTL,St.LTR;const gH=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=nw(t.state,i.from);return n.line?OH(t):n.block?_H(t):!1};function iw(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=t(e,i);return r?(n(i.update(r)),!0):!1}}const OH=iw(SH,0),vH=iw(n$,0),_H=iw((t,e)=>n$(t,e,bH(e)),0);function nw(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const Eu=50;function yH(t,{open:e,close:i},n,r){let s=t.sliceDoc(n-Eu,n),o=t.sliceDoc(r,r+Eu),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-e.length,u)==e&&o.slice(c,c+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,p;r-n<=2*Eu?d=p=t.sliceDoc(n,r):(d=t.sliceDoc(n,n+Eu),p=t.sliceDoc(r-Eu,r));let g=/^\s*/.exec(d)[0].length,O=/\s*$/.exec(p)[0].length,_=p.length-O-i.length;return d.slice(g,g+e.length)==e&&p.slice(_,_+i.length)==i?{open:{pos:n+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:r-O-i.length,margin:/\s/.test(p.charAt(_-1))?1:0}}:null}function bH(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),r=i.to<=n.to?n:t.doc.lineAt(i.to);r.from>n.from&&r.from==i.to&&(r=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function n$(t,e,i=e.selection.ranges){let n=i.map(s=>nw(e,s.from).block);if(!n.every(s=>s))return null;let r=i.map((s,o)=>yH(e,n[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(i.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let c=n[o],{open:u,close:d}=l;s.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:s}}return null}function SH(t,e,i=e.selection.ranges){let n=[],r=-1;e:for(let{from:s,to:o}of i){let l=n.length,c=1e9,u;for(let d=s;d<=o;){let p=e.doc.lineAt(d);if(u==null&&(u=nw(e,p.from).line,!u))continue e;if(p.from>r&&(s==o||o>p.from)){r=p.from;let g=/^\s*/.exec(p.text)[0].length,O=g==p.length,_=p.text.slice(g,g+u.length)==u?g:-1;g<p.text.length&&g<c&&(c=g),n.push({line:p,comment:_,token:u,indent:g,empty:O,single:!1})}d=p.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(t!=2&&n.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:p}of n)(p||!d)&&s.push({from:l.from+u,insert:c+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of n)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const Pb=Rs.define(),xH=Rs.define(),wH=Se.define(),r$=Se.define({combine(t){return Qs(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,i)=>i},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,i)=>(n,r)=>e(n,r)||i(n,r)})}}),s$=Bi.define({create(){return Ss.empty},update(t,e){let i=e.state.facet(r$),n=e.annotation(Pb);if(n){let c=zn.fromTransaction(e,n.selection),u=n.side,d=u==0?t.undone:t.done;return c?d=Bg(d,d.length,i.minDepth,c):d=l$(d,e.startState.selection),new Ss(u==0?n.rest:d,u==0?d:n.rest)}let r=e.annotation(xH);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(hi.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=zn.fromTransaction(e),o=e.annotation(hi.time),l=e.annotation(hi.userEvent);return s?t=t.addChanges(s,o,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,i.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Ss(t.done.map(zn.fromJSON),t.undone.map(zn.fromJSON))}});function CH(t={}){return[s$,r$.of(t),ve.domEventHandlers({beforeinput(e,i){let n=e.inputType=="historyUndo"?o$:e.inputType=="historyRedo"?Rb:null;return n?(e.preventDefault(),n(i)):!1}})]}function yO(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let r=i.field(s$,!1);if(!r)return!1;let s=r.pop(t,i,e);return s?(n(s),!0):!1}}const o$=yO(0,!1),Rb=yO(1,!1),kH=yO(0,!0),TH=yO(1,!0);class zn{constructor(e,i,n,r,s){this.changes=e,this.effects=i,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new zn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,i,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(i=this.mapped)===null||i===void 0?void 0:i.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new zn(e.changes&&vi.fromJSON(e.changes),[],e.mapped&&Cs.fromJSON(e.mapped),e.startSelection&&se.fromJSON(e.startSelection),e.selectionsAfter.map(se.fromJSON))}static fromTransaction(e,i){let n=Er;for(let r of e.startState.facet(wH)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new zn(e.changes.invert(e.startState.doc),n,void 0,i||e.startState.selection,Er)}static selection(e){return new zn(void 0,Er,void 0,void 0,e)}}function Bg(t,e,i,n){let r=e+1>i+20?e-i-1:0,s=t.slice(r,e);return s.push(n),s}function AH(t,e){let i=[],n=!1;return t.iterChangedRanges((r,s)=>i.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let c=0;c<i.length;){let u=i[c++],d=i[c++];l>=u&&o<=d&&(n=!0)}}),n}function EH(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((i,n)=>i.empty!=e.ranges[n].empty).length===0}function a$(t,e){return t.length?e.length?t.concat(e):t:e}const Er=[],MH=200;function l$(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-MH));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Bg(t,t.length-1,1e9,i.setSelAfter(n)))}else return[zn.selection([e])]}function PH(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function I_(t,e){if(!t.length)return t;let i=t.length,n=Er;for(;i;){let r=RH(t[i-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,i);return s[i-1]=r,s}else e=r.mapped,i--,n=r.selectionsAfter}return n.length?[zn.selection(n)]:Er}function RH(t,e,i){let n=a$(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Er,i);if(!t.changes)return zn.selection(n);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new zn(r,ze.mapEffects(t.effects,e),o,t.startSelection.map(s),n)}const QH=/^(input\.type|delete)($|\.)/;class Ss{constructor(e,i,n=0,r=void 0){this.done=e,this.undone=i,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new Ss(this.done,this.undone):this}addChanges(e,i,n,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||QH.test(n))&&(!l.selectionsAfter.length&&i-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,AH(l.changes,e.changes))||n=="input.type.compose")?o=Bg(o,o.length-1,r.minDepth,new zn(e.changes.compose(l.changes),a$(ze.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Er)):o=Bg(o,o.length,r.minDepth,e),new Ss(o,Er,i,n)}addSelection(e,i,n,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Er;return s.length>0&&i-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&EH(s[s.length-1],e)?this:new Ss(l$(this.done,e),this.undone,i,n)}addMapping(e){return new Ss(I_(this.done,e),I_(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,i,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):i.selection);if(n&&s.selectionsAfter.length)return i.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Pb.of({side:e,rest:PH(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Er:r.slice(0,r.length-1);return s.mapped&&(l=I_(l,s.mapped)),i.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Pb.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ss.empty=new Ss(Er,Er);const LH=[{key:"Mod-z",run:o$,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Rb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Rb,preventDefault:!0},{key:"Mod-u",run:kH,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:TH,preventDefault:!0}];function bh(t,e){return se.create(t.ranges.map(e),t.mainIndex)}function Kr(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Jr({state:t,dispatch:e},i){let n=bh(t.selection,i);return n.eq(t.selection,!0)?!1:(e(Kr(t,n)),!0)}function bO(t,e){return se.cursor(e?t.to:t.from)}function c$(t,e){return Jr(t,i=>i.empty?t.moveByChar(i,e):bO(i,e))}function an(t){return t.textDirectionAt(t.state.selection.main.head)==St.LTR}const h$=t=>c$(t,!an(t)),u$=t=>c$(t,an(t));function f$(t,e){return Jr(t,i=>i.empty?t.moveByGroup(i,e):bO(i,e))}const DH=t=>f$(t,!an(t)),BH=t=>f$(t,an(t));function $H(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function SO(t,e,i){let n=xt(t).resolveInner(e.head),r=i?Ne.closedBy:Ne.openedBy;for(let c=e.head;;){let u=i?n.childAfter(c):n.childBefore(c);if(!u)break;$H(t,u,r)?n=u:c=i?u.to:u.from}let s=n.type.prop(r),o,l;return s&&(o=i?bs(t,n.from,1):bs(t,n.to,-1))&&o.matched?l=i?o.end.to:o.end.from:l=i?n.to:n.from,se.cursor(l,i?-1:1)}const zH=t=>Jr(t,e=>SO(t.state,e,!an(t))),NH=t=>Jr(t,e=>SO(t.state,e,an(t)));function d$(t,e){return Jr(t,i=>{if(!i.empty)return bO(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)})}const p$=t=>d$(t,!1),m$=t=>d$(t,!0);function g$(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,i=0,n=0,r;if(e){for(let s of t.state.facet(ve.scrollMargins)){let o=s(t);o!=null&&o.top&&(i=Math.max(o==null?void 0:o.top,i)),o!=null&&o.bottom&&(n=Math.max(o==null?void 0:o.bottom,n))}r=t.scrollDOM.clientHeight-i-n}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:n,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function O$(t,e){let i=g$(t),{state:n}=t,r=bh(n.selection,o=>o.empty?t.moveVertically(o,e,i.height):bO(o,e));if(r.eq(n.selection))return!1;let s;if(i.selfScroll){let o=t.coordsAtPos(n.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+i.marginTop,u=l.bottom-i.marginBottom;o&&o.top>c&&o.bottom<u&&(s=ve.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-c}))}return t.dispatch(Kr(n,r),{effects:s}),!0}const HE=t=>O$(t,!1),Qb=t=>O$(t,!0);function Pa(t,e,i){let n=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,i);if(r.head==e.head&&r.head!=(i?n.to:n.from)&&(r=t.moveToLineBoundary(e,i,!1)),!i&&r.head==n.from&&n.length){let s=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=se.cursor(n.from+s))}return r}const jH=t=>Jr(t,e=>Pa(t,e,!0)),IH=t=>Jr(t,e=>Pa(t,e,!1)),VH=t=>Jr(t,e=>Pa(t,e,!an(t))),XH=t=>Jr(t,e=>Pa(t,e,an(t))),ZH=t=>Jr(t,e=>se.cursor(t.lineBlockAt(e.head).from,1)),qH=t=>Jr(t,e=>se.cursor(t.lineBlockAt(e.head).to,-1));function WH(t,e,i){let n=!1,r=bh(t.selection,s=>{let o=bs(t,s.head,-1)||bs(t,s.head,1)||s.head>0&&bs(t,s.head-1,1)||s.head<t.doc.length&&bs(t,s.head+1,-1);if(!o||!o.end)return s;n=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return se.cursor(l)});return n?(e(Kr(t,r)),!0):!1}const UH=({state:t,dispatch:e})=>WH(t,e);function Lr(t,e){let i=bh(t.state.selection,n=>{let r=e(n);return se.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return i.eq(t.state.selection)?!1:(t.dispatch(Kr(t.state,i)),!0)}function v$(t,e){return Lr(t,i=>t.moveByChar(i,e))}const _$=t=>v$(t,!an(t)),y$=t=>v$(t,an(t));function b$(t,e){return Lr(t,i=>t.moveByGroup(i,e))}const YH=t=>b$(t,!an(t)),HH=t=>b$(t,an(t)),FH=t=>Lr(t,e=>SO(t.state,e,!an(t))),GH=t=>Lr(t,e=>SO(t.state,e,an(t)));function S$(t,e){return Lr(t,i=>t.moveVertically(i,e))}const x$=t=>S$(t,!1),w$=t=>S$(t,!0);function C$(t,e){return Lr(t,i=>t.moveVertically(i,e,g$(t).height))}const FE=t=>C$(t,!1),GE=t=>C$(t,!0),KH=t=>Lr(t,e=>Pa(t,e,!0)),JH=t=>Lr(t,e=>Pa(t,e,!1)),eF=t=>Lr(t,e=>Pa(t,e,!an(t))),tF=t=>Lr(t,e=>Pa(t,e,an(t))),iF=t=>Lr(t,e=>se.cursor(t.lineBlockAt(e.head).from)),nF=t=>Lr(t,e=>se.cursor(t.lineBlockAt(e.head).to)),KE=({state:t,dispatch:e})=>(e(Kr(t,{anchor:0})),!0),JE=({state:t,dispatch:e})=>(e(Kr(t,{anchor:t.doc.length})),!0),eM=({state:t,dispatch:e})=>(e(Kr(t,{anchor:t.selection.main.anchor,head:0})),!0),tM=({state:t,dispatch:e})=>(e(Kr(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),rF=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),sF=({state:t,dispatch:e})=>{let i=xO(t).map(({from:n,to:r})=>se.range(n,Math.min(r+1,t.doc.length)));return e(t.update({selection:se.create(i),userEvent:"select"})),!0},oF=({state:t,dispatch:e})=>{let i=bh(t.selection,n=>{let r=xt(t),s=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return se.range(l.to,l.from)}return n});return i.eq(t.selection)?!1:(e(Kr(t,i)),!0)};function k$(t,e){let{state:i}=t,n=i.selection,r=i.selection.ranges.slice();for(let s of i.selection.ranges){let o=i.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let c=t.moveVertically(l,e);if(c.head<o.from||c.head>o.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==n.ranges.length?!1:(t.dispatch(Kr(i,se.create(r,r.length-1))),!0)}const aF=t=>k$(t,!1),lF=t=>k$(t,!0),cF=({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=se.create([i.main]):i.main.empty||(n=se.create([se.cursor(i.main.head)])),n?(e(Kr(t,n)),!0):!1};function vd(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,r=n.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=e(s);c<o?(i="delete.backward",c=pm(t,c,!1)):c>o&&(i="delete.forward",c=pm(t,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=pm(t,o,!1),l=pm(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:se.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(n.update(r,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?ve.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function pm(t,e,i){if(t instanceof ve)for(let n of t.state.facet(ve.atomicRanges).map(r=>r(t)))n.between(e,e,(r,s)=>{r<e&&s>e&&(e=i?s:r)});return e}const T$=(t,e,i)=>vd(t,n=>{let r=n.from,{state:s}=t,o=s.doc.lineAt(r),l,c;if(i&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let u=Yr(l,s.tabSize),d=u%Qg(s)||Qg(s);for(let p=0;p<d&&l[l.length-1-p]==" ";p++)r--;c=r}else c=Di(o.text,r-o.from,e,e)+o.from,c==r&&o.number!=(e?s.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,r-o.from))&&(c=Di(o.text,c-o.from,!1,!1)+o.from);return c}),Lb=t=>T$(t,!1,!0),A$=t=>T$(t,!0,!1),E$=(t,e)=>vd(t,i=>{let n=i.head,{state:r}=t,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let l=null;;){if(n==(e?s.to:s.from)){n==i.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let c=Di(s.text,n-s.from,e)+s.from,u=s.text.slice(Math.min(n,c)-s.from,Math.max(n,c)-s.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||n!=i.head)&&(l=d),n=c}return n}),M$=t=>E$(t,!1),hF=t=>E$(t,!0),uF=t=>vd(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),fF=t=>vd(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),dF=t=>vd(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),pF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:at.of(["",""])},range:se.cursor(n.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0},mF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let r=n.from,s=t.doc.lineAt(r),o=r==s.from?r-1:Di(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Di(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:se.cursor(l)}});return i.changes.empty?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function xO(t){let e=[],i=-1;for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=t.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=t.doc.lineAt(n.to-1)),i>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});i=s.number+1}return e}function P$(t,e,i){if(t.readOnly)return!1;let n=[],r=[];for(let s of xO(t)){if(i?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(i?s.to+1:s.from-1),l=o.length+1;if(i){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let c of s.ranges)r.push(se.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let c of s.ranges)r.push(se.range(c.anchor-l,c.head-l))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:se.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const gF=({state:t,dispatch:e})=>P$(t,e,!1),OF=({state:t,dispatch:e})=>P$(t,e,!0);function R$(t,e,i){if(t.readOnly)return!1;let n=[];for(let s of xO(t))i?n.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):n.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(n);return e(t.update({changes:r,selection:t.selection.map(r,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const vF=({state:t,dispatch:e})=>R$(t,e,!1),_F=({state:t,dispatch:e})=>R$(t,e,!0),yF=t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(xO(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),n=bh(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function bF(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=xt(t).resolveInner(e),n=i.childBefore(e),r=i.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(Ne.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}const iM=Q$(!1),SF=Q$(!0);function Q$(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),c=!t&&s==o&&bF(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let u=new vO(e,{simulateBreak:s,simulateDoubleBreak:!!c}),d=ew(u,s);for(d==null&&(d=Yr(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;c?{from:s,to:o}=c:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let p=["",Vf(e,d)];return c&&p.push(Vf(e,u.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:at.of(p)},range:se.cursor(s+1+p[1].length)}});return i(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function rw(t,e){let i=-1;return t.changeByRange(n=>{let r=[];for(let o=n.from;o<=n.to;){let l=t.doc.lineAt(o);l.number>i&&(n.empty||n.to>l.from)&&(e(l,r,n),i=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:se.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const xF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new vO(t,{overrideIndentation:s=>{let o=i[s];return o??-1}}),r=rw(t,(s,o,l)=>{let c=ew(n,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=Vf(t,c);(u!=d||l.from<s.from+u.length)&&(i[s.from]=c,o.push({from:s.from,to:s.from+u.length,insert:d}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},L$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(rw(t,(i,n)=>{n.push({from:i.from,insert:t.facet(_h)})}),{userEvent:"input.indent"})),!0),D$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(rw(t,(i,n)=>{let r=/^\s*/.exec(i.text)[0];if(!r)return;let s=Yr(r,t.tabSize),o=0,l=Vf(t,Math.max(0,s-Qg(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;n.push({from:i.from+o,to:i.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),wF=t=>(t.setTabFocusMode(),!0),CF=[{key:"Ctrl-b",run:h$,shift:_$,preventDefault:!0},{key:"Ctrl-f",run:u$,shift:y$},{key:"Ctrl-p",run:p$,shift:x$},{key:"Ctrl-n",run:m$,shift:w$},{key:"Ctrl-a",run:ZH,shift:iF},{key:"Ctrl-e",run:qH,shift:nF},{key:"Ctrl-d",run:A$},{key:"Ctrl-h",run:Lb},{key:"Ctrl-k",run:uF},{key:"Ctrl-Alt-h",run:M$},{key:"Ctrl-o",run:pF},{key:"Ctrl-t",run:mF},{key:"Ctrl-v",run:Qb}],kF=[{key:"ArrowLeft",run:h$,shift:_$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:DH,shift:YH,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:VH,shift:eF,preventDefault:!0},{key:"ArrowRight",run:u$,shift:y$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:BH,shift:HH,preventDefault:!0},{mac:"Cmd-ArrowRight",run:XH,shift:tF,preventDefault:!0},{key:"ArrowUp",run:p$,shift:x$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:KE,shift:eM},{mac:"Ctrl-ArrowUp",run:HE,shift:FE},{key:"ArrowDown",run:m$,shift:w$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:JE,shift:tM},{mac:"Ctrl-ArrowDown",run:Qb,shift:GE},{key:"PageUp",run:HE,shift:FE},{key:"PageDown",run:Qb,shift:GE},{key:"Home",run:IH,shift:JH,preventDefault:!0},{key:"Mod-Home",run:KE,shift:eM},{key:"End",run:jH,shift:KH,preventDefault:!0},{key:"Mod-End",run:JE,shift:tM},{key:"Enter",run:iM,shift:iM},{key:"Mod-a",run:rF},{key:"Backspace",run:Lb,shift:Lb,preventDefault:!0},{key:"Delete",run:A$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:M$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:hF,preventDefault:!0},{mac:"Mod-Backspace",run:fF,preventDefault:!0},{mac:"Mod-Delete",run:dF,preventDefault:!0}].concat(CF.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),TF=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:zH,shift:FH},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:NH,shift:GH},{key:"Alt-ArrowUp",run:gF},{key:"Shift-Alt-ArrowUp",run:vF},{key:"Alt-ArrowDown",run:OF},{key:"Shift-Alt-ArrowDown",run:_F},{key:"Mod-Alt-ArrowUp",run:aF},{key:"Mod-Alt-ArrowDown",run:lF},{key:"Escape",run:cF},{key:"Mod-Enter",run:SF},{key:"Alt-l",mac:"Ctrl-l",run:sF},{key:"Mod-i",run:oF,preventDefault:!0},{key:"Mod-[",run:D$},{key:"Mod-]",run:L$},{key:"Mod-Alt-\\",run:xF},{key:"Shift-Mod-k",run:yF},{key:"Shift-Mod-\\",run:UH},{key:"Mod-/",run:gH},{key:"Alt-A",run:vH},{key:"Ctrl-m",mac:"Shift-Alt-m",run:wF}].concat(kF),AF={key:"Tab",run:L$,shift:D$},nM=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class ch{constructor(e,i,n=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?l=>s(nM(l)):nM,this.query=this.normalize(i)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ln(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let i=Ex(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=gs(e);let r=this.normalize(i);if(r.length)for(let s=0,o=n;;s++){let l=r.charCodeAt(s),c=this.match(l,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(c)return this.value=c,this;break}o==n&&s<i.length&&i.charCodeAt(s)==l&&o++}}}match(e,i,n){let r=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[s+1],to:n}:(this.matches[s]++,l=!0)),l||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:i,to:n}:this.matches.push(1,i)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(ch.prototype[Symbol.iterator]=function(){return this});const B$={from:-1,to:-1,match:/.*/.exec("")},sw="gm"+(/x/.unicode==null?"":"u");class $${constructor(e,i,n,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=B$,/\\[sWDnr]|\n|\r|\[\^/.test(i))return new z$(e,i,n,r,s);this.re=new RegExp(i,sw+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=$g(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let i=this.matchPos<=this.to&&this.re.exec(this.curLine);if(i){let n=this.curLineStart+i.index,r=n+i[0].length;if(this.matchPos=$g(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,i)))return this.value={from:n,to:r,match:i},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const V_=new WeakMap;class Fc{constructor(e,i){this.from=e,this.text=i}get to(){return this.from+this.text.length}static get(e,i,n){let r=V_.get(e);if(!r||r.from>=n||r.to<=i){let l=new Fc(i,e.sliceString(i,n));return V_.set(e,l),l}if(r.from==i&&r.to==n)return r;let{text:s,from:o}=r;return o>i&&(s=e.sliceString(i,o)+s,o=i),r.to<n&&(s+=e.sliceString(r.to,n)),V_.set(e,new Fc(o,s)),new Fc(i,s.slice(i-o,n-o))}}class z${constructor(e,i,n,r,s){this.text=e,this.to=s,this.done=!1,this.value=B$,this.matchPos=$g(e,r),this.re=new RegExp(i,sw+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Fc.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,i=this.re.exec(this.flat.text);if(i&&!i[0]&&i.index==e&&(this.re.lastIndex=e+1,i=this.re.exec(this.flat.text)),i){let n=this.flat.from+i.index,r=n+i[0].length;if((this.flat.to>=this.to||i.index+i[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,i)))return this.value={from:n,to:r,match:i},this.matchPos=$g(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Fc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&($$.prototype[Symbol.iterator]=z$.prototype[Symbol.iterator]=function(){return this});function EF(t){try{return new RegExp(t,sw),!0}catch{return!1}}function $g(t,e){if(e>=t.length)return e;let i=t.lineAt(e),n;for(;e<i.to&&(n=i.text.charCodeAt(e-i.from))>=56320&&n<57344;)e++;return e}const MF=t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:r}=UU(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){t.dispatch({effects:n});return}let l=e.doc.lineAt(e.selection.main.head),[,c,u,d,p]=o,g=d?+d.slice(1):0,O=u?+u:l.number;if(u&&p){let x=O/100;c&&(x=x*(c=="-"?-1:1)+l.number/e.doc.lines),O=Math.round(e.doc.lines*x)}else u&&c&&(O=O*(c=="-"?-1:1)+l.number);let _=e.doc.line(Math.max(1,Math.min(e.doc.lines,O))),b=se.cursor(_.from+Math.max(0,Math.min(g,_.length)));t.dispatch({effects:[n,ve.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},PF={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},RF=Se.define({combine(t){return Qs(t,PF,{highlightWordAroundCursor:(e,i)=>e||i,minSelectionLength:Math.min,maxMatches:Math.min})}});function QF(t){return[zF,$F]}const LF=Pe.mark({class:"cm-selectionMatch"}),DF=Pe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function rM(t,e,i,n){return(i==0||t(e.sliceDoc(i-1,i))!=Dt.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=Dt.Word)}function BF(t,e,i,n){return t(e.sliceDoc(i,i+1))==Dt.Word&&t(e.sliceDoc(n-1,n))==Dt.Word}const $F=Jt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(RF),{state:i}=t,n=i.selection;if(n.ranges.length>1)return Pe.none;let r=n.main,s,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return Pe.none;let c=i.wordAt(r.head);if(!c)return Pe.none;o=i.charCategorizer(r.head),s=i.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c<e.minSelectionLength||c>200)return Pe.none;if(e.wholeWords){if(s=i.sliceDoc(r.from,r.to),o=i.charCategorizer(r.head),!(rM(o,i,r.from,r.to)&&BF(o,i,r.from,r.to)))return Pe.none}else if(s=i.sliceDoc(r.from,r.to),!s)return Pe.none}let l=[];for(let c of t.visibleRanges){let u=new ch(i.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:p}=u.value;if((!o||rM(o,i,d,p))&&(r.empty&&d<=r.from&&p>=r.to?l.push(DF.range(d,p)):(d>=r.to||p<=r.from)&&l.push(LF.range(d,p)),l.length>e.maxMatches))return Pe.none}}return Pe.set(l)}},{decorations:t=>t.decorations}),zF=ve.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),NF=({state:t,dispatch:e})=>{let{selection:i}=t,n=se.create(i.ranges.map(r=>t.wordAt(r.head)||se.cursor(r.head)),i.mainIndex);return n.eq(i)?!1:(e(t.update({selection:n})),!0)};function jF(t,e){let{main:i,ranges:n}=t.selection,r=t.wordAt(i.head),s=r&&r.from==i.from&&r.to==i.to;for(let o=!1,l=new ch(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ch(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(c=>c.from==l.value.from))continue;if(s){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const IF=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(s=>s.from===s.to))return NF({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=n))return!1;let r=jF(t,n);return r?(e(t.update({selection:t.selection.addRange(se.range(r.from,r.to),!1),effects:ve.scrollIntoView(r.to)})),!0):!1},Sh=Se.define({combine(t){return Qs(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new tG(e),scrollToMatch:e=>ve.scrollIntoView(e)})}});class N${constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||EF(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(i,n)=>n=="n"?`
|
|
69
|
+
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new UF(this):new ZF(this)}getCursor(e,i=0,n){let r=e.doc?e:et.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?Pc(this,r,i,n):Mc(this,r,i,n)}}class j${constructor(e){this.spec=e}}function VF(t,e,i){return(n,r,s,o)=>{if(i&&!i(n,r,s,o))return!1;let l=n>=o&&r<=o+s.length?s.slice(n-o,r-o):e.doc.sliceString(n,r);return t(l,e,n,r)}}function Mc(t,e,i,n){let r;return t.wholeWord&&(r=XF(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(r=VF(t.test,e,r)),new ch(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:s=>s.toLowerCase(),r)}function XF(t,e){return(i,n,r,s)=>((s>i||s+r.length<n)&&(s=Math.max(0,i-2),r=t.sliceString(s,Math.min(t.length,n+2))),(e(zg(r,i-s))!=Dt.Word||e(Ng(r,i-s))!=Dt.Word)&&(e(Ng(r,n-s))!=Dt.Word||e(zg(r,n-s))!=Dt.Word))}class ZF extends j${constructor(e){super(e)}nextMatch(e,i,n){let r=Mc(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,i+this.spec.unquoted.length);r=Mc(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==i&&r.value.to==n?null:r.value}prevMatchInRange(e,i,n){for(let r=n;;){let s=Math.max(i,r-1e4-this.spec.unquoted.length),o=Mc(this.spec,e,s,r),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==i)return null;r-=1e4}}prevMatch(e,i,n){let r=this.prevMatchInRange(e,0,i);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=i||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,i){let n=Mc(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Mc(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function qF(t,e,i){return(n,r,s)=>(!i||i(n,r,s))&&t(s[0],e,n,r)}function Pc(t,e,i,n){let r;return t.wholeWord&&(r=WF(e.charCategorizer(e.selection.main.head))),t.test&&(r=qF(t.test,e,r)),new $$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:r},i,n)}function zg(t,e){return t.slice(Di(t,e,!1),e)}function Ng(t,e){return t.slice(e,Di(t,e))}function WF(t){return(e,i,n)=>!n[0].length||(t(zg(n.input,n.index))!=Dt.Word||t(Ng(n.input,n.index))!=Dt.Word)&&(t(Ng(n.input,n.index+n[0].length))!=Dt.Word||t(zg(n.input,n.index+n[0].length))!=Dt.Word)}class UF extends j${nextMatch(e,i,n){let r=Pc(this.spec,e,n,e.doc.length).next();return r.done&&(r=Pc(this.spec,e,0,i).next()),r.done?null:r.value}prevMatchInRange(e,i,n){for(let r=1;;r++){let s=Math.max(i,n-r*1e4),o=Pc(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==i||l.from>s+10))return l;if(s==i)return null}}prevMatch(e,i,n){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(i,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let s=+n.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+n.slice(r)}return i})}matchAll(e,i){let n=Pc(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Pc(this.spec,e,Math.max(0,i-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const Xf=ze.define(),ow=ze.define(),_a=Bi.define({create(t){return new X_(Db(t).create(),null)},update(t,e){for(let i of e.effects)i.is(Xf)?t=new X_(i.value.create(),t.panel):i.is(ow)&&(t=new X_(t.query,i.value?aw:null));return t},provide:t=>$f.from(t,e=>e.panel)});class X_{constructor(e,i){this.query=e,this.panel=i}}const YF=Pe.mark({class:"cm-searchMatch"}),HF=Pe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),FF=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(_a))}update(t){let e=t.state.field(_a);(e!=t.startState.field(_a)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Pe.none;let{view:i}=this,n=new _o;for(let r=0,s=i.visibleRanges,o=s.length;r<o;r++){let{from:l,to:c}=s[r];for(;r<o-1&&c>s[r+1].from-500;)c=s[++r].to;t.highlight(i.state,l,c,(u,d)=>{let p=i.state.selection.ranges.some(g=>g.from==u&&g.to==d);n.add(u,d,p?HF:YF)})}return n.finish()}},{decorations:t=>t.decorations});function _d(t){return e=>{let i=e.state.field(_a,!1);return i&&i.query.spec.valid?t(e,i):X$(e)}}const jg=_d((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let r=se.single(n.from,n.to),s=t.state.facet(Sh);return t.dispatch({selection:r,effects:[lw(t,n),s.scrollToMatch(r.main,t)],userEvent:"select.search"}),V$(t),!0}),Ig=_d((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,r=e.prevMatch(i,n,n);if(!r)return!1;let s=se.single(r.from,r.to),o=t.state.facet(Sh);return t.dispatch({selection:s,effects:[lw(t,r),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),V$(t),!0}),GF=_d((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:se.create(i.map(n=>se.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),KF=({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:r}=i.main,s=[],o=0;for(let l=new ch(t.doc,t.sliceDoc(n,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==n&&(o=s.length),s.push(se.range(l.value.from,l.value.to))}return e(t.update({selection:se.create(s,o),userEvent:"select.search.matches"})),!0},sM=_d((t,{query:e})=>{let{state:i}=t,{from:n,to:r}=i.selection.main;if(i.readOnly)return!1;let s=e.nextMatch(i,n,n);if(!s)return!1;let o=s,l=[],c,u,d=[];o.from==n&&o.to==r&&(u=i.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(i,o.from,o.to),d.push(ve.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+".")));let p=t.state.changes(l);return o&&(c=se.single(o.from,o.to).map(p),d.push(lw(t,o)),d.push(i.facet(Sh).scrollToMatch(c.main,t))),t.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),JF=_d((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map(r=>{let{from:s,to:o}=r;return{from:s,to:o,insert:e.getReplacement(r)}});if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:ve.announce.of(n),userEvent:"input.replace.all"}),!0});function aw(t){return t.state.facet(Sh).createPanel(t)}function Db(t,e){var i,n,r,s,o;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let u=t.facet(Sh);return new N$({search:((i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function I$(t){let e=Ux(t,aw);return e&&e.dom.querySelector("[main-field]")}function V$(t){let e=I$(t);e&&e==t.root.activeElement&&e.select()}const X$=t=>{let e=t.state.field(_a,!1);if(e&&e.panel){let i=I$(t);if(i&&i!=t.root.activeElement){let n=Db(t.state,e.query.spec);n.valid&&t.dispatch({effects:Xf.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[ow.of(!0),e?Xf.of(Db(t.state,e.query.spec)):ze.appendConfig.of(nG)]});return!0},Z$=t=>{let e=t.state.field(_a,!1);if(!e||!e.panel)return!1;let i=Ux(t,aw);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:ow.of(!1)}),!0},eG=[{key:"Mod-f",run:X$,scope:"editor search-panel"},{key:"F3",run:jg,shift:Ig,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jg,shift:Ig,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Z$,scope:"editor search-panel"},{key:"Mod-Shift-l",run:KF},{key:"Mod-Alt-g",run:MF},{key:"Mod-d",run:IF,preventDefault:!0}];class tG{constructor(e){this.view=e;let i=this.query=e.state.field(_a).query.spec;this.commit=this.commit.bind(this),this.searchField=vt("input",{value:i.search,placeholder:Hn(e,"Find"),"aria-label":Hn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=vt("input",{value:i.replace,placeholder:Hn(e,"Replace"),"aria-label":Hn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=vt("input",{type:"checkbox",name:"case",form:"",checked:i.caseSensitive,onchange:this.commit}),this.reField=vt("input",{type:"checkbox",name:"re",form:"",checked:i.regexp,onchange:this.commit}),this.wordField=vt("input",{type:"checkbox",name:"word",form:"",checked:i.wholeWord,onchange:this.commit});function n(r,s,o){return vt("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=vt("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>jg(e),[Hn(e,"next")]),n("prev",()=>Ig(e),[Hn(e,"previous")]),n("select",()=>GF(e),[Hn(e,"all")]),vt("label",null,[this.caseField,Hn(e,"match case")]),vt("label",null,[this.reField,Hn(e,"regexp")]),vt("label",null,[this.wordField,Hn(e,"by word")]),...e.state.readOnly?[]:[vt("br"),this.replaceField,n("replace",()=>sM(e),[Hn(e,"replace")]),n("replaceAll",()=>JF(e),[Hn(e,"replace all")])],vt("button",{name:"close",onclick:()=>Z$(e),"aria-label":Hn(e,"close"),type:"button"},["×"])])}commit(){let e=new N$({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Xf.of(e)}))}keydown(e){nU(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ig:jg)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),sM(this.view))}update(e){for(let i of e.transactions)for(let n of i.effects)n.is(Xf)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Sh).top}}function Hn(t,e){return t.state.phrase(e)}const mm=30,gm=/[\s\.,:;?!]/;function lw(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),r=t.state.doc.lineAt(i).to,s=Math.max(n.from,e-mm),o=Math.min(r,i+mm),l=t.state.sliceDoc(s,o);if(s!=n.from){for(let c=0;c<mm;c++)if(!gm.test(l[c+1])&&gm.test(l[c])){l=l.slice(c);break}}if(o!=r){for(let c=l.length-1;c>l.length-mm;c--)if(!gm.test(l[c-1])&&gm.test(l[c])){l=l.slice(0,c);break}}return ve.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const iG=ve.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),nG=[_a,So.low(FF),iG];class cw{constructor(e,i,n,r){this.state=e,this.pos=i,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let i=xt(this.state).resolveInner(this.pos,-1);for(;i&&e.indexOf(i.name)<0;)i=i.parent;return i?{from:i.from,to:this.pos,text:this.state.sliceDoc(i.from,this.pos),type:i.type}:null}matchBefore(e){let i=this.state.doc.lineAt(this.pos),n=Math.max(i.from,this.pos-250),r=i.text.slice(n-i.from,this.pos-i.from),s=r.search(W$(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,i,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(i),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function oM(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function rG(t){let e=Object.create(null),i=Object.create(null);for(let{label:r}of t){e[r[0]]=!0;for(let s=1;s<r.length;s++)i[r[s]]=!0}let n=oM(e)+oM(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function q$(t){let e=t.map(r=>typeof r=="string"?{label:r}:r),[i,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:rG(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:i}:null}}function sG(t,e){return i=>{for(let n=xt(i.state).resolveInner(i.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(i)}}class aM{constructor(e,i,n,r){this.completion=e,this.source=i,this.match=n,this.score=r}}function bl(t){return t.selection.main.from}function W$(t,e){var i;let{source:n}=t,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?t:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}const hw=Rs.define();function oG(t,e,i,n){let{main:r}=t.selection,s=i-r.from,o=n-r.from;return{...t.changeByRange(l=>{if(l!=r&&i!=n&&t.sliceDoc(l.from+s,l.from+o)!=t.sliceDoc(i,n))return{range:l};let c=t.toText(e);return{changes:{from:l.from+s,to:n==r.from?l.to:l.from+o,insert:c},range:se.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const lM=new WeakMap;function aG(t){if(!Array.isArray(t))return t;let e=lM.get(t);return e||lM.set(t,e=q$(t)),e}const Vg=ze.define(),Zf=ze.define();class lG{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let i=0;i<e.length;){let n=Ln(e,i),r=gs(n);this.chars.push(n);let s=e.slice(i,i+r),o=s.toUpperCase();this.folded.push(Ln(o==s?s.toLowerCase():o,0)),i+=r}this.astral=e.length!=this.chars.length}ret(e,i){return this.score=e,this.matched=i,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:i,folded:n,any:r,precise:s,byWord:o}=this;if(i.length==1){let k=Ln(e,0),T=gs(k),A=T==e.length?0:-100;if(k!=i[0])if(k==n[0])A+=-200;else return null;return this.ret(A,[0,T])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=i.length,u=0;if(l<0){for(let k=0,T=Math.min(e.length,200);k<T&&u<c;){let A=Ln(e,k);(A==i[u]||A==n[u])&&(r[u++]=k),k+=gs(A)}if(u<c)return null}let d=0,p=0,g=!1,O=0,_=-1,b=-1,x=/[a-z]/.test(e),w=!0;for(let k=0,T=Math.min(e.length,200),A=0;k<T&&p<c;){let L=Ln(e,k);l<0&&(d<c&&L==i[d]&&(s[d++]=k),O<c&&(L==i[O]||L==n[O]?(O==0&&(_=k),b=k+1,O++):O=0));let E,N=L<255?L>=48&&L<=57||L>=97&&L<=122?2:L>=65&&L<=90?1:0:(E=Ex(L))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!k||N==1&&x||A==0&&N!=0)&&(i[p]==L||n[p]==L&&(g=!0)?o[p++]=k:o.length&&(w=!1)),A=N,k+=gs(L)}return p==c&&o[0]==0&&w?this.result(-100+(g?-200:0),o,e):O==c&&_==0?this.ret(-200-e.length+(b==e.length?0:-100),[0,b]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):O==c?this.ret(-900-e.length,[_,b]):p==c?this.result(-100+(g?-200:0)+-700+(w?0:-1100),o,e):i.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,i,n){let r=[],s=0;for(let o of i){let l=o+(this.astral?gs(Ln(n,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(e-n.length,r)}}class cG{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let i=e.slice(0,this.pattern.length),n=i==this.pattern?0:i.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,i.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const Li=Se.define({combine(t){return Qs(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:hG,filterStrict:!1,compareCompletions:(e,i)=>(e.sortText||e.label).localeCompare(i.sortText||i.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,i)=>e&&i,closeOnBlur:(e,i)=>e&&i,icons:(e,i)=>e&&i,tooltipClass:(e,i)=>n=>cM(e(n),i(n)),optionClass:(e,i)=>n=>cM(e(n),i(n)),addToOptions:(e,i)=>e.concat(i),filterStrict:(e,i)=>e||i})}});function cM(t,e){return t?e?t+" "+e:t:e}function hG(t,e,i,n,r,s){let o=t.textDirection==St.RTL,l=o,c=!1,u="top",d,p,g=e.left-r.left,O=r.right-e.right,_=n.right-n.left,b=n.bottom-n.top;if(l&&g<Math.min(_,O)?l=!1:!l&&O<Math.min(_,g)&&(l=!0),_<=(l?g:O))d=Math.max(r.top,Math.min(i.top,r.bottom-b))-e.top,p=Math.min(400,l?g:O);else{c=!0,p=Math.min(400,(o?e.right:r.right-e.left)-30);let k=r.bottom-e.bottom;k>=b||k>e.top?d=i.bottom-e.top:(u="bottom",d=e.bottom-i.top)}let x=(e.bottom-e.top)/s.offsetHeight,w=(e.right-e.left)/s.offsetWidth;return{style:`${u}: ${d/x}px; max-width: ${p/w}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}function uG(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(i){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),i.type&&n.classList.add(...i.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(i,n,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=i.displayLabel||i.label,c=0;for(let u=0;u<s.length;){let d=s[u++],p=s[u++];d>c&&o.appendChild(document.createTextNode(l.slice(c,d)));let g=o.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(d,p))),g.className="cm-completionMatchedText",c=p}return c<l.length&&o.appendChild(document.createTextNode(l.slice(c))),o},position:50},{render(i){if(!i.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=i.detail,n},position:80}),e.sort((i,n)=>i.position-n.position).map(i=>i.render)}function Z_(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let r=Math.floor(e/i);return{from:r*i,to:(r+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class fG{constructor(e,i,n){this.view=e,this.stateField=i,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=e.state.field(i),{options:s,selected:o}=r.open,l=e.state.facet(Li);this.optionContent=uG(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Z_(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=e.state.field(i).open;for(let d=c.target,p;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(p=/-(\d+)$/.exec(d.id))&&+p[1]<u.length){this.applyCompletion(e,u[+p[1]]),c.preventDefault();return}}),this.dom.addEventListener("focusout",c=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Li).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:Zf.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,i){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,i,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var i;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:o,disabled:l}=n.open;(!r.open||r.open.options!=s)&&(this.range=Z_(s.length,o,e.state.facet(Li).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),l!=((i=r.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let i=this.tooltipClass(e);if(i!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of i.split(" "))n&&this.dom.classList.add(n);this.currentClass=i}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),i=e.open;(i.selected>-1&&i.selected<this.range.from||i.selected>=this.range.to)&&(this.range=Z_(i.options.length,i.selected,this.view.state.facet(Li).maxRenderedOptions),this.showOptions(i.options,e.id));let n=this.updateSelectedOption(i.selected);if(n){this.destroyInfo();let{completion:r}=i.options[i.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>$n(this.view.state,l,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,i){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let i=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),i=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return i&&pG(this.list,i),i}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let i=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,i.bottom)-10||r.bottom<Math.max(s.top,i.top)+10?null:this.view.state.facet(Li).positionInfo(this.view,i,r,n,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,i,n){const r=document.createElement("ul");r.id=i,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",o=>{o.target==r&&o.preventDefault()});let s=null;for(let o=n.from;o<n.to;o++){let{completion:l,match:c}=e[o],{section:u}=l;if(u){let g=typeof u=="string"?u:u.name;if(g!=s&&(o>n.from||n.from==0))if(s=g,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let O=r.appendChild(document.createElement("completion-section"));O.textContent=g}}const d=r.appendChild(document.createElement("li"));d.id=i+"-"+o,d.setAttribute("role","option");let p=this.optionClass(l);p&&(d.className=p);for(let g of this.optionContent){let O=g(l,this.view.state,this.view,c);O&&d.appendChild(O)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function dG(t,e){return i=>new fG(i,t,e)}function pG(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=i.height/t.offsetHeight;n.top<i.top?t.scrollTop-=(i.top-n.top)/r:n.bottom>i.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/r)}function hM(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function mG(t,e){let i=[],n=null,r=null,s=d=>{i.push(d);let{section:p}=d.completion;if(p){n||(n=[]);let g=typeof p=="string"?p:p.name;n.some(O=>O.name==g)||n.push(typeof p=="string"?{name:g}:p)}},o=e.facet(Li);for(let d of t)if(d.hasResult()){let p=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)s(new aM(g,d.source,p?p(g):[],1e9-i.length));else{let g=e.sliceDoc(d.from,d.to),O,_=o.filterStrict?new cG(g):new lG(g);for(let b of d.result.options)if(O=_.match(b.label)){let x=b.displayLabel?p?p(b,O.matched):[]:O.matched,w=O.score+(b.boost||0);if(s(new aM(b,d.source,x,w)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:k}=b.section;r||(r=Object.create(null)),r[k]=Math.max(w,r[k]||-1e9)}}}}if(n){let d=Object.create(null),p=0,g=(O,_)=>(O.rank==="dynamic"&&_.rank==="dynamic"?r[_.name]-r[O.name]:0)||(typeof O.rank=="number"?O.rank:1e9)-(typeof _.rank=="number"?_.rank:1e9)||(O.name<_.name?-1:1);for(let O of n.sort(g))p-=1e5,d[O.name]=p;for(let O of i){let{section:_}=O.completion;_&&(O.score+=d[typeof _=="string"?_:_.name])}}let l=[],c=null,u=o.compareCompletions;for(let d of i.sort((p,g)=>g.score-p.score||u(p.completion,g.completion))){let p=d.completion;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?l.push(d):hM(d.completion)>hM(c)&&(l[l.length-1]=d),c=d.completion}return l}class jc{constructor(e,i,n,r,s,o){this.options=e,this.attrs=i,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,i){return e==this.selected||e>=this.options.length?this:new jc(this.options,uM(i,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,i,n,r,s,o){if(r&&!o&&e.some(u=>u.isPending))return r.setDisabled();let l=mG(e,i);if(!l.length)return r&&e.some(u=>u.isPending)?r.setDisabled():null;let c=i.facet(Li).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;d<l.length;d++)if(l[d].completion==u){c=d;break}}return new jc(l,uM(n,c),{pos:e.reduce((u,d)=>d.hasResult()?Math.min(u,d.from):u,1e8),create:bG,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(e){return new jc(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new jc(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Xg{constructor(e,i,n){this.active=e,this.id=i,this.open=n}static start(){return new Xg(_G,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:i}=e,n=i.facet(Li),s=(n.override||i.languageDataAt("autocomplete",bl(i)).map(aG)).map(c=>(this.active.find(d=>d.source==c)||new Mr(c,this.active.some(d=>d.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let o=this.open,l=e.effects.some(c=>c.is(uw));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!gG(s,this.active)||l?o=jc.build(s,i,this.id,o,n,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new Mr(c.source,0):c));for(let c of e.effects)c.is(Y$)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new Xg(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?OG:vG}}function gG(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;n<e.length&&!e[n].hasResult();)n++;let r=i==t.length,s=n==e.length;if(r||s)return r==s;if(t[i++].result!=e[n++].result)return!1}}const OG={"aria-autocomplete":"list"},vG={};function uM(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const _G=[];function U$(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(hw);if(n&&e.activateOnCompletion(n))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Mr{constructor(e,i,n=!1){this.source=e,this.state=i,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,i){let n=U$(e,i),r=this;(n&8||n&16&&this.touches(e))&&(r=new Mr(r.source,0)),n&4&&r.state==0&&(r=new Mr(this.source,1)),r=r.updateFor(e,n);for(let s of e.effects)if(s.is(Vg))r=new Mr(r.source,1,s.value);else if(s.is(Zf))r=new Mr(r.source,0);else if(s.is(uw))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,i){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(bl(e.state))}}class Gc extends Mr{constructor(e,i,n,r,s,o){super(e,3,i),this.limit=n,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,i){var n;if(!(i&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=bl(e.state);if(l>o||!r||i&2&&(bl(e.startState)==this.from||l<this.limit))return new Mr(this.source,i&4?1:0);let c=e.changes.mapPos(this.limit);return yG(r.validFor,e.state,s,o)?new Gc(this.source,this.explicit,c,r,s,o):r.update&&(r=r.update(r,s,o,new cw(e.state,l,!1)))?new Gc(this.source,this.explicit,c,r,r.from,(n=r.to)!==null&&n!==void 0?n:bl(e.state)):new Mr(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Gc(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Mr(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function yG(t,e,i,n){if(!t)return!1;let r=e.sliceDoc(i,n);return typeof t=="function"?t(r,i,n,e):W$(t,!0).test(r)}const uw=ze.define({map(t,e){return t.map(i=>i.map(e))}}),Y$=ze.define(),Dn=Bi.define({create(){return Xg.start()},update(t,e){return t.update(e)},provide:t=>[Wx.from(t,e=>e.tooltip),ve.contentAttributes.from(t,e=>e.attrs)]});function fw(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(Dn).active.find(r=>r.source==e.source);return n instanceof Gc?(typeof i=="string"?t.dispatch({...oG(t.state,i,n.from,n.to),annotations:hw.of(e.completion)}):i(t,e.completion,n.from,n.to),!0):!1}const bG=dG(Dn,fw);function Om(t,e="option"){return i=>{let n=i.state.field(Dn,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(Li).interactionDelay)return!1;let r=1,s;e=="page"&&(s=CB(i,n.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=n.open.options,l=n.open.selected>-1?n.open.selected+r*(t?1:-1):t?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),i.dispatch({effects:Y$.of(l)}),!0}}const SG=t=>{let e=t.state.field(Dn,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Li).interactionDelay?!1:fw(t,e.open.options[e.open.selected])},q_=t=>t.state.field(Dn,!1)?(t.dispatch({effects:Vg.of(!0)}),!0):!1,xG=t=>{let e=t.state.field(Dn,!1);return!e||!e.active.some(i=>i.state!=0)?!1:(t.dispatch({effects:Zf.of(null)}),!0)};class wG{constructor(e,i){this.active=e,this.context=i,this.time=Date.now(),this.updates=[],this.done=void 0}}const CG=50,kG=1e3,TG=Jt.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Dn).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Dn),i=t.state.facet(Li);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Dn)==e)return;let n=t.transactions.some(s=>{let o=U$(s,i);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(n||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>CG&&Date.now()-o.time>kG){for(let l of o.context.abortListeners)try{l()}catch(c){$n(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(Vg)))&&(this.pendingStart=!0);let r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Dn);for(let i of e.active)i.isPending&&!this.running.some(n=>n.active.source==i.source)&&this.startQuery(i);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Li).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=bl(e),n=new cw(e,i,t.explicit,this.view),r=new wG(t,n);this.running.push(r),Promise.resolve(t.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Zf.of(null)}),$n(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Li).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Li),n=this.view.state.field(Dn);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(s.done===void 0)continue;if(this.running.splice(r--,1),s.done){let l=bl(s.updates.length?s.updates[0].startState:this.view.state),c=Math.min(l,s.done.from+(s.active.explicit?0:1)),u=new Gc(s.active.source,s.active.explicit,c,s.done,s.done.from,(t=s.done.to)!==null&&t!==void 0?t:l);for(let d of s.updates)u=u.update(d,i);if(u.hasResult()){e.push(u);continue}}let o=n.active.find(l=>l.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new Mr(s.active.source,0);for(let c of s.updates)l=l.update(c,i);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:uw.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Dn,!1);if(e&&e.tooltip&&this.view.state.facet(Li).closeOnBlur){let i=e.open&&CB(this.view,e.open.tooltip);(!i||!i.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Zf.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Vg.of(!1)}),20),this.composing=0}}}),AG=typeof navigator=="object"&&/Win/.test(navigator.platform),EG=So.highest(ve.domEventHandlers({keydown(t,e){let i=e.state.field(Dn,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&!(AG&&t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],r=i.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&fw(e,n),!1}})),H$=ve.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class MG{constructor(e,i,n,r){this.field=e,this.line=i,this.from=n,this.to=r}}class dw{constructor(e,i,n){this.field=e,this.from=i,this.to=n}map(e){let i=e.mapPos(this.from,-1,Fi.TrackDel),n=e.mapPos(this.to,1,Fi.TrackDel);return i==null||n==null?null:new dw(this.field,i,n)}}class pw{constructor(e,i){this.lines=e,this.fieldPositions=i}instantiate(e,i){let n=[],r=[i],s=e.doc.lineAt(i),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(n.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let p=0;p<d;p++)u+=e.facet(_h);r.push(i+u.length-d),c=u+c.slice(d)}n.push(c),i+=c.length+1}let l=this.fieldPositions.map(c=>new dw(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:n,ranges:l}}static parse(e){let i=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1,d=c.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<i.length;p++)(l!=null?i[p].seq==l:d&&i[p].name==d)&&(u=p);if(u<0){let p=0;for(;p<i.length&&(l==null||i[p].seq!=null&&i[p].seq<l);)p++;i.splice(p,0,{seq:l,name:d}),u=p;for(let g of r)g.field>=u&&g.field++}for(let p of r)if(p.line==n.length&&p.from>s.index){let g=s[2]?3+(s[1]||"").length:2;p.from-=g,p.to-=g}r.push(new MG(u,n.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==n.length&&d.from>u&&(d.from--,d.to--);return c}),n.push(o)}return new pw(n,r)}}let PG=Pe.widget({widget:new class extends Gr{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),RG=Pe.mark({class:"cm-snippetField"});class xh{constructor(e,i){this.ranges=e,this.active=i,this.deco=Pe.set(e.map(n=>(n.from==n.to?PG:RG).range(n.from,n.to)),!0)}map(e){let i=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;i.push(r)}return new xh(i,this.active)}selectionInsideField(e){return e.ranges.every(i=>this.ranges.some(n=>n.field==this.active&&n.from<=i.from&&n.to>=i.to))}}const yd=ze.define({map(t,e){return t&&t.map(e)}}),QG=ze.define(),qf=Bi.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(yd))return i.value;if(i.is(QG)&&t)return new xh(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ve.decorations.from(t,e=>e?e.deco:Pe.none)});function mw(t,e){return se.create(t.filter(i=>i.field==e).map(i=>se.range(i.from,i.to)))}function LG(t){let e=pw.parse(t);return(i,n,r,s)=>{let{text:o,ranges:l}=e.instantiate(i.state,r),{main:c}=i.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:at.of(o)},scrollIntoView:!0,annotations:n?[hw.of(n),hi.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=mw(l,0)),l.some(d=>d.field>0)){let d=new xh(l,0),p=u.effects=[yd.of(d)];i.state.field(qf,!1)===void 0&&p.push(ze.appendConfig.of([qf,NG,jG,H$]))}i.dispatch(i.state.update(u))}}function F$(t){return({state:e,dispatch:i})=>{let n=e.field(qf,!1);if(!n||t<0&&n.active==0)return!1;let r=n.active+t,s=t>0&&!n.ranges.some(o=>o.field==r+t);return i(e.update({selection:mw(n.ranges,r),effects:yd.of(s?null:new xh(n.ranges,r)),scrollIntoView:!0})),!0}}const DG=({state:t,dispatch:e})=>t.field(qf,!1)?(e(t.update({effects:yd.of(null)})),!0):!1,BG=F$(1),$G=F$(-1),zG=[{key:"Tab",run:BG,shift:$G},{key:"Escape",run:DG}],fM=Se.define({combine(t){return t.length?t[0]:zG}}),NG=So.highest(Ql.compute([fM],t=>t.facet(fM)));function Qn(t,e){return{...e,apply:LG(t)}}const jG=ve.domEventHandlers({mousedown(t,e){let i=e.state.field(qf,!1),n;if(!i||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let r=i.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==i.active?!1:(e.dispatch({selection:mw(i.ranges,r.field),effects:yd.of(i.ranges.some(s=>s.field>r.field)?new xh(i.ranges,r.field):null),scrollIntoView:!0}),!0)}}),Wf={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ol=ze.define({map(t,e){let i=e.mapPos(t,-1,Fi.TrackAfter);return i??void 0}}),gw=new class extends Sa{};gw.startSide=1;gw.endSide=-1;const G$=Bi.define({create(){return Ge.empty},update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:n=>n>=i.from&&n<=i.to})}for(let i of e.effects)i.is(Ol)&&(t=t.update({add:[gw.range(i.value,i.value+1)]}));return t}});function IG(){return[XG,G$]}const W_="()[]{}<>«»»«[]{}";function K$(t){for(let e=0;e<W_.length;e+=2)if(W_.charCodeAt(e)==t)return W_.charAt(e+1);return Ex(t<128?t:t+1)}function J$(t,e){return t.languageDataAt("closeBrackets",e)[0]||Wf}const VG=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),XG=ve.inputHandler.of((t,e,i,n)=>{if((VG?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let r=t.state.selection.main;if(n.length>2||n.length==2&&gs(Ln(n,0))==1||e!=r.from||i!=r.to)return!1;let s=WG(t.state,n);return s?(t.dispatch(s),!0):!1}),ZG=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=J$(t,t.selection.main.head).brackets||Wf.brackets,r=null,s=t.changeByRange(o=>{if(o.empty){let l=UG(t.doc,o.head);for(let c of n)if(c==l&&wO(t.doc,o.head)==K$(Ln(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:se.cursor(o.head-c.length)}}return{range:r=o}});return r||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},qG=[{key:"Backspace",run:ZG}];function WG(t,e){let i=J$(t,t.selection.main.head),n=i.brackets||Wf.brackets;for(let r of n){let s=K$(Ln(r,0));if(e==r)return s==r?FG(t,r,n.indexOf(r+r+r)>-1,i):YG(t,r,s,i.before||Wf.before);if(e==s&&e4(t,t.selection.main.from))return HG(t,r,s)}return null}function e4(t,e){let i=!1;return t.field(G$).between(0,t.doc.length,n=>{n==e&&(i=!0)}),i}function wO(t,e){let i=t.sliceString(e,e+2);return i.slice(0,gs(Ln(i,0)))}function UG(t,e){let i=t.sliceString(e-2,e);return gs(Ln(i,0))==i.length?i:i.slice(1)}function YG(t,e,i,n){let r=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:i,from:o.to}],effects:Ol.of(o.to+e.length),range:se.range(o.anchor+e.length,o.head+e.length)};let l=wO(t.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+i,from:o.head},effects:Ol.of(o.head+e.length),range:se.cursor(o.head+e.length)}:{range:r=o}});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function HG(t,e,i){let n=null,r=t.changeByRange(s=>s.empty&&wO(t.doc,s.head)==i?{changes:{from:s.head,to:s.head+i.length,insert:i},range:se.cursor(s.head+i.length)}:n={range:s});return n?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function FG(t,e,i,n){let r=n.stringPrefixes||Wf.stringPrefixes,s=null,o=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Ol.of(l.to+e.length),range:se.range(l.anchor+e.length,l.head+e.length)};let c=l.head,u=wO(t.doc,c),d;if(u==e){if(dM(t,c))return{changes:{insert:e+e,from:c},effects:Ol.of(c+e.length),range:se.cursor(c+e.length)};if(e4(t,c)){let g=i&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:se.cursor(c+g.length)}}}else{if(i&&t.sliceDoc(c-2*e.length,c)==e+e&&(d=pM(t,c-2*e.length,r))>-1&&dM(t,d))return{changes:{insert:e+e+e+e,from:c},effects:Ol.of(c+e.length),range:se.cursor(c+e.length)};if(t.charCategorizer(c)(u)!=Dt.Word&&pM(t,c,r)>-1&&!GG(t,c,e,r))return{changes:{insert:e+e,from:c},effects:Ol.of(c+e.length),range:se.cursor(c+e.length)}}return{range:s=l}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function dM(t,e){let i=xt(t).resolveInner(e+1);return i.parent&&i.from==e}function GG(t,e,i,n){let r=xt(t).resolveInner(e,-1),s=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=t.sliceDoc(r.from,Math.min(r.to,r.from+i.length+s)),c=l.indexOf(i);if(!c||c>-1&&n.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>i.length+c;){if(t.sliceDoc(d.to-i.length,d.to)==i)return!1;d=d.firstChild}return!0}let u=r.to==e&&r.parent;if(!u)break;r=u}return!1}function pM(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Dt.Word)return e;for(let r of i){let s=e-r.length;if(t.sliceDoc(s,e)==r&&n(t.sliceDoc(s-1,s))!=Dt.Word)return s}return-1}function KG(t={}){return[EG,Dn,Li.of(t),TG,JG,H$]}const t4=[{key:"Ctrl-Space",run:q_},{mac:"Alt-`",run:q_},{mac:"Alt-i",run:q_},{key:"Escape",run:xG},{key:"ArrowDown",run:Om(!0)},{key:"ArrowUp",run:Om(!1)},{key:"PageDown",run:Om(!0,"page")},{key:"PageUp",run:Om(!1,"page")},{key:"Enter",run:SG}],JG=So.highest(Ql.computeN([Li],t=>t.facet(Li).defaultKeymap?[t4]:[]));class mM{constructor(e,i,n){this.from=e,this.to=i,this.diagnostic=n}}class hl{constructor(e,i,n){this.diagnostics=e,this.panel=i,this.selected=n}static init(e,i,n){let r=n.facet(Uf).markerFilter;r&&(e=r(e,n));let s=e.slice().sort((O,_)=>O.from-_.from||O.to-_.to),o=new _o,l=[],c=0,u=n.doc.iter(),d=0,p=n.doc.length;for(let O=0;;){let _=O==s.length?null:s[O];if(!_&&!l.length)break;let b,x;if(l.length)b=c,x=l.reduce((T,A)=>Math.min(T,A.to),_&&_.from>b?_.from:1e8);else{if(b=_.from,b>p)break;x=_.to,l.push(_),O++}for(;O<s.length;){let T=s[O];if(T.from==b&&(T.to>T.from||T.to==b))l.push(T),O++,x=Math.min(T.to,x);else{x=Math.min(T.from,x);break}}x=Math.min(x,p);let w=!1;if(l.some(T=>T.from==b&&(T.to==x||x==p))&&(w=b==x,!w&&x-b<10)){let T=b-(d+u.value.length);T>0&&(u.next(T),d=b);for(let A=b;;){if(A>=x){w=!0;break}if(!u.lineBreak&&d+u.value.length>A)break;A=d+u.value.length,d+=u.value.length,u.next()}}let k=fK(l);if(w)o.add(b,b,Pe.widget({widget:new lK(k),diagnostics:l.slice()}));else{let T=l.reduce((A,L)=>L.markClass?A+" "+L.markClass:A,"");o.add(b,x,Pe.mark({class:"cm-lintRange cm-lintRange-"+k+T,diagnostics:l.slice(),inclusiveEnd:l.some(A=>A.to>x)}))}if(c=x,c==p)break;for(let T=0;T<l.length;T++)l[T].to<=c&&l.splice(T--,1)}let g=o.finish();return new hl(g,i,Aa(g))}}function Aa(t,e=null,i=0){let n=null;return t.between(i,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new mM(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new mM(n.from,s,n.diagnostic)}}),n}function eK(t,e){let i=e.pos,n=e.end||i,r=t.state.facet(Uf).hideOn(t,i,n);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(i4))||t.changes.touchesRange(s.from,Math.max(s.to,n)))}function tK(t,e){return t.field(rr,!1)?e:e.concat(ze.appendConfig.of(dK))}const i4=ze.define(),Ow=ze.define(),n4=ze.define(),rr=Bi.define({create(){return new hl(Pe.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),n=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);n=Aa(i,t.selected.diagnostic,s)||Aa(i,null,s)}!i.size&&r&&e.state.facet(Uf).autoPanel&&(r=null),t=new hl(i,r,n)}for(let i of e.effects)if(i.is(i4)){let n=e.state.facet(Uf).autoPanel?i.value.length?Yf.open:null:t.panel;t=hl.init(i.value,n,e.state)}else i.is(Ow)?t=new hl(t.diagnostics,i.value?Yf.open:null,t.selected):i.is(n4)&&(t=new hl(t.diagnostics,t.panel,i.value));return t},provide:t=>[$f.from(t,e=>e.panel),ve.decorations.from(t,e=>e.diagnostics)]}),iK=Pe.mark({class:"cm-lintRange cm-lintRange-active"});function nK(t,e,i){let{diagnostics:n}=t.state.field(rr),r,s=-1,o=-1;n.between(e-(i<0?1:0),e+(i>0?1:0),(c,u,{spec:d})=>{if(e>=c&&e<=u&&(c==u||(e>c||i>0)&&(e<u||i<0)))return r=d.diagnostics,s=c,o=u,!1});let l=t.state.facet(Uf).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:o,above:t.state.doc.lineAt(s).to<o,create(){return{dom:rK(t,r)}}}:null}function rK(t,e){return vt("ul",{class:"cm-tooltip-lint"},e.map(i=>s4(t,i,!1)))}const sK=t=>{let e=t.state.field(rr,!1);(!e||!e.panel)&&t.dispatch({effects:tK(t.state,[Ow.of(!0)])});let i=Ux(t,Yf.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},gM=t=>{let e=t.state.field(rr,!1);return!e||!e.panel?!1:(t.dispatch({effects:Ow.of(!1)}),!0)},oK=t=>{let e=t.state.field(rr,!1);if(!e)return!1;let i=t.state.selection.main,n=Aa(e.diagnostics,null,i.to+1);return!n&&(n=Aa(e.diagnostics,null,0),!n||n.from==i.from&&n.to==i.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},aK=[{key:"Mod-Shift-m",run:sK,preventDefault:!0},{key:"F8",run:oK}],Uf=Se.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...Qs(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:OM,tooltipFilter:OM,needsRefresh:(e,i)=>e?i?n=>e(n)||i(n):e:i,hideOn:(e,i)=>e?i?(n,r,s)=>e(n,r,s)||i(n,r,s):e:i,autoPanel:(e,i)=>e||i})}}});function OM(t,e){return t?e?(i,n)=>e(t(i,n),n):t:e}function r4(t){let e=[];if(t)e:for(let{name:i}of t){for(let n=0;n<i.length;n++){let r=i[n];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function s4(t,e,i){var n;let r=i?r4(e.actions):[];return vt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},vt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,o)=>{let l=!1,c=O=>{if(O.preventDefault(),l)return;l=!0;let _=Aa(t.state.field(rr).diagnostics,e);_&&s.apply(t,_.from,_.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,p=d<0?u:[u.slice(0,d),vt("u",u.slice(d,d+1)),u.slice(d+1)],g=s.markClass?" "+s.markClass:"";return vt("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},p)}),e.source&&vt("div",{class:"cm-diagnosticSource"},e.source))}class lK extends Gr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return vt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class vM{constructor(e,i){this.diagnostic=i,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=s4(e,i,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Yf{constructor(e){this.view=e,this.items=[];let i=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)gM(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=r4(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let c=Aa(this.view.state.field(rr).diagnostics,s);c&&s.actions[l].apply(e,c.from,c.to)}}else return;r.preventDefault()}},n=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=vt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:i,onclick:n}),this.dom=vt("div",{class:"cm-panel-lint"},this.list,vt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>gM(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(rr).selected;if(!e)return-1;for(let i=0;i<this.items.length;i++)if(this.items[i].diagnostic==e.diagnostic)return i;return-1}update(){let{diagnostics:e,selected:i}=this.view.state.field(rr),n=0,r=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,c,{spec:u})=>{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let p=-1,g;for(let O=n;O<this.items.length;O++)if(this.items[O].diagnostic==d){p=O;break}p<0?(g=new vM(this.view,d),this.items.splice(n,0,g),r=!0):(g=this.items[p],p>n&&(this.items.splice(n,p-n),r=!0)),i&&g.diagnostic==i.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),s=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new vM(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/u:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function i(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)i();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)i()}moveSelection(e){if(this.selectedIndex<0)return;let i=this.view.state.field(rr),n=Aa(i.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:n4.of(n)})}static open(e){return new Yf(e)}}function cK(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function vm(t){return cK(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const hK=ve.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:vm("#d11")},".cm-lintRange-warning":{backgroundImage:vm("orange")},".cm-lintRange-info":{backgroundImage:vm("#999")},".cm-lintRange-hint":{backgroundImage:vm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function uK(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function fK(t){let e="hint",i=1;for(let n of t){let r=uK(n.severity);r>i&&(i=r,e=n.severity)}return e}const dK=[rr,ve.decorations.compute([rr],t=>{let{selected:e,panel:i}=t.field(rr);return!e||!i||e.from==e.to?Pe.none:Pe.set([iK.range(e.from,e.to)])}),qU(nK,{hideOn:eK}),hK];var _M=function(e){e===void 0&&(e={});var{crosshairCursor:i=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(qG)),e.defaultKeymap!==!1&&(n=n.concat(TF)),e.searchKeymap!==!1&&(n=n.concat(eG)),e.historyKeymap!==!1&&(n=n.concat(LH)),e.foldKeymap!==!1&&(n=n.concat(HY)),e.completionKeymap!==!1&&(n=n.concat(t4)),e.lintKeymap!==!1&&(n=n.concat(aK));var r=[];return e.lineNumbers!==!1&&r.push(rY()),e.highlightActiveLineGutter!==!1&&r.push(aY()),e.highlightSpecialChars!==!1&&r.push(yU()),e.history!==!1&&r.push(CH()),e.foldGutter!==!1&&r.push(JY()),e.drawSelection!==!1&&r.push(cU()),e.dropCursor!==!1&&r.push(pU()),e.allowMultipleSelections!==!1&&r.push(et.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(IY()),e.syntaxHighlighting!==!1&&r.push(KB(nH,{fallback:!0})),e.bracketMatching!==!1&&r.push(hH()),e.closeBrackets!==!1&&r.push(IG()),e.autocompletion!==!1&&r.push(KG()),e.rectangularSelection!==!1&&r.push(LU()),i!==!1&&r.push($U()),e.highlightActiveLine!==!1&&r.push(kU()),e.highlightSelectionMatches!==!1&&r.push(QF()),e.tabSize&&typeof e.tabSize=="number"&&r.push(_h.of(" ".repeat(e.tabSize))),r.concat([Ql.of(n.flat())]).filter(Boolean)};const pK="#e5c07b",yM="#e06c75",mK="#56b6c2",gK="#ffffff",Hm="#abb2bf",Bb="#7d8799",OK="#61afef",vK="#98c379",bM="#d19a66",_K="#c678dd",yK="#21252b",SM="#2c313a",xM="#282c34",U_="#353a42",bK="#3E4451",wM="#528bff",SK=ve.theme({"&":{color:Hm,backgroundColor:xM},".cm-content":{caretColor:wM},".cm-cursor, .cm-dropCursor":{borderLeftColor:wM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:bK},".cm-panels":{backgroundColor:yK,color:Hm},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:xM,color:Bb,border:"none"},".cm-activeLineGutter":{backgroundColor:SM},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U_},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U_,borderBottomColor:U_},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:SM,color:Hm}}},{dark:!0}),xK=Od.define([{tag:V.keyword,color:_K},{tag:[V.name,V.deleted,V.character,V.propertyName,V.macroName],color:yM},{tag:[V.function(V.variableName),V.labelName],color:OK},{tag:[V.color,V.constant(V.name),V.standard(V.name)],color:bM},{tag:[V.definition(V.name),V.separator],color:Hm},{tag:[V.typeName,V.className,V.number,V.changed,V.annotation,V.modifier,V.self,V.namespace],color:pK},{tag:[V.operator,V.operatorKeyword,V.url,V.escape,V.regexp,V.link,V.special(V.string)],color:mK},{tag:[V.meta,V.comment],color:Bb},{tag:V.strong,fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.link,color:Bb,textDecoration:"underline"},{tag:V.heading,fontWeight:"bold",color:yM},{tag:[V.atom,V.bool,V.special(V.variableName)],color:bM},{tag:[V.processingInstruction,V.string,V.inserted],color:vK},{tag:V.invalid,color:gK}]),o4=[SK,KB(xK)];var wK=ve.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),CK=function(e){e===void 0&&(e={});var{indentWithTab:i=!0,editable:n=!0,readOnly:r=!1,theme:s="light",placeholder:o="",basicSetup:l=!0}=e,c=[];switch(i&&c.unshift(Ql.of([AF])),l&&(typeof l=="boolean"?c.unshift(_M()):c.unshift(_M(l))),o&&c.unshift(MU(o)),s){case"light":c.push(wK);break;case"dark":c.push(o4);break;case"none":break;default:c.push(s);break}return n===!1&&c.push(ve.editable.of(!1)),r&&c.push(et.readOnly.of(!0)),[...c]},kK=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class TK{constructor(e,i){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=i,this.timeoutMS=i,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(i=>{try{i()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class CM{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Y_=null,AK=()=>typeof window>"u"?new CM:(Y_||(Y_=new CM),Y_),kM=Rs.define(),EK=200,MK=[];function PK(t){var{value:e,selection:i,onChange:n,onStatistics:r,onCreateEditor:s,onUpdate:o,extensions:l=MK,autoFocus:c,theme:u="light",height:d=null,minHeight:p=null,maxHeight:g=null,width:O=null,minWidth:_=null,maxWidth:b=null,placeholder:x="",editable:w=!0,readOnly:k=!1,indentWithTab:T=!0,basicSetup:A=!0,root:L,initialState:E}=t,[N,z]=q.useState(),[Z,J]=q.useState(),[U,R]=q.useState(),B=q.useState(()=>({current:null}))[0],D=q.useState(()=>({current:null}))[0],j=ve.theme({"&":{height:d,minHeight:p,maxHeight:g,width:O,minWidth:_,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),$=ve.updateListener.of(F=>{if(F.docChanged&&typeof n=="function"&&!F.transactions.some(K=>K.annotation(kM))){B.current?B.current.reset():(B.current=new TK(()=>{if(D.current){var K=D.current;D.current=null,K()}B.current=null},EK),AK().add(B.current));var M=F.state.doc,I=M.toString();n(I,F)}r&&r(kK(F))}),X=CK({theme:u,editable:w,readOnly:k,placeholder:x,indentWithTab:T,basicSetup:A}),H=[$,j,...X];return o&&typeof o=="function"&&H.push(ve.updateListener.of(o)),H=H.concat(l),q.useLayoutEffect(()=>{if(N&&!U){var F={doc:e,selection:i,extensions:H},M=E?et.fromJSON(E.json,F,E.fields):et.create(F);if(R(M),!Z){var I=new ve({state:M,parent:N,root:L});J(I),s&&s(I,M)}}return()=>{Z&&(R(void 0),J(void 0))}},[N,U]),q.useEffect(()=>{t.container&&z(t.container)},[t.container]),q.useEffect(()=>()=>{Z&&(Z.destroy(),J(void 0)),B.current&&(B.current.cancel(),B.current=null)},[Z]),q.useEffect(()=>{c&&Z&&Z.focus()},[c,Z]),q.useEffect(()=>{Z&&Z.dispatch({effects:ze.reconfigure.of(H)})},[u,l,d,p,g,O,_,b,x,w,k,T,A,n,o]),q.useEffect(()=>{if(e!==void 0){var F=Z?Z.state.doc.toString():"";if(Z&&e!==F){var M=B.current&&!B.current.isDone,I=()=>{Z&&e!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:e||""},annotations:[kM.of(!0)]})};M?D.current=I:I()}}},[e,Z]),{state:U,setState:R,view:Z,setView:J,container:N,setContainer:z}}var RK=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],a4=q.forwardRef((t,e)=>{var{className:i,value:n="",selection:r,extensions:s=[],onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:p="light",height:g,minHeight:O,maxHeight:_,width:b,minWidth:x,maxWidth:w,basicSetup:k,placeholder:T,indentWithTab:A,editable:L,readOnly:E,root:N,initialState:z}=t,Z=HZ(t,RK),J=q.useRef(null),{state:U,view:R,container:B,setContainer:D}=PK({root:N,value:n,autoFocus:d,theme:p,height:g,minHeight:O,maxHeight:_,width:b,minWidth:x,maxWidth:w,basicSetup:k,placeholder:T,indentWithTab:A,editable:L,readOnly:E,selection:r,onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:s,initialState:z});q.useImperativeHandle(e,()=>({editor:J.current,state:U,view:R}),[J,B,U,R]);var j=q.useCallback(X=>{J.current=X,D(X)},[D]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var $=typeof p=="string"?"cm-theme-"+p:"cm-theme";return S.jsx("div",X1({ref:j,className:""+$+(i?" "+i:"")},Z))});a4.displayName="CodeMirror";class Zg{static create(e,i,n,r,s){let o=r+(r<<8)+e+(i<<4)|0;return new Zg(e,i,n,o,s,[],[])}constructor(e,i,n,r,s,o,l){this.type=e,this.value=i,this.from=n,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[Ne.contextHash,r]]}addChild(e,i){e.prop(Ne.contextHash)!=this.hash&&(e=new ct(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(i)}toTree(e,i=this.end){let n=this.children.length-1;return n>=0&&(i=Math.max(i,this.positions[n]+this.children[n].length+this.from)),new ct(e.types[this.type],this.children,this.positions,i-this.from).balance({makeTree:(r,s,o)=>new ct(_i.none,r,s,o,this.hashProp)})}}var pe;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(pe||(pe={}));class QK{constructor(e,i){this.start=e,this.content=i,this.marks=[],this.parsers=[]}}class LK{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return vf(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,i=0,n=0){for(let r=i;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let i=0;for(let n=0;i<this.text.length&&n<e;i++)n+=this.text.charCodeAt(i)==9?4-n%4:1;return i}scrub(){if(!this.baseIndent)return this.text;let e="";for(let i=0;i<this.basePos;i++)e+=" ";return e+this.text.slice(this.basePos)}}function TM(t,e,i){if(i.pos==i.text.length||t!=e.block&&i.indent>=e.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;let n=(t.type==pe.OrderedList?yw:_w)(i,e,!1);return n>0&&(t.type!=pe.BulletList||vw(i,e,!1)<0)&&i.text.charCodeAt(i.pos+n-1)==t.value}const l4={[pe.Blockquote](t,e,i){return i.next!=62?!1:(i.markers.push(it(pe.QuoteMark,e.lineStart+i.pos,e.lineStart+i.pos+1)),i.moveBase(i.pos+(Dr(i.text.charCodeAt(i.pos+1))?2:1)),t.end=e.lineStart+i.text.length,!0)},[pe.ListItem](t,e,i){return i.indent<i.baseIndent+t.value&&i.next>-1?!1:(i.moveBaseColumn(i.baseIndent+t.value),!0)},[pe.OrderedList]:TM,[pe.BulletList]:TM,[pe.Document](){return!0}};function Dr(t){return t==32||t==9||t==10||t==13}function vf(t,e=0){for(;e<t.length&&Dr(t.charCodeAt(e));)e++;return e}function AM(t,e,i){for(;e>i&&Dr(t.charCodeAt(e-1));)e--;return e}function c4(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let i=e;i<t.text.length;i++)if(t.text.charCodeAt(i)==96)return-1}return e}function h4(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function vw(t,e,i){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let r=t.pos+1;r<t.text.length;r++){let s=t.text.charCodeAt(r);if(s==t.next)n++;else if(!Dr(s))return-1}return i&&t.next==45&&d4(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(O4.SetextHeading)>-1||n<3?-1:1}function u4(t,e){for(let i=t.stack.length-1;i>=0;i--)if(t.stack[i].type==e)return!0;return!1}function _w(t,e,i){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||Dr(t.text.charCodeAt(t.pos+1)))&&(!i||u4(e,pe.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function yw(t,e,i){let n=t.pos,r=t.next;for(;r>=48&&r<=57;){n++;if(n==t.text.length)return-1;r=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||r!=46&&r!=41||n<t.text.length-1&&!Dr(t.text.charCodeAt(n+1))||i&&!u4(e,pe.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function f4(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let i=e-t.pos;return i>6?-1:i}function d4(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let i=e;for(;e<t.text.length&&Dr(t.text.charCodeAt(e));)e++;return e==t.text.length?i:-1}const $b=/^[ \t]*$/,p4=/-->/,m4=/\?>/,zb=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,p4],[/^\s*<\?/,m4],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,$b],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,$b]];function g4(t,e,i){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let r=0,s=zb.length-(i?1:0);r<s;r++)if(zb[r][0].test(n))return r;return-1}function EM(t,e){let i=t.countIndent(e,t.pos,t.indent),n=t.countIndent(t.skipSpace(e),e,i);return n>=i+5?i+1:n}function ta(t,e,i){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==pe.CodeText?t[n].to=i:t.push(it(pe.CodeText,e,i))}const _m={LinkReference:void 0,IndentedCode(t,e){let i=e.baseIndent+4;if(e.indent<i)return!1;let n=e.findColumn(i),r=t.lineStart+n,s=t.lineStart+e.text.length,o=[],l=[];for(ta(o,r,s);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){ta(l,t.lineStart-1,t.lineStart);for(let c of e.markers)l.push(c)}else{if(e.indent<i)break;{if(l.length){for(let u of l)u.type==pe.CodeText?ta(o,u.from,u.to):o.push(u);l=[]}ta(o,t.lineStart-1,t.lineStart);for(let u of e.markers)o.push(u);s=t.lineStart+e.text.length;let c=t.lineStart+e.findColumn(e.baseIndent+4);c<s&&ta(o,c,s)}}return l.length&&(l=l.filter(c=>c.type!=pe.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-r).finish(pe.CodeBlock,s-r),r),!0},FencedCode(t,e){let i=c4(e);if(i<0)return!1;let n=t.lineStart+e.pos,r=e.next,s=i-e.pos,o=e.skipSpace(i),l=AM(e.text,e.text.length,o),c=[it(pe.CodeMark,n,n+s)];o<l&&c.push(it(pe.CodeInfo,t.lineStart+o,t.lineStart+l));for(let u=!0,d=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;u=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==r;)g++;if(g-e.pos>=s&&e.skipSpace(g)==e.text.length){for(let O of e.markers)c.push(O);d&&p&&ta(c,t.lineStart-1,t.lineStart),c.push(it(pe.CodeMark,t.lineStart+e.pos,t.lineStart+g)),t.nextLine();break}else{p=!0,u||(ta(c,t.lineStart-1,t.lineStart),d=!1);for(let b of e.markers)c.push(b);let O=t.lineStart+e.basePos,_=t.lineStart+e.text.length;O<_&&(ta(c,O,_),d=!1)}}return t.addNode(t.buffer.writeElements(c,-n).finish(pe.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let i=h4(e);return i<0?!1:(t.startContext(pe.Blockquote,e.pos),t.addNode(pe.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+i),null)},HorizontalRule(t,e){if(vw(e,t,!1)<0)return!1;let i=t.lineStart+e.pos;return t.nextLine(),t.addNode(pe.HorizontalRule,i),!0},BulletList(t,e){let i=_w(e,t,!1);if(i<0)return!1;t.block.type!=pe.BulletList&&t.startContext(pe.BulletList,e.basePos,e.next);let n=EM(e,e.pos+1);return t.startContext(pe.ListItem,e.basePos,n-e.baseIndent),t.addNode(pe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(n),null},OrderedList(t,e){let i=yw(e,t,!1);if(i<0)return!1;t.block.type!=pe.OrderedList&&t.startContext(pe.OrderedList,e.basePos,e.text.charCodeAt(e.pos+i-1));let n=EM(e,e.pos+i);return t.startContext(pe.ListItem,e.basePos,n-e.baseIndent),t.addNode(pe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(n),null},ATXHeading(t,e){let i=f4(e);if(i<0)return!1;let n=e.pos,r=t.lineStart+n,s=AM(e.text,e.text.length,n),o=s;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==n||!Dr(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=t.buffer.write(pe.HeaderMark,0,i).writeElements(t.parser.parseInline(e.text.slice(n+i+1,o),r+i+1),-r);o<e.text.length&&l.write(pe.HeaderMark,o-n,s-n);let c=l.finish(pe.ATXHeading1-1+i,e.text.length-n);return t.nextLine(),t.addNode(c,r),!0},HTMLBlock(t,e){let i=g4(e,t,!1);if(i<0)return!1;let n=t.lineStart+e.pos,r=zb[i][1],s=[],o=r!=$b;for(;!r.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let u of e.markers)s.push(u)}o&&t.nextLine();let l=r==p4?pe.CommentBlock:r==m4?pe.ProcessingInstructionBlock:pe.HTMLBlock,c=t.prevLineEnd();return t.addNode(t.buffer.writeElements(s,-n).finish(l,c-n),n),!0},SetextHeading:void 0};class DK{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,i,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
70
|
+
`+i.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,n,s):!1}finish(e,i){return(this.stage==2||this.stage==3)&&vf(i.content,this.pos)==i.content.length?this.complete(e,i,i.content.length):!1}complete(e,i,n){return e.addLeafElement(i,it(pe.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(k4(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(it(pe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(w4(e,vf(e,this.pos),this.start)))return-1}else if(this.stage==2){let i=vf(e,this.pos),n=0;if(i>this.pos){let r=C4(e,i,this.start);if(r){let s=H_(e,r.to-this.start);s>0&&(this.nextStage(r),n=s)}}return n||(n=H_(e,this.pos)),n>0&&n<e.length?n:-1}else return H_(e,this.pos)}}}function H_(t,e){for(;e<t.length;e++){let i=t.charCodeAt(e);if(i==10)break;if(!Dr(i))return-1}return e}class BK{nextLine(e,i,n){let r=i.depth<e.stack.length?-1:d4(i),s=i.next;if(r<0)return!1;let o=it(pe.HeaderMark,e.lineStart+i.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,it(s==61?pe.SetextHeading1:pe.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const O4={LinkReference(t,e){return e.content.charCodeAt(0)==91?new DK(e):null},SetextHeading(){return new BK}},$K=[(t,e)=>f4(e)>=0,(t,e)=>c4(e)>=0,(t,e)=>h4(e)>=0,(t,e)=>_w(e,t,!0)>=0,(t,e)=>yw(e,t,!0)>=0,(t,e)=>vw(e,t,!0)>=0,(t,e)=>g4(e,t,!0)>=0],zK={text:"",end:0};class NK{constructor(e,i,n,r){this.parser=e,this.input=i,this.ranges=r,this.line=new LK,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=Zg.create(pe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new VK(n,i):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!r||e.markers[n].from<r.end);){let s=e.markers[n++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let r=n(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let i=new QK(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let r=n(this,i);r&&i.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,i))break e}for(let n of i.parsers)if(n.nextLine(this,e,i))return null;i.content+=`
|
|
71
|
+
`+e.scrub();for(let n of e.markers)i.marks.push(n)}return this.finishLeaf(i),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let i=this.fragments.takeNodes(this);return i?(this.absoluteLineStart+=i,this.lineStart=T4(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let i=zK;if(i.end=e,e>=this.to)i.text="";else if(i.text=this.lineChunkAt(e),i.end+=i.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<i.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);i.end=s+o.length,i.text=i.text.slice(0,this.ranges[r-1].to-n)+o,n=i.end-i.text.length}}return i}readLine(){let{line:e}=this,{text:i,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(i);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+pe[r.type]);let o=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>o&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let i=this.input.chunk(e),n;if(this.input.lineChunks)n=i==`
|
|
72
|
+
`?"":i;else{let r=i.indexOf(`
|
|
73
|
+
`);n=r<0?i:i.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,i,n=0){this.block=Zg.create(e,n,this.lineStart+i,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,i,n=0){this.startContext(this.parser.getNodeType(e),i,n)}addNode(e,i,n){typeof e=="number"&&(e=new ct(this.parser.nodeSet.types[e],hh,hh,(n??this.prevLineEnd())-i)),this.block.addChild(e,i-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,i){this.addNode(this.buffer.writeElements(jb(i.children,e.marks),-i.from).finish(i.type,i.to-i.from),i.from)}finishContext(){let e=this.stack.pop(),i=this.stack[this.stack.length-1];i.addChild(e.toTree(this.parser.nodeSet),e.from-i.from),this.block=i}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?v4(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let i=jb(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(i,-e.start).finish(pe.Paragraph,e.content.length),e.start)}elt(e,i,n,r){return typeof e=="string"?it(this.parser.getNodeType(e),i,n,r):new b4(e,i)}get buffer(){return new y4(this.parser.nodeSet)}}function v4(t,e,i,n,r){let s=t[e].to,o=[],l=[],c=i.from+n;function u(d,p){for(;p?d>=s:d>s;){let g=t[e+1].from-s;n+=g,d+=g,e++,s=t[e].to}}for(let d=i.firstChild;d;d=d.nextSibling){u(d.from+n,!0);let p=d.from+n,g,O=r.get(d.tree);O?g=O:d.to+n>s?(g=v4(t,e,d,n,r),u(d.to+n,!1)):g=d.toTree(),o.push(g),l.push(p-c)}return u(i.to+n,!1),new ct(i.type,o,l,i.to+n-c,i.tree?i.tree.propValues:void 0)}class CO extends Gx{constructor(e,i,n,r,s,o,l,c,u){super(),this.nodeSet=e,this.blockParsers=i,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,i,n){let r=new NK(this,e,i,n);for(let s of this.wrappers)r=s(r,e,i,n);return r}configure(e){let i=Nb(e);if(!i)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),p=this.wrappers;if(Mu(i.defineNodes)){r=Object.assign({},r);let g=n.types.slice(),O;for(let _ of i.defineNodes){let{name:b,block:x,composite:w,style:k}=typeof _=="string"?{name:_}:_;if(g.some(L=>L.name==b))continue;w&&(r[g.length]=(L,E,N)=>w(E,N,L.value));let T=g.length,A=w?["Block","BlockContext"]:x?T>=pe.ATXHeading1&&T<=pe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(_i.define({id:T,name:b,props:A&&[[Ne.group,A]]})),k&&(O||(O={}),Array.isArray(k)||k instanceof nr?O[b]=k:Object.assign(O,k))}n=new pd(g),O&&(n=n.extend(vh(O)))}if(Mu(i.props)&&(n=n.extend(...i.props)),Mu(i.remove))for(let g of i.remove){let O=this.blockNames.indexOf(g),_=this.inlineNames.indexOf(g);O>-1&&(s[O]=o[O]=void 0),_>-1&&(c[_]=void 0)}if(Mu(i.parseBlock))for(let g of i.parseBlock){let O=l.indexOf(g.name);if(O>-1)s[O]=g.parse,o[O]=g.leaf;else{let _=g.before?ym(l,g.before):g.after?ym(l,g.after)+1:l.length-1;s.splice(_,0,g.parse),o.splice(_,0,g.leaf),l.splice(_,0,g.name)}g.endLeaf&&d.push(g.endLeaf)}if(Mu(i.parseInline))for(let g of i.parseInline){let O=u.indexOf(g.name);if(O>-1)c[O]=g.parse;else{let _=g.before?ym(u,g.before):g.after?ym(u,g.after)+1:u.length-1;c.splice(_,0,g.parse),u.splice(_,0,g.name)}}return i.wrap&&(p=p.concat(i.wrap)),new CO(n,s,o,l,d,r,c,u,p)}getNodeType(e){let i=this.nodeTypes[e];if(i==null)throw new RangeError(`Unknown node type '${e}'`);return i}parseInline(e,i){let n=new bw(this,e,i);e:for(let r=i;r<n.end;){let s=n.char(r);for(let o of this.inlineParsers)if(o){let l=o(n,s,r);if(l>=0){r=l;continue e}}r++}return n.resolveMarkers(0)}}function Mu(t){return t!=null&&t.length>0}function Nb(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Nb(t[0]);if(t.length==1)return e;let i=Nb(t.slice(1));if(!i||!e)return e||i;let n=(o,l)=>(o||hh).concat(l||hh),r=e.wrap,s=i.wrap;return{props:n(e.props,i.props),defineNodes:n(e.defineNodes,i.defineNodes),parseBlock:n(e.parseBlock,i.parseBlock),parseInline:n(e.parseInline,i.parseInline),remove:n(e.remove,i.remove),wrap:r?s?(o,l,c,u)=>r(s(o,l,c,u),l,c,u):r:s}}function ym(t,e){let i=t.indexOf(e);if(i<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return i}let _4=[_i.none];for(let t=1,e;e=pe[t];t++)_4[t]=_i.define({id:t,name:e,props:t>=pe.Escape?[]:[[Ne.group,t in l4?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const hh=[];class y4{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,i,n,r=0){return this.content.push(e,i,n,4+r*4),this}writeElements(e,i=0){for(let n of e)n.writeTo(this,i);return this}finish(e,i){return ct.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:i})}}let Hf=class{constructor(e,i,n,r=hh){this.type=e,this.from=i,this.to=n,this.children=r}writeTo(e,i){let n=e.content.length;e.writeElements(this.children,i),e.content.push(this.type,this.from+i,this.to+i,e.content.length+4-n)}toTree(e){return new y4(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class b4{constructor(e,i){this.tree=e,this.from=i}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return hh}writeTo(e,i){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+i,this.to+i,-1)}toTree(){return this.tree}}function it(t,e,i,n){return new Hf(t,e,i,n)}const S4={resolve:"Emphasis",mark:"EmphasisMark"},x4={resolve:"Emphasis",mark:"EmphasisMark"},ul={},qg={};class ir{constructor(e,i,n,r){this.type=e,this.from=i,this.to=n,this.side=r}}const MM="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Ff=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Ff=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const F_={Escape(t,e,i){if(e!=92||i==t.end-1)return-1;let n=t.char(i+1);for(let r=0;r<MM.length;r++)if(MM.charCodeAt(r)==n)return t.append(it(pe.Escape,i,i+2));return-1},Entity(t,e,i){if(e!=38)return-1;let n=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(i+1,i+31));return n?t.append(it(pe.Entity,i,i+1+n[0].length)):-1},InlineCode(t,e,i){if(e!=96||i&&t.char(i-1)==96)return-1;let n=i+1;for(;n<t.end&&t.char(n)==96;)n++;let r=n-i,s=0;for(;n<t.end;n++)if(t.char(n)==96){if(s++,s==r&&t.char(n+1)!=96)return t.append(it(pe.InlineCode,i,n+1,[it(pe.CodeMark,i,i+r),it(pe.CodeMark,n+1-r,n+1)]))}else s=0;return-1},HTMLTag(t,e,i){if(e!=60||i==t.end-1)return-1;let n=t.slice(i+1,t.end),r=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(r)return t.append(it(pe.Autolink,i,i+1+r[0].length,[it(pe.LinkMark,i,i+1),it(pe.URL,i+1,i+r[0].length),it(pe.LinkMark,i+r[0].length,i+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(s)return t.append(it(pe.Comment,i,i+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(it(pe.ProcessingInstruction,i,i+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return l?t.append(it(pe.HTMLTag,i,i+1+l[0].length)):-1},Emphasis(t,e,i){if(e!=95&&e!=42)return-1;let n=i+1;for(;t.char(n)==e;)n++;let r=t.slice(i-1,i),s=t.slice(n,n+1),o=Ff.test(r),l=Ff.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),p=!c&&(!o||u||l),g=d&&(e==42||!p||o),O=p&&(e==42||!d||l);return t.append(new ir(e==95?S4:x4,i,n,(g?1:0)|(O?2:0)))},HardBreak(t,e,i){if(e==92&&t.char(i+1)==10)return t.append(it(pe.HardBreak,i,i+2));if(e==32){let n=i+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=i+2)return t.append(it(pe.HardBreak,i,n+1))}return-1},Link(t,e,i){return e==91?t.append(new ir(ul,i,i+1,1)):-1},Image(t,e,i){return e==33&&t.char(i+1)==91?t.append(new ir(qg,i,i+2,1)):-1},LinkEnd(t,e,i){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let r=t.parts[n];if(r instanceof ir&&(r.type==ul||r.type==qg)){if(!r.side||t.skipSpace(r.to)==i&&!/[(\[]/.test(t.slice(i+1,i+2)))return t.parts[n]=null,-1;let s=t.takeContent(n),o=t.parts[n]=jK(t,s,r.type==ul?pe.Link:pe.Image,r.from,i+1);if(r.type==ul)for(let l=0;l<n;l++){let c=t.parts[l];c instanceof ir&&c.type==ul&&(c.side=0)}return o.to}}return-1}};function jK(t,e,i,n,r){let{text:s}=t,o=t.char(r),l=r;if(e.unshift(it(pe.LinkMark,n,n+(i==pe.Image?2:1))),e.push(it(pe.LinkMark,r-1,r)),o==40){let c=t.skipSpace(r+1),u=w4(s,c-t.offset,t.offset),d;u&&(c=t.skipSpace(u.to),c!=u.to&&(d=C4(s,c-t.offset,t.offset),d&&(c=t.skipSpace(d.to)))),t.char(c)==41&&(e.push(it(pe.LinkMark,r,r+1)),l=c+1,u&&e.push(u),d&&e.push(d),e.push(it(pe.LinkMark,c,l)))}else if(o==91){let c=k4(s,r-t.offset,t.offset,!1);c&&(e.push(c),l=c.to)}return it(i,n,l,e)}function w4(t,e,i){if(t.charCodeAt(e)==60){for(let r=e+1;r<t.length;r++){let s=t.charCodeAt(r);if(s==62)return it(pe.URL,e+i,r+1+i);if(s==60||s==10)return!1}return null}else{let r=0,s=e;for(let o=!1;s<t.length;s++){let l=t.charCodeAt(s);if(Dr(l))break;if(o)o=!1;else if(l==40)r++;else if(l==41){if(!r)break;r--}else l==92&&(o=!0)}return s>e?it(pe.URL,e+i,s+i):s==t.length?null:!1}}function C4(t,e,i){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let r=n==40?41:n;for(let s=e+1,o=!1;s<t.length;s++){let l=t.charCodeAt(s);if(o)o=!1;else{if(l==r)return it(pe.LinkTitle,e+i,s+1+i);l==92&&(o=!0)}}return null}function k4(t,e,i,n){for(let r=!1,s=e+1,o=Math.min(t.length,s+999);s<o;s++){let l=t.charCodeAt(s);if(r)r=!1;else{if(l==93)return n?!1:it(pe.LinkLabel,e+i,s+1+i);if(n&&!Dr(l)&&(n=!1),l==91)return!1;l==92&&(r=!0)}}return null}class bw{constructor(e,i,n){this.parser=e,this.text=i,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,i){return this.text.slice(e-this.offset,i-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,i,n,r,s){return this.append(new ir(e,i,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let i=this.parts[e];if(i instanceof ir&&(i.type==ul||i.type==qg))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n<this.parts.length;n++){let r=this.parts[n];if(!(r instanceof ir&&r.type.resolve&&r.side&2))continue;let s=r.type==S4||r.type==x4,o=r.to-r.from,l,c=n-1;for(;c>=e;c--){let b=this.parts[c];if(b instanceof ir&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],p=l.from,g=r.to;if(s){let b=Math.min(2,l.to-l.from,o);p=l.to-b,g=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,p,l.to));for(let b=c+1;b<n;b++)this.parts[b]instanceof Hf&&d.push(this.parts[b]),this.parts[b]=null;r.type.mark&&d.push(this.elt(r.type.mark,r.from,g));let O=this.elt(u,p,g,d);this.parts[c]=s&&l.from!=p?new ir(l.type,l.from,p,l.side):null,(this.parts[n]=s&&r.to!=g?new ir(r.type,g,r.to,r.side):null)?this.parts.splice(n,0,O):this.parts[n]=O}let i=[];for(let n=e;n<this.parts.length;n++){let r=this.parts[n];r instanceof Hf&&i.push(r)}return i}findOpeningDelimiter(e){for(let i=this.parts.length-1;i>=0;i--){let n=this.parts[i];if(n instanceof ir&&n.type==e&&n.side&1)return i}return null}takeContent(e){let i=this.resolveMarkers(e);return this.parts.length=e,i}getDelimiterAt(e){let i=this.parts[e];return i instanceof ir?i:null}skipSpace(e){return vf(this.text,e-this.offset)+this.offset}elt(e,i,n,r){return typeof e=="string"?it(this.parser.getNodeType(e),i,n,r):new b4(e,i)}}bw.linkStart=ul;bw.imageStart=qg;function jb(t,e){if(!e.length)return t;if(!t.length)return e;let i=t.slice(),n=0;for(let r of e){for(;n<i.length&&i[n].to<r.to;)n++;if(n<i.length&&i[n].from<r.from){let s=i[n];s instanceof Hf&&(i[n]=new Hf(s.type,s.from,s.to,jb(s.children,[r])))}else i.splice(n++,0,r)}return i}const IK=[pe.CodeBlock,pe.ListItem,pe.OrderedList,pe.BulletList];let VK=class{constructor(e,i){this.fragments=e,this.input=i,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,i){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
|
|
74
|
+
`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=i;if(!n.childAfter(r))return!1}}matches(e){let i=this.cursor.tree;return i&&i.prop(Ne.contextHash)==e}takeNodes(e){let i=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,c=o,u=l;for(;;){if(i.to-n>r){if(i.type.isAnonymous&&i.firstChild())continue;break}let d=T4(i.from-n,e.ranges);if(i.to-n<=e.ranges[e.rangeI].to)e.addNode(i.tree,d);else{let p=new ct(e.parser.nodeSet.types[pe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(p,i.tree),e.addNode(p,d)}if(i.type.is("Block")&&(IK.indexOf(i.type.id)<0?(o=i.to-n,l=e.block.children.length):(o=c,l=u),c=i.to-n,u=e.block.children.length),!i.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function T4(t,e){let i=t;for(let n=1;n<e.length;n++){let r=e[n-1].to,s=e[n].from;r<t&&(i-=s-r)}return i}const XK=vh({"Blockquote/...":V.quote,HorizontalRule:V.contentSeparator,"ATXHeading1/... SetextHeading1/...":V.heading1,"ATXHeading2/... SetextHeading2/...":V.heading2,"ATXHeading3/...":V.heading3,"ATXHeading4/...":V.heading4,"ATXHeading5/...":V.heading5,"ATXHeading6/...":V.heading6,"Comment CommentBlock":V.comment,Escape:V.escape,Entity:V.character,"Emphasis/...":V.emphasis,"StrongEmphasis/...":V.strong,"Link/... Image/...":V.link,"OrderedList/... BulletList/...":V.list,"BlockQuote/...":V.quote,"InlineCode CodeText":V.monospace,"URL Autolink":V.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":V.processingInstruction,"CodeInfo LinkLabel":V.labelName,LinkTitle:V.string,Paragraph:V.content}),ZK=new CO(new pd(_4).extend(XK),Object.keys(_m).map(t=>_m[t]),Object.keys(_m).map(t=>O4[t]),Object.keys(_m),$K,l4,Object.keys(F_).map(t=>F_[t]),Object.keys(F_),[]);function qK(t,e,i){let n=[];for(let r=t.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:i;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function WK(t){let{codeParser:e,htmlParser:i}=t;return{wrap:BB((r,s)=>{let o=r.type.id;if(e&&(o==pe.CodeBlock||o==pe.FencedCode)){let l="";if(o==pe.FencedCode){let u=r.node.getChild(pe.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=e(l);if(c)return{parser:c,overlay:u=>u.type.id==pe.CodeText,bracketed:o==pe.FencedCode}}else if(i&&(o==pe.HTMLBlock||o==pe.HTMLTag||o==pe.CommentBlock))return{parser:i,overlay:qK(r.node,r.from,r.to)};return null})}}const UK={resolve:"Strikethrough",mark:"StrikethroughMark"},YK={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":V.strikethrough}},{name:"StrikethroughMark",style:V.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,i){if(e!=126||t.char(i+1)!=126||t.char(i+2)==126)return-1;let n=t.slice(i-1,i),r=t.slice(i+2,i+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=Ff.test(n),c=Ff.test(r);return t.addDelimiter(UK,i,i+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function _f(t,e,i=0,n,r=0){let s=0,o=!0,l=-1,c=-1,u=!1,d=()=>{n.push(t.elt("TableCell",r+l,r+c,t.parser.parseInline(e.slice(l,c),r+l)))};for(let p=i;p<e.length;p++){let g=e.charCodeAt(p);g==124&&!u?((!o||l>-1)&&s++,o=!1,n&&(l>-1&&d(),n.push(t.elt("TableDelimiter",p+r,p+r+1))),l=c=-1):(u||g!=32&&g!=9)&&(l<0&&(l=p),c=p+1),u=!u&&g==92}return l>-1&&(s++,n&&d()),s}function PM(t,e){for(let i=e;i<t.length;i++){let n=t.charCodeAt(i);if(n==124)return!0;n==92&&i++}return!1}const A4=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class RM{constructor(){this.rows=null}nextLine(e,i,n){if(this.rows==null){this.rows=!1;let r;if((i.next==45||i.next==58||i.next==124)&&A4.test(r=i.text.slice(i.pos))){let s=[];_f(e,n.content,0,s,n.start)==_f(e,r,i.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+i.pos,e.lineStart+i.text.length)])}}else if(this.rows){let r=[];_f(e,i.text,i.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+i.pos,e.lineStart+i.text.length,r))}return!1}finish(e,i){return this.rows?(e.addLeafElement(i,e.elt("Table",i.start,i.start+i.content.length,this.rows)),!0):!1}}const HK={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":V.heading}},"TableRow",{name:"TableCell",style:V.content},{name:"TableDelimiter",style:V.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return PM(e.content,0)?new RM:null},endLeaf(t,e,i){if(i.parsers.some(r=>r instanceof RM)||!PM(e.text,e.basePos))return!1;let n=t.peekLine();return A4.test(n)&&_f(t,e.text,e.basePos)==_f(t,n,e.basePos)},before:"SetextHeading"}]};class FK{nextLine(){return!1}finish(e,i){return e.addLeafElement(i,e.elt("Task",i.start,i.start+i.content.length,[e.elt("TaskMarker",i.start,i.start+3),...e.parser.parseInline(i.content.slice(3),i.start+3)])),!0}}const GK={defineNodes:[{name:"Task",block:!0,style:V.list},{name:"TaskMarker",style:V.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new FK:null},after:"SetextHeading"}]},QM=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,LM=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,KK=/[\w-]+\.[\w-]+($|\/)/,DM=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,BM=/\/[a-zA-Z\d@.]+/gy;function $M(t,e,i,n){let r=0;for(let s=e;s<i;s++)t[s]==n&&r++;return r}function JK(t,e){LM.lastIndex=e;let i=LM.exec(t);if(!i||KK.exec(i[0])[0].indexOf("_")>-1)return-1;let n=e+i[0].length;for(;;){let r=t[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&$M(t,e,n,")")>$M(t,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+s.index;else break}return n}function zM(t,e){DM.lastIndex=e;let i=DM.exec(t);if(!i)return-1;let n=i[0][i[0].length-1];return n=="_"||n=="-"?-1:e+i[0].length-(n=="."?1:0)}const eJ={parseInline:[{name:"Autolink",parse(t,e,i){let n=i-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;QM.lastIndex=n;let r=QM.exec(t.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=JK(t.text,n+r[0].length),s>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,s));s=n+o[0].length}}else r[3]?s=zM(t.text,n):(s=zM(t.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&(BM.lastIndex=s,r=BM.exec(t.text),r&&(s=r.index+r[0].length)));return s<0?-1:(t.addElement(t.elt("URL",i,s+t.offset)),s+t.offset)}}]},tJ=[HK,GK,YK,eJ];function E4(t,e,i){return(n,r,s)=>{if(r!=t||n.char(s+1)==t)return-1;let o=[n.elt(i,s,s+1)];for(let l=s+1;l<n.end;l++){let c=n.char(l);if(c==t)return n.addElement(n.elt(e,s,l+1,o.concat(n.elt(i,l,l+1))));if(c==92&&o.push(n.elt("Escape",l,l+++2)),Dr(c))break}return-1}}const iJ={defineNodes:[{name:"Superscript",style:V.special(V.content)},{name:"SuperscriptMark",style:V.processingInstruction}],parseInline:[{name:"Superscript",parse:E4(94,"Superscript","SuperscriptMark")}]},nJ={defineNodes:[{name:"Subscript",style:V.special(V.content)},{name:"SubscriptMark",style:V.processingInstruction}],parseInline:[{name:"Subscript",parse:E4(126,"Subscript","SubscriptMark")}]},rJ={defineNodes:[{name:"Emoji",style:V.character}],parseInline:[{name:"Emoji",parse(t,e,i){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(i+1,t.end)))?-1:t.addElement(t.elt("Emoji",i,i+1+n[0].length))}}]};var NM={};class Wg{constructor(e,i,n,r,s,o,l,c,u,d=0,p){this.p=e,this.stack=i,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=p}toString(){return`[${this.stack.filter((e,i)=>i%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,i,n=0){let r=e.parser.context;return new Wg(e,[],i,n,n,0,[],0,r?new jM(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,i){this.stack.push(this.state,i,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var i;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),n==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let c=this.stack.length-(n-1)*3-(e&262144?6:0),u=c?this.stack[c-2]:this.p.ranges[0].from,d=this.reducePos-u;d>=2e3&&!(!((i=this.p.parser.nodeSet.types[r])===null||i===void 0)&&i.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=u,this.p.lastBigReductionSize=d));let p=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-p;if(r<s.minRepeatTerm||e&131072){let O=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,u,O,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let O=this.stack[c-3];this.state=s.getGoto(O,r,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(r,u)}storeNode(e,i,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(i==n)return;if(o.buffer[l-2]>=i){o.buffer[l-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,i,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>n;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=i,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,i,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||i<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(i,n),i<=o.maxNode&&this.buffer.push(i,n,r,4)}else this.pos=r,this.shiftContext(i,n),i<=this.p.parser.maxNode&&this.buffer.push(i,n,r,4)}apply(e,i,n,r){e&65536?this.reduce(e):this.shift(e,i,n,r)}useNode(e,i){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(i,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,i=e.buffer.length;for(;i>0&&e.buffer[i-2]>e.reducePos;)i-=4;let n=e.buffer.slice(i),r=e.bufferBase+i;for(;e&&r==e.bufferBase;)e=e.parent;return new Wg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,i){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,i,4),this.storeNode(0,this.pos,i,n?8:4),this.pos=this.reducePos=i,this.score-=190}canShift(e){for(let i=new sJ(this);;){let n=this.p.parser.stateSlot(i.state,4)||this.p.parser.hasAction(i.state,e);if(n==0)return!1;if((n&65536)==0)return!0;i.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let i=this.p.parser.nextStates(this.state);if(i.length>8||this.stack.length>=120){let r=[];for(let s=0,o;s<i.length;s+=2)(o=i[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(i[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<i.length;s+=2){let o=i[s+1];r.some((l,c)=>c&1&&l==o)||r.push(i[s],o)}i=r}let n=[];for(let r=0;r<i.length&&n.length<4;r+=2){let s=i[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(i[r],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,i=e.stateSlot(this.state,5);if((i&65536)==0)return!1;if(!e.validAction(this.state,i)){let n=i>>19,r=i&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;i=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(i),!0}findForcedReduction(){let{parser:e}=this.p,i=[],n=(r,s)=>{if(!i.includes(r))return i.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&e.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let i=0;i<this.stack.length;i+=3)if(this.stack[i]!=e.stack[i])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(i)))}reduceContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(i)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let i=new jM(this.curContext.tracker,e);i.hash!=this.curContext.hash&&this.emitContext(),this.curContext=i}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class jM{constructor(e,i){this.tracker=e,this.context=i,this.hash=e.strict?e.hash(i):0}}class sJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let i=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],i,!0);this.state=r}}class Ug{constructor(e,i,n){this.stack=e,this.pos=i,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,i=e.bufferBase+e.buffer.length){return new Ug(e,i,i-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ug(this.stack,this.pos,this.index)}}function Ju(t,e=Uint16Array){if(typeof t!="string")return t;let i=null;for(let n=0,r=0;n<t.length;){let s=0;for(;;){let o=t.charCodeAt(n++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}i?i[r++]=s:i=new e(s)}return i}class Fm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const IM=new Fm;class oJ{constructor(e,i){this.input=e,this.ranges=i,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=IM,this.rangeIndex=0,this.pos=this.chunkPos=i[0].from,this.range=i[0],this.end=i[i.length-1].to,this.readNext()}resolveOffset(e,i){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<n.from;){if(!r)return null;let o=this.ranges[--r];s-=n.from-o.to,n=o}for(;i<0?s>n.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let i of this.ranges)if(i.to>e)return Math.max(e,i.from);return this.end}peek(e){let i=this.chunkOff+e,n,r;if(i>=0&&i<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(i);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=n;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,i=0){let n=i?this.resolveOffset(i,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,i){this.token.value=e,this.token.end=i}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:i}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=i,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),i=this.pos+e.length;this.chunk=i>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,i){if(i?(this.token=i,i.start=e,i.lookAhead=e+1,i.value=i.extended=-1):this.token=IM,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,i){if(e>=this.chunkPos&&i<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,i-this.chunkPos);if(e>=this.chunk2Pos&&i<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,i-this.chunk2Pos);if(e>=this.range.from&&i<=this.range.to)return this.input.read(e,i);let n="";for(let r of this.ranges){if(r.from>=i)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,i)))}return n}}class Kc{constructor(e,i){this.data=e,this.id=i}token(e,i){let{parser:n}=i.p;M4(this.data,e,i,this.id,n.data,n.tokenPrecTable)}}Kc.prototype.contextual=Kc.prototype.fallback=Kc.prototype.extend=!1;class Yg{constructor(e,i,n){this.precTable=i,this.elseToken=n,this.data=typeof e=="string"?Ju(e):e}token(e,i){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(M4(this.data,e,i,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Yg.prototype.contextual=Kc.prototype.fallback=Kc.prototype.extend=!1;class or{constructor(e,i={}){this.token=e,this.contextual=!!i.contextual,this.fallback=!!i.fallback,this.extend=!!i.extend}}function M4(t,e,i,n,r,s){let o=0,l=1<<n,{dialect:c}=i.p.parser;e:for(;(l&t[o])!=0;){let u=t[o+1];for(let O=o+3;O<u;O+=2)if((t[O+1]&l)>0){let _=t[O];if(c.allows(_)&&(e.token.value==-1||e.token.value==_||aJ(_,e.token.value,r,s))){e.acceptToken(_);break}}let d=e.next,p=0,g=t[o+2];if(e.next<0&&g>p&&t[u+g*3-3]==65535){o=t[u+g*3-1];continue e}for(;p<g;){let O=p+g>>1,_=u+O+(O<<1),b=t[_],x=t[_+1]||65536;if(d<b)g=O;else if(d>=x)p=O+1;else{o=t[_+2],e.advance();continue e}}break}}function VM(t,e,i){for(let n=e,r;(r=t[n])!=65535;n++)if(r==i)return n-e;return-1}function aJ(t,e,i,n){let r=VM(i,n,e);return r<0||VM(i,n,t)<r}const Fn=typeof process<"u"&&NM&&/\bparse\b/.test(NM.LOG);let G_=null;function XM(t,e,i){let n=t.cursor(ut.IncludeAnonymous);for(n.moveTo(e);;)if(!(i<0?n.childBefore(e):n.childAfter(e)))for(;;){if((i<0?n.to<e:n.from>e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class lJ{constructor(e,i){this.fragments=e,this.nodeSet=i,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?XM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?XM(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let i=this.trees.length-1;if(i<0)return this.nextFragment(),null;let n=this.trees[i],r=this.index[i];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[r],o=this.start[i]+n.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof ct){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let c=s.prop(Ne.lookAhead);if(!c||l+c<this.fragment.to)return s}}this.index[i]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[i]++,this.nextStart=o+s.length}}}class cJ{constructor(e,i){this.stream=i,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Fm)}getActions(e){let i=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let u=0;u<s.length;u++){if((1<<u&o)==0)continue;let d=s[u],p=this.tokens[u];if(!(n&&!d.fallback)&&((d.contextual||p.start!=e.pos||p.mask!=o||p.context!=l)&&(this.updateCachedToken(p,d,e),p.mask=o,p.context=l),p.lookAhead>p.end+25&&(c=Math.max(p.lookAhead,c)),p.value!=0)){let g=i;if(p.extended>-1&&(i=this.addActions(e,p.extended,p.end,i)),i=this.addActions(e,p.value,p.end,i),!d.extend&&(n=p,i>g))break}}for(;this.actions.length>i;)this.actions.pop();return c&&e.setLookAhead(c),!n&&e.pos==this.stream.end&&(n=new Fm,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,i=this.addActions(e,n.value,n.end,i)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let i=new Fm,{pos:n,p:r}=e;return i.start=n,i.end=Math.min(n+1,r.stream.end),i.value=n==r.stream.end?r.parser.eofTerm:0,i}updateCachedToken(e,i,n){let r=this.stream.clipPos(n.pos);if(i.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),n);if(l>=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,i,n,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=i,this.actions[r++]=n,r}addActions(e,i,n,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let c=0;c<2;c++)for(let u=o.stateSlot(s,c?2:1);;u+=3){if(l[u]==65535)if(l[u+1]==1)u=ho(l,u+2);else{r==0&&l[u+1]==2&&(r=this.putAction(ho(l,u+2),i,n,r));break}l[u]==i&&(r=this.putAction(ho(l,u+1),i,n,r))}return r}}class hJ{constructor(e,i,n,r){this.parser=e,this.input=i,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new oJ(i,r),this.tokens=new cJ(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[Wg.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new lJ(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,i=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>i)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!n.length){let o=r&&fJ(r);if(o)return Fn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Fn&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return Fn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,c)=>c.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>i)&&this.recovering--}else if(n.length>1){e:for(let o=0;o<n.length-1;o++){let l=n[o];for(let c=o+1;c<n.length;c++){let u=n[c];if(l.sameState(u)||l.buffer.length>500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)n.splice(c--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o<n.length;o++)n[o].pos<this.minStackPos&&(this.minStackPos=n[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,i,n){let r=e.pos,{parser:s}=this,o=Fn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,d=u?e.curContext.hash:0;for(let p=this.fragments.nodeAt(r);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?s.getGoto(e.state,p.type.id):-1;if(g>-1&&p.length&&(!u||(p.prop(Ne.contextHash)||0)==d))return e.useNode(p,g),Fn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof ct)||p.children.length==0||p.positions[0]>0)break;let O=p.children[0];if(O instanceof ct&&p.positions[0]==0)p=O;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Fn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let u=0;u<c.length;){let d=c[u++],p=c[u++],g=c[u++],O=u==c.length||!n,_=O?e:e.split(),b=this.tokens.mainToken;if(_.apply(d,p,b?b.start:_.pos,g),Fn&&console.log(o+this.stackID(_)+` (via ${(d&65536)==0?"shift":`reduce of ${s.getName(d&65535)}`} for ${s.getName(p)} @ ${r}${_==e?"":", split"})`),O)return!0;_.pos>r?i.push(_):n.push(_)}return!1}advanceFully(e,i){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return ZM(e,i),!0}}runRecovery(e,i,n){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],c=i[o<<1],u=i[(o<<1)+1],d=Fn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Fn&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let p=l.split(),g=d;for(let O=0;O<10&&p.forceReduce()&&(Fn&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,n));O++)Fn&&(g=this.stackID(p)+" -> ");for(let O of l.recoverByInsert(c))Fn&&console.log(d+this.stackID(O)+" (via recover-insert)"),this.advanceFully(O,n);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),Fn&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),ZM(l,n)):(!r||r.score<p.score)&&(r=p)}return r}stackToTree(e){return e.close(),ct.build({buffer:Ug.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let i=(G_||(G_=new WeakMap)).get(e);return i||G_.set(e,i=String.fromCodePoint(this.nextStackID++)),i+e}}function ZM(t,e){for(let i=0;i<e.length;i++){let n=e[i];if(n.pos==t.pos&&n.sameState(t)){e[i].score<t.score&&(e[i]=t);return}}e.push(t)}class uJ{constructor(e,i,n){this.source=e,this.flags=i,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const K_=t=>t;class P4{constructor(e){this.start=e.start,this.shift=e.shift||K_,this.reduce=e.reduce||K_,this.reuse=e.reuse||K_,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class uh extends Gx{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let i=e.nodeNames.split(" ");this.minRepeatTerm=i.length;for(let l=0;l<e.repeatNodeCount;l++)i.push("");let n=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<i.length;l++)r.push([]);function s(l,c,u){r[l].push([c,c.deserialize(String(u))])}if(e.nodeProps)for(let l of e.nodeProps){let c=l[0];typeof c=="string"&&(c=Ne[c]);for(let u=1;u<l.length;){let d=l[u++];if(d>=0)s(d,c,l[u++]);else{let p=l[u+-d];for(let g=-d;g>0;g--)s(l[u++],c,p);u++}}}this.nodeSet=new pd(i.map((l,c)=>_i.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:n.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=PB;let o=Ju(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(qM),this.states=Ju(e.states,Uint32Array),this.data=Ju(e.stateData),this.goto=Ju(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Kc(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,i,n){let r=new hJ(this,e,i,n);for(let s of this.wrappers)r=s(r,e,i,n);return r}getGoto(e,i,n=!1){let r=this.goto;if(i>=r[0])return-1;for(let s=r[i+1];;){let o=r[s++],l=o&1,c=r[s++];if(l&&n)return c;for(let u=s+(o>>1);s<u;s++)if(r[s]==e)return c;if(l)return-1}}hasAction(e,i){let n=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=n[s])==65535)if(n[s+1]==1)o=n[s=ho(n,s+2)];else{if(n[s+1]==2)return ho(n,s+2);break}if(o==i||o==0)return ho(n,s+1)}return 0}stateSlot(e,i){return this.states[e*6+i]}stateFlag(e,i){return(this.stateSlot(e,0)&i)>0}validAction(e,i){return!!this.allActions(e,n=>n==i?!0:null)}allActions(e,i){let n=this.stateSlot(e,4),r=n?i(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=ho(this.data,s+2);else break;r=i(ho(this.data,s+1))}return r}nextStates(e){let i=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=ho(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];i.some((s,o)=>o&1&&s==r)||i.push(this.data[n],r)}}return i}configure(e){let i=Object.assign(Object.create(uh.prototype),this);if(e.props&&(i.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);i.top=n}return e.tokenizers&&(i.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(i.specializers=this.specializers.slice(),i.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return i.specializers[r]=qM(o),o})),e.contextTracker&&(i.context=e.contextTracker),e.dialect&&(i.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(i.strict=e.strict),e.wrap&&(i.wrappers=i.wrappers.concat(e.wrap)),e.bufferLength!=null&&(i.bufferLength=e.bufferLength),i}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let i=this.dynamicPrecedences;return i==null?0:i[e]||0}parseDialect(e){let i=Object.keys(this.dialects),n=i.map(()=>!1);if(e)for(let s of e.split(" ")){let o=i.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;s<i.length;s++)if(!n[s])for(let o=this.dialects[i[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new uJ(e,n,r)}static deserialize(e){return new uh(e)}}function ho(t,e){return t[e]|t[e+1]<<16}function fJ(t){let e=null;for(let i of t){let n=i.p.stoppedAt;(i.pos==i.p.stream.end||n!=null&&i.pos>n)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.score<i.score)&&(e=i)}return e}function qM(t){if(t.external){let e=t.extend?1:0;return(i,n)=>t.external(i,n)<<1|e}return t.get}const dJ=55,pJ=1,mJ=56,gJ=2,OJ=57,vJ=3,WM=4,_J=5,Sw=6,R4=7,Q4=8,L4=9,D4=10,yJ=11,bJ=12,SJ=13,J_=58,xJ=14,wJ=15,UM=59,B4=21,CJ=23,$4=24,kJ=25,Ib=27,z4=28,TJ=29,AJ=32,EJ=35,MJ=37,PJ=38,RJ=0,QJ=1,LJ={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},DJ={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},YM={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function BJ(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let HM=null,FM=null,GM=0;function Vb(t,e){let i=t.pos+e;if(GM==i&&FM==t)return HM;let n=t.peek(e),r="";for(;BJ(n);)r+=String.fromCharCode(n),n=t.peek(++e);return FM=t,GM=i,HM=r?r.toLowerCase():n==$J||n==zJ?void 0:null}const N4=60,Hg=62,xw=47,$J=63,zJ=33,NJ=45;function KM(t,e){this.name=t,this.parent=e}const jJ=[Sw,D4,R4,Q4,L4],IJ=new P4({start:null,shift(t,e,i,n){return jJ.indexOf(e)>-1?new KM(Vb(n,1)||"",t):t},reduce(t,e){return e==B4&&t?t.parent:t},reuse(t,e,i,n){let r=e.type.id;return r==Sw||r==MJ?new KM(Vb(n,1)||"",t):t},strict:!1}),VJ=new or((t,e)=>{if(t.next!=N4){t.next<0&&e.context&&t.acceptToken(J_);return}t.advance();let i=t.next==xw;i&&t.advance();let n=Vb(t,0);if(n===void 0)return;if(!n)return t.acceptToken(i?wJ:xJ);let r=e.context?e.context.name:null;if(i){if(n==r)return t.acceptToken(yJ);if(r&&DJ[r])return t.acceptToken(J_,-2);if(e.dialectEnabled(RJ))return t.acceptToken(bJ);for(let s=e.context;s;s=s.parent)if(s.name==n)return;t.acceptToken(SJ)}else{if(n=="script")return t.acceptToken(R4);if(n=="style")return t.acceptToken(Q4);if(n=="textarea")return t.acceptToken(L4);if(LJ.hasOwnProperty(n))return t.acceptToken(D4);r&&YM[r]&&YM[r][n]?t.acceptToken(J_,-1):t.acceptToken(Sw)}},{contextual:!0}),XJ=new or(t=>{for(let e=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(UM);break}if(t.next==NJ)e++;else if(t.next==Hg&&e>=2){i>=3&&t.acceptToken(UM,-2);break}else e=0;t.advance()}});function ZJ(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const qJ=new or((t,e)=>{if(t.next==xw&&t.peek(1)==Hg){let i=e.dialectEnabled(QJ)||ZJ(e.context);t.acceptToken(i?_J:WM,2)}else t.next==Hg&&t.acceptToken(WM,1)});function ww(t,e,i){let n=2+t.length;return new or(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==N4||s==1&&r.next==xw||s>=2&&s<n&&r.next==t.charCodeAt(s-2))s++,o++;else if(s==n&&r.next==Hg){l>o?r.acceptToken(e,-o):r.acceptToken(i,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}const WJ=ww("script",dJ,pJ),UJ=ww("style",mJ,gJ),YJ=ww("textarea",OJ,vJ),HJ=vh({"Text RawText IncompleteTag IncompleteCloseTag":V.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":V.angleBracket,TagName:V.tagName,"MismatchedCloseTag/TagName":[V.tagName,V.invalid],AttributeName:V.attributeName,"AttributeValue UnquotedAttributeValue":V.attributeValue,Is:V.definitionOperator,"EntityReference CharacterReference":V.character,Comment:V.blockComment,ProcessingInst:V.processingInstruction,DoctypeDecl:V.documentMeta}),FJ=uh.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:IJ,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[HJ],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[WJ,UJ,YJ,qJ,VJ,XJ,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function j4(t,e){let i=Object.create(null);for(let n of t.getChildren($4)){let r=n.getChild(kJ),s=n.getChild(Ib)||n.getChild(z4);r&&(i[e.read(r.from,r.to)]=s?s.type.id==Ib?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return i}function JM(t,e){let i=t.getChild(CJ);return i?e.read(i.from,i.to):" "}function ey(t,e,i){let n;for(let r of i)if(!r.attrs||r.attrs(n||(n=j4(t.node.parent.firstChild,e))))return{parser:r.parser,bracketed:!0};return null}function I4(t=[],e=[]){let i=[],n=[],r=[],s=[];for(let l of t)(l.tag=="script"?i:l.tag=="style"?n:l.tag=="textarea"?r:s).push(l);let o=e.length?Object.create(null):null;for(let l of e)(o[l.name]||(o[l.name]=[])).push(l);return BB((l,c)=>{let u=l.type.id;if(u==TJ)return ey(l,c,i);if(u==AJ)return ey(l,c,n);if(u==EJ)return ey(l,c,r);if(u==B4&&s.length){let d=l.node,p=d.firstChild,g=p&&JM(p,c),O;if(g){for(let _ of s)if(_.tag==g&&(!_.attrs||_.attrs(O||(O=j4(p,c))))){let b=d.lastChild,x=b.type.id==PJ?b.from:d.to;if(x>p.to)return{parser:_.parser,overlay:[{from:p.to,to:x}]}}}}if(o&&u==$4){let d=l.node,p;if(p=d.firstChild){let g=o[c.read(p.from,p.to)];if(g)for(let O of g){if(O.tagName&&O.tagName!=JM(d.parent,c))continue;let _=d.lastChild;if(_.type.id==Ib){let b=_.from+1,x=_.lastChild,w=_.to-(x&&x.isError?0:1);if(w>b)return{parser:O.parser,overlay:[{from:b,to:w}],bracketed:!0}}else if(_.type.id==z4)return{parser:O.parser,overlay:[{from:_.from,to:_.to}]}}}}return null})}const GJ=122,eP=1,KJ=123,JJ=124,V4=2,eee=125,tee=3,iee=4,X4=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],nee=58,ree=40,Z4=95,see=91,Gm=45,oee=46,aee=35,lee=37,cee=38,hee=92,uee=10,fee=42;function Gf(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Cw(t){return t>=48&&t<=57}function tP(t){return Cw(t)||t>=97&&t<=102||t>=65&&t<=70}const q4=(t,e,i)=>(n,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=n;if(Gf(c)||c==Gm||c==Z4||s&&Cw(c))!s&&(c!=Gm||l>0)&&(s=!0),o===l&&c==Gm&&o++,n.advance();else if(c==hee&&n.peek(1)!=uee){if(n.advance(),tP(n.next)){do n.advance();while(tP(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();s=!0}else{s&&n.acceptToken(o==2&&r.canShift(V4)?e:c==ree?i:t);break}}},dee=new or(q4(KJ,V4,JJ)),pee=new or(q4(eee,tee,iee)),mee=new or(t=>{if(X4.includes(t.peek(-1))){let{next:e}=t;(Gf(e)||e==Z4||e==aee||e==oee||e==fee||e==see||e==nee&&Gf(t.peek(1))||e==Gm||e==cee)&&t.acceptToken(GJ)}}),gee=new or(t=>{if(!X4.includes(t.peek(-1))){let{next:e}=t;if(e==lee&&(t.advance(),t.acceptToken(eP)),Gf(e)){do t.advance();while(Gf(t.next)||Cw(t.next));t.acceptToken(eP)}}}),Oee=vh({"AtKeyword import charset namespace keyframes media supports":V.definitionKeyword,"from to selector":V.keyword,NamespaceName:V.namespace,KeyframeName:V.labelName,KeyframeRangeName:V.operatorKeyword,TagName:V.tagName,ClassName:V.className,PseudoClassName:V.constant(V.className),IdName:V.labelName,"FeatureName PropertyName":V.propertyName,AttributeName:V.attributeName,NumberLiteral:V.number,KeywordQuery:V.keyword,UnaryQueryOp:V.operatorKeyword,"CallTag ValueName":V.atom,VariableName:V.variableName,Callee:V.operatorKeyword,Unit:V.unit,"UniversalSelector NestingSelector":V.definitionOperator,"MatchOp CompareOp":V.compareOperator,"ChildOp SiblingOp, LogicOp":V.logicOperator,BinOp:V.arithmeticOperator,Important:V.modifier,Comment:V.blockComment,ColorLiteral:V.color,"ParenthesizedContent StringLiteral":V.string,":":V.punctuation,"PseudoOp #":V.derefOperator,"; ,":V.separator,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace}),vee={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},_ee={__proto__:null,or:98,and:98,not:106,only:106,layer:170},yee={__proto__:null,selector:112,layer:166},bee={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},See={__proto__:null,to:207},xee=uh.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[Oee],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[mee,gee,dee,pee,1,2,3,4,new Yg("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:t=>vee[t]||-1},{term:125,get:t=>_ee[t]||-1},{term:4,get:t=>yee[t]||-1},{term:25,get:t=>bee[t]||-1},{term:123,get:t=>See[t]||-1}],tokenPrec:1963});let ty=null;function iy(){if(!ty&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],i=new Set;for(let n in t)n!="cssText"&&n!="cssFloat"&&typeof t[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),i.has(n)||(e.push(n),i.add(n)));ty=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return ty||[]}const iP=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),nP=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),wee=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Cee=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),io=/^(\w[\w-]*|-\w[\w-]*|)$/,kee=/^-(-[\w-]*)?$/;function Tee(t,e){var i;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let n=(i=t.parent)===null||i===void 0?void 0:i.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const rP=new DB,Aee=["Declaration"];function Eee(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function W4(t,e,i){if(e.to-e.from>4096){let n=rP.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(ut.IncludeAnonymous);if(o.firstChild())do for(let l of W4(t,o.node,i))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return rP.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(i(s)&&s.matchContext(Aee)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=t.sliceString(s.from,s.to);r.has(l)||(r.add(l),n.push({label:l,type:"variable"}))}}),n}}const Mee=t=>e=>{let{state:i,pos:n}=e,r=xt(i).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&i.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:iy(),validFor:io};if(r.name=="ValueName")return{from:r.from,options:nP,validFor:io};if(r.name=="PseudoClassName")return{from:r.from,options:iP,validFor:io};if(t(r)||(e.explicit||s)&&Tee(r,i.doc))return{from:t(r)||s?r.from:n,options:W4(i.doc,Eee(r),t),validFor:kee};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:iy(),validFor:io};return{from:r.from,options:wee,validFor:io}}if(r.name=="AtKeyword")return{from:r.from,options:Cee,validFor:io};if(!e.explicit)return null;let o=r.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:iP,validFor:io}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:nP,validFor:io}:o.name=="Block"||o.name=="Styles"?{from:n,options:iy(),validFor:io}:null},Pee=Mee(t=>t.name=="VariableName"),Fg=ah.define({name:"css",parser:xee.configure({props:[md.add({Declaration:Ym()}),yh.add({"Block KeyframeList":XB})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Ree(){return new If(Fg,Fg.data.of({autocomplete:Pee}))}const Qee=316,Lee=317,sP=1,Dee=2,Bee=3,$ee=4,zee=318,Nee=320,jee=321,Iee=5,Vee=6,Xee=0,Xb=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],U4=125,Zee=59,Zb=47,qee=42,Wee=43,Uee=45,Yee=60,Hee=44,Fee=63,Gee=46,Kee=91,Jee=new P4({start:!1,shift(t,e){return e==Iee||e==Vee||e==Nee?t:e==jee},strict:!1}),ete=new or((t,e)=>{let{next:i}=t;(i==U4||i==-1||e.context)&&t.acceptToken(zee)},{contextual:!0,fallback:!0}),tte=new or((t,e)=>{let{next:i}=t,n;Xb.indexOf(i)>-1||i==Zb&&((n=t.peek(1))==Zb||n==qee)||i!=U4&&i!=Zee&&i!=-1&&!e.context&&t.acceptToken(Qee)},{contextual:!0}),ite=new or((t,e)=>{t.next==Kee&&!e.context&&t.acceptToken(Lee)},{contextual:!0}),nte=new or((t,e)=>{let{next:i}=t;if(i==Wee||i==Uee){if(t.advance(),i==t.next){t.advance();let n=!e.context&&e.canShift(sP);t.acceptToken(n?sP:Dee)}}else i==Fee&&t.peek(1)==Gee&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(Bee))},{contextual:!0});function ny(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const rte=new or((t,e)=>{if(t.next!=Yee||!e.dialectEnabled(Xee)||(t.advance(),t.next==Zb))return;let i=0;for(;Xb.indexOf(t.next)>-1;)t.advance(),i++;if(ny(t.next,!0)){for(t.advance(),i++;ny(t.next,!1);)t.advance(),i++;for(;Xb.indexOf(t.next)>-1;)t.advance(),i++;if(t.next==Hee)return;for(let n=0;;n++){if(n==7){if(!ny(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),i++}}t.acceptToken($ee,-i)}),ste=vh({"get set async static":V.modifier,"for while do if else switch try catch finally return throw break continue default case defer":V.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":V.operatorKeyword,"let var const using function class extends":V.definitionKeyword,"import export from":V.moduleKeyword,"with debugger new":V.keyword,TemplateString:V.special(V.string),super:V.atom,BooleanLiteral:V.bool,this:V.self,null:V.null,Star:V.modifier,VariableName:V.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":V.function(V.variableName),VariableDefinition:V.definition(V.variableName),Label:V.labelName,PropertyName:V.propertyName,PrivatePropertyName:V.special(V.propertyName),"CallExpression/MemberExpression/PropertyName":V.function(V.propertyName),"FunctionDeclaration/VariableDefinition":V.function(V.definition(V.variableName)),"ClassDeclaration/VariableDefinition":V.definition(V.className),"NewExpression/VariableName":V.className,PropertyDefinition:V.definition(V.propertyName),PrivatePropertyDefinition:V.definition(V.special(V.propertyName)),UpdateOp:V.updateOperator,"LineComment Hashbang":V.lineComment,BlockComment:V.blockComment,Number:V.number,String:V.string,Escape:V.escape,ArithOp:V.arithmeticOperator,LogicOp:V.logicOperator,BitOp:V.bitwiseOperator,CompareOp:V.compareOperator,RegExp:V.regexp,Equals:V.definitionOperator,Arrow:V.function(V.punctuation),": Spread":V.punctuation,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace,"InterpolationStart InterpolationEnd":V.special(V.brace),".":V.derefOperator,", ;":V.separator,"@":V.meta,TypeName:V.typeName,TypeDefinition:V.definition(V.typeName),"type enum interface implements namespace module declare":V.definitionKeyword,"abstract global Privacy readonly override":V.modifier,"is keyof unique infer asserts":V.operatorKeyword,JSXAttributeValue:V.attributeValue,JSXText:V.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":V.angleBracket,"JSXIdentifier JSXNameSpacedName":V.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":V.attributeName,"JSXBuiltin/JSXIdentifier":V.standard(V.tagName)}),ote={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},ate={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},lte={__proto__:null,"<":193},cte=uh.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hOTX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WOPP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Jee,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[ste],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[tte,ite,nte,rte,2,3,4,5,6,7,8,9,10,11,12,13,14,ete,new Yg("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Yg("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>ote[t]||-1},{term:343,get:t=>ate[t]||-1},{term:95,get:t=>lte[t]||-1}],tokenPrec:15201}),Y4=[Qn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Qn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Qn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Qn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Qn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Qn(`try {
|
|
75
|
+
\${}
|
|
76
|
+
} catch (\${error}) {
|
|
77
|
+
\${}
|
|
78
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Qn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Qn(`if (\${}) {
|
|
79
|
+
\${}
|
|
80
|
+
} else {
|
|
81
|
+
\${}
|
|
82
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Qn(`class \${name} {
|
|
83
|
+
constructor(\${params}) {
|
|
84
|
+
\${}
|
|
85
|
+
}
|
|
86
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Qn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Qn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],hte=Y4.concat([Qn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Qn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Qn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),oP=new DB,H4=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Pu(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const ute=["FunctionDeclaration"],fte={FunctionDeclaration:Pu("function"),ClassDeclaration:Pu("class"),ClassExpression:()=>!0,EnumDeclaration:Pu("constant"),TypeAliasDeclaration:Pu("type"),NamespaceDeclaration:Pu("namespace"),VariableDefinition(t,e){t.matchContext(ute)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function F4(t,e){let i=oP.get(e);if(i)return i;let n=[],r=!0;function s(o,l){let c=t.sliceString(o.from,o.to);n.push({label:c,type:l})}return e.cursor(ut.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=fte[o.name];if(l&&l(o,s)||H4.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of F4(t,o.node))n.push(l);return!1}}),oP.set(e,n),n}const aP=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,G4=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function dte(t){let e=xt(t.state).resolveInner(t.pos,-1);if(G4.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&aP.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let r=e;r;r=r.parent)H4.has(r.name)&&(n=n.concat(F4(t.state.doc,r)));return{options:n,from:i?e.from:t.pos,validFor:aP}}const ks=ah.define({name:"javascript",parser:cte.configure({props:[md.add({IfStatement:Ym({except:/^\s*({|else\b)/}),TryStatement:Ym({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:NY,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:zY({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ym({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),yh.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":XB,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),K4={test:t=>/^JSX/.test(t.name),facet:Kx({commentTokens:{block:{open:"{/*",close:"*/}"}}})},J4=ks.configure({dialect:"ts"},"typescript"),e6=ks.configure({dialect:"jsx",props:[Jx.add(t=>t.isTop?[K4]:void 0)]}),t6=ks.configure({dialect:"jsx ts",props:[Jx.add(t=>t.isTop?[K4]:void 0)]},"typescript");let i6=t=>({label:t,type:"keyword"});const n6="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(i6),pte=n6.concat(["declare","implements","private","protected","public"].map(i6));function mte(t={}){let e=t.jsx?t.typescript?t6:e6:t.typescript?J4:ks,i=t.typescript?hte.concat(pte):Y4.concat(n6);return new If(e,[ks.data.of({autocomplete:sG(G4,q$(i))}),ks.data.of({autocomplete:dte}),t.jsx?vte:[]])}function gte(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function lP(t,e,i=t.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,i));return""}const Ote=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),vte=ve.inputHandler.of((t,e,i,n,r)=>{if((Ote?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||n!=">"&&n!="/"||!ks.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u;let{head:d}=c,p=xt(o).resolveInner(d-1,-1),g;if(p.name=="JSXStartTag"&&(p=p.parent),!(o.doc.sliceString(d-1,d)!=n||p.name=="JSXAttributeValue"&&p.to>d)){if(n==">"&&p.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&p.name=="JSXStartCloseTag"){let O=p.parent,_=O.parent;if(_&&O.from==d-2&&((g=lP(o.doc,_.firstChild,d))||((u=_.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${g}>`;return{range:se.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(n==">"){let O=gte(p);if(O&&O.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(g=lP(o.doc,O,d)))return{range:c,changes:{from:d,insert:`</${g}>`}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ru=["_blank","_self","_top","_parent"],ry=["ascii","utf-8","utf-16","latin1","latin1"],sy=["get","post","put","delete"],oy=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Gn=["true","false"],Me={},_te={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ru,hreflang:null}},abbr:Me,address:Me,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Me,aside:Me,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Me,base:{attrs:{href:null,target:Ru}},bdi:Me,bdo:Me,blockquote:{attrs:{cite:null}},body:Me,br:Me,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:oy,formmethod:sy,formnovalidate:["novalidate"],formtarget:Ru,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Me,center:Me,cite:Me,code:Me,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Me,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Me,div:Me,dl:Me,dt:Me,em:Me,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Me,figure:Me,footer:Me,form:{attrs:{action:null,name:null,"accept-charset":ry,autocomplete:["on","off"],enctype:oy,method:sy,novalidate:["novalidate"],target:Ru}},h1:Me,h2:Me,h3:Me,h4:Me,h5:Me,h6:Me,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Me,hgroup:Me,hr:Me,html:{attrs:{manifest:null}},i:Me,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:oy,formmethod:sy,formnovalidate:["novalidate"],formtarget:Ru,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Me,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Me,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Me,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ry,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Me,noscript:Me,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Me,param:{attrs:{name:null,value:null}},pre:Me,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Me,rt:Me,ruby:Me,samp:Me,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ry}},section:Me,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Me,source:{attrs:{src:null,type:null,media:null}},span:Me,strong:Me,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Me,summary:Me,sup:Me,table:Me,tbody:Me,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Me,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Me,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Me,time:{attrs:{datetime:null}},title:Me,tr:Me,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Me,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Me},r6={accesskey:null,class:null,contenteditable:Gn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Gn,autocorrect:Gn,autocapitalize:Gn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Gn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Gn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Gn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Gn,"aria-hidden":Gn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Gn,"aria-multiselectable":Gn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Gn,"aria-relevant":null,"aria-required":Gn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},s6="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of s6)r6[t]=null;let Kf=class{constructor(e,i){this.tags={..._te,...e},this.globalAttrs={...r6,...i},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};Kf.default=new Kf;function fh(t,e,i=t.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?t.sliceString(r.from,Math.min(r.to,i)):""}function dh(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function o6(t,e,i){let n=i.tags[fh(t,dh(e))];return(n==null?void 0:n.children)||i.allTags}function kw(t,e){let i=[];for(let n=dh(e);n&&!n.type.isTop;n=dh(n.parent)){let r=fh(t,n);if(r&&n.lastChild.name=="CloseTag")break;r&&i.indexOf(r)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&i.push(r)}return i}const a6=/^[:\-\.\w\u00b7-\uffff]*$/;function cP(t,e,i,n,r){let s=/\s*>/.test(t.sliceDoc(r,r+5))?"":">",o=dh(i,i.name=="StartTag"||i.name=="TagName");return{from:n,to:r,options:o6(t.doc,o,e).map(l=>({label:l,type:"type"})).concat(kw(t.doc,i).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function hP(t,e,i,n){let r=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:kw(t.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:a6}}function yte(t,e,i,n){let r=[],s=0;for(let o of o6(t.doc,i,e))r.push({label:"<"+o,type:"type"});for(let o of kw(t.doc,i))r.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function bte(t,e,i,n,r){let s=dh(i),o=s?e.tags[fh(t.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:a6}}function Ste(t,e,i,n,r){var s;let o=(s=i.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=t.sliceDoc(o.from,o.to),d=e.globalAttrs[u];if(!d){let p=dh(i),g=p?e.tags[fh(t.doc,p)]:null;d=(g==null?void 0:g.attrs)&&g.attrs[u]}if(d){let p=t.sliceDoc(n,r).toLowerCase(),g='"',O='"';/^['"]/.test(p)?(c=p[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",O=t.sliceDoc(r,r+1)==p[0]?"":p[0],p=p.slice(1),n++):c=/^[^\s<>='"]*$/;for(let _ of d)l.push({label:_,apply:g+_+O,type:"constant"})}}return{from:n,to:r,options:l,validFor:c}}function l6(t,e){let{state:i,pos:n}=e,r=xt(i).resolveInner(n,-1),s=r.resolve(n);for(let o=n,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;s=r=l,o=c.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?hP(i,r,r.from,n):cP(i,t,r,r.from,n):r.name=="StartTag"||r.name=="IncompleteTag"?cP(i,t,r,n,n):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?hP(i,r,n,n):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?bte(i,t,r,r.name=="AttributeName"?r.from:n,n):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?Ste(i,t,r,r.name=="Is"?n:r.from,n):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?yte(i,t,r,n):null}function xte(t){return l6(Kf.default,t)}function wte(t){let{extraTags:e,extraGlobalAttributes:i}=t,n=i||e?new Kf(e,i):Kf.default;return r=>l6(n,r)}const Cte=ks.parser.configure({top:"SingleExpression"}),c6=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:J4.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:e6.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:t6.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:Cte},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:ks.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:Fg.parser}],h6=[{name:"style",parser:Fg.parser.configure({top:"Styles"})}].concat(s6.map(t=>({name:t,parser:ks.parser}))),u6=ah.define({name:"html",parser:FJ.configure({props:[md.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,i;for(let n=t.node;;){let r=n.lastChild;if(!r||r.name!="Element"||r.to!=n.to)break;e=n=r}return e&&!((i=e.lastChild)&&(i.name=="CloseTag"||i.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),yh.add({Element(t){let e=t.firstChild,i=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:i.name=="CloseTag"?i.from:t.to}}}),i$.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Km=u6.configure({wrap:I4(c6,h6)});function kte(t={}){let e="",i;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(i=I4((t.nestedLanguages||[]).concat(c6),(t.nestedAttributes||[]).concat(h6)));let n=i?u6.configure({wrap:i,dialect:e}):e?Km.configure({dialect:e}):Km;return new If(n,[Km.data.of({autocomplete:wte(t)}),t.autoCloseTags!==!1?Tte:[],mte().support,Ree().support])}const uP=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Tte=ve.inputHandler.of((t,e,i,n,r)=>{if(t.composing||t.state.readOnly||e!=i||n!=">"&&n!="/"||!Km.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,p;let g=o.doc.sliceString(c.from-1,c.to)==n,{head:O}=c,_=xt(o).resolveInner(O,-1),b;if(g&&n==">"&&_.name=="EndTag"){let x=_.parent;if(((d=(u=x.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=fh(o.doc,x.parent,O))&&!uP.has(b)){let w=O+(o.doc.sliceString(O,O+1)===">"?1:0),k=`</${b}>`;return{range:c,changes:{from:O,to:w,insert:k}}}}else if(g&&n=="/"&&_.name=="IncompleteCloseTag"){let x=_.parent;if(_.from==O-2&&((p=x.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(b=fh(o.doc,x,O))&&!uP.has(b)){let w=O+(o.doc.sliceString(O,O+1)===">"?1:0),k=`${b}>`;return{range:se.cursor(O+k.length,-1),changes:{from:O,to:w,insert:k}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),f6=Kx({commentTokens:{block:{open:"<!--",close:"-->"}}}),d6=new Ne,p6=ZK.configure({props:[yh.add(t=>!t.is("Block")||t.is("Document")||qb(t)!=null||Ate(t)?void 0:(e,i)=>({from:i.doc.lineAt(e.from).to,to:e.to})),d6.add(qb),md.add({Document:()=>null}),gl.add({Document:f6})]});function qb(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Ate(t){return t.name=="OrderedList"||t.name=="BulletList"}function Ete(t,e){let i=t;for(;;){let n=i.nextSibling,r;if(!n||(r=qb(n.type))!=null&&r<=e)break;i=n}return i.to}const Mte=VB.of((t,e,i)=>{for(let n=xt(t).resolveInner(i,-1);n&&!(n.from<e);n=n.parent){let r=n.type.prop(d6);if(r==null)continue;let s=Ete(n,r);if(s>i)return{from:i,to:s}}return null});function Tw(t){return new Ar(f6,t,[],"markdown")}const Pte=Tw(p6),Rte=p6.configure([tJ,nJ,iJ,rJ,{props:[yh.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),Jf=Tw(Rte);function Qte(t,e){return i=>{if(i&&t){let n=null;if(i=/\S*/.exec(i)[0],typeof t=="function"?n=t(i):n=Rg.matchLanguageName(t,i,!0),n instanceof Rg)return n.support?n.support.language.parser:jf.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class ay{constructor(e,i,n,r,s,o,l){this.node=e,this.from=i,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,i=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let r=this.to-this.from-n.length-this.spaceAfter.length;r>0;r--)n+=" ";return n+(i?this.spaceAfter:"")}}marker(e,i){let n=this.node.name=="OrderedList"?String(+g6(this.item,e)[2]+i):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function m6(t,e){let i=[],n=[];for(let r=t;r;r=r.parent){if(r.name=="FencedCode")return n;(r.name=="ListItem"||r.name=="Blockquote")&&i.push(r)}for(let r=i.length-1;r>=0;r--){let s=i[r],o,l=e.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new ay(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new ay(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let p=o[2];o[3]&&(p+=o[3].replace(/[xX]/," ")),n.push(new ay(s.parent,c,c+d,o[1],u,p,s))}}return n}function g6(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function ly(t,e,i,n=0){for(let r=-1,s=t;;){if(s.name=="ListItem"){let l=g6(s,e),c=+l[2];if(r>=0){if(c!=r+1)return;i.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+n)})}r=c}let o=s.nextSibling;if(!o)break;s=o}}function Aw(t,e){let i=/^[ \t]*/.exec(t)[0].length;if(!i||e.facet(_h)!=" ")return t;let n=Yr(t,4,i),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+t.slice(i)}const Lte=(t={})=>({state:e,dispatch:i})=>{let n=xt(e),{doc:r}=e,s=null,o=e.changeByRange(l=>{if(!l.empty||!Jf.isActiveAt(e,l.from,-1)&&!Jf.isActiveAt(e,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=m6(n.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let p=d[d.length-1];if(p.to-p.spaceAfter.length>c-u.from)return s={range:l};let g=c>=p.to-p.spaceAfter.length&&!/\S/.test(u.text.slice(p.to));if(p.item&&g){let w=p.node.firstChild,k=p.node.getChild("ListItem","ListItem");if(w.to>=c||k&&k.to<c||u.from>0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||t.nonTightLists===!1){let T=d.length>1?d[d.length-2]:null,A,L="";T&&T.item?(A=u.from+T.from,L=T.marker(r,1)):A=u.from+(T?T.to:0);let E=[{from:A,to:c,insert:L}];return p.node.name=="OrderedList"&&ly(p.item,r,E,-2),T&&T.node.name=="OrderedList"&&ly(T.item,r,E),{range:se.cursor(A+L.length),changes:E}}else{let T=dP(d,e,u);return{range:se.cursor(c+T.length+1),changes:{from:u.from,insert:T+e.lineBreak}}}}if(p.node.name=="Blockquote"&&g&&u.from){let w=r.lineAt(u.from-1),k=/>\s*$/.exec(w.text);if(k&&k.index==p.from){let T=e.changes([{from:w.from+k.index,to:w.to},{from:u.from+p.from,to:u.to}]);return{range:l.map(T),changes:T}}}let O=[];p.node.name=="OrderedList"&&ly(p.item,r,O);let _=p.item&&p.item.from<u.from,b="";if(!_||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=p.to)for(let w=0,k=d.length-1;w<=k;w++)b+=w==k&&!_?d[w].marker(r,1):d[w].blank(w<k?Yr(u.text,4,d[w+1].from)-b.length:null);let x=c;for(;x>u.from&&/\s/.test(u.text.charAt(x-u.from-1));)x--;return b=Aw(b,e),Bte(p.node,e.doc)&&(b=dP(d,e,u)+e.lineBreak+b),O.push({from:x,to:c,insert:e.lineBreak+b}),{range:se.cursor(x+b.length+1),changes:O}});return s?!1:(i(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},Dte=Lte();function fP(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Bte(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let i=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(i.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1)<s.number}function dP(t,e,i){let n="";for(let r=0,s=t.length-2;r<=s;r++)n+=t[r].blank(r<s?Yr(i.text,4,t[r+1].from)-n.length:null,r<s);return Aw(n,e)}function $te(t,e){let i=t.resolveInner(e,-1),n=e;fP(i)&&(n=i.from,i=i.parent);for(let r;r=i.childBefore(n);)if(fP(r))n=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")i=r.lastChild,n=i.to;else break;return i}const zte=({state:t,dispatch:e})=>{let i=xt(t),n=null,r=t.changeByRange(s=>{let o=s.from,{doc:l}=t;if(s.empty&&Jf.isActiveAt(t,s.from)){let c=l.lineAt(o),u=m6($te(i,o),l);if(u.length){let d=u[u.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>p&&!/\S/.test(c.text.slice(p,o-c.from)))return{range:se.cursor(c.from+p),changes:{from:c.from+p,to:o}};if(o-c.from==p&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let g=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let O=d.blank(Yr(c.text,4,d.to)-Yr(c.text,4,d.from));return g==c.from&&(O=Aw(O,t)),{range:se.cursor(g+O.length),changes:{from:g,to:c.from+d.to,insert:O}}}if(g<o)return{range:se.cursor(g),changes:{from:g,to:o}}}}}return n={range:s}});return n?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},Nte=[{key:"Enter",run:Dte},{key:"Backspace",run:zte}],O6=kte({matchClosingTags:!1});function jte(t={}){let{codeLanguages:e,defaultCodeLanguage:i,addKeymap:n=!0,base:{parser:r}=Pte,completeHTMLTags:s=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=O6}=t;if(!(r instanceof CO))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=t.extensions?[t.extensions]:[],u=[l.support,Mte],d;o&&u.push(Zte),i instanceof If?(u.push(i.support),d=i.language):i&&(d=i);let p=e||d?Qte(e,d):void 0;c.push(WK({codeParser:p,htmlParser:l.language.parser})),n&&u.push(So.high(Ql.of(Nte)));let g=Tw(r.configure(c));return s&&u.push(g.data.of({autocomplete:Ite})),new If(g,u)}function Ite(t){let{state:e,pos:i}=t,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(i-25,i));if(!n)return null;let r=xt(e).resolveInner(i,-1);for(;r&&!r.type.isTop;){if(r.name=="CodeBlock"||r.name=="FencedCode"||r.name=="ProcessingInstructionBlock"||r.name=="CommentBlock"||r.name=="Link"||r.name=="Image")return null;r=r.parent}return{from:i-n[0].length,to:i,options:Vte(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let cy=null;function Vte(){if(cy)return cy;let t=xte(new cw(et.create({extensions:O6}),0,!0));return cy=t?t.options:[]}const Xte=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Zte=ve.domEventHandlers({paste:(t,e)=>{var i;let{main:n}=e.state.selection;if(n.empty)return!1;let r=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!Jf.isActiveAt(e.state,n.from,1)))return!1;let s=xt(e.state),o=!1;return s.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||Xte.test(l.name))&&(o=!0)},leave:l=>{l.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});function qte({initialContent:t,filePath:e,onSave:i,onClose:n}){const[r,s]=q.useState(t),[o,l]=q.useState(!1),[c,u]=q.useState(!1),d=q.useRef(r);q.useEffect(()=>{d.current=r},[r]);const p=q.useCallback(b=>{s(b),u(b!==t)},[t]),g=q.useCallback(async()=>{if(!o){l(!0);try{await i(d.current),u(!1)}catch(b){console.error("[plan-editor] Save failed:",b)}finally{l(!1)}}},[i,o]),O=q.useCallback(()=>{c&&!window.confirm("Unsaved changes -- discard?")||n()},[c,n]),_=Ql.of([{key:"Mod-s",run:()=>(g(),!0)}]);return q.useEffect(()=>{const b=x=>{(x.ctrlKey||x.metaKey)&&x.key==="s"&&x.preventDefault()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[]),S.jsxs("div",{className:"fixed inset-0 z-50 bg-background/95 flex flex-col",children:[S.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-card",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:e}),c&&S.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-sm bg-warning/20 text-warning font-mono",children:"unsaved"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[c&&S.jsx("button",{type:"button",onClick:g,disabled:o,className:Fe("text-xs px-3 py-1.5 rounded-md font-mono","bg-accent text-foreground","hover:bg-accent-glow","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50"),children:o?"Saving...":"Save"}),S.jsx("button",{type:"button",onClick:O,className:Fe("text-xs px-3 py-1.5 rounded-md font-mono","bg-muted text-muted-foreground","hover:bg-danger/20 hover:text-danger","transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50"),children:"Close"})]})]}),S.jsx("div",{className:"flex-1 overflow-auto",children:S.jsx(a4,{value:r,onChange:p,theme:o4,extensions:[jte({base:Jf}),_],height:"calc(100vh - 56px)",basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0,bracketMatching:!0,indentOnInput:!0}})})]})}function Wte({phaseId:t,onBack:e}){const{plans:i,context:n,research:r,loading:s,error:o,refetch:l}=WZ(t),[c,u]=q.useState(null),[d,p]=q.useState(""),g=i.length>0?i[0].frontmatter.phase??t:t,O=q.useCallback(async x=>{try{const k=x.replace(/^\.planning[\\/]/,"").split(/[\\/]/),T=await fetch(`/api/plan/${k.join("/")}`);if(!T.ok)return;const A=await T.json();p(A.content),u(x)}catch(w){console.error("[phase-detail]",w)}},[]),_=q.useCallback(async x=>{if(!c)return;const k=c.replace(/^\.planning[\\/]/,"").split(/[\\/]/);if(!(await fetch(`/api/plan/${k.join("/")}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})})).ok)throw new Error("Failed to save plan")},[c]),b=q.useCallback(()=>{u(null),p(""),l()},[l]);return S.jsxs("div",{className:"space-y-6",children:[S.jsxs("button",{type:"button",onClick:e,className:Fe("flex items-center gap-2 font-mono text-[10px] uppercase tracking-widest text-muted-foreground","hover:text-foreground transition-colors"),children:[S.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M10 3L5 8l5 5"})}),"Overview"]}),S.jsxs("div",{className:"border-b border-border pb-4",children:[S.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[S.jsxs("span",{className:"font-mono text-xs font-bold text-accent uppercase tracking-widest",children:["Phase ",t]}),S.jsx("h2",{className:"text-lg font-semibold tracking-tight text-foreground",children:g})]}),S.jsxs("div",{className:"flex gap-2",children:[n&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-success/30 text-success",children:"Context"}),r&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-success/30 text-success",children:"Research"}),!n&&!r&&!s&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-border text-muted-foreground",children:"No context"})]})]}),o&&S.jsx("div",{className:"border border-danger/30 p-4 text-danger text-sm font-mono text-xs",children:o}),s&&i.length===0&&S.jsx("div",{className:"space-y-3",children:[1,2,3].map(x=>S.jsxs("div",{className:"border border-border p-4 animate-pulse",children:[S.jsx("div",{className:"h-4 w-24 bg-muted mb-3"}),S.jsx("div",{className:"h-3 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-3 w-1/2 bg-muted"})]},x))}),!s&&!o&&i.length===0&&S.jsx("div",{className:"border border-border p-8 text-center",children:S.jsxs("p",{className:"font-mono text-xs text-muted-foreground",children:["No plans yet — run"," ",S.jsx("code",{className:"text-accent",children:"/maxsim:plan-phase"})]})}),i.length>0&&S.jsx("div",{className:"space-y-3",children:i.map(x=>S.jsx(YZ,{plan:x,onEdit:O},x.path))}),c&&S.jsx(qte,{initialContent:d,filePath:c,onSave:_,onClose:b})]})}function Ute(){const{lastChange:t}=sd(),[e,i]=q.useState([]),[n,r]=q.useState([]),[s,o]=q.useState(!0),[l,c]=q.useState(null),[u,d]=q.useState(""),[p,g]=q.useState(!1),[O,_]=q.useState(!1),b=q.useCallback(async()=>{try{c(null);const k=await fetch("/api/todos");if(!k.ok)throw new Error(`Failed to fetch todos: ${k.status}`);const T=await k.json();i(T.pending),r(T.completed)}catch(k){c(k instanceof Error?k.message:"Failed to fetch todos")}finally{o(!1)}},[]);q.useEffect(()=>{b()},[b]),q.useEffect(()=>{t>0&&b()},[t,b]);const x=q.useCallback(async()=>{const k=u.trim();if(k){g(!0);try{if(!(await fetch("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:k})})).ok)throw new Error("Failed to create todo");d(""),await b()}catch(T){c(T instanceof Error?T.message:"Failed to create todo")}finally{g(!1)}}},[u,b]),w=q.useCallback(async(k,T)=>{try{if(!(await fetch("/api/todos",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:k,completed:T})})).ok)throw new Error("Failed to update todo");await b()}catch(A){c(A instanceof Error?A.message:"Failed to update todo")}},[b]);return S.jsxs("div",{className:"space-y-6",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"font-mono text-xs uppercase tracking-widest text-foreground",children:"Todos"}),S.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[e.length," pending"]})]}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("input",{type:"text",value:u,onChange:k=>d(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!p&&x()},placeholder:"Add a new todo...",className:"flex-1 border border-border bg-card px-3 py-2 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),S.jsx("button",{type:"button",onClick:x,disabled:p||!u.trim(),className:Fe("bg-accent px-4 py-2 font-mono text-[10px] uppercase tracking-widest text-foreground transition-colors","hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed"),children:"Add"})]}),l&&S.jsx("div",{className:"border border-danger/30 px-3 py-2 font-mono text-xs text-danger",children:l}),s&&S.jsx("div",{className:"space-y-px",children:[1,2,3].map(k=>S.jsxs("div",{className:"flex items-center gap-3 bg-card px-4 py-3",children:[S.jsx("div",{className:"h-3 w-3 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-48 animate-pulse bg-muted"})]},k))}),!s&&S.jsx("div",{className:"space-y-1",children:e.length===0?S.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"No pending todos"}):e.map(k=>S.jsxs("button",{type:"button",onClick:()=>w(k.file,!0),className:"group flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-card-hover border-b border-border",children:[S.jsx("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center border border-muted-foreground transition-colors group-hover:border-accent"}),S.jsx("span",{className:"text-sm text-foreground",children:k.text})]},k.file))}),!s&&n.length>0&&S.jsxs("div",{className:"border-t border-border pt-4",children:[S.jsxs("button",{type:"button",onClick:()=>_(!O),className:"flex w-full items-center gap-2 text-left",children:[S.jsx("svg",{className:Fe("h-3 w-3 text-muted-foreground transition-transform",O&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:S.jsx("path",{d:"M4 2l5 4-5 4z"})}),S.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Completed (",n.length,")"]})]}),O&&S.jsx("div",{className:"mt-2 space-y-1",children:n.map(k=>S.jsxs("button",{type:"button",onClick:()=>w(k.file,!1),className:"group flex w-full items-center gap-3 rounded-sm px-4 py-2 text-left transition-colors hover:bg-card-hover",children:[S.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-success bg-success/20",children:S.jsx("svg",{className:"h-3 w-3 text-success",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M2 6l3 3 5-5"})})}),S.jsx("span",{className:"text-sm text-muted-foreground line-through",children:k.text})]},k.file))})]})]})}function Yte({onEntryAdded:t}){const[e,i]=q.useState(!1),[n,r]=q.useState("decision"),[s,o]=q.useState(""),[l,c]=q.useState(""),[u,d]=q.useState(!1),[p,g]=q.useState(null),[O,_]=q.useState(null),b=q.useCallback(async()=>{const x=l.trim();if(x){d(!0),g(null),_(null);try{if(n==="decision"){const w=await fetch("/api/state/decision",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phase:s.trim()||void 0,text:x})});if(!w.ok){const k=await w.json().catch(()=>({}));throw new Error(k.error||"Could not add decision")}_("Decision added")}else{const w=await fetch("/api/state/blocker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:x})});if(!w.ok){const k=await w.json().catch(()=>({}));throw new Error(k.error||"Could not add blocker")}_("Blocker added")}c(""),o(""),t==null||t(),setTimeout(()=>_(null),2e3)}catch(w){g(w instanceof Error?w.message:"Failed to update STATE.md")}finally{d(!1)}}},[n,s,l,t]);return S.jsxs("div",{className:"border-t border-border pt-4",children:[S.jsxs("button",{type:"button",onClick:()=>i(!e),className:"flex w-full items-center gap-2 text-left",children:[S.jsx("svg",{className:Fe("h-3 w-3 text-muted-foreground transition-transform",e&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:S.jsx("path",{d:"M4 2l5 4-5 4z"})}),S.jsx("span",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Add to STATE.md"})]}),e&&S.jsxs("div",{className:"mt-3 space-y-3",children:[S.jsxs("div",{className:"flex gap-1",children:[S.jsx("button",{type:"button",onClick:()=>r("decision"),className:Fe("rounded-sm px-3 py-1 font-mono text-xs transition-colors",n==="decision"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"),children:"Decision"}),S.jsx("button",{type:"button",onClick:()=>r("blocker"),className:Fe("rounded-sm px-3 py-1 font-mono text-xs transition-colors",n==="blocker"?"bg-danger/20 text-danger":"text-muted-foreground hover:text-foreground"),children:"Blocker"})]}),n==="decision"&&S.jsx("input",{type:"text",value:s,onChange:x=>o(x.target.value),placeholder:"Phase (e.g. 13-06)",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),S.jsx("input",{type:"text",value:l,onChange:x=>c(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!u&&b()},placeholder:n==="decision"?"Decision text...":"Blocker description...",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),S.jsx("button",{type:"button",onClick:b,disabled:u||!l.trim(),className:Fe("rounded-sm px-3 py-1.5 font-mono text-xs font-semibold transition-colors","disabled:opacity-40 disabled:cursor-not-allowed",n==="decision"?"bg-accent/20 text-accent hover:bg-accent/30":"bg-danger/20 text-danger hover:bg-danger/30"),children:u?"Saving...":`Add ${n==="decision"?"Decision":"Blocker"}`}),p&&S.jsx("p",{className:"text-xs text-danger",children:p}),O&&S.jsx("p",{className:"text-xs text-success",children:O})]})]})}function Hte(t){return t.map(e=>({text:e.replace(/~~(.+)~~/,"$1").replace(/\s*RESOLVED.*$/i,"").trim(),resolved:e.includes("RESOLVED")||e.startsWith("~~")&&e.endsWith("~~")}))}function Fte(){const{state:t}=Pl(),[e,i]=q.useState(!1),[n,r]=q.useState(null),[s,o]=q.useState(null),[l,c]=q.useState(0),u=Hte((t==null?void 0:t.blockers)??[]),d=u.filter(_=>!_.resolved),p=u.filter(_=>_.resolved),g=q.useCallback(async _=>{r(_),o(null);try{if(!(await fetch("/api/state",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({field:"blockers",value:`~~${_}~~ RESOLVED`})})).ok)throw new Error("Failed to resolve blocker");c(x=>x+1)}catch(b){o(b instanceof Error?b.message:"Failed to resolve blocker")}finally{r(null)}},[]),O=q.useCallback(()=>{c(_=>_+1)},[]);return S.jsxs("div",{className:"space-y-6",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"font-mono text-xs uppercase tracking-widest text-foreground",children:"Blockers"}),S.jsx("span",{className:Fe("font-mono text-xs",d.length>0?"text-danger":"text-success"),children:d.length>0?`${d.length} active`:"No active blockers"})]}),s&&S.jsx("div",{className:"border border-danger/30 px-3 py-2 font-mono text-xs text-danger",children:s}),d.length===0?S.jsx("div",{className:"border border-success/20 px-4 py-6 text-center",children:S.jsx("p",{className:"font-mono text-xs text-success",children:"No active blockers"})}):S.jsx("div",{className:"border border-border divide-y divide-border",children:d.map(_=>S.jsxs("div",{className:"flex items-start gap-3 bg-card px-4 py-3",children:[S.jsx("span",{className:"mt-1.5 inline-block h-1.5 w-1.5 shrink-0 bg-danger"}),S.jsx("div",{className:"flex-1",children:S.jsx("p",{className:"text-sm text-foreground",children:_.text})}),S.jsx("button",{type:"button",onClick:()=>g(_.text),disabled:n===_.text,className:Fe("shrink-0 border border-success/30 px-3 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors","text-success hover:bg-success/10","disabled:opacity-30 disabled:cursor-not-allowed"),children:n===_.text?"...":"Resolve"})]},_.text))}),p.length>0&&S.jsxs("div",{className:"border-t border-border pt-4",children:[S.jsxs("button",{type:"button",onClick:()=>i(!e),className:"flex w-full items-center gap-2 text-left",children:[S.jsx("svg",{className:Fe("h-3 w-3 text-muted-foreground transition-transform",e&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:S.jsx("path",{d:"M4 2l5 4-5 4z"})}),S.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Resolved (",p.length,")"]})]}),e&&S.jsx("div",{className:"mt-2 space-y-1",children:p.map(_=>S.jsxs("div",{className:"flex items-center gap-3 rounded-sm px-4 py-2",children:[S.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 bg-muted"}),S.jsx("p",{className:"text-sm text-muted-foreground line-through",children:_.text})]},_.text))})]}),S.jsx(Yte,{onEntryAdded:O})]},l)}function Gte({sidebar:t,children:e,mobileMenuOpen:i=!1,onMobileMenuToggle:n,onMobileMenuClose:r,headerRight:s,simpleMode:o=!1}){return S.jsxs("div",{className:"flex h-screen flex-col overflow-hidden md:flex-row",children:[S.jsxs("div",{className:Fe("flex shrink-0 items-center justify-between border-b bg-card px-4 py-3 md:hidden",o?"border-simple-accent/30 bg-simple-accent/5":"border-border"),children:[S.jsxs("span",{className:"text-sm font-bold tracking-tight text-foreground",children:["MAXSIM",S.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground",children:"Dashboard"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[s,S.jsx("button",{type:"button",onClick:n,className:"flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground","aria-label":"Toggle menu",children:i?S.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M3 3l10 10M13 3L3 13"})}):S.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M2 4h12M2 8h12M2 12h12"})})})]})]}),i&&S.jsxs("div",{className:"fixed inset-0 z-50 md:hidden",children:[S.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:r}),S.jsx("div",{className:"absolute left-0 top-0 h-full w-64",children:t})]}),S.jsx("div",{className:"hidden shrink-0 md:flex",children:t}),S.jsxs("main",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[o&&S.jsxs("div",{className:"hidden md:flex shrink-0 items-center justify-between border-b border-simple-accent/30 bg-simple-accent/5 px-6 py-3",children:[S.jsxs("span",{className:"text-sm font-bold tracking-tight text-foreground",children:["MAXSIM ",S.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground",children:"Simple Mode"})]}),s]}),e]})]})}var Sc={},hy,pP;function Kte(){return pP||(pP=1,hy=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),hy}var uy={},ia={},mP;function Ll(){if(mP)return ia;mP=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ia.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},ia.getSymbolTotalCodewords=function(n){return e[n]},ia.getBCHDigit=function(i){let n=0;for(;i!==0;)n++,i>>>=1;return n},ia.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');t=n},ia.isKanjiModeEnabled=function(){return typeof t<"u"},ia.toSJIS=function(n){return t(n)},ia}var fy={},gP;function Ew(){return gP||(gP=1,(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+i)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,r){if(t.isValid(n))return n;try{return e(n)}catch{return r}}})(fy)),fy}var dy,OP;function Jte(){if(OP)return dy;OP=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const i=Math.floor(e/8);return(this.buffer[i]>>>7-e%8&1)===1},put:function(e,i){for(let n=0;n<i;n++)this.putBit((e>>>i-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),e&&(this.buffer[i]|=128>>>this.length%8),this.length++}},dy=t,dy}var py,vP;function eie(){if(vP)return py;vP=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,i,n,r){const s=e*this.size+i;this.data[s]=n,r&&(this.reservedBit[s]=!0)},t.prototype.get=function(e,i){return this.data[e*this.size+i]},t.prototype.xor=function(e,i,n){this.data[e*this.size+i]^=n},t.prototype.isReserved=function(e,i){return this.reservedBit[e*this.size+i]},py=t,py}var my={},_P;function tie(){return _P||(_P=1,(function(t){const e=Ll().getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const r=Math.floor(n/7)+2,s=e(n),o=s===145?26:Math.ceil((s-13)/(2*r-2))*2,l=[s-7];for(let c=1;c<r-1;c++)l[c]=l[c-1]-o;return l.push(6),l.reverse()},t.getPositions=function(n){const r=[],s=t.getRowColCoords(n),o=s.length;for(let l=0;l<o;l++)for(let c=0;c<o;c++)l===0&&c===0||l===0&&c===o-1||l===o-1&&c===0||r.push([s[l],s[c]]);return r}})(my)),my}var gy={},yP;function iie(){if(yP)return gy;yP=1;const t=Ll().getSymbolSize,e=7;return gy.getPositions=function(n){const r=t(n);return[[0,0],[r-e,0],[0,r-e]]},gy}var Oy={},bP;function nie(){return bP||(bP=1,(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const s=r.size;let o=0,l=0,c=0,u=null,d=null;for(let p=0;p<s;p++){l=c=0,u=d=null;for(let g=0;g<s;g++){let O=r.get(p,g);O===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=O,l=1),O=r.get(g,p),O===d?c++:(c>=5&&(o+=e.N1+(c-5)),d=O,c=1)}l>=5&&(o+=e.N1+(l-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(r){const s=r.size;let o=0;for(let l=0;l<s-1;l++)for(let c=0;c<s-1;c++){const u=r.get(l,c)+r.get(l,c+1)+r.get(l+1,c)+r.get(l+1,c+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(r){const s=r.size;let o=0,l=0,c=0;for(let u=0;u<s;u++){l=c=0;for(let d=0;d<s;d++)l=l<<1&2047|r.get(u,d),d>=10&&(l===1488||l===93)&&o++,c=c<<1&2047|r.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*e.N3},t.getPenaltyN4=function(r){let s=0;const o=r.data.length;for(let c=0;c<o;c++)s+=r.data[c];return Math.abs(Math.ceil(s*100/o/5)-10)*e.N4};function i(n,r,s){switch(n){case t.Patterns.PATTERN000:return(r+s)%2===0;case t.Patterns.PATTERN001:return r%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(r+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return r*s%2+r*s%3===0;case t.Patterns.PATTERN110:return(r*s%2+r*s%3)%2===0;case t.Patterns.PATTERN111:return(r*s%3+(r+s)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(r,s){const o=s.size;for(let l=0;l<o;l++)for(let c=0;c<o;c++)s.isReserved(c,l)||s.xor(c,l,i(r,c,l))},t.getBestMask=function(r,s){const o=Object.keys(t.Patterns).length;let l=0,c=1/0;for(let u=0;u<o;u++){s(u),t.applyMask(u,r);const d=t.getPenaltyN1(r)+t.getPenaltyN2(r)+t.getPenaltyN3(r)+t.getPenaltyN4(r);t.applyMask(u,r),d<c&&(c=d,l=u)}return l}})(Oy)),Oy}var bm={},SP;function v6(){if(SP)return bm;SP=1;const t=Ew(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return bm.getBlocksCount=function(r,s){switch(s){case t.L:return e[(r-1)*4+0];case t.M:return e[(r-1)*4+1];case t.Q:return e[(r-1)*4+2];case t.H:return e[(r-1)*4+3];default:return}},bm.getTotalCodewordsCount=function(r,s){switch(s){case t.L:return i[(r-1)*4+0];case t.M:return i[(r-1)*4+1];case t.Q:return i[(r-1)*4+2];case t.H:return i[(r-1)*4+3];default:return}},bm}var vy={},Qu={},xP;function rie(){if(xP)return Qu;xP=1;const t=new Uint8Array(512),e=new Uint8Array(256);return(function(){let n=1;for(let r=0;r<255;r++)t[r]=n,e[n]=r,n<<=1,n&256&&(n^=285);for(let r=255;r<512;r++)t[r]=t[r-255]})(),Qu.log=function(n){if(n<1)throw new Error("log("+n+")");return e[n]},Qu.exp=function(n){return t[n]},Qu.mul=function(n,r){return n===0||r===0?0:t[e[n]+e[r]]},Qu}var wP;function sie(){return wP||(wP=1,(function(t){const e=rie();t.mul=function(n,r){const s=new Uint8Array(n.length+r.length-1);for(let o=0;o<n.length;o++)for(let l=0;l<r.length;l++)s[o+l]^=e.mul(n[o],r[l]);return s},t.mod=function(n,r){let s=new Uint8Array(n);for(;s.length-r.length>=0;){const o=s[0];for(let c=0;c<r.length;c++)s[c]^=e.mul(r[c],o);let l=0;for(;l<s.length&&s[l]===0;)l++;s=s.slice(l)}return s},t.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let s=0;s<n;s++)r=t.mul(r,new Uint8Array([1,e.exp(s)]));return r}})(vy)),vy}var _y,CP;function oie(){if(CP)return _y;CP=1;const t=sie();function e(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(n.length+this.degree);r.set(n);const s=t.mod(r,this.genPoly),o=this.degree-s.length;if(o>0){const l=new Uint8Array(this.degree);return l.set(s,o),l}return s},_y=e,_y}var yy={},by={},Sy={},kP;function _6(){return kP||(kP=1,Sy.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),Sy}var as={},TP;function y6(){if(TP)return as;TP=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
|
|
87
|
+
]))+`;as.KANJI=new RegExp(i,"g"),as.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),as.BYTE=new RegExp(n,"g"),as.NUMERIC=new RegExp(t,"g"),as.ALPHANUMERIC=new RegExp(e,"g");const r=new RegExp("^"+i+"$"),s=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return as.testKanji=function(c){return r.test(c)},as.testNumeric=function(c){return s.test(c)},as.testAlphanumeric=function(c){return o.test(c)},as}var AP;function Dl(){return AP||(AP=1,(function(t){const e=_6(),i=y6();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return i.testNumeric(s)?t.NUMERIC:i.testAlphanumeric(s)?t.ALPHANUMERIC:i.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function n(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+r)}}t.from=function(s,o){if(t.isValid(s))return s;try{return n(s)}catch{return o}}})(by)),by}var EP;function aie(){return EP||(EP=1,(function(t){const e=Ll(),i=v6(),n=Ew(),r=Dl(),s=_6(),o=7973,l=e.getBCHDigit(o);function c(g,O,_){for(let b=1;b<=40;b++)if(O<=t.getCapacity(b,_,g))return b}function u(g,O){return r.getCharCountIndicator(g,O)+4}function d(g,O){let _=0;return g.forEach(function(b){const x=u(b.mode,O);_+=x+b.getBitsLength()}),_}function p(g,O){for(let _=1;_<=40;_++)if(d(g,_)<=t.getCapacity(_,O,r.MIXED))return _}t.from=function(O,_){return s.isValid(O)?parseInt(O,10):_},t.getCapacity=function(O,_,b){if(!s.isValid(O))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=r.BYTE);const x=e.getSymbolTotalCodewords(O),w=i.getTotalCodewordsCount(O,_),k=(x-w)*8;if(b===r.MIXED)return k;const T=k-u(b,O);switch(b){case r.NUMERIC:return Math.floor(T/10*3);case r.ALPHANUMERIC:return Math.floor(T/11*2);case r.KANJI:return Math.floor(T/13);case r.BYTE:default:return Math.floor(T/8)}},t.getBestVersionForData=function(O,_){let b;const x=n.from(_,n.M);if(Array.isArray(O)){if(O.length>1)return p(O,x);if(O.length===0)return 1;b=O[0]}else b=O;return c(b.mode,b.getLength(),x)},t.getEncodedBits=function(O){if(!s.isValid(O)||O<7)throw new Error("Invalid QR Code version");let _=O<<12;for(;e.getBCHDigit(_)-l>=0;)_^=o<<e.getBCHDigit(_)-l;return O<<12|_}})(yy)),yy}var xy={},MP;function lie(){if(MP)return xy;MP=1;const t=Ll(),e=1335,i=21522,n=t.getBCHDigit(e);return xy.getEncodedBits=function(s,o){const l=s.bit<<3|o;let c=l<<10;for(;t.getBCHDigit(c)-n>=0;)c^=e<<t.getBCHDigit(c)-n;return(l<<10|c)^i},xy}var wy={},Cy,PP;function cie(){if(PP)return Cy;PP=1;const t=Dl();function e(i){this.mode=t.NUMERIC,this.data=i.toString()}return e.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){let r,s,o;for(r=0;r+3<=this.data.length;r+=3)s=this.data.substr(r,3),o=parseInt(s,10),n.put(o,10);const l=this.data.length-r;l>0&&(s=this.data.substr(r),o=parseInt(s,10),n.put(o,l*3+1))},Cy=e,Cy}var ky,RP;function hie(){if(RP)return ky;RP=1;const t=Dl(),e=["0","1","2","3","4","5","6","7","8","9","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"," ","$","%","*","+","-",".","/",":"];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}return i.getBitsLength=function(r){return 11*Math.floor(r/2)+6*(r%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){let s;for(s=0;s+2<=this.data.length;s+=2){let o=e.indexOf(this.data[s])*45;o+=e.indexOf(this.data[s+1]),r.put(o,11)}this.data.length%2&&r.put(e.indexOf(this.data[s]),6)},ky=i,ky}var Ty,QP;function uie(){if(QP)return Ty;QP=1;const t=Dl();function e(i){this.mode=t.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return e.getBitsLength=function(n){return n*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){for(let n=0,r=this.data.length;n<r;n++)i.put(this.data[n],8)},Ty=e,Ty}var Ay,LP;function fie(){if(LP)return Ay;LP=1;const t=Dl(),e=Ll();function i(n){this.mode=t.KANJI,this.data=n}return i.getBitsLength=function(r){return r*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(n){let r;for(r=0;r<this.data.length;r++){let s=e.toSJIS(this.data[r]);if(s>=33088&&s<=40956)s-=33088;else if(s>=57408&&s<=60351)s-=49472;else throw new Error("Invalid SJIS character: "+this.data[r]+`
|
|
88
|
+
Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),n.put(s,13)}},Ay=i,Ay}var Ey={exports:{}},DP;function die(){return DP||(DP=1,(function(t){var e={single_source_shortest_paths:function(i,n,r){var s={},o={};o[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var c,u,d,p,g,O,_,b,x;!l.empty();){c=l.pop(),u=c.value,p=c.cost,g=i[u]||{};for(d in g)g.hasOwnProperty(d)&&(O=g[d],_=p+O,b=o[d],x=typeof o[d]>"u",(x||b>_)&&(o[d]=_,l.push(d,_),s[d]=u))}if(typeof r<"u"&&typeof o[r]>"u"){var w=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(w)}return s},extract_shortest_path_from_predecessor_list:function(i,n){for(var r=[],s=n;s;)r.push(s),i[s],s=i[s];return r.reverse(),r},find_path:function(i,n,r){var s=e.single_source_shortest_paths(i,n,r);return e.extract_shortest_path_from_predecessor_list(s,r)},PriorityQueue:{make:function(i){var n=e.PriorityQueue,r={},s;i=i||{};for(s in n)n.hasOwnProperty(s)&&(r[s]=n[s]);return r.queue=[],r.sorter=i.sorter||n.default_sorter,r},default_sorter:function(i,n){return i.cost-n.cost},push:function(i,n){var r={value:i,cost:n};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Ey)),Ey.exports}var BP;function pie(){return BP||(BP=1,(function(t){const e=Dl(),i=cie(),n=hie(),r=uie(),s=fie(),o=y6(),l=Ll(),c=die();function u(w){return unescape(encodeURIComponent(w)).length}function d(w,k,T){const A=[];let L;for(;(L=w.exec(T))!==null;)A.push({data:L[0],index:L.index,mode:k,length:L[0].length});return A}function p(w){const k=d(o.NUMERIC,e.NUMERIC,w),T=d(o.ALPHANUMERIC,e.ALPHANUMERIC,w);let A,L;return l.isKanjiModeEnabled()?(A=d(o.BYTE,e.BYTE,w),L=d(o.KANJI,e.KANJI,w)):(A=d(o.BYTE_KANJI,e.BYTE,w),L=[]),k.concat(T,A,L).sort(function(N,z){return N.index-z.index}).map(function(N){return{data:N.data,mode:N.mode,length:N.length}})}function g(w,k){switch(k){case e.NUMERIC:return i.getBitsLength(w);case e.ALPHANUMERIC:return n.getBitsLength(w);case e.KANJI:return s.getBitsLength(w);case e.BYTE:return r.getBitsLength(w)}}function O(w){return w.reduce(function(k,T){const A=k.length-1>=0?k[k.length-1]:null;return A&&A.mode===T.mode?(k[k.length-1].data+=T.data,k):(k.push(T),k)},[])}function _(w){const k=[];for(let T=0;T<w.length;T++){const A=w[T];switch(A.mode){case e.NUMERIC:k.push([A,{data:A.data,mode:e.ALPHANUMERIC,length:A.length},{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.ALPHANUMERIC:k.push([A,{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.KANJI:k.push([A,{data:A.data,mode:e.BYTE,length:u(A.data)}]);break;case e.BYTE:k.push([{data:A.data,mode:e.BYTE,length:u(A.data)}])}}return k}function b(w,k){const T={},A={start:{}};let L=["start"];for(let E=0;E<w.length;E++){const N=w[E],z=[];for(let Z=0;Z<N.length;Z++){const J=N[Z],U=""+E+Z;z.push(U),T[U]={node:J,lastCount:0},A[U]={};for(let R=0;R<L.length;R++){const B=L[R];T[B]&&T[B].node.mode===J.mode?(A[B][U]=g(T[B].lastCount+J.length,J.mode)-g(T[B].lastCount,J.mode),T[B].lastCount+=J.length):(T[B]&&(T[B].lastCount=J.length),A[B][U]=g(J.length,J.mode)+4+e.getCharCountIndicator(J.mode,k))}}L=z}for(let E=0;E<L.length;E++)A[L[E]].end=0;return{map:A,table:T}}function x(w,k){let T;const A=e.getBestModeForData(w);if(T=e.from(k,A),T!==e.BYTE&&T.bit<A.bit)throw new Error('"'+w+'" cannot be encoded with mode '+e.toString(T)+`.
|
|
89
|
+
Suggested mode is: `+e.toString(A));switch(T===e.KANJI&&!l.isKanjiModeEnabled()&&(T=e.BYTE),T){case e.NUMERIC:return new i(w);case e.ALPHANUMERIC:return new n(w);case e.KANJI:return new s(w);case e.BYTE:return new r(w)}}t.fromArray=function(k){return k.reduce(function(T,A){return typeof A=="string"?T.push(x(A,null)):A.data&&T.push(x(A.data,A.mode)),T},[])},t.fromString=function(k,T){const A=p(k,l.isKanjiModeEnabled()),L=_(A),E=b(L,T),N=c.find_path(E.map,"start","end"),z=[];for(let Z=1;Z<N.length-1;Z++)z.push(E.table[N[Z]].node);return t.fromArray(O(z))},t.rawSplit=function(k){return t.fromArray(p(k,l.isKanjiModeEnabled()))}})(wy)),wy}var $P;function mie(){if($P)return uy;$P=1;const t=Ll(),e=Ew(),i=Jte(),n=eie(),r=tie(),s=iie(),o=nie(),l=v6(),c=oie(),u=aie(),d=lie(),p=Dl(),g=pie();function O(E,N){const z=E.size,Z=s.getPositions(N);for(let J=0;J<Z.length;J++){const U=Z[J][0],R=Z[J][1];for(let B=-1;B<=7;B++)if(!(U+B<=-1||z<=U+B))for(let D=-1;D<=7;D++)R+D<=-1||z<=R+D||(B>=0&&B<=6&&(D===0||D===6)||D>=0&&D<=6&&(B===0||B===6)||B>=2&&B<=4&&D>=2&&D<=4?E.set(U+B,R+D,!0,!0):E.set(U+B,R+D,!1,!0))}}function _(E){const N=E.size;for(let z=8;z<N-8;z++){const Z=z%2===0;E.set(z,6,Z,!0),E.set(6,z,Z,!0)}}function b(E,N){const z=r.getPositions(N);for(let Z=0;Z<z.length;Z++){const J=z[Z][0],U=z[Z][1];for(let R=-2;R<=2;R++)for(let B=-2;B<=2;B++)R===-2||R===2||B===-2||B===2||R===0&&B===0?E.set(J+R,U+B,!0,!0):E.set(J+R,U+B,!1,!0)}}function x(E,N){const z=E.size,Z=u.getEncodedBits(N);let J,U,R;for(let B=0;B<18;B++)J=Math.floor(B/3),U=B%3+z-8-3,R=(Z>>B&1)===1,E.set(J,U,R,!0),E.set(U,J,R,!0)}function w(E,N,z){const Z=E.size,J=d.getEncodedBits(N,z);let U,R;for(U=0;U<15;U++)R=(J>>U&1)===1,U<6?E.set(U,8,R,!0):U<8?E.set(U+1,8,R,!0):E.set(Z-15+U,8,R,!0),U<8?E.set(8,Z-U-1,R,!0):U<9?E.set(8,15-U-1+1,R,!0):E.set(8,15-U-1,R,!0);E.set(Z-8,8,1,!0)}function k(E,N){const z=E.size;let Z=-1,J=z-1,U=7,R=0;for(let B=z-1;B>0;B-=2)for(B===6&&B--;;){for(let D=0;D<2;D++)if(!E.isReserved(J,B-D)){let j=!1;R<N.length&&(j=(N[R]>>>U&1)===1),E.set(J,B-D,j),U--,U===-1&&(R++,U=7)}if(J+=Z,J<0||z<=J){J-=Z,Z=-Z;break}}}function T(E,N,z){const Z=new i;z.forEach(function(D){Z.put(D.mode.bit,4),Z.put(D.getLength(),p.getCharCountIndicator(D.mode,E)),D.write(Z)});const J=t.getSymbolTotalCodewords(E),U=l.getTotalCodewordsCount(E,N),R=(J-U)*8;for(Z.getLengthInBits()+4<=R&&Z.put(0,4);Z.getLengthInBits()%8!==0;)Z.putBit(0);const B=(R-Z.getLengthInBits())/8;for(let D=0;D<B;D++)Z.put(D%2?17:236,8);return A(Z,E,N)}function A(E,N,z){const Z=t.getSymbolTotalCodewords(N),J=l.getTotalCodewordsCount(N,z),U=Z-J,R=l.getBlocksCount(N,z),B=Z%R,D=R-B,j=Math.floor(Z/R),$=Math.floor(U/R),X=$+1,H=j-$,F=new c(H);let M=0;const I=new Array(R),K=new Array(R);let Q=0;const ue=new Uint8Array(E.buffer);for(let ye=0;ye<R;ye++){const nt=ye<D?$:X;I[ye]=ue.slice(M,M+nt),K[ye]=F.encode(I[ye]),M+=nt,Q=Math.max(Q,nt)}const he=new Uint8Array(Z);let fe=0,Oe,Ce;for(Oe=0;Oe<Q;Oe++)for(Ce=0;Ce<R;Ce++)Oe<I[Ce].length&&(he[fe++]=I[Ce][Oe]);for(Oe=0;Oe<H;Oe++)for(Ce=0;Ce<R;Ce++)he[fe++]=K[Ce][Oe];return he}function L(E,N,z,Z){let J;if(Array.isArray(E))J=g.fromArray(E);else if(typeof E=="string"){let j=N;if(!j){const $=g.rawSplit(E);j=u.getBestVersionForData($,z)}J=g.fromString(E,j||40)}else throw new Error("Invalid data");const U=u.getBestVersionForData(J,z);if(!U)throw new Error("The amount of data is too big to be stored in a QR Code");if(!N)N=U;else if(N<U)throw new Error(`
|
|
90
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
91
|
+
Minimum version required to store current data is: `+U+`.
|
|
92
|
+
`);const R=T(N,z,J),B=t.getSymbolSize(N),D=new n(B);return O(D,N),_(D),b(D,N),w(D,z,0),N>=7&&x(D,N),k(D,R),isNaN(Z)&&(Z=o.getBestMask(D,w.bind(null,D,z))),o.applyMask(Z,D),w(D,z,Z),{modules:D,version:N,errorCorrectionLevel:z,maskPattern:Z,segments:J}}return uy.create=function(N,z){if(typeof N>"u"||N==="")throw new Error("No input text");let Z=e.M,J,U;return typeof z<"u"&&(Z=e.from(z.errorCorrectionLevel,e.M),J=u.from(z.version),U=o.from(z.maskPattern),z.toSJISFunc&&t.setToSJISFunction(z.toSJISFunc)),L(N,J,Z,U)},uy}var My={},Py={},zP;function b6(){return zP||(zP=1,(function(t){function e(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let n=i.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+i);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(s){return[s,s]}))),n.length===6&&n.push("F","F");const r=parseInt(n.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const r=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,s=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:s,scale:s?4:o,margin:r,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,r){return r.width&&r.width>=n+r.margin*2?r.width/(n+r.margin*2):r.scale},t.getImageWidth=function(n,r){const s=t.getScale(n,r);return Math.floor((n+r.margin*2)*s)},t.qrToImageData=function(n,r,s){const o=r.modules.size,l=r.modules.data,c=t.getScale(o,s),u=Math.floor((o+s.margin*2)*c),d=s.margin*c,p=[s.color.light,s.color.dark];for(let g=0;g<u;g++)for(let O=0;O<u;O++){let _=(g*u+O)*4,b=s.color.light;if(g>=d&&O>=d&&g<u-d&&O<u-d){const x=Math.floor((g-d)/c),w=Math.floor((O-d)/c);b=p[l[x*o+w]?1:0]}n[_++]=b.r,n[_++]=b.g,n[_++]=b.b,n[_]=b.a}}})(Py)),Py}var NP;function gie(){return NP||(NP=1,(function(t){const e=b6();function i(r,s,o){r.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,o,l){let c=l,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=n()),c=e.getOptions(c);const d=e.getImageWidth(s.modules.size,c),p=u.getContext("2d"),g=p.createImageData(d,d);return e.qrToImageData(g.data,s,c),i(p,u,d),p.putImageData(g,0,0),u},t.renderToDataURL=function(s,o,l){let c=l;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=t.render(s,o,c),d=c.type||"image/png",p=c.rendererOpts||{};return u.toDataURL(d,p.quality)}})(My)),My}var Ry={},jP;function Oie(){if(jP)return Ry;jP=1;const t=b6();function e(r,s){const o=r.a/255,l=s+'="'+r.hex+'"';return o<1?l+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':l}function i(r,s,o){let l=r+s;return typeof o<"u"&&(l+=" "+o),l}function n(r,s,o){let l="",c=0,u=!1,d=0;for(let p=0;p<r.length;p++){const g=Math.floor(p%s),O=Math.floor(p/s);!g&&!u&&(u=!0),r[p]?(d++,p>0&&g>0&&r[p-1]||(l+=u?i("M",g+o,.5+O+o):i("m",c,0),c=0,u=!1),g+1<s&&r[p+1]||(l+=i("h",d),d=0)):c++}return l}return Ry.render=function(s,o,l){const c=t.getOptions(o),u=s.modules.size,d=s.modules.data,p=u+c.margin*2,g=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",O="<path "+e(c.color.dark,"stroke")+' d="'+n(d,u,c.margin)+'"/>',_='viewBox="0 0 '+p+" "+p+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+_+' shape-rendering="crispEdges">'+g+O+`</svg>
|
|
93
|
+
`;return typeof l=="function"&&l(null,x),x},Ry}var IP;function vie(){if(IP)return Sc;IP=1;const t=Kte(),e=mie(),i=gie(),n=Oie();function r(s,o,l,c,u){const d=[].slice.call(arguments,1),p=d.length,g=typeof d[p-1]=="function";if(!g&&!t())throw new Error("Callback required as last argument");if(g){if(p<2)throw new Error("Too few arguments provided");p===2?(u=l,l=o,o=c=void 0):p===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=o,o=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(l=o,o=c=void 0):p===2&&!o.getContext&&(c=l,l=o,o=void 0),new Promise(function(O,_){try{const b=e.create(l,c);O(s(b,o,c))}catch(b){_(b)}})}try{const O=e.create(l,c);u(null,s(O,o,c))}catch(O){u(O)}}return Sc.create=e.create,Sc.toCanvas=r.bind(null,i.render),Sc.toDataURL=r.bind(null,i.renderToDataURL),Sc.toString=r.bind(null,function(s,o,l){return n.render(s,l)}),Sc}var _ie=vie();const VP=WS(_ie);function yie(){const[t,e]=q.useState(null),[i,n]=q.useState(!1),[r,s]=q.useState(null),[o,l]=q.useState(null);q.useEffect(()=>{fetch("/api/server-info").then(p=>p.json()).then(p=>e(p)).catch(()=>{})},[]),q.useEffect(()=>{t!=null&&t.tailscaleUrl&&VP.toDataURL(t.tailscaleUrl,{width:192,margin:2}).then(s).catch(()=>{}),t!=null&&t.networkUrl&&VP.toDataURL(t.networkUrl,{width:192,margin:2}).then(l).catch(()=>{})},[t==null?void 0:t.tailscaleUrl,t==null?void 0:t.networkUrl]);const c=!!(t!=null&&t.tailscaleUrl),u=!!(t!=null&&t.networkUrl),d=c||u;return S.jsxs("div",{className:"relative border-t border-border px-1 py-2",children:[i&&S.jsxs("div",{className:"absolute bottom-full left-2 right-2 mb-2 border border-border bg-card shadow-xl",children:[c&&S.jsxs("div",{className:"p-3",children:[S.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[S.jsx("span",{className:"inline-block h-1.5 w-1.5 bg-success"}),S.jsx("p",{className:"font-mono text-[9px] uppercase tracking-widest text-success",children:"Tailscale — Secure"})]}),S.jsx("p",{className:"mb-3 break-all font-mono text-[11px] text-foreground",children:t.tailscaleUrl}),r&&S.jsx("img",{src:r,alt:"QR code for Tailscale access",width:192,height:192,className:"w-full"}),S.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Only visible to your Tailscale devices"})]}),u&&S.jsxs("div",{className:`p-3 ${c?"border-t border-border":""}`,children:[S.jsx("p",{className:"mb-0.5 font-mono text-[9px] uppercase tracking-widest text-muted-foreground",children:"Local Network"}),S.jsx("p",{className:"mb-3 break-all font-mono text-[11px] text-foreground",children:t.networkUrl}),o&&S.jsx("img",{src:o,alt:"QR code for local network access",width:192,height:192,className:"w-full"}),S.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Anyone on your local network can access this"})]}),!d&&S.jsxs("div",{className:"p-3",children:[S.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[S.jsx("span",{className:"inline-block h-1.5 w-1.5 bg-muted-foreground"}),S.jsx("p",{className:"font-mono text-[9px] uppercase tracking-widest text-muted-foreground",children:"Remote Access"})]}),S.jsx("p",{className:"mb-3 font-mono text-[11px] leading-relaxed text-muted-foreground",children:"Install Tailscale on this device and your phone to securely access the dashboard from anywhere — no port forwarding, no public URLs."}),S.jsx("a",{href:"https://tailscale.com/download",target:"_blank",rel:"noopener noreferrer",className:"block w-full border border-border px-3 py-1.5 text-center font-mono text-[10px] uppercase tracking-widest text-muted-foreground transition-colors hover:border-accent hover:text-accent",children:"Get Tailscale →"}),S.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Free · E2E encrypted · No account sharing"})]})]}),S.jsxs("button",{type:"button",onClick:()=>n(p=>!p),title:c?"Open on another device via Tailscale":u?"Open on another device via local network":"Set up remote access",className:"flex w-full items-center gap-2.5 rounded-sm px-3 py-2 text-left text-sm transition-colors hover:bg-card-hover text-muted-foreground",children:[S.jsx(bie,{active:c}),S.jsx("span",{className:"font-mono text-xs uppercase tracking-wide",children:"Share"}),c&&S.jsx("span",{className:"ml-auto inline-block h-1.5 w-1.5 bg-success"})]})]})}function bie({active:t}){return S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[S.jsx("circle",{cx:"18",cy:"5",r:"3"}),S.jsx("circle",{cx:"6",cy:"12",r:"3"}),S.jsx("circle",{cx:"18",cy:"19",r:"3"}),S.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),S.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}function Sie(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";case"planned":case"researched":case"discussed":return"bg-muted-foreground/50";default:return"bg-muted"}}function xie({activeView:t,activePhaseId:e,onNavigate:i,logoAction:n}){const{roadmap:r,state:s,todos:o}=Pl(),{connected:l}=sd(),[c,u]=q.useState(!1);q.useEffect(()=>{if(!c)return;const b=setTimeout(()=>u(!1),3e3);return()=>clearTimeout(b)},[c]);async function d(){if(!c){u(!0);return}try{await fetch("/api/shutdown",{method:"POST"})}catch{}}const p=((r==null?void 0:r.phases)??[]).map(b=>({number:b.number,name:b.name,goal:b.goal??"",dependsOn:b.depends_on?[b.depends_on]:[],planCount:b.plan_count,summaryCount:b.summary_count,diskStatus:b.disk_status,roadmapComplete:b.roadmap_complete,hasContext:b.has_context,hasResearch:b.has_research})),g=(r==null?void 0:r.current_phase)??null,O=(s==null?void 0:s.blockers.filter(b=>!b.includes("RESOLVED")).length)??0,_=(o==null?void 0:o.pending.length)??0;return S.jsxs("aside",{className:"flex h-full w-56 shrink-0 flex-col border-r border-border bg-card",children:[S.jsxs("div",{className:"border-b border-border px-5 py-4 flex items-center justify-between",children:[S.jsxs("button",{type:"button",onClick:()=>i("overview"),className:"flex flex-col gap-0.5 text-left",children:[S.jsx("span",{className:"text-sm font-bold tracking-tight text-foreground",children:"MAXSIM"}),S.jsx("span",{className:"text-xs text-muted-foreground",children:"Dashboard"})]}),n]}),S.jsxs("div",{className:"flex-1 overflow-y-auto",children:[S.jsxs("div",{className:"flex items-center gap-2 px-5 py-3",children:[S.jsx("span",{className:"block w-4 h-px bg-border"}),S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Phases"})]}),S.jsx("nav",{className:"flex flex-col",children:p.map(b=>{const x=t==="phase"&&e===b.number,w=b.number===g;return S.jsxs("button",{type:"button",onClick:()=>i("phase",b.number),className:Fe("flex w-full items-center gap-2.5 px-5 py-2 text-left transition-colors duration-200",x?"bg-card-hover border-l-2 border-l-accent text-foreground":"border-l-2 border-l-transparent text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsx("span",{className:Fe("inline-block h-1.5 w-1.5 shrink-0",Sie(b.diskStatus))}),S.jsx("span",{className:Fe("font-mono text-xs tabular-nums shrink-0",w||x?"text-accent":""),children:b.number}),S.jsx("span",{className:"truncate text-xs",children:b.name})]},b.number)})})]}),S.jsxs("div",{className:"border-t border-border",children:[S.jsxs("button",{type:"button",onClick:()=>i("todos"),className:Fe("flex w-full items-center justify-between px-5 py-2.5 text-left transition-colors duration-200",t==="todos"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsx("span",{className:"text-sm",children:"Todos"}),_>0&&S.jsx("span",{className:"font-mono text-xs text-warning tabular-nums",children:_})]}),S.jsxs("button",{type:"button",onClick:()=>i("blockers"),className:Fe("flex w-full items-center justify-between border-t border-border px-5 py-2.5 text-left transition-colors duration-200",t==="blockers"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsx("span",{className:"text-sm",children:"Blockers"}),O>0&&S.jsx("span",{className:"font-mono text-xs text-danger tabular-nums",children:O})]})]}),S.jsx("div",{className:"border-t border-border",children:S.jsxs("button",{type:"button",onClick:()=>i("terminal"),className:Fe("flex w-full items-center gap-2 px-5 py-2.5 text-left transition-colors duration-200",t==="terminal"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsxs("span",{className:"font-mono text-xs",children:[">","_"]}),S.jsx("span",{className:"text-sm",children:"Terminal"})]})}),S.jsx(yie,{}),S.jsx("div",{className:"border-t border-border px-5 py-3",children:S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:Fe("inline-block h-1.5 w-1.5",l?"bg-success":"bg-danger")}),S.jsx("span",{className:"text-xs text-muted-foreground",children:l?"Connected":"Disconnected"})]}),S.jsxs("button",{type:"button",onClick:d,title:c?"Click again to confirm shutdown":"Shut down dashboard server",className:Fe("flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors duration-150",c?"bg-danger/15 text-danger hover:bg-danger/25":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"h-3 w-3 shrink-0","aria-hidden":"true",children:[S.jsx("path",{d:"M6 2.5A5.5 5.5 0 1 0 10 3",strokeLinecap:"round"}),S.jsx("path",{d:"M8 1v5",strokeLinecap:"round"})]}),c&&S.jsx("span",{children:"Confirm"})]})]})})]})}/**
|
|
94
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
95
|
+
* @license MIT
|
|
96
|
+
*
|
|
97
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
98
|
+
* @license MIT
|
|
99
|
+
*
|
|
100
|
+
* Originally forked from (with the author's permission):
|
|
101
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
102
|
+
* http://bellard.org/jslinux/
|
|
103
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
104
|
+
*/var S6=Object.defineProperty,wie=Object.getOwnPropertyDescriptor,Cie=(t,e)=>{for(var i in e)S6(t,i,{get:e[i],enumerable:!0})},Ut=(t,e,i,n)=>{for(var r=n>1?void 0:n?wie(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(r=(n?o(e,i,r):o(r))||r);return n&&r&&S6(e,i,r),r},be=(t,e)=>(i,n)=>e(i,n,t),XP="Terminal input",Wb={get:()=>XP,set:t=>XP=t},ZP="Too much output to announce, navigate to rows manually to read",Ub={get:()=>ZP,set:t=>ZP=t};function kie(t){return t.replace(/\r?\n/g,"\r")}function Tie(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function Aie(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function Eie(t,e,i,n){if(t.stopPropagation(),t.clipboardData){let r=t.clipboardData.getData("text/plain");x6(r,e,i,n)}}function x6(t,e,i,n){t=kie(t),t=Tie(t,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function w6(t,e,i){let n=i.getBoundingClientRect(),r=t.clientX-n.left-10,s=t.clientY-n.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${r}px`,e.style.top=`${s}px`,e.style.zIndex="1000",e.focus()}function qP(t,e,i,n,r){w6(t,e,i),r&&n.rightClickSelect(t),e.value=n.selectionText,e.select()}function pa(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function kO(t,e=0,i=t.length){let n="";for(let r=e;r<i;++r){let s=t[r];s>65535?(s-=65536,n+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):n+=String.fromCharCode(s)}return n}var Mie=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let r=0,s=0;if(this._interim){let o=e.charCodeAt(s++);56320<=o&&o<=57343?i[r++]=(this._interim-55296)*1024+o-56320+65536:(i[r++]=this._interim,i[r++]=o),this._interim=0}for(let o=s;o<n;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return this._interim=l,r;let c=e.charCodeAt(o);56320<=c&&c<=57343?i[r++]=(l-55296)*1024+c-56320+65536:(i[r++]=l,i[r++]=c);continue}l!==65279&&(i[r++]=l)}return r}},Pie=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let r=0,s,o,l,c,u=0,d=0;if(this.interim[0]){let O=!1,_=this.interim[0];_&=(_&224)===192?31:(_&240)===224?15:7;let b=0,x;for(;(x=this.interim[++b]&63)&&b<4;)_<<=6,_|=x;let w=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=w-b;for(;d<k;){if(d>=n)return 0;if(x=e[d++],(x&192)!==128){d--,O=!0;break}else this.interim[b++]=x,_<<=6,_|=x&63}O||(w===2?_<128?d--:i[r++]=_:w===3?_<2048||_>=55296&&_<=57343||_===65279||(i[r++]=_):_<65536||_>1114111||(i[r++]=_)),this.interim.fill(0)}let p=n-4,g=d;for(;g<n;){for(;g<p&&!((s=e[g])&128)&&!((o=e[g+1])&128)&&!((l=e[g+2])&128)&&!((c=e[g+3])&128);)i[r++]=s,i[r++]=o,i[r++]=l,i[r++]=c,g+=4;if(s=e[g++],s<128)i[r++]=s;else if((s&224)===192){if(g>=n)return this.interim[0]=s,r;if(o=e[g++],(o&192)!==128){g--;continue}if(u=(s&31)<<6|o&63,u<128){g--;continue}i[r++]=u}else if((s&240)===224){if(g>=n)return this.interim[0]=s,r;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=s,this.interim[1]=o,r;if(l=e[g++],(l&192)!==128){g--;continue}if(u=(s&15)<<12|(o&63)<<6|l&63,u<2048||u>=55296&&u<=57343||u===65279)continue;i[r++]=u}else if((s&248)===240){if(g>=n)return this.interim[0]=s,r;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=s,this.interim[1]=o,r;if(l=e[g++],(l&192)!==128){g--;continue}if(g>=n)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=l,r;if(c=e[g++],(c&192)!==128){g--;continue}if(u=(s&7)<<18|(o&63)<<12|(l&63)<<6|c&63,u<65536||u>1114111)continue;i[r++]=u}}return r}},C6="",va=" ",bd=class k6{constructor(){this.fg=0,this.bg=0,this.extended=new Gg}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new k6;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Gg=class T6{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new T6(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Rr=class A6 extends bd{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Gg,this.combinedData=""}static fromCharData(e){let i=new A6;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?pa(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},WP="di$target",Yb="di$dependencies",Qy=new Map;function Rie(t){return t[Yb]||[]}function $i(t){if(Qy.has(t))return Qy.get(t);let e=function(i,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Qie(e,i,r)};return e._id=t,Qy.set(t,e),e}function Qie(t,e,i){e[WP]===e?e[Yb].push({id:t,index:i}):(e[Yb]=[{id:t,index:i}],e[WP]=e)}var yn=$i("BufferService"),E6=$i("CoreMouseService"),Bl=$i("CoreService"),Lie=$i("CharsetService"),Mw=$i("InstantiationService"),M6=$i("LogService"),bn=$i("OptionsService"),P6=$i("OscLinkService"),Die=$i("UnicodeService"),Sd=$i("DecorationService"),Hb=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,o=new Rr,l=n.getTrimmedLength(),c=-1,u=-1,d=!1;for(let g=0;g<l;g++)if(!(u===-1&&!n.hasContent(g))){if(n.loadCell(g,o),o.hasExtendedAttrs()&&o.extended.urlId)if(u===-1){u=g,c=o.extended.urlId;continue}else d=o.extended.urlId!==c;else u!==-1&&(d=!0);if(d||u!==-1&&g===l-1){let O=(p=this._oscLinkService.getLinkData(c))==null?void 0:p.uri;if(O){let _={start:{x:u+1,y:e},end:{x:g+(!d&&g===l-1?1:0),y:e}},b=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let x=new URL(O);["http:","https:"].includes(x.protocol)||(b=!0)}catch{b=!0}b||r.push({text:O,range:_,activate:(x,w)=>s?s.activate(x,w,_):Bie(x,w),hover:(x,w)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,x,w,_)},leave:(x,w)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,x,w,_)}})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=g,c=o.extended.urlId):(u=-1,c=-1)}}i(r)}};Hb=Ut([be(0,yn),be(1,bn),be(2,P6)],Hb);function Bie(t,e){if(confirm(`Do you want to navigate to ${e}?
|
|
105
|
+
|
|
106
|
+
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var TO=$i("CharSizeService"),xo=$i("CoreBrowserService"),Pw=$i("MouseService"),wo=$i("RenderService"),$ie=$i("SelectionService"),R6=$i("CharacterJoinerService"),wh=$i("ThemeService"),Q6=$i("LinkProviderService"),zie=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?UP.isErrorNoTelemetry(e)?new UP(e.message+`
|
|
107
|
+
|
|
108
|
+
`+e.stack):new Error(e.message+`
|
|
109
|
+
|
|
110
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Nie=new zie;function Jm(t){jie(t)||Nie.onUnexpectedError(t)}var Fb="Canceled";function jie(t){return t instanceof Iie?!0:t instanceof Error&&t.name===Fb&&t.message===Fb}var Iie=class extends Error{constructor(){super(Fb),this.name=this.message}};function Vie(t){return new Error(`Illegal argument: ${t}`)}var UP=class Gb extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Gb)return e;let i=new Gb;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Kb=class L6 extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,L6.prototype)}};function Kn(t,e=0){return t[t.length-(1+e)]}var Xie;(t=>{function e(s){return s<0}t.isLessThan=e;function i(s){return s<=0}t.isLessThanOrEqual=i;function n(s){return s>0}t.isGreaterThan=n;function r(s){return s===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Xie||(Xie={}));function Zie(t,e){let i=this,n=!1,r;return function(){return n||(n=!0,e||(r=t.apply(i,arguments))),r}}var D6;(t=>{function e(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*r(A){yield A}t.single=r;function s(A){return e(A)?A:r(A)}t.wrap=s;function o(A){return A||i}t.from=o;function*l(A){for(let L=A.length-1;L>=0;L--)yield A[L]}t.reverse=l;function c(A){return!A||A[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(A){return A[Symbol.iterator]().next().value}t.first=u;function d(A,L){let E=0;for(let N of A)if(L(N,E++))return!0;return!1}t.some=d;function p(A,L){for(let E of A)if(L(E))return E}t.find=p;function*g(A,L){for(let E of A)L(E)&&(yield E)}t.filter=g;function*O(A,L){let E=0;for(let N of A)yield L(N,E++)}t.map=O;function*_(A,L){let E=0;for(let N of A)yield*L(N,E++)}t.flatMap=_;function*b(...A){for(let L of A)yield*L}t.concat=b;function x(A,L,E){let N=E;for(let z of A)N=L(N,z);return N}t.reduce=x;function*w(A,L,E=A.length){for(L<0&&(L+=A.length),E<0?E+=A.length:E>A.length&&(E=A.length);L<E;L++)yield A[L]}t.slice=w;function k(A,L=Number.POSITIVE_INFINITY){let E=[];if(L===0)return[E,A];let N=A[Symbol.iterator]();for(let z=0;z<L;z++){let Z=N.next();if(Z.done)return[E,t.empty()];E.push(Z.value)}return[E,{[Symbol.iterator](){return N}}]}t.consume=k;async function T(A){let L=[];for await(let E of A)L.push(E);return Promise.resolve(L)}t.asyncToArray=T})(D6||(D6={}));function El(t){if(D6.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function qie(...t){return Bt(()=>El(t))}function Bt(t){return{dispose:Zie(()=>{t()})}}var B6=class $6{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{El(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?$6.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};B6.DISABLE_DISPOSED_WARNING=!1;var ya=B6,We=class{constructor(){this._store=new ya,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};We.None=Object.freeze({dispose(){}});var ph=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var i;this._isDisposed||e===this._value||((i=this._value)==null||i.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},fo=typeof window=="object"?window:globalThis,Jb=class eS{constructor(e){this.element=e,this.next=eS.Undefined,this.prev=eS.Undefined}};Jb.Undefined=new Jb(void 0);var $t=Jb,YP=class{constructor(){this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===$t.Undefined}clear(){let e=this._first;for(;e!==$t.Undefined;){let i=e.next;e.prev=$t.Undefined,e.next=$t.Undefined,e=i}this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new $t(e);if(this._first===$t.Undefined)this._first=n,this._last=n;else if(i){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==$t.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==$t.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==$t.Undefined&&e.next!==$t.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===$t.Undefined&&e.next===$t.Undefined?(this._first=$t.Undefined,this._last=$t.Undefined):e.next===$t.Undefined?(this._last=this._last.prev,this._last.next=$t.Undefined):e.prev===$t.Undefined&&(this._first=this._first.next,this._first.prev=$t.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==$t.Undefined;)yield e.element,e=e.next}},Wie=globalThis.performance&&typeof globalThis.performance.now=="function",Uie=class z6{static create(e){return new z6(e)}constructor(e){this._now=Wie&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Gi;(t=>{t.None=()=>We.None;function e(R,B){return p(R,()=>{},0,void 0,!0,void 0,B)}t.defer=e;function i(R){return(B,D=null,j)=>{let $=!1,X;return X=R(H=>{if(!$)return X?X.dispose():$=!0,B.call(D,H)},null,j),$&&X.dispose(),X}}t.once=i;function n(R,B,D){return u((j,$=null,X)=>R(H=>j.call($,B(H)),null,X),D)}t.map=n;function r(R,B,D){return u((j,$=null,X)=>R(H=>{B(H),j.call($,H)},null,X),D)}t.forEach=r;function s(R,B,D){return u((j,$=null,X)=>R(H=>B(H)&&j.call($,H),null,X),D)}t.filter=s;function o(R){return R}t.signal=o;function l(...R){return(B,D=null,j)=>{let $=qie(...R.map(X=>X(H=>B.call(D,H))));return d($,j)}}t.any=l;function c(R,B,D,j){let $=D;return n(R,X=>($=B($,X),$),j)}t.reduce=c;function u(R,B){let D,j={onWillAddFirstListener(){D=R($.fire,$)},onDidRemoveLastListener(){D==null||D.dispose()}},$=new me(j);return B==null||B.add($),$.event}function d(R,B){return B instanceof Array?B.push(R):B&&B.add(R),R}function p(R,B,D=100,j=!1,$=!1,X,H){let F,M,I,K=0,Q,ue={leakWarningThreshold:X,onWillAddFirstListener(){F=R(fe=>{K++,M=B(M,fe),j&&!I&&(he.fire(M),M=void 0),Q=()=>{let Oe=M;M=void 0,I=void 0,(!j||K>1)&&he.fire(Oe),K=0},typeof D=="number"?(clearTimeout(I),I=setTimeout(Q,D)):I===void 0&&(I=0,queueMicrotask(Q))})},onWillRemoveListener(){$&&K>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,F.dispose()}},he=new me(ue);return H==null||H.add(he),he.event}t.debounce=p;function g(R,B=0,D){return t.debounce(R,(j,$)=>j?(j.push($),j):[$],B,void 0,!0,void 0,D)}t.accumulate=g;function O(R,B=(j,$)=>j===$,D){let j=!0,$;return s(R,X=>{let H=j||!B(X,$);return j=!1,$=X,H},D)}t.latch=O;function _(R,B,D){return[t.filter(R,B,D),t.filter(R,j=>!B(j),D)]}t.split=_;function b(R,B=!1,D=[],j){let $=D.slice(),X=R(M=>{$?$.push(M):F.fire(M)});j&&j.add(X);let H=()=>{$==null||$.forEach(M=>F.fire(M)),$=null},F=new me({onWillAddFirstListener(){X||(X=R(M=>F.fire(M)),j&&j.add(X))},onDidAddFirstListener(){$&&(B?setTimeout(H):H())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return j&&j.add(F),F.event}t.buffer=b;function x(R,B){return(D,j,$)=>{let X=B(new k);return R(function(H){let F=X.evaluate(H);F!==w&&D.call(j,F)},void 0,$)}}t.chain=x;let w=Symbol("HaltChainable");class k{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(D=>(B(D),D)),this}filter(B){return this.steps.push(D=>B(D)?D:w),this}reduce(B,D){let j=D;return this.steps.push($=>(j=B(j,$),j)),this}latch(B=(D,j)=>D===j){let D=!0,j;return this.steps.push($=>{let X=D||!B($,j);return D=!1,j=$,X?$:w}),this}evaluate(B){for(let D of this.steps)if(B=D(B),B===w)break;return B}}function T(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.on(B,j),X=()=>R.removeListener(B,j),H=new me({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromNodeEventEmitter=T;function A(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.addEventListener(B,j),X=()=>R.removeEventListener(B,j),H=new me({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromDOMEventEmitter=A;function L(R){return new Promise(B=>i(R)(B))}t.toPromise=L;function E(R){let B=new me;return R.then(D=>{B.fire(D)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}t.fromPromise=E;function N(R,B){return R(D=>B.fire(D))}t.forward=N;function z(R,B,D){return B(D),R(j=>B(j))}t.runAndSubscribe=z;class Z{constructor(B,D){this._observable=B,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new me(j),D&&D.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,D){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function J(R,B){return new Z(R,B).emitter.event}t.fromObservable=J;function U(R){return(B,D,j)=>{let $=0,X=!1,H={beginUpdate(){$++},endUpdate(){$--,$===0&&(R.reportChanges(),X&&(X=!1,B.call(D)))},handlePossibleChange(){},handleChange(){X=!0}};R.addObserver(H),R.reportChanges();let F={dispose(){R.removeObserver(H)}};return j instanceof ya?j.add(F):Array.isArray(j)&&j.push(F),F}}t.fromObservableLight=U})(Gi||(Gi={}));var tS=class iS{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${iS._idPool++}`,iS.all.add(this)}start(e){this._stopWatch=new Uie,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};tS.all=new Set,tS._idPool=0;var Yie=tS,Hie=-1,N6=class j6{constructor(e,i,n=(j6._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(s);let c=new Kie(l,s);this._errorHandler(c)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,r]of this._stacks)(!e||i<r)&&(e=[n,r],i=r);return e}};N6._idPool=1;var Fie=N6,Gie=class I6{constructor(e){this.value=e}static create(){let e=new Error;return new I6(e.stack??"")}print(){console.warn(this.value.split(`
|
|
111
|
+
`).slice(2).join(`
|
|
112
|
+
`))}},Kie=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},Jie=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},ene=0,Ly=class{constructor(e){this.value=e,this.id=ene++}},tne=2,ine,me=class{constructor(e){var i,n,r,s;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new Fie((e==null?void 0:e.onListenerError)??Jm,((n=this._options)==null?void 0:n.leakWarningThreshold)??Hie):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new Yie(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,i,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||n.call(i),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,i,n)=>{var l,c,u,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let O=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],_=new Jie(`${g}. HINT: Stack shows most frequent listener (${O[1]}-times)`,O[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Jm)(_),We.None}if(this._disposed)return We.None;i&&(e=e.bind(i));let r=new Ly(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Gie.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Ly?(this._deliveryQueue??(this._deliveryQueue=new nne),this._listeners=[this._listeners,r]):this._listeners.push(r):((u=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||u.call(c,this),this._listeners=r,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let o=Bt(()=>{s==null||s(),this._removeListener(r)});return n instanceof ya?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var s,o,l,c;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||c.call(l,this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*tne<=i.length){let u=0;for(let d=0;d<i.length;d++)i[d]?i[u++]=i[d]:r&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=u}}_deliver(e,i){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||Jm;if(!n){e.value(i);return}try{e.value(i)}catch(s){n(s)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){var i,n,r,s;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof Ly)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},nne=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},nS=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new me,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new me,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};nS.INSTANCE=new nS;var Rw=nS;function rne(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}Rw.INSTANCE.onDidChangeZoomLevel;function sne(t){return Rw.INSTANCE.getZoomFactor(t)}Rw.INSTANCE.onDidChangeFullscreen;var Ch=typeof navigator=="object"?navigator.userAgent:"",rS=Ch.indexOf("Firefox")>=0,one=Ch.indexOf("AppleWebKit")>=0,Qw=Ch.indexOf("Chrome")>=0,ane=!Qw&&Ch.indexOf("Safari")>=0;Ch.indexOf("Electron/")>=0;Ch.indexOf("Android")>=0;var Dy=!1;if(typeof fo.matchMedia=="function"){let t=fo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=fo.matchMedia("(display-mode: fullscreen)");Dy=t.matches,rne(fo,t,({matches:i})=>{Dy&&e.matches||(Dy=i)})}var Ic="en",sS=!1,oS=!1,eg=!1,V6=!1,Sm,tg=Ic,HP=Ic,lne,Ir,Sl=globalThis,Ui,FQ;typeof Sl.vscode<"u"&&typeof Sl.vscode.process<"u"?Ui=Sl.vscode.process:typeof process<"u"&&typeof((FQ=process==null?void 0:process.versions)==null?void 0:FQ.node)=="string"&&(Ui=process);var GQ,cne=typeof((GQ=Ui==null?void 0:Ui.versions)==null?void 0:GQ.electron)=="string",hne=cne&&(Ui==null?void 0:Ui.type)==="renderer",KQ;if(typeof Ui=="object"){sS=Ui.platform==="win32",oS=Ui.platform==="darwin",eg=Ui.platform==="linux",eg&&Ui.env.SNAP&&Ui.env.SNAP_REVISION,Ui.env.CI||Ui.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Sm=Ic,tg=Ic;let t=Ui.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Sm=e.userLocale,HP=e.osLocale,tg=e.resolvedLanguage||Ic,lne=(KQ=e.languagePack)==null?void 0:KQ.translationsConfigFile}catch{}V6=!0}else typeof navigator=="object"&&!hne?(Ir=navigator.userAgent,sS=Ir.indexOf("Windows")>=0,oS=Ir.indexOf("Macintosh")>=0,(Ir.indexOf("Macintosh")>=0||Ir.indexOf("iPad")>=0||Ir.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,eg=Ir.indexOf("Linux")>=0,(Ir==null?void 0:Ir.indexOf("Mobi"))>=0,tg=globalThis._VSCODE_NLS_LANGUAGE||Ic,Sm=navigator.language.toLowerCase(),HP=Sm):console.error("Unable to resolve platform.");var X6=sS,Ts=oS,une=eg,FP=V6,Es=Ir,na=tg,fne;(t=>{function e(){return na}t.value=e;function i(){return na.length===2?na==="en":na.length>=3?na[0]==="e"&&na[1]==="n"&&na[2]==="-":!1}t.isDefaultVariant=i;function n(){return na==="en"}t.isDefault=n})(fne||(fne={}));var dne=typeof Sl.postMessage=="function"&&!Sl.importScripts;(()=>{if(dne){let t=[];Sl.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,r=t.length;n<r;n++){let s=t[n];if(s.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),s.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),Sl.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var pne=!!(Es&&Es.indexOf("Chrome")>=0);Es&&Es.indexOf("Firefox")>=0;!pne&&Es&&Es.indexOf("Safari")>=0;Es&&Es.indexOf("Edg/")>=0;Es&&Es.indexOf("Android")>=0;var xc=typeof navigator=="object"?navigator:{};FP||document.queryCommandSupported&&document.queryCommandSupported("copy")||xc&&xc.clipboard&&xc.clipboard.writeText,FP||xc&&xc.clipboard&&xc.clipboard.readText;var Lw=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},By=new Lw,GP=new Lw,KP=new Lw,mne=new Array(230),Z6;(t=>{function e(l){return By.keyCodeToStr(l)}t.toString=e;function i(l){return By.strToKeyCode(l)}t.fromString=i;function n(l){return GP.keyCodeToStr(l)}t.toUserSettingsUS=n;function r(l){return KP.keyCodeToStr(l)}t.toUserSettingsGeneral=r;function s(l){return GP.strToKeyCode(l)||KP.strToKeyCode(l)}t.fromUserSettings=s;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return By.keyCodeToStr(l)}t.toElectronAccelerator=o})(Z6||(Z6={}));var gne=class q6{constructor(e,i,n,r,s){this.ctrlKey=e,this.shiftKey=i,this.altKey=n,this.metaKey=r,this.keyCode=s}equals(e){return e instanceof q6&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${e}${i}${n}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new One([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},One=class{constructor(t){if(t.length===0)throw Vie("chords");this.chords=t}getHashCode(){let t="";for(let e=0,i=this.chords.length;e<i;e++)e!==0&&(t+=";"),t+=this.chords[e].getHashCode();return t}equals(t){if(t===null||this.chords.length!==t.chords.length)return!1;for(let e=0;e<this.chords.length;e++)if(!this.chords[e].equals(t.chords[e]))return!1;return!0}};function vne(t){if(t.charCode){let i=String.fromCharCode(t.charCode).toUpperCase();return Z6.fromString(i)}let e=t.keyCode;if(e===3)return 7;if(rS)switch(e){case 59:return 85;case 60:if(une)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ts)return 57;break}else if(one&&(Ts&&e===93||!Ts&&e===92))return 57;return mne[e]||0}var _ne=Ts?256:2048,yne=512,bne=1024,Sne=Ts?2048:256,JP=class{constructor(t){var i;this._standardKeyboardEventBrand=!0;let e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=(i=e.getModifierState)==null?void 0:i.call(e,"AltGraph"),this.keyCode=vne(e),this.code=e.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let e=0;return this.ctrlKey&&(e|=_ne),this.altKey&&(e|=yne),this.shiftKey&&(e|=bne),this.metaKey&&(e|=Sne),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new gne(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},eR=new WeakMap;function xne(t){if(!t.parent||t.parent===t)return null;try{let e=t.location,i=t.parent.location;if(e.origin!=="null"&&i.origin!=="null"&&e.origin!==i.origin)return null}catch{return null}return t.parent}var wne=class{static getSameOriginWindowChain(t){let e=eR.get(t);if(!e){e=[],eR.set(t,e);let i=t,n;do n=xne(i),n?e.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):e.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let i=0,n=0,r=this.getSameOriginWindowChain(t);for(let s of r){let o=s.window.deref();if(i+=(o==null?void 0:o.scrollY)??0,n+=(o==null?void 0:o.scrollX)??0,o===e||!s.iframeElement)break;let l=s.iframeElement.getBoundingClientRect();i+=l.top,n+=l.left}return{top:i,left:n}}},xm=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=wne.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},tR=class{constructor(e,i=0,n=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let r=!1;if(Qw){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,c=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*c):this.deltaY=o.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?rS&&!Ts?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")ane&&X6?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*c):this.deltaX=o.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?rS&&!Ts?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},W6=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),Cne;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof kne?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gi.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:W6})})(Cne||(Cne={}));var kne=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?W6:(this._emitter||(this._emitter=new me),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Dw=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new Kb("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new Kb("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},Tne=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new Kb("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},i);this.disposable=Bt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Ane;(t=>{async function e(n){let r,s=await Promise.all(n.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return s}t.settled=e;function i(n){return new Promise(async(r,s)=>{try{await n(r,s)}catch(o){s(o)}})}t.withAsyncBody=i})(Ane||(Ane={}));var iR=class _r{static fromArray(e){return new _r(i=>{i.emitMany(e)})}static fromPromise(e){return new _r(async i=>{i.emitMany(await e)})}static fromPromises(e){return new _r(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new _r(async i=>{await Promise.all(e.map(async n=>{for await(let r of n)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new me,queueMicrotask(async()=>{let n={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(n)),this.resolve()}catch(r){this.reject(r)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Gi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(e,i){return new _r(async n=>{for await(let r of e)n.emitOne(i(r))})}map(e){return _r.map(this,e)}static filter(e,i){return new _r(async n=>{for await(let r of e)i(r)&&n.emitOne(r)})}filter(e){return _r.filter(this,e)}static coalesce(e){return _r.filter(e,i=>!!i)}coalesce(){return _r.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return _r.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};iR.EMPTY=iR.fromArray([]);var{getWindow:xs,getWindowId:Ene,onDidRegisterWindow:Mne}=(function(){let t=new Map,e={window:fo,disposables:new ya};t.set(fo.vscodeWindowId,e);let i=new me,n=new me,r=new me;function s(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:n.event,registerWindow(o){if(t.has(o.vscodeWindowId))return We.None;let l=new ya,c={window:o,disposables:l.add(new ya)};return t.set(o.vscodeWindowId,c),l.add(Bt(()=>{t.delete(o.vscodeWindowId),n.fire(o)})),l.add(Be(o,wi.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(c),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:s,getWindow(o){var u;let l=o;if((u=l==null?void 0:l.ownerDocument)!=null&&u.defaultView)return l.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:fo},getDocument(o){return xs(o).document}}})(),Pne=class{constructor(e,i,n,r){this._node=e,this._type=i,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Be(t,e,i,n){return new Pne(t,e,i,n)}var nR=function(t,e,i,n){return Be(t,e,i,n)},Bw,Rne=class extends Tne{constructor(t){super(),this.defaultTarget=t&&xs(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},rR=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Jm(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let t=new Map,e=new Map,i=new Map,n=new Map,r=s=>{i.set(s,!1);let o=t.get(s)??[];for(e.set(s,o),t.set(s,[]),n.set(s,!0);o.length>0;)o.sort(rR.sort),o.shift().execute();n.set(s,!1)};Bw=(s,o,l=0)=>{let c=Ene(s),u=new rR(o,l),d=t.get(c);return d||(d=[],t.set(c,d)),d.push(u),i.get(c)||(i.set(c,!0),s.requestAnimationFrame(()=>r(c))),u}})();function Qne(t){let e=t.getBoundingClientRect(),i=xs(t);return{left:e.left+i.scrollX,top:e.top+i.scrollY,width:e.width,height:e.height}}var wi={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Lne=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=Mn(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=Mn(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=Mn(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=Mn(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=Mn(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=Mn(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=Mn(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=Mn(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=Mn(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=Mn(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=Mn(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=Mn(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=Mn(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=Mn(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function Mn(t){return typeof t=="number"?`${t}px`:t}function yf(t){return new Lne(t)}var U6=class{constructor(){this._hooks=new ya,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,r,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let o=e;try{e.setPointerCapture(i),this._hooks.add(Bt(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{o=xs(e)}this._hooks.add(Be(o,wi.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Be(o,wi.POINTER_UP,l=>this.stopMonitoring(!0)))}};function Dne(t,e,i){let n=null,r=null;if(typeof i.value=="function"?(n="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",r=i.get),!r)throw new Error("not supported");let s=`$memoize$${e}`;i[n]=function(...o){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[s]}}var fs;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(fs||(fs={}));var ef=class en extends We{constructor(){super(),this.dispatched=!1,this.targets=new YP,this.ignoreTargets=new YP,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Gi.runAndSubscribe(Mne,({window:e,disposables:i})=>{i.add(Be(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(Be(e.document,"touchend",n=>this.onTouchEnd(e,n))),i.add(Be(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:fo,disposables:this._store}))}static addTarget(e){if(!en.isTouchDevice())return We.None;en.INSTANCE||(en.INSTANCE=new en);let i=en.INSTANCE.targets.push(e);return Bt(i)}static ignoreTarget(e){if(!en.isTouchDevice())return We.None;en.INSTANCE||(en.INSTANCE=new en);let i=en.INSTANCE.ignoreTargets.push(e);return Bt(i)}static isTouchDevice(){return"ontouchstart"in fo||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,r=e.targetTouches.length;n<r;n++){let s=e.targetTouches.item(n);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:i,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[i],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let o=this.newGestureEvent(fs.Start,s.target);o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,i){let n=Date.now(),r=Object.keys(this.activeTouches).length;for(let s=0,o=i.changedTouches.length;s<o;s++){let l=i.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("move of an UNKNOWN touch",l);continue}let c=this.activeTouches[l.identifier],u=Date.now()-c.initialTimeStamp;if(u<en.HOLD_DELAY&&Math.abs(c.initialPageX-Kn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Kn(c.rollingPageY))<30){let d=this.newGestureEvent(fs.Tap,c.initialTarget);d.pageX=Kn(c.rollingPageX),d.pageY=Kn(c.rollingPageY),this.dispatchEvent(d)}else if(u>=en.HOLD_DELAY&&Math.abs(c.initialPageX-Kn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Kn(c.rollingPageY))<30){let d=this.newGestureEvent(fs.Contextmenu,c.initialTarget);d.pageX=Kn(c.rollingPageX),d.pageY=Kn(c.rollingPageY),this.dispatchEvent(d)}else if(r===1){let d=Kn(c.rollingPageX),p=Kn(c.rollingPageY),g=Kn(c.rollingTimestamps)-c.rollingTimestamps[0],O=d-c.rollingPageX[0],_=p-c.rollingPageY[0],b=[...this.targets].filter(x=>c.initialTarget instanceof Node&&x.contains(c.initialTarget));this.inertia(e,b,n,Math.abs(O)/g,O>0?1:-1,d,Math.abs(_)/g,_>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(fs.End,c.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(e){if(e.type===fs.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>en.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,e.tapCount=n}else(e.type===fs.Change||e.type===fs.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(e.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(e.initialTarget)){let r=0,s=e.initialTarget;for(;s&&s!==n;)r++,s=s.parentElement;i.push([r,n])}i.sort((n,r)=>n[0]-r[0]);for(let[n,r]of i)r.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,n,r,s,o,l,c,u){this.handle=Bw(e,()=>{let d=Date.now(),p=d-n,g=0,O=0,_=!0;r+=en.SCROLL_FRICTION*p,l+=en.SCROLL_FRICTION*p,r>0&&(_=!1,g=s*r*p),l>0&&(_=!1,O=c*l*p);let b=this.newGestureEvent(fs.Change);b.translationX=g,b.translationY=O,i.forEach(x=>x.dispatchEvent(b)),_||this.inertia(e,i,d,r,s,o+g,l,c,u+O)})}onTouchMove(e){let i=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let s=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let o=this.activeTouches[s.identifier],l=this.newGestureEvent(fs.Change,o.initialTarget);l.translationX=s.pageX-Kn(o.rollingPageX),l.translationY=s.pageY-Kn(o.rollingPageY),l.pageX=s.pageX,l.pageY=s.pageY,this.dispatchEvent(l),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};ef.SCROLL_FRICTION=-.005,ef.HOLD_DELAY=700,ef.CLEAR_TAP_COUNT_TIME=400,Ut([Dne],ef,"isTouchDevice",1);var Bne=ef,$w=class extends We{onclick(e,i){this._register(Be(e,wi.CLICK,n=>i(new xm(xs(e),n))))}onmousedown(e,i){this._register(Be(e,wi.MOUSE_DOWN,n=>i(new xm(xs(e),n))))}onmouseover(e,i){this._register(Be(e,wi.MOUSE_OVER,n=>i(new xm(xs(e),n))))}onmouseleave(e,i){this._register(Be(e,wi.MOUSE_LEAVE,n=>i(new xm(xs(e),n))))}onkeydown(e,i){this._register(Be(e,wi.KEY_DOWN,n=>i(new JP(n))))}onkeyup(e,i){this._register(Be(e,wi.KEY_UP,n=>i(new JP(n))))}oninput(e,i){this._register(Be(e,wi.INPUT,i))}onblur(e,i){this._register(Be(e,wi.BLUR,i))}onfocus(e,i){this._register(Be(e,wi.FOCUS,i))}onchange(e,i){this._register(Be(e,wi.CHANGE,i))}ignoreGesture(e){return Bne.ignoreTarget(e)}},sR=11,$ne=class extends $w{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=sR+"px",this.domNode.style.height=sR+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new U6),this._register(nR(this.bgDomNode,wi.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(nR(this.domNode,wi.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Rne),this._pointerdownScheduleRepeatTimer=this._register(new Dw)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,xs(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},zne=class aS{constructor(e,i,n,r,s,o,l){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,r=r|0,s=s|0,o=o|0,l=l|0),this.rawScrollLeft=r,this.rawScrollTop=l,i<0&&(i=0),r+i>n&&(r=n-i),r<0&&(r=0),s<0&&(s=0),l+s>o&&(l=o-s),l<0&&(l=0),this.width=i,this.scrollWidth=n,this.scrollLeft=r,this.height=s,this.scrollHeight=o,this.scrollTop=l}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,i){return new aS(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new aS(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,i){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,l=this.scrollHeight!==e.scrollHeight,c=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:i,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:c}}},Nne=class extends We{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new zne(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){var n;let i=this._state.withScrollDimensions(t,e);this._setState(i,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let i=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;e?n=new aR(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(t);this._smoothScrolling=aR.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let i=this._state;i.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(i,e)))}},oR=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function $y(t,e){let i=e-t;return function(n){return t+i*Vne(n)}}function jne(t,e,i){return function(n){return n<i?t(n/i):e((n-i)/(1-i))}}var aR=class lS{constructor(e,i,n,r){this.from=e,this.to=i,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,i,n){if(Math.abs(e-i)>2.5*n){let r,s;return e<i?(r=e+.75*n,s=i-.75*n):(r=e-.75*n,s=i+.75*n),jne($y(e,r),$y(s,i),.33)}return $y(e,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let i=(e-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),r=this.scrollTop(i);return new oR(n,r,!1)}return new oR(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,i,n){return lS.start(e,i,n)}static start(e,i,n){n=n+10;let r=Date.now()-10;return new lS(e,i,r,n)}};function Ine(t){return Math.pow(t,3)}function Vne(t){return 1-Ine(1-t)}var Xne=class extends We{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Dw)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var i;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(i=this._domNode)==null||i.setClassName(this._invisibleClassName+(e?" fade":"")))}},Zne=140,Y6=class extends $w{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Xne(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new U6),this._shouldRender=!0,this.domNode=yf(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Be(this.domNode.domNode,wi.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new $ne(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,r){this.slider=yf(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Be(this.slider.domNode,wi.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),r=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);n<=s&&s<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let s=Qne(this.domNode.domNode);i=e.pageX-s.left,n=e.pageY-s.top}let r=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let o=this._sliderOrthogonalPointerPosition(s),l=Math.abs(o-n);if(X6&&l>Zne){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let c=this._sliderPointerPosition(s)-i;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},H6=class cS{constructor(e,i,n,r,s,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new cS(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let i=Math.round(e);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(e){let i=Math.round(e);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let i=Math.round(e);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,i,n,r,s){let o=Math.max(0,n-e),l=Math.max(0,o-2*i),c=r>0&&r>n;if(!c)return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let u=Math.round(Math.max(20,Math.floor(n*l/r))),d=(l-u)/(r-n),p=s*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(u),computedSliderRatio:d,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let e=cS._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+e;return Math.round(i/this._computedSliderRatio)}},qne=class extends Y6{constructor(e,i,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new H6(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,r.width,r.scrollWidth,s.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Wne=class extends Y6{constructor(t,e,i){let n=t.getScrollDimensions(),r=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i,scrollbarState:new H6(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,n.height,n.scrollHeight,r.scrollTop),visibility:e.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:e.scrollByPage}),e.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((e.verticalScrollbarSize-e.verticalSliderSize)/2),e.verticalSliderSize,void 0)}_updateSlider(t,e){this.slider.setHeight(t),this.slider.setTop(e)}_renderDomNode(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return e}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,e){t.scrollTop=e}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},Une=500,lR=50,Yne=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},hS=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,i=0,n=1,r=this._rear;do{let s=r===this._front?e:Math.pow(2,-n);if(e-=s,i+=this._memory[r].score*s,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(e){if(Qw){let i=xs(e.browserEvent),n=sne(i);this.accept(Date.now(),e.deltaX*n,e.deltaY*n)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,i,n){let r=null,s=new Yne(e,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,r)}_computeScore(e,i){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),i){let r=Math.abs(e.deltaX),s=Math.abs(e.deltaY),o=Math.abs(i.deltaX),l=Math.abs(i.deltaY),c=Math.max(Math.min(r,o),1),u=Math.max(Math.min(s,l),1),d=Math.max(r,o),p=Math.max(s,l);d%c===0&&p%u===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};hS.INSTANCE=new hS;var Hne=hS,Fne=class extends $w{constructor(t,e,i){super(),this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new me),this.onWillScroll=this._onWillScroll.event,this._options=Kne(e),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let n={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Wne(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new qne(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=yf(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=yf(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=yf(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Dw),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=El(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,Ts&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new tR(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=El(this._mouseWheelToDispose),t)){let e=i=>{this._onMouseWheel(new tR(i))};this._mouseWheelToDispose.push(Be(this._listenOnDomNode,wi.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){var r;if((r=t.browserEvent)!=null&&r.defaultPrevented)return;let e=Hne.INSTANCE;e.acceptStandardWheelEvent(t);let i=!1;if(t.deltaY||t.deltaX){let s=t.deltaY*this._options.mouseWheelScrollSensitivity,o=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+s===0?o=s=0:Math.abs(s)>=Math.abs(o)?o=0:s=0),this._options.flipAxes&&([s,o]=[o,s]);let l=!Ts&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!o&&(o=s,s=0),t.browserEvent&&t.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),u={};if(s){let d=lR*s,p=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,p)}if(o){let d=lR*o,p=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,p)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,i=t.scrollLeft>0,n=i?" left":"",r=e?" top":"",s=i||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${r}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Une)}},Gne=class extends Fne{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Kne(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,Ts&&(e.className+=" mac"),e}var uS=class extends We{constructor(e,i,n,r,s,o,l,c){super(),this._bufferService=n,this._optionsService=l,this._renderService=c,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let u=this._register(new Nne({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>Bw(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{u.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Gne(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},u)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Gi.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Bt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(Bt(()=>this._styleElement.remove())),this._register(Gi.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
113
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};uS=Ut([be(2,yn),be(3,xo),be(4,E6),be(5,wh),be(6,bn),be(7,wo)],uS);var fS=class extends We{constructor(e,i,n,r,s){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,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(o=>this._removeDecoration(o))),this._register(Bt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))==null||i.remove(),this._decorationElements.delete(e),e.dispose()}};fS=Ut([be(1,yn),be(2,xo),be(3,Sd),be(4,wo)],fS);var Jne=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(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},ls={full:0,left:0,center:0,right:0},ra={full:0,left:0,center:0,right:0},Lu={full:0,left:0,center:0,right:0},Kg=class extends We{constructor(e,i,n,r,s,o,l,c){var d;super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=o,this._themeService=l,this._coreBrowserService=c,this._colorZoneStore=new Jne,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(Bt(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let u=this._canvas.getContext("2d");if(u)this._ctx=u;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);ra.full=this._canvas.width,ra.left=e,ra.center=i,ra.right=e,this._refreshDrawHeightConstants(),Lu.full=1,Lu.left=1,Lu.center=1+ra.left,Lu.right=1+ra.left+ra.center}_refreshDrawHeightConstants(){ls.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);ls.left=i,ls.center=i,ls.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ls.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ls.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ls.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ls.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(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Lu[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-ls[e.position||"full"]/2),ra[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+ls[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Kg=Ut([be(2,yn),be(3,Sd),be(4,wo),be(5,bn),be(6,wh),be(7,xo)],Kg);var ce;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=`
|
|
114
|
+
`,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(ce||(ce={}));var ig;(t=>(t.PAD="",t.HOP="",t.BPH="",t.NBH="",t.IND="",t.NEL="
",t.SSA="",t.ESA="",t.HTS="",t.HTJ="",t.VTS="",t.PLD="",t.PLU="",t.RI="",t.SS2="",t.SS3="",t.DCS="",t.PU1="",t.PU2="",t.STS="",t.CCH="",t.MW="",t.SPA="",t.EPA="",t.SOS="",t.SGCI="",t.SCI="",t.CSI="",t.ST="",t.OSC="",t.PM="",t.APC=""))(ig||(ig={}));var F6;(t=>t.ST=`${ce.ESC}\\`)(F6||(F6={}));var dS=class{constructor(e,i,n,r,s,o){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${ce.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};dS=Ut([be(2,yn),be(3,bn),be(4,Bl),be(5,wo)],dS);var Ci=0,ki=0,Ti=0,Zt=0,cR={css:"#00000000",rgba:0},ci;(t=>{function e(r,s,o,l){return l!==void 0?`#${tl(r)}${tl(s)}${tl(o)}${tl(l)}`:`#${tl(r)}${tl(s)}${tl(o)}`}t.toCss=e;function i(r,s,o,l=255){return(r<<24|s<<16|o<<8|l)>>>0}t.toRgba=i;function n(r,s,o,l){return{css:t.toCss(r,s,o,l),rgba:t.toRgba(r,s,o,l)}}t.toColor=n})(ci||(ci={}));var Pt;(t=>{function e(c,u){if(Zt=(u.rgba&255)/255,Zt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Ci=O+Math.round((d-O)*Zt),ki=_+Math.round((p-_)*Zt),Ti=b+Math.round((g-b)*Zt);let x=ci.toCss(Ci,ki,Ti),w=ci.toRgba(Ci,ki,Ti);return{css:x,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=ng.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return ci.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function r(c){let u=(c.rgba|255)>>>0;return[Ci,ki,Ti]=ng.toChannels(u),{css:ci.toCss(Ci,ki,Ti),rgba:u}}t.opaque=r;function s(c,u){return Zt=Math.round(u*255),[Ci,ki,Ti]=ng.toChannels(c.rgba),{css:ci.toCss(Ci,ki,Ti,Zt),rgba:ci.toRgba(Ci,ki,Ti,Zt)}}t.opacity=s;function o(c,u){return Zt=c.rgba&255,s(c,Zt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(Pt||(Pt={}));var zt;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let s=r.getContext("2d",{willReadFrequently:!0});s&&(e=s,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Ci=parseInt(r.slice(1,2).repeat(2),16),ki=parseInt(r.slice(2,3).repeat(2),16),Ti=parseInt(r.slice(3,4).repeat(2),16),ci.toColor(Ci,ki,Ti);case 5:return Ci=parseInt(r.slice(1,2).repeat(2),16),ki=parseInt(r.slice(2,3).repeat(2),16),Ti=parseInt(r.slice(3,4).repeat(2),16),Zt=parseInt(r.slice(4,5).repeat(2),16),ci.toColor(Ci,ki,Ti,Zt);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}}let s=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(s)return Ci=parseInt(s[1]),ki=parseInt(s[2]),Ti=parseInt(s[3]),Zt=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),ci.toColor(Ci,ki,Ti,Zt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=r,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Ci,ki,Ti,Zt]=e.getImageData(0,0,1,1).data,Zt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ci.toRgba(Ci,ki,Ti,Zt),css:r}}t.toColor=n})(zt||(zt={}));var fn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,r,s){let o=n/255,l=r/255,c=s/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(fn||(fn={}));var ng;(t=>{function e(o,l){if(Zt=(l&255)/255,Zt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Ci=p+Math.round((c-p)*Zt),ki=g+Math.round((u-g)*Zt),Ti=O+Math.round((d-O)*Zt),ci.toRgba(Ci,ki,Ti)}t.blend=e;function i(o,l,c){let u=fn.relativeLuminance(o>>8),d=fn.relativeLuminance(l>>8);if(no(u,d)<c){if(d<u){let O=n(o,l,c),_=no(u,fn.relativeLuminance(O>>8));if(_<c){let b=r(o,l,c),x=no(u,fn.relativeLuminance(b>>8));return _>x?O:b}return O}let p=r(o,l,c),g=no(u,fn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=no(u,fn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function r(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=r;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=s})(ng||(ng={}));function tl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function no(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var ere=class extends bd{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Jg=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Rr}register(t){let e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let e=this._bufferService.buffer.lines.get(t);if(!e||e.length===0)return[];let i=[],n=e.translateToString(!0),r=0,s=0,o=0,l=e.getFg(0),c=e.getBg(0);for(let u=0;u<e.getTrimmedLength();u++)if(e.loadCell(u,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==l||this._workCell.bg!==c){if(u-r>1){let d=this._getJoinedRanges(n,o,s,e,r);for(let p=0;p<d.length;p++)i.push(d[p])}r=u,o=s,l=this._workCell.fg,c=this._workCell.bg}s+=this._workCell.getChars().length||va.length}if(this._bufferService.cols-r>1){let u=this._getJoinedRanges(n,o,s,e,r);for(let d=0;d<u.length;d++)i.push(u[d])}return i}_getJoinedRanges(t,e,i,n,r){let s=t.substring(e,i),o=[];try{o=this._characterJoiners[0].handler(s)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let c=this._characterJoiners[l].handler(s);for(let u=0;u<c.length;u++)Jg._mergeRanges(o,c[u])}catch(c){console.error(c)}return this._stringRangesToCellRanges(o,n,r),o}_stringRangesToCellRanges(t,e,i){let n=0,r=!1,s=0,o=t[n];if(o){for(let l=i;l<this._bufferService.cols;l++){let c=e.getWidth(l),u=e.getString(l).length||va.length;if(c!==0){if(!r&&o[0]<=s&&(o[0]=l,r=!0),o[1]<=s){if(o[1]=l,o=t[++n],!o)break;o[0]<=s?(o[0]=l,r=!0):r=!1}s+=u}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let i=!1;for(let n=0;n<t.length;n++){let r=t[n];if(i){if(e[1]<=r[0])return t[n-1][1]=e[1],t;if(e[1]<=r[1])return t[n-1][1]=Math.max(e[1],r[1]),t.splice(n,1),t;t.splice(n,1),n--}else{if(e[1]<=r[0])return t.splice(n,0,e),t;if(e[1]<=r[1])return r[0]=Math.min(e[0],r[0]),t;e[0]<r[1]&&(r[0]=Math.min(e[0],r[0]),i=!0);continue}}return i?t[t.length-1][1]=e[1]:t.push(e),t}};Jg=Ut([be(0,yn)],Jg);function tre(t){return 57508<=t&&t<=57558}function ire(t){return 9472<=t&&t<=9631}function nre(t){return tre(t)||ire(t)}function rre(){return{css:{canvas:wm(),cell:wm()},device:{canvas:wm(),cell:wm(),char:{width:0,height:0,left:0,top:0}}}}function wm(){return{width:0,height:0}}var pS=class{constructor(e,i,n,r,s,o,l){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=o,this._themeService=l,this._workCell=new Rr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,r,s,o,l,c,u,d,p){let g=[],O=this._characterJoinerService.getJoinedCharacters(i),_=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<o+1&&(b=o+1);let x,w=0,k="",T=0,A=0,L=0,E=0,N=!1,z=0,Z=!1,J=0,U=0,R=[],B=d!==-1&&p!==-1;for(let D=0;D<b;D++){e.loadCell(D,this._workCell);let j=this._workCell.getWidth();if(j===0)continue;let $=!1,X=D>=U,H=D,F=this._workCell;if(O.length>0&&D===O[0][0]&&X){let Le=O.shift(),ar=this._isCellInSelection(Le[0],i);for(T=Le[0]+1;T<Le[1];T++)X&&(X=ar===this._isCellInSelection(T,i));X&&(X=!n||o<Le[0]||o>=Le[1]),X?($=!0,F=new ere(this._workCell,e.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),H=Le[1]-1,j=F.getWidth()):U=Le[1]}let M=this._isCellInSelection(D,i),I=n&&D===o,K=B&&D>=d&&D<=p,Q=!1;this._decorationService.forEachDecorationAtCell(D,i,void 0,Le=>{Q=!0});let ue=F.getChars()||va;if(ue===" "&&(F.isUnderline()||F.isOverline())&&(ue=" "),J=j*c-u.get(ue,F.isBold(),F.isItalic()),!x)x=this._document.createElement("span");else if(w&&(M&&Z||!M&&!Z&&F.bg===A)&&(M&&Z&&_.selectionForeground||F.fg===L)&&F.extended.ext===E&&K===N&&J===z&&!I&&!$&&!Q&&X){F.isInvisible()?k+=va:k+=ue,w++;continue}else w&&(x.textContent=k),x=this._document.createElement("span"),w=0,k="";if(A=F.bg,L=F.fg,E=F.extended.ext,N=K,z=J,Z=M,$&&o>=D&&o<=H&&(o=D),!this._coreService.isCursorHidden&&I&&this._coreService.isCursorInitialized){if(R.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&R.push("xterm-cursor-blink"),R.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":R.push("xterm-cursor-outline");break;case"block":R.push("xterm-cursor-block");break;case"bar":R.push("xterm-cursor-bar");break;case"underline":R.push("xterm-cursor-underline");break}}if(F.isBold()&&R.push("xterm-bold"),F.isItalic()&&R.push("xterm-italic"),F.isDim()&&R.push("xterm-dim"),F.isInvisible()?k=va:k=F.getChars()||va,F.isUnderline()&&(R.push(`xterm-underline-${F.extended.underlineStyle}`),k===" "&&(k=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${bd.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let Le=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&Le<8&&(Le+=8),x.style.textDecorationColor=_.ansi[Le].css}F.isOverline()&&(R.push("xterm-overline"),k===" "&&(k=" ")),F.isStrikethrough()&&R.push("xterm-strikethrough"),K&&(x.style.textDecoration="underline");let he=F.getFgColor(),fe=F.getFgColorMode(),Oe=F.getBgColor(),Ce=F.getBgColorMode(),ye=!!F.isInverse();if(ye){let Le=he;he=Oe,Oe=Le;let ar=fe;fe=Ce,Ce=ar}let nt,Qt,Yt=!1;this._decorationService.forEachDecorationAtCell(D,i,void 0,Le=>{Le.options.layer!=="top"&&Yt||(Le.backgroundColorRGB&&(Ce=50331648,Oe=Le.backgroundColorRGB.rgba>>8&16777215,nt=Le.backgroundColorRGB),Le.foregroundColorRGB&&(fe=50331648,he=Le.foregroundColorRGB.rgba>>8&16777215,Qt=Le.foregroundColorRGB),Yt=Le.options.layer==="top")}),!Yt&&M&&(nt=this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque,Oe=nt.rgba>>8&16777215,Ce=50331648,Yt=!0,_.selectionForeground&&(fe=50331648,he=_.selectionForeground.rgba>>8&16777215,Qt=_.selectionForeground)),Yt&&R.push("xterm-decoration-top");let ei;switch(Ce){case 16777216:case 33554432:ei=_.ansi[Oe],R.push(`xterm-bg-${Oe}`);break;case 50331648:ei=ci.toColor(Oe>>16,Oe>>8&255,Oe&255),this._addStyle(x,`background-color:#${hR((Oe>>>0).toString(16),"0",6)}`);break;case 0:default:ye?(ei=_.foreground,R.push("xterm-bg-257")):ei=_.background}switch(nt||F.isDim()&&(nt=Pt.multiplyOpacity(ei,.5)),fe){case 16777216:case 33554432:F.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(x,ei,_.ansi[he],F,nt,void 0)||R.push(`xterm-fg-${he}`);break;case 50331648:let Le=ci.toColor(he>>16&255,he>>8&255,he&255);this._applyMinimumContrast(x,ei,Le,F,nt,Qt)||this._addStyle(x,`color:#${hR(he.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(x,ei,_.foreground,F,nt,Qt)||ye&&R.push("xterm-fg-257")}R.length&&(x.className=R.join(" "),R.length=0),!I&&!$&&!Q&&X?w++:x.textContent=k,J!==this.defaultSpacing&&(x.style.letterSpacing=`${J}px`),g.push(x),D=H}return x&&w&&(x.textContent=k),g}_applyMinimumContrast(e,i,n,r,s,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||nre(r.getCode()))return!1;let l=this._getContrastCache(r),c;if(!s&&!o&&(c=l.getColor(i.rgba,n.rgba)),c===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);c=Pt.ensureContrastRatio(s||i,o||n,u),l.setColor((s||i).rgba,(o||n).rgba,c??null)}return c?(this._addStyle(e,`color:${c.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&i>=n[1]&&e<r[0]&&i<=r[1]:e<n[0]&&i>=n[1]&&e>=r[0]&&i<=r[1]:i>n[1]&&i<r[1]||n[1]===r[1]&&i===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&i===r[1]&&e<r[0]||n[1]<r[1]&&i===n[1]&&e>=n[0]}};pS=Ut([be(1,R6),be(2,bn),be(3,xo),be(4,Bl),be(5,Sd),be(6,wh)],pS);function hR(t,e,i){for(;t.length<i;)t=e+t;return t}var sre=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,r,s,o],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(o),i.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(e,i,n,r){e===this._font&&i===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,i,n){let r=0;if(!i&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let l=this._measure(e,0);return l>0&&(this._flat[r]=l),l}let s=e;i&&(s+="B"),n&&(s+="I");let o=this._holey.get(s);if(o===void 0){let l=0;i&&(l|=1),n&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(s,o)}return o}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},ore=class{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(e,i,n,r=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,o=i[1]-s,l=n[1]-s,c=Math.max(o,0),u=Math.min(l,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function are(){return new ore}var zy="xterm-dom-renderer-owner-",vr="xterm-rows",Cm="xterm-fg-",uR="xterm-bg-",Du="xterm-focus",km="xterm-selection",lre=1,mS=class extends We{constructor(e,i,n,r,s,o,l,c,u,d,p,g,O,_){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=o,this._linkifier2=l,this._charSizeService=u,this._optionsService=d,this._bufferService=p,this._coreService=g,this._coreBrowserService=O,this._themeService=_,this._terminalClass=lre++,this._rowElements=[],this._selectionRenderModel=are(),this.onRequestRedraw=this._register(new me).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(vr),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(km),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=rre(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=c.createInstance(pS,document),this._element.classList.add(zy+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(Bt(()=>{this._element.classList.remove(zy+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new sre(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${vr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${vr} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${vr} .xterm-dim { color: ${Pt.multiplyOpacity(e.foreground,.5).css};}`,i+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${r} { 50% { box-shadow: none; }}`,i+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${vr}.${Du} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${vr}.${Du} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${vr}.${Du} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${km} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${km} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${km} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())i+=`${this._terminalSelector} .${Cm}${o} { color: ${l.css}; }${this._terminalSelector} .${Cm}${o}.xterm-dim { color: ${Pt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${uR}${o} { background-color: ${l.css}; }`;i+=`${this._terminalSelector} .${Cm}257 { color: ${Pt.opaque(e.background).css}; }${this._terminalSelector} .${Cm}257.xterm-dim { color: ${Pt.multiplyOpacity(Pt.opaque(e.background),.5).css}; }${this._terminalSelector} .${uR}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),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(Du),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Du),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(n){let u=e[0]>i[0];c.appendChild(this._createSelectionElement(o,u?i[0]:e[0],u?e[0]:i[0],l-o+1))}else{let u=r===o?e[0]:0,d=o===s?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(o,u,d));let p=l-o-1;if(c.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,p)),o!==l){let g=s===l?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(l,0,g))}}this._selectionContainer.appendChild(c)}_createSelectionElement(e,i,n,r=1){let s=this._document.createElement("div"),o=i*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-i);return o+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-o),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${o}px`,s.style.width=`${l}px`,s}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,r=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,c=this._optionsService.rawOptions.cursorInactiveStyle;for(let u=e;u<=i;u++){let d=u+n.ydisp,p=this._rowElements[u],g=n.lines.get(d);if(!p||!g)break;p.replaceChildren(...this._rowFactory.createRow(g,d,d===r,l,c,s,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${zy}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,r,s,o){n<0&&(e=0),r<0&&(i=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),r=Math.max(Math.min(r,l),0),s=Math.min(s,this._bufferService.cols);let c=this._bufferService.buffer,u=c.ybase+c.y,d=Math.min(c.x,s-1),p=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let _=n;_<=r;++_){let b=_+c.ydisp,x=this._rowElements[_],w=c.lines.get(b);if(!x||!w)break;x.replaceChildren(...this._rowFactory.createRow(w,b,b===u,g,O,d,p,this.dimensions.css.cell.width,this._widthCache,o?_===n?e:0:-1,o?(_===r?i:s)-1:-1))}}};mS=Ut([be(7,Mw),be(8,TO),be(9,bn),be(10,yn),be(11,Bl),be(12,xo),be(13,wh)],mS);var gS=class extends We{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new me),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new hre(this._optionsService))}catch{this._measureStrategy=this._register(new cre(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};gS=Ut([be(2,bn)],gS);var G6=class extends We{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},cre=class extends G6{constructor(t,e,i){super(),this._document=t,this._parentElement=e,this._optionsService=i,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}},hre=class extends G6{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},ure=class extends We{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new fre(this._window)),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new me),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Gi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Be(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Be(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},fre=class extends We{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ph),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Bt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Be(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},dre=class extends We{constructor(){super(),this.linkProviders=[],this._register(Bt(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function zw(t,e,i){let n=i.getBoundingClientRect(),r=t.getComputedStyle(i),s=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[e.clientX-n.left-s,e.clientY-n.top-o]}function pre(t,e,i,n,r,s,o,l,c){if(!s)return;let u=zw(t,e,i);if(u)return u[0]=Math.ceil((u[0]+(c?o/2:0))/o),u[1]=Math.ceil(u[1]/l),u[0]=Math.min(Math.max(u[0],1),n+(c?1:0)),u[1]=Math.min(Math.max(u[1],1),r),u}var OS=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,r,s){return pre(window,e,i,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,i){let n=zw(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};OS=Ut([be(0,wo),be(1,TO)],OS);var mre=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},K6={};Cie(K6,{getSafariVersion:()=>Ore,isChromeOS:()=>iz,isFirefox:()=>J6,isIpad:()=>vre,isIphone:()=>_re,isLegacyEdge:()=>gre,isLinux:()=>Nw,isMac:()=>eO,isNode:()=>AO,isSafari:()=>ez,isWindows:()=>tz});var AO=typeof process<"u"&&"title"in process,xd=AO?"node":navigator.userAgent,wd=AO?"node":navigator.platform,J6=xd.includes("Firefox"),gre=xd.includes("Edge"),ez=/^((?!chrome|android).)*safari/i.test(xd);function Ore(){if(!ez)return 0;let t=xd.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var eO=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(wd),vre=wd==="iPad",_re=wd==="iPhone",tz=["Windows","Win16","Win32","WinCE"].includes(wd),Nw=wd.indexOf("Linux")>=0,iz=/\bCrOS\b/.test(xd),nz=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),r=t.timeRemaining(),i*1.5>r){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=r}this.clear()}},yre=class extends nz{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},bre=class extends nz{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},tO=!AO&&"requestIdleCallback"in window?bre:yre,Sre=class{constructor(){this._queue=new tO}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},vS=class extends We{constructor(e,i,n,r,s,o,l,c,u){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=c,this._renderer=this._register(new ph),this._pausedResizeTask=new Sre,this._observerDisposable=this._register(new ph),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 me),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new me),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new me),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new mre((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new xre(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Bt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(u.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=Bt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),i=Math.max(i,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,i;this._renderer.value&&((i=(e=this._renderer.value).clearTextureAtlas)==null||i.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,i)}):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,i,n){var r;this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,i,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};vS=Ut([be(2,bn),be(3,TO),be(4,Bl),be(5,Sd),be(6,yn),be(7,xo),be(8,wh)],vS);var xre=class{constructor(t,e,i){this._coreBrowserService=t,this._coreService=e,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function wre(t,e,i,n){let r=i.buffer.x,s=i.buffer.y;if(!i.buffer.hasScrollback)return Tre(r,s,t,e,i,n)+EO(s,e,i,n)+Are(r,s,t,e,i,n);let o;if(s===e)return o=r>t?"D":"C",td(Math.abs(r-t),ed(o,n));o=s>e?"D":"C";let l=Math.abs(s-e),c=kre(s>e?t:r,i)+(l-1)*i.cols+1+Cre(s>e?r:t);return td(c,ed(o,n))}function Cre(t,e){return t-1}function kre(t,e){return e.cols-t}function Tre(t,e,i,n,r,s){return EO(e,n,r,s).length===0?"":td(sz(t,e,t,e-Ml(e,r),!1,r).length,ed("D",s))}function EO(t,e,i,n){let r=t-Ml(t,i),s=e-Ml(e,i),o=Math.abs(r-s)-Ere(t,e,i);return td(o,ed(rz(t,e),n))}function Are(t,e,i,n,r,s){let o;EO(e,n,r,s).length>0?o=n-Ml(n,r):o=e;let l=n,c=Mre(t,e,i,n,r,s);return td(sz(t,o,i,l,c==="C",r).length,ed(c,s))}function Ere(t,e,i){var o;let n=0,r=t-Ml(t,i),s=e-Ml(e,i);for(let l=0;l<Math.abs(r-s);l++){let c=rz(t,e)==="A"?-1:1;(o=i.buffer.lines.get(r+c*l))!=null&&o.isWrapped&&n++}return n}function Ml(t,e){let i=0,n=e.buffer.lines.get(t),r=n==null?void 0:n.isWrapped;for(;r&&t>=0&&t<e.rows;)i++,n=e.buffer.lines.get(--t),r=n==null?void 0:n.isWrapped;return i}function Mre(t,e,i,n,r,s){let o;return EO(i,n,r,s).length>0?o=n-Ml(n,r):o=e,t<i&&o<=n||t>=i&&o<n?"C":"D"}function rz(t,e){return t>e?"A":"B"}function sz(t,e,i,n,r,s){let o=t,l=e,c="";for(;(o!==i||l!==n)&&l>=0&&l<s.buffer.lines.length;)o+=r?1:-1,r&&o>s.cols-1?(c+=s.buffer.translateBufferLineToString(l,!1,t,o),o=0,t=0,l++):!r&&o<0&&(c+=s.buffer.translateBufferLineToString(l,!1,0,t+1),o=s.cols-1,t=o,l--);return c+s.buffer.translateBufferLineToString(l,!1,t,o)}function ed(t,e){let i=e?"O":"[";return ce.ESC+i+t}function td(t,e){t=Math.floor(t);let i="";for(let n=0;n<t;n++)i+=e;return i}var Pre=class{constructor(t){this._bufferService=t,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.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()){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function fR(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var Ny=50,Rre=15,Qre=50,Lre=500,Dre=" ",Bre=new RegExp(Dre,"g"),_S=class extends We{constructor(e,i,n,r,s,o,l,c,u){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=o,this._optionsService=l,this._renderService=c,this._coreBrowserService=u,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Rr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new me),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new me),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new Pre(this._bufferService),this._activeSelectionMode=0,this._register(Bt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let s=e[0]<i[0]?e[0]:i[0],o=e[0]<i[0]?i[0]:e[0];for(let l=e[1];l<=i[1];l++){let c=n.translateBufferLineToString(l,!0,s,o);r.push(c)}}else{let s=e[1]===i[1]?i[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let o=e[1]+1;o<=i[1]-1;o++){let l=n.lines.get(o),c=n.translateBufferLineToString(o,!0);l!=null&&l.isWrapped?r[r.length-1]+=c:r.push(c)}if(e[1]!==i[1]){let o=n.lines.get(i[1]),l=n.translateBufferLineToString(i[1],!0,0,i[0]);o&&o.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(s=>s.replace(Bre," ")).join(tz?`\r
|
|
115
|
+
`:`
|
|
116
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Nw&&e&&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(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!i?!1:this._areCoordsInSelection(i,n,r)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,i],n,r)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){var s,o;let n=(o=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:o.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=fR(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=zw(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-Ny),Ny),i/=Ny,i/Math.abs(i)+Math.round(i*(Rre-1)))}shouldForceSelection(e){return eO?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),Qre)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(eO&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<Lre&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=wre(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let r=0;i>=r;r++){let s=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&i!==r&&(n+=s-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,o=s.lines.get(e[1]);if(!o)return;let l=s.translateBufferLineToString(e[1],!1),c=this._convertViewportColToCharacterIndex(o,e[0]),u=c,d=e[0]-c,p=0,g=0,O=0,_=0;if(l.charAt(c)===" "){for(;c>0&&l.charAt(c-1)===" ";)c--;for(;u<l.length&&l.charAt(u+1)===" ";)u++}else{let w=e[0],k=e[0];o.getWidth(w)===0&&(p++,w--),o.getWidth(k)===2&&(g++,k++);let T=o.getString(k).length;for(T>1&&(_+=T-1,u+=T-1);w>0&&c>0&&!this._isCharWordSeparator(o.loadCell(w-1,this._workCell));){o.loadCell(w-1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,w--):A>1&&(O+=A-1,c-=A-1),c--,w--}for(;k<o.length&&u+1<l.length&&!this._isCharWordSeparator(o.loadCell(k+1,this._workCell));){o.loadCell(k+1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,k++):A>1&&(_+=A-1,u+=A-1),u++,k++}}u++;let b=c+d-p+O,x=Math.min(this._bufferService.cols,u-c+p+g-O-_);if(!(!i&&l.slice(c,u).trim()==="")){if(n&&b===0&&o.getCodePoint(0)!==32){let w=s.lines.get(e[1]-1);if(w&&o.isWrapped&&w.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;b-=T,x+=T}}}if(r&&b+x===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let w=s.lines.get(e[1]+1);if(w!=null&&w.isWrapped&&w.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(x+=k.length)}}return{start:b,length:x}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=fR(n,this._bufferService.cols)}};_S=Ut([be(3,yn),be(4,Bl),be(5,Pw),be(6,bn),be(7,wo),be(8,xo)],_S);var dR=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},pR=class{constructor(){this._color=new dR,this._css=new dR}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},mi=Object.freeze((()=>{let t=[zt.toColor("#2e3436"),zt.toColor("#cc0000"),zt.toColor("#4e9a06"),zt.toColor("#c4a000"),zt.toColor("#3465a4"),zt.toColor("#75507b"),zt.toColor("#06989a"),zt.toColor("#d3d7cf"),zt.toColor("#555753"),zt.toColor("#ef2929"),zt.toColor("#8ae234"),zt.toColor("#fce94f"),zt.toColor("#729fcf"),zt.toColor("#ad7fa8"),zt.toColor("#34e2e2"),zt.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],r=e[i/6%6|0],s=e[i%6];t.push({css:ci.toCss(n,r,s),rgba:ci.toRgba(n,r,s)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:ci.toCss(n,n,n),rgba:ci.toRgba(n,n,n)})}return t})()),al=zt.toColor("#ffffff"),tf=zt.toColor("#000000"),mR=zt.toColor("#ffffff"),gR=tf,Bu={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},$re=al,yS=class extends We{constructor(e){super(),this._optionsService=e,this._contrastCache=new pR,this._halfContrastCache=new pR,this._onChangeColors=this._register(new me),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:al,background:tf,cursor:mR,cursorAccent:gR,selectionForeground:void 0,selectionBackgroundTransparent:Bu,selectionBackgroundOpaque:Pt.blend(tf,Bu),selectionInactiveBackgroundTransparent:Bu,selectionInactiveBackgroundOpaque:Pt.blend(tf,Bu),scrollbarSliderBackground:Pt.opacity(al,.2),scrollbarSliderHoverBackground:Pt.opacity(al,.4),scrollbarSliderActiveBackground:Pt.opacity(al,.5),overviewRulerBorder:al,ansi:mi.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)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Ot(e.foreground,al),i.background=Ot(e.background,tf),i.cursor=Pt.blend(i.background,Ot(e.cursor,mR)),i.cursorAccent=Pt.blend(i.background,Ot(e.cursorAccent,gR)),i.selectionBackgroundTransparent=Ot(e.selectionBackground,Bu),i.selectionBackgroundOpaque=Pt.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Ot(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Pt.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Ot(e.selectionForeground,cR):void 0,i.selectionForeground===cR&&(i.selectionForeground=void 0),Pt.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Pt.opacity(i.selectionBackgroundTransparent,.3)),Pt.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Pt.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Ot(e.scrollbarSliderBackground,Pt.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Ot(e.scrollbarSliderHoverBackground,Pt.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Ot(e.scrollbarSliderActiveBackground,Pt.opacity(i.foreground,.5)),i.overviewRulerBorder=Ot(e.overviewRulerBorder,$re),i.ansi=mi.slice(),i.ansi[0]=Ot(e.black,mi[0]),i.ansi[1]=Ot(e.red,mi[1]),i.ansi[2]=Ot(e.green,mi[2]),i.ansi[3]=Ot(e.yellow,mi[3]),i.ansi[4]=Ot(e.blue,mi[4]),i.ansi[5]=Ot(e.magenta,mi[5]),i.ansi[6]=Ot(e.cyan,mi[6]),i.ansi[7]=Ot(e.white,mi[7]),i.ansi[8]=Ot(e.brightBlack,mi[8]),i.ansi[9]=Ot(e.brightRed,mi[9]),i.ansi[10]=Ot(e.brightGreen,mi[10]),i.ansi[11]=Ot(e.brightYellow,mi[11]),i.ansi[12]=Ot(e.brightBlue,mi[12]),i.ansi[13]=Ot(e.brightMagenta,mi[13]),i.ansi[14]=Ot(e.brightCyan,mi[14]),i.ansi[15]=Ot(e.brightWhite,mi[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)i.ansi[r+16]=Ot(e.extendedAnsi[r],mi[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};yS=Ut([be(0,bn)],yS);function Ot(t,e){if(t!==void 0)try{return zt.toColor(t)}catch{}return e}var zre=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},Nre=class{constructor(){this._services=new zre,this._services.set(Mw,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let i=Rie(t).sort((s,o)=>s.index-o.index),n=[];for(let s of i){let o=this._services.get(s.id);if(!o)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${s.id._id}.`);n.push(o)}let r=i.length>0?i[0].index:e.length;if(e.length!==r)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${r+1} conflicts with ${e.length} static arguments`);return new t(...e,...n)}},jre={trace:0,debug:1,info:2,warn:3,error:4,off:5},Ire="xterm.js: ",bS=class extends We{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=jre[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":Ire)+i,...n)}trace(e,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,i)}debug(e,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,i)}info(e,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,i)}warn(e,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,i)}error(e,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,i)}};bS=Ut([be(0,bn)],bS);var OR=class extends We{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new me),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new me),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new me),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,i,...n){if(i){for(let r=e;r<this._length-i;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let s=i-1;s>=0;s--)this.set(e+s+n,this.get(e+s));let r=e+i+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<i;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ze=3,oi=Object.freeze(new bd),Tm=0,jy=2,nf=class oz{constructor(e,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*Ze);let r=i||Rr.fromCharData([0,C6,1,0]);for(let s=0;s<e;++s)this.setCell(s,r);this.length=e}get(e){let i=this._data[e*Ze+0],n=i&2097151;return[this._data[e*Ze+1],i&2097152?this._combined[e]:n?pa(n):"",i>>22,i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,i){this._data[e*Ze+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[e*Ze+0]=e|2097152|i[2]<<22):this._data[e*Ze+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[e*Ze+0]>>22}hasWidth(e){return this._data[e*Ze+0]&12582912}getFg(e){return this._data[e*Ze+1]}getBg(e){return this._data[e*Ze+2]}hasContent(e){return this._data[e*Ze+0]&4194303}getCodePoint(e){let i=this._data[e*Ze+0];return i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):i&2097151}isCombined(e){return this._data[e*Ze+0]&2097152}getString(e){let i=this._data[e*Ze+0];return i&2097152?this._combined[e]:i&2097151?pa(i&2097151):""}isProtected(e){return this._data[e*Ze+2]&536870912}loadCell(e,i){return Tm=e*Ze,i.content=this._data[Tm+0],i.fg=this._data[Tm+1],i.bg=this._data[Tm+2],i.content&2097152&&(i.combinedData=this._combined[e]),i.bg&268435456&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){i.content&2097152&&(this._combined[e]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[e]=i.extended),this._data[e*Ze+0]=i.content,this._data[e*Ze+1]=i.fg,this._data[e*Ze+2]=i.bg}setCellFromCodepoint(e,i,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*Ze+0]=i|n<<22,this._data[e*Ze+1]=r.fg,this._data[e*Ze+2]=r.bg}addCodepointToCell(e,i,n){let r=this._data[e*Ze+0];r&2097152?this._combined[e]+=pa(i):r&2097151?(this._combined[e]=pa(r&2097151)+pa(i),r&=-2097152,r|=2097152):r=i|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*Ze+0]=r}insertCells(e,i,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length-e){let r=new Rr;for(let s=this.length-e-i-1;s>=0;--s)this.setCell(e+i+s,this.loadCell(e+s,r));for(let s=0;s<i;++s)this.setCell(e+s,n)}else for(let r=e;r<this.length;++r)this.setCell(r,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,i,n){if(e%=this.length,i<this.length-e){let r=new Rr;for(let s=0;s<this.length-e-i;++s)this.setCell(e+s,this.loadCell(e+i+s,r));for(let s=this.length-i;s<this.length;++s)this.setCell(s,n)}else for(let r=e;r<this.length;++r)this.setCell(r,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,i,n,r=!1){if(r){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.setCell(e++,n)}resize(e,i){if(e===this.length)return this._data.length*4*jy<this._data.buffer.byteLength;let n=e*Ze;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let r=new Uint32Array(n);r.set(this._data),this._data=r}for(let r=this.length;r<e;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,n);let r=Object.keys(this._combined);for(let o=0;o<r.length;o++){let l=parseInt(r[o],10);l>=e&&delete this._combined[l]}let s=Object.keys(this._extendedAttrs);for(let o=0;o<s.length;o++){let l=parseInt(s[o],10);l>=e&&delete this._extendedAttrs[l]}}return this.length=e,n*4*jy<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*jy<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,e);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,e)}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(let i in e._combined)this._combined[i]=e._combined[i];this._extendedAttrs={};for(let i in e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let e=new oz(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let i in this._combined)e._combined[i]=this._combined[i];for(let i in this._extendedAttrs)e._extendedAttrs[i]=this._extendedAttrs[i];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Ze+0]&4194303)return e+(this._data[e*Ze+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Ze+0]&4194303||this._data[e*Ze+2]&50331648)return e+(this._data[e*Ze+0]>>22);return 0}copyCellsFrom(e,i,n,r,s){let o=e._data;if(s)for(let c=r-1;c>=0;c--){for(let u=0;u<Ze;u++)this._data[(n+c)*Ze+u]=o[(i+c)*Ze+u];o[(i+c)*Ze+2]&268435456&&(this._extendedAttrs[n+c]=e._extendedAttrs[i+c])}else for(let c=0;c<r;c++){for(let u=0;u<Ze;u++)this._data[(n+c)*Ze+u]=o[(i+c)*Ze+u];o[(i+c)*Ze+2]&268435456&&(this._extendedAttrs[n+c]=e._extendedAttrs[i+c])}let l=Object.keys(e._combined);for(let c=0;c<l.length;c++){let u=parseInt(l[c],10);u>=i&&(this._combined[u-i+n]=e._combined[u])}}translateToString(e,i,n,r){i=i??0,n=n??this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let s="";for(;i<n;){let o=this._data[i*Ze+0],l=o&2097151,c=o&2097152?this._combined[i]:l?pa(l):va;if(s+=c,r)for(let u=0;u<c.length;++u)r.push(i);i+=o>>22||1}return r&&r.push(i),s}};function Vre(t,e,i,n,r,s){let o=[];for(let l=0;l<t.length-1;l++){let c=l,u=t.get(++c);if(!u.isWrapped)continue;let d=[t.get(l)];for(;c<t.length&&u.isWrapped;)d.push(u),u=t.get(++c);if(!s&&n>=l&&n<c){l+=d.length-1;continue}let p=0,g=id(d,p,e),O=1,_=0;for(;O<d.length;){let x=id(d,O,e),w=x-_,k=i-g,T=Math.min(w,k);d[p].copyCellsFrom(d[O],_,g,T,!1),g+=T,g===i&&(p++,g=0),_+=T,_===x&&(O++,_=0),g===0&&p!==0&&d[p-1].getWidth(i-1)===2&&(d[p].copyCellsFrom(d[p-1],i-1,g++,1,!1),d[p-1].setCell(i-1,r))}d[p].replaceCells(g,i,r);let b=0;for(let x=d.length-1;x>0&&(x>p||d[x].getTrimmedLength()===0);x--)b++;b>0&&(o.push(l+d.length-b),o.push(b)),l+=d.length-1}return o}function Xre(t,e){let i=[],n=0,r=e[n],s=0;for(let o=0;o<t.length;o++)if(r===o){let l=e[++n];t.onDeleteEmitter.fire({index:o-s,amount:l}),o+=l-1,s+=l,r=e[++n]}else i.push(o);return{layout:i,countRemoved:s}}function Zre(t,e){let i=[];for(let n=0;n<e.length;n++)i.push(t.get(e[n]));for(let n=0;n<i.length;n++)t.set(n,i[n]);t.length=e.length}function qre(t,e,i){let n=[],r=t.map((c,u)=>id(t,u,e)).reduce((c,u)=>c+u),s=0,o=0,l=0;for(;l<r;){if(r-l<i){n.push(r-l);break}s+=i;let c=id(t,o,e);s>c&&(s-=c,o++);let u=t[o].getWidth(s-1)===2;u&&s--;let d=u?i-1:i;n.push(d),l+=d}return n}function id(t,e,i){if(e===t.length-1)return t[e].getTrimmedLength();let n=!t[e].hasContent(i-1)&&t[e].getWidth(i-1)===1,r=t[e+1].getWidth(0)===2;return n&&r?i-1:i}var az=class lz{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=lz._nextId++,this._onDispose=this.register(new me),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),El(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};az._nextId=1;var Wre=az,yi={},ll=yi.B;yi[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:"≥","{":"π","|":"≠","}":"£","~":"·"};yi.A={"#":"£"};yi.B=void 0;yi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};yi.C=yi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};yi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};yi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};yi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};yi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};yi.E=yi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};yi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};yi.H=yi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};yi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var vR=4294967295,_R=class{constructor(t,e,i){this._hasScrollback=t,this._optionsService=e,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=oi.clone(),this.savedCharset=ll,this.markers=[],this._nullCell=Rr.fromCharData([0,C6,1,0]),this._whitespaceCell=Rr.fromCharData([0,va,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new tO,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new OR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Gg),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Gg),this._whitespaceCell}getBlankLine(t,e){return new nf(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let e=t+this._optionsService.rawOptions.scrollback;return e>vR?vR:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=oi);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new OR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(oi),n=0,r=this._getCorrectBufferLength(e);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<t)for(let o=0;o<this.lines.length;o++)n+=+this.lines.get(o).resize(t,i);let s=0;if(this._rows<e)for(let o=this._rows;o<e;o++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new nf(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new nf(t,i)));else for(let o=this._rows;o>e;o--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let o=this.lines.length-r;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let s=0;s<this.lines.length;s++)n+=+this.lines.get(s).resize(t,i);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=Vre(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(oi),i);if(n.length>0){let r=Xre(this.lines,n);Zre(this.lines,r.layout),this._reflowLargerAdjustViewport(t,e,r.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let n=this.getNullCell(oi),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new nf(t,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(oi),r=[],s=0;for(let o=this.lines.length-1;o>=0;o--){let l=this.lines.get(o);if(!l||!l.isWrapped&&l.getTrimmedLength()<=t)continue;let c=[l];for(;l.isWrapped&&o>0;)l=this.lines.get(--o),c.unshift(l);if(!i){let T=this.ybase+this.y;if(T>=o&&T<o+c.length)continue}let u=c[c.length-1].getTrimmedLength(),d=qre(c,this._cols,t),p=d.length-c.length,g;this.ybase===0&&this.y!==this.lines.length-1?g=Math.max(0,this.y-this.lines.maxLength+p):g=Math.max(0,this.lines.length-this.lines.maxLength+p);let O=[];for(let T=0;T<p;T++){let A=this.getBlankLine(oi,!0);O.push(A)}O.length>0&&(r.push({start:o+c.length+s,newLines:O}),s+=O.length),c.push(...O);let _=d.length-1,b=d[_];b===0&&(_--,b=d[_]);let x=c.length-p-1,w=u;for(;x>=0;){let T=Math.min(w,b);if(c[_]===void 0)break;if(c[_].copyCellsFrom(c[x],w-T,b-T,T,!0),b-=T,b===0&&(_--,b=d[_]),w-=T,w===0){x--;let A=Math.max(x,0);w=id(c,A,this._cols)}}for(let T=0;T<c.length;T++)d[T]<t&&c[T].setCell(d[T],n);let k=p-g;for(;k-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+e-1)}if(r.length>0){let o=[],l=[];for(let b=0;b<this.lines.length;b++)l.push(this.lines.get(b));let c=this.lines.length,u=c-1,d=0,p=r[d];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let g=0;for(let b=Math.min(this.lines.maxLength-1,c+s-1);b>=0;b--)if(p&&p.start>u+g){for(let x=p.newLines.length-1;x>=0;x--)this.lines.set(b--,p.newLines[x]);b++,o.push({index:u+1,amount:p.newLines.length}),g+=p.newLines.length,p=r[++d]}else this.lines.set(b,l[u--]);let O=0;for(let b=o.length-1;b>=0;b--)o[b].index+=O,this.lines.onInsertEmitter.fire(o[b]),O+=o[b].amount;let _=Math.max(0,c+s-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(t,e,i=0,n){let r=this.lines.get(t);return r?r.translateToString(e,i,n):""}getWrappedRangeForLine(t){let e=t,i=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:e,last:i}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let e=new Wre(t);return this.markers.push(e),e.register(this.lines.onTrim(i=>{e.line-=i,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i=>{e.line>=i.index&&(e.line+=i.amount)})),e.register(this.lines.onDelete(i=>{e.line>=i.index&&e.line<i.index+i.amount&&e.dispose(),e.line>i.index&&(e.line-=i.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},Ure=class extends We{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new me),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 _R(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new _R(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},cz=2,hz=1,SS=class extends We{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,cz),this.rows=Math.max(t.rawOptions.rows||0,hz),this.buffers=this._register(new Ure(t,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,e){let i=this.cols!==t,n=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:i,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let i=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==t.fg||n.getBg(0)!==t.bg)&&(n=i.getBlankLine(t,e),this._cachedBlankLine=n),n.isWrapped=e;let r=i.ybase+i.scrollTop,s=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;s===i.lines.length-1?o?i.lines.recycle().copyFrom(n):i.lines.push(n.clone()):i.lines.splice(s+1,0,n.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=s-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(s,n.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(t,e){let i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let n=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),n!==i.ydisp&&(e||this._onScroll.fire(i.ydisp))}};SS=Ut([be(0,bn)],SS);var wc={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:eO,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Yre=["normal","bold","100","200","300","400","500","600","700","800","900"],Hre=class extends We{constructor(e){super(),this._onOptionChange=this._register(new me),this.onOptionChange=this._onOptionChange.event;let i={...wc};for(let n in e)if(n in i)try{let r=e[n];i[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(Bt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in wc))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,r)=>{if(!(n in wc))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=wc[e]),!Fre(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=wc[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=Yre.includes(i)?i:wc[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function Fre(t){return t==="block"||t==="underline"||t==="bar"}function rf(t,e=5){if(typeof t!="object")return t;let i=Array.isArray(t)?[]:{};for(let n in t)i[n]=e<=1?t[n]:t[n]&&rf(t[n],e-1);return i}var yR=Object.freeze({insertMode:!1}),bR=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),xS=class extends We{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new me),this.onData=this._onData.event,this._onUserInput=this._register(new me),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new me),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=rf(yR),this.decPrivateModes=rf(bR)}reset(){this.modes=rf(yR),this.decPrivateModes=rf(bR)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};xS=Ut([be(0,yn),be(1,M6),be(2,bn)],xS);var SR={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function Iy(t,e){let i=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(i|=64,i|=t.action):(i|=t.button&3,t.button&4&&(i|=64),t.button&8&&(i|=128),t.action===32?i|=32:t.action===0&&!e&&(i|=3)),i}var Vy=String.fromCharCode,xR={DEFAULT:t=>{let e=[Iy(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${Vy(e[0])}${Vy(e[1])}${Vy(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Iy(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Iy(t,!0)};${t.x};${t.y}${e}`}},wS=class extends We{constructor(t,e,i){super(),this._bufferService=t,this._coreService=e,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new me),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(SR))this.addProtocol(n,SR[n]);for(let n of Object.keys(xR))this.addEncoding(n,xR[n]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,i){if(t.deltaY===0||t.shiftKey||e===void 0||i===void 0)return 0;let n=e/i,r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=n+0,Math.abs(t.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,i){if(i){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};wS=Ut([be(0,yn),be(1,Bl),be(2,bn)],wS);var Xy=[[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]],Gre=[[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]],gi;function Kre(t,e){let i=0,n=e.length-1,r;if(t<e[0][0]||t>e[n][1])return!1;for(;n>=i;)if(r=i+n>>1,t>e[r][1])i=r+1;else if(t<e[r][0])n=r-1;else return!0;return!1}var Jre=class{constructor(){if(this.version="6",!gi){gi=new Uint8Array(65536),gi.fill(1),gi[0]=0,gi.fill(0,1,32),gi.fill(0,127,160),gi.fill(2,4352,4448),gi[9001]=2,gi[9002]=2,gi.fill(2,11904,42192),gi[12351]=1,gi.fill(2,44032,55204),gi.fill(2,63744,64256),gi.fill(2,65040,65050),gi.fill(2,65072,65136),gi.fill(2,65280,65377),gi.fill(2,65504,65511);for(let e=0;e<Xy.length;++e)gi.fill(0,Xy[e][0],Xy[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?gi[e]:Kre(e,Gre)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),r=n===0&&i!==0;if(r){let s=vl.extractWidth(i);s===0?r=!1:s>n&&(n=s)}return vl.createPropertyValue(0,n,r)}},vl=class rg{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new me,this.onChange=this._onChange.event;let e=new Jre;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,n=!1){return(e&16777215)<<3|(i&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,n=0,r=e.length;for(let s=0;s<r;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=r)return i+this.wcwidth(o);let u=e.charCodeAt(s);56320<=u&&u<=57343?o=(o-55296)*1024+u-56320+65536:i+=this.wcwidth(u)}let l=this.charProperties(o,n),c=rg.extractWidth(l);rg.extractShouldJoin(l)&&(c-=rg.extractWidth(n)),i+=c,n=l}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},ese=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function wR(t){var n;let e=(n=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1))==null?void 0:n.get(t.cols-1),i=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);i&&e&&(i.isWrapped=e[3]!==0&&e[3]!==32)}var $u=2147483647,tse=256,uz=class CS{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>tse)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let i=new CS;if(!e.length)return i;for(let n=Array.isArray(e[0])?1:0;n<e.length;++n){let r=e[n];if(Array.isArray(r))for(let s=0;s<r.length;++s)i.addSubParam(r[s]);else i.addParam(r)}return i}clone(){let e=new CS(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let n=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>$u?$u:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>$u?$u:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-n>0&&(e[i]=this._subParams.slice(n,r))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[i-1];n[i-1]=~r?Math.min(r*10+e,$u):e}},zu=[],ise=class{constructor(){this._state=0,this._active=zu,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let r=n.indexOf(i);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=zu}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=zu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||zu,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",kO(e,i,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let r=e[i++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=zu,this._id=-1,this._state=0}}},Jn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=kO(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},Nu=[],nse=class{constructor(){this._handlers=Object.create(null),this._active=Nu,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Nu}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let r=n.indexOf(i);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Nu,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Nu,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",kO(e,i,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Nu,this._ident=0}},sf=new uz;sf.addParam(0);var CR=class{constructor(t){this._handler=t,this._data="",this._params=sf,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():sf,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=kO(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i=>(this._params=sf,this._data="",this._hitLimit=!1,i));return this._params=sf,this._data="",this._hitLimit=!1,e}},rse=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,r){this.table[i<<8|e]=n<<4|r}addMany(e,i,n,r){for(let s=0;s<e.length;s++)this.table[i<<8|e[s]]=n<<4|r}},Sr=160,sse=(function(){let t=new rse(4095),e=Array.apply(null,Array(256)).map((l,c)=>c),i=(l,c)=>e.slice(l,c),n=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let s=i(0,14),o;t.setDefault(1,0),t.addMany(n,0,2,0);for(o in s)t.addMany([24,26,153,154],o,3,0),t.addMany(i(128,144),o,3,0),t.addMany(i(144,152),o,3,0),t.add(156,o,0,0),t.add(27,o,11,1),t.add(157,o,4,8),t.addMany([152,158,159],o,0,7),t.add(155,o,11,3),t.add(144,o,11,9);return t.addMany(r,0,3,0),t.addMany(r,1,3,1),t.add(127,1,0,1),t.addMany(r,8,0,8),t.addMany(r,3,3,3),t.add(127,3,0,3),t.addMany(r,4,3,4),t.add(127,4,0,4),t.addMany(r,6,3,6),t.addMany(r,5,3,5),t.add(127,5,0,5),t.addMany(r,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(n,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(i(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(n,7,0,7),t.addMany(r,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(i(64,127),3,7,0),t.addMany(i(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(i(48,60),4,8,4),t.addMany(i(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(i(32,64),6,0,6),t.add(127,6,0,6),t.addMany(i(64,127),6,0,0),t.addMany(i(32,48),3,9,5),t.addMany(i(32,48),5,9,5),t.addMany(i(48,64),5,0,6),t.addMany(i(64,127),5,7,0),t.addMany(i(32,48),4,9,5),t.addMany(i(32,48),1,9,2),t.addMany(i(32,48),2,9,2),t.addMany(i(48,127),2,10,0),t.addMany(i(48,80),1,10,0),t.addMany(i(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(i(96,127),1,10,0),t.add(80,1,11,9),t.addMany(r,9,0,9),t.add(127,9,0,9),t.addMany(i(28,32),9,0,9),t.addMany(i(32,48),9,9,12),t.addMany(i(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(r,11,0,11),t.addMany(i(32,128),11,0,11),t.addMany(i(28,32),11,0,11),t.addMany(r,10,0,10),t.add(127,10,0,10),t.addMany(i(28,32),10,0,10),t.addMany(i(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(i(32,48),10,9,12),t.addMany(r,12,0,12),t.add(127,12,0,12),t.addMany(i(28,32),12,0,12),t.addMany(i(32,48),12,9,12),t.addMany(i(48,64),12,0,11),t.addMany(i(64,127),12,12,13),t.addMany(i(64,127),10,12,13),t.addMany(i(64,127),9,12,13),t.addMany(r,13,13,13),t.addMany(n,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(Sr,0,2,0),t.add(Sr,8,5,8),t.add(Sr,6,0,6),t.add(Sr,11,0,11),t.add(Sr,13,13,13),t})(),ose=class extends We{constructor(e=sse){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new uz,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,r)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Bt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new ise),this._dcsParser=this._register(new nse),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let o=e.intermediates.charCodeAt(s);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(i[0]>r||r>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=r,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(i),{dispose:()=>{let s=r.indexOf(i);s!==-1&&r.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(i),{dispose:()=>{let s=r.indexOf(i);s!==-1&&r.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,i,n,r,s){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(e,i,n){let r=0,s=0,o=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let c=this._parseStack.handlers,u=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&u>-1){for(;u>=0&&(l=c[u](this._params),l!==!0);u--)if(l instanceof Promise)return this._parseStack.handlerPos=u,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&u>-1){for(;u>=0&&(l=c[u](),l!==!0);u--)if(l instanceof Promise)return this._parseStack.handlerPos=u,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let c=o;c<i;++c){switch(r=e[c],s=this._transitions.table[this.currentState<<8|(r<160?r:Sr)],s>>4){case 2:for(let O=c+1;;++O){if(O>=i||(r=e[O])<32||r>126&&r<Sr){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(r=e[O])<32||r>126&&r<Sr){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(r=e[O])<32||r>126&&r<Sr){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(r=e[O])<32||r>126&&r<Sr){this._printHandler(e,c,O),c=O-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:c,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let u=this._csiHandlers[this._collect<<8|r],d=u?u.length-1:-1;for(;d>=0&&(l=u[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,u,d,s,c),l;d<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++c<i&&(r=e[c])>47&&r<60);c--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let p=this._escHandlers[this._collect<<8|r],g=p?p.length-1:-1;for(;g>=0&&(l=p[g](),l!==!0);g--)if(l instanceof Promise)return this._preserveStack(4,p,g,s,c),l;g<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let O=c+1;;++O)if(O>=i||(r=e[O])===24||r===26||r===27||r>127&&r<Sr){this._dcsParser.put(e,c,O),c=O-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,s,c),l;r===27&&(s|=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 O=c+1;;O++)if(O>=i||(r=e[O])<32||r>127&&r<Sr){this._oscParser.put(e,c,O),c=O-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,s,c),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},ase=/^([\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})$/,lse=/^[\da-f]+$/;function kR(t){if(!t)return;let e=t.toLowerCase();if(e.indexOf("rgb:")===0){e=e.slice(4);let i=ase.exec(e);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(e.indexOf("#")===0&&(e=e.slice(1),lse.exec(e)&&[3,6,9,12].includes(e.length))){let i=e.length/3,n=[0,0,0];for(let r=0;r<3;++r){let s=parseInt(e.slice(i*r,i*r+i),16);n[r]=i===1?s<<4:i===2?s:i===3?s>>4:s>>8}return n}}function Zy(t,e){let i=t.toString(16),n=i.length<2?"0"+i:i;switch(e){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function cse(t,e=16){let[i,n,r]=t;return`rgb:${Zy(i,e)}/${Zy(n,e)}/${Zy(r,e)}`}var hse={"(":0,")":1,"*":2,"+":3,"-":1,".":2},sa=131072,TR=10;function AR(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var ER=5e3,MR=0,use=class extends We{constructor(t,e,i,n,r,s,o,l,c=new ose){super(),this._bufferService=t,this._charsetService=e,this._coreService=i,this._logService=n,this._optionsService=r,this._oscLinkService=s,this._coreMouseService=o,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Mie,this._utf8Decoder=new Pie,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=oi.clone(),this._eraseAttrDataInternal=oi.clone(),this._onRequestBell=this._register(new me),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new me),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new me),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new me),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new me),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new me),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new me),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new me),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new me),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 kS(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(u=>this._activeBuffer=u.activeBuffer)),this._parser.setCsiHandlerFallback((u,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(u),params:d.toArray()})}),this._parser.setEscHandlerFallback(u=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(u)})}),this._parser.setExecuteHandlerFallback(u=>{this._logService.debug("Unknown EXECUTE code: ",{code:u})}),this._parser.setOscHandlerFallback((u,d,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:u,action:d,data:p})}),this._parser.setDcsHandlerFallback((u,d,p)=>{d==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(u),action:d,payload:p})}),this._parser.setPrintHandler((u,d,p)=>this.print(u,d,p)),this._parser.registerCsiHandler({final:"@"},u=>this.insertChars(u)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},u=>this.scrollLeft(u)),this._parser.registerCsiHandler({final:"A"},u=>this.cursorUp(u)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},u=>this.scrollRight(u)),this._parser.registerCsiHandler({final:"B"},u=>this.cursorDown(u)),this._parser.registerCsiHandler({final:"C"},u=>this.cursorForward(u)),this._parser.registerCsiHandler({final:"D"},u=>this.cursorBackward(u)),this._parser.registerCsiHandler({final:"E"},u=>this.cursorNextLine(u)),this._parser.registerCsiHandler({final:"F"},u=>this.cursorPrecedingLine(u)),this._parser.registerCsiHandler({final:"G"},u=>this.cursorCharAbsolute(u)),this._parser.registerCsiHandler({final:"H"},u=>this.cursorPosition(u)),this._parser.registerCsiHandler({final:"I"},u=>this.cursorForwardTab(u)),this._parser.registerCsiHandler({final:"J"},u=>this.eraseInDisplay(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},u=>this.eraseInDisplay(u,!0)),this._parser.registerCsiHandler({final:"K"},u=>this.eraseInLine(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},u=>this.eraseInLine(u,!0)),this._parser.registerCsiHandler({final:"L"},u=>this.insertLines(u)),this._parser.registerCsiHandler({final:"M"},u=>this.deleteLines(u)),this._parser.registerCsiHandler({final:"P"},u=>this.deleteChars(u)),this._parser.registerCsiHandler({final:"S"},u=>this.scrollUp(u)),this._parser.registerCsiHandler({final:"T"},u=>this.scrollDown(u)),this._parser.registerCsiHandler({final:"X"},u=>this.eraseChars(u)),this._parser.registerCsiHandler({final:"Z"},u=>this.cursorBackwardTab(u)),this._parser.registerCsiHandler({final:"`"},u=>this.charPosAbsolute(u)),this._parser.registerCsiHandler({final:"a"},u=>this.hPositionRelative(u)),this._parser.registerCsiHandler({final:"b"},u=>this.repeatPrecedingCharacter(u)),this._parser.registerCsiHandler({final:"c"},u=>this.sendDeviceAttributesPrimary(u)),this._parser.registerCsiHandler({prefix:">",final:"c"},u=>this.sendDeviceAttributesSecondary(u)),this._parser.registerCsiHandler({final:"d"},u=>this.linePosAbsolute(u)),this._parser.registerCsiHandler({final:"e"},u=>this.vPositionRelative(u)),this._parser.registerCsiHandler({final:"f"},u=>this.hVPosition(u)),this._parser.registerCsiHandler({final:"g"},u=>this.tabClear(u)),this._parser.registerCsiHandler({final:"h"},u=>this.setMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"h"},u=>this.setModePrivate(u)),this._parser.registerCsiHandler({final:"l"},u=>this.resetMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"l"},u=>this.resetModePrivate(u)),this._parser.registerCsiHandler({final:"m"},u=>this.charAttributes(u)),this._parser.registerCsiHandler({final:"n"},u=>this.deviceStatus(u)),this._parser.registerCsiHandler({prefix:"?",final:"n"},u=>this.deviceStatusPrivate(u)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},u=>this.softReset(u)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},u=>this.setCursorStyle(u)),this._parser.registerCsiHandler({final:"r"},u=>this.setScrollRegion(u)),this._parser.registerCsiHandler({final:"s"},u=>this.saveCursor(u)),this._parser.registerCsiHandler({final:"t"},u=>this.windowOptions(u)),this._parser.registerCsiHandler({final:"u"},u=>this.restoreCursor(u)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},u=>this.insertColumns(u)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},u=>this.deleteColumns(u)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},u=>this.selectProtected(u)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},u=>this.requestMode(u,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},u=>this.requestMode(u,!1)),this._parser.setExecuteHandler(ce.BEL,()=>this.bell()),this._parser.setExecuteHandler(ce.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ce.BS,()=>this.backspace()),this._parser.setExecuteHandler(ce.HT,()=>this.tab()),this._parser.setExecuteHandler(ce.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ce.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ig.IND,()=>this.index()),this._parser.setExecuteHandler(ig.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ig.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Jn(u=>(this.setTitle(u),this.setIconName(u),!0))),this._parser.registerOscHandler(1,new Jn(u=>this.setIconName(u))),this._parser.registerOscHandler(2,new Jn(u=>this.setTitle(u))),this._parser.registerOscHandler(4,new Jn(u=>this.setOrReportIndexedColor(u))),this._parser.registerOscHandler(8,new Jn(u=>this.setHyperlink(u))),this._parser.registerOscHandler(10,new Jn(u=>this.setOrReportFgColor(u))),this._parser.registerOscHandler(11,new Jn(u=>this.setOrReportBgColor(u))),this._parser.registerOscHandler(12,new Jn(u=>this.setOrReportCursorColor(u))),this._parser.registerOscHandler(104,new Jn(u=>this.restoreIndexedColor(u))),this._parser.registerOscHandler(110,new Jn(u=>this.restoreFgColor(u))),this._parser.registerOscHandler(111,new Jn(u=>this.restoreBgColor(u))),this._parser.registerOscHandler(112,new Jn(u=>this.restoreCursorColor(u))),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(let u in yi)this._parser.registerEscHandler({intermediates:"(",final:u},()=>this.selectCharset("("+u)),this._parser.registerEscHandler({intermediates:")",final:u},()=>this.selectCharset(")"+u)),this._parser.registerEscHandler({intermediates:"*",final:u},()=>this.selectCharset("*"+u)),this._parser.registerEscHandler({intermediates:"+",final:u},()=>this.selectCharset("+"+u)),this._parser.registerEscHandler({intermediates:"-",final:u},()=>this.selectCharset("-"+u)),this._parser.registerEscHandler({intermediates:".",final:u},()=>this.selectCharset("."+u)),this._parser.registerEscHandler({intermediates:"/",final:u},()=>this.selectCharset("/"+u));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(u=>(this._logService.error("Parsing error: ",u),u)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new CR((u,d)=>this.requestStatusString(u,d)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),ER))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${ER} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let i,n=this._activeBuffer.x,r=this._activeBuffer.y,s=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>sa&&(s=this._parseStack.position+sa)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,u=>String.fromCharCode(u)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(u=>u.charCodeAt(0)):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<sa&&(this._parseBuffer=new Uint32Array(Math.min(t.length,sa))),o||this._dirtyRowTracker.clearRange(),t.length>sa)for(let u=s;u<t.length;u+=sa){let d=u+sa<t.length?u+sa:t.length,p=typeof t=="string"?this._stringDecoder.decode(t.substring(u,d),this._parseBuffer):this._utf8Decoder.decode(t.subarray(u,d),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,p))return this._preserveStack(n,r,p,u),this._logSlowResolvingAsync(i),i}else if(!o){let u=typeof t=="string"?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(n,r,u,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(t,e,i){let n,r,s=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-e>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let g=this._parser.precedingJoinState;for(let O=e;O<i;++O){if(n=t[O],n<127&&s){let w=s[String.fromCharCode(n)];w&&(n=w.charCodeAt(0))}let _=this._unicodeService.charProperties(n,g);r=vl.extractWidth(_);let b=vl.extractShouldJoin(_),x=b?vl.extractWidth(g):0;if(g=_,o&&this._onA11yChar.fire(pa(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-x>l){if(c){let w=p,k=this._activeBuffer.x-x;for(this._activeBuffer.x=x,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),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),x>0&&p instanceof nf&&p.copyCellsFrom(w,k,0,x,!1);k<l;)w.setCellFromCodepoint(k++,0,1,d)}else if(this._activeBuffer.x=l-1,r===2)continue}if(b&&this._activeBuffer.x){let w=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-w,n,r);for(let k=r-x;--k>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(u&&(p.insertCells(this._activeBuffer.x,r-x,this._activeBuffer.getNullCell(d)),p.getWidth(l-1)===2&&p.setCellFromCodepoint(l-1,0,1,d)),p.setCellFromCodepoint(this._activeBuffer.x++,n,r,d),r>0)for(;--r;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=g,this._activeBuffer.x<l&&i-e>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,i=>AR(i.params[0],this._optionsService.rawOptions.windowOptions)?e(i):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new CR(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Jn(e))}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 t;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&&((t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&t.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,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(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,i,n=!1,r=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);s.replaceCells(e,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),n&&(s.isWrapped=!1)}_resetBufferLine(t,e=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),i.isWrapped=!1)}eraseInDisplay(t,e=!1){var n;this._restrictCursor(this._bufferService.cols);let i;switch(t.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);i<this._bufferService.rows;i++)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,e),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i))!=null&&n.getTrimmedLength()););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let r=this._activeBuffer.lines.length-this._bufferService.rows;r>0&&(this._activeBuffer.lines.trimStart(r),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-r,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-r,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;e--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;e--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let e=t.params[0]||1;for(;e--;)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(t){let e=t.params[0]||1;for(;e--;)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(oi));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){let e=this._parser.precedingJoinState;if(!e)return!0;let i=t.params[0]||1,n=vl.extractWidth(e),r=this._activeBuffer.x-n,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),o=new Uint32Array(s.length*i),l=0;for(let u=0;u<s.length;){let d=s.codePointAt(u)||0;o[l++]=d,u+=d>65535?2:1}let c=l;for(let u=1;u<i;++u)o.copyWithin(c,0,l),c+=l;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ce.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ce.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ce.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ce.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ce.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,ll),this._charsetService.setgCharset(1,ll),this._charsetService.setgCharset(2,ll),this._charsetService.setgCharset(3,ll);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),t.params[e]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(t,e){(b=>(b[b.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",b[b.SET=1]="SET",b[b.RESET=2]="RESET",b[b.PERMANENTLY_SET=3]="PERMANENTLY_SET",b[b.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(i={}));let n=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:s}=this._coreMouseService,o=this._coreService,{buffers:l,cols:c}=this._bufferService,{active:u,alt:d}=l,p=this._optionsService.rawOptions,g=(b,x)=>(o.triggerDataEvent(`${ce.ESC}[${e?"":"?"}${b};${x}$y`),!0),O=b=>b?1:2,_=t.params[0];return e?_===2?g(_,4):_===4?g(_,O(o.modes.insertMode)):_===12?g(_,3):_===20?g(_,O(p.convertEol)):g(_,0):_===1?g(_,O(n.applicationCursorKeys)):_===3?g(_,p.windowOptions.setWinLines?c===80?2:c===132?1:0:0):_===6?g(_,O(n.origin)):_===7?g(_,O(n.wraparound)):_===8?g(_,3):_===9?g(_,O(r==="X10")):_===12?g(_,O(p.cursorBlink)):_===25?g(_,O(!o.isCursorHidden)):_===45?g(_,O(n.reverseWraparound)):_===66?g(_,O(n.applicationKeypad)):_===67?g(_,4):_===1e3?g(_,O(r==="VT200")):_===1002?g(_,O(r==="DRAG")):_===1003?g(_,O(r==="ANY")):_===1004?g(_,O(n.sendFocus)):_===1005?g(_,4):_===1006?g(_,O(s==="SGR")):_===1015?g(_,4):_===1016?g(_,O(s==="SGR_PIXELS")):_===1048?g(_,1):_===47||_===1047||_===1049?g(_,O(u===d)):_===2004?g(_,O(n.bracketedPasteMode)):_===2026?g(_,O(n.synchronizedOutput)):g(_,0)}_updateAttrColor(t,e,i,n,r){return e===2?(t|=50331648,t&=-16777216,t|=bd.fromColorRGB([i,n,r])):e===5&&(t&=-50331904,t|=33554432|i&255),t}_extractColor(t,e,i){let n=[0,0,-1,0,0,0],r=0,s=0;do{if(n[s+r]=t.params[e+s],t.hasSubParams(e+s)){let o=t.getSubParams(e+s),l=0;do n[1]===5&&(r=1),n[s+l+1+r]=o[l];while(++l<o.length&&l+s+1+r<n.length);break}if(n[1]===5&&s+r>=2||n[1]===2&&s+r>=5)break;n[1]&&(r=1)}while(++s+e<t.length&&s+r<n.length);for(let o=2;o<n.length;++o)n[o]===-1&&(n[o]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return s}_processUnderline(t,e){e.extended=e.extended.clone(),(!~t||t>5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=oi.fg,t.bg=oi.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,i,n=this._curAttrData;for(let r=0;r<e;r++)i=t.params[r],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(t.hasSubParams(r)?t.getSubParams(r)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=oi.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=oi.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(t,r,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=oi.fg&16777215,n.bg&=-67108864,n.bg|=oi.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${ce.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[${e};${i}R`);break}return!0}deviceStatusPrivate(t){switch(t.params[0]){case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[?${e};${i}R`);break}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=oi.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(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=e%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(t){let e=t.params[0]||1,i;return(t.length<2||(i=t.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(t){if(!AR(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ce.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>TR&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>TR&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){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(t){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(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],i=t.split(";");for(;i.length>1;){let n=i.shift(),r=i.shift();if(/^\d+$/.exec(n)){let s=parseInt(n);if(PR(s))if(r==="?")e.push({type:0,index:s});else{let o=kR(r);o&&e.push({type:1,index:s,color:o})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let i=t.slice(0,e).trim(),n=t.slice(e+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let i=t.split(":"),n,r=i.findIndex(s=>s.startsWith("id="));return r!==-1&&(n=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let i=t.split(";");for(let n=0;n<i.length&&!(e>=this._specialColors.length);++n,++e)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let r=kR(i[n]);r&&this._onColor.fire([{type:1,index:this._specialColors[e],color:r}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],i=t.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let r=parseInt(i[n]);PR(r)&&e.push({type:2,index:r})}return e.length&&this._onColor.fire(e),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){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,ll),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(hse[t[0]],yi[t[1]]||ll),!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){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,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=oi.clone(),this._eraseAttrDataInternal=oi.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new Rr;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e<this._bufferService.rows;++e){let i=this._activeBuffer.ybase+this._activeBuffer.y+e,n=this._activeBuffer.lines.get(i);n&&(n.fill(t),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,e){let i=o=>(this._coreService.triggerDataEvent(`${ce.ESC}${o}${ce.ESC}\\`),!0),n=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},kS=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(MR=t,t=e,e=MR),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};kS=Ut([be(0,yn)],kS);function PR(t){return 0<=t&&t<256}var fse=5e7,RR=12,dse=50,pse=class extends We{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>fse)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],s=this._action(r,i);if(s){let l=c=>performance.now()-n>=RR?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(n,c);s.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(l);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=RR)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>dse&&(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()}},TS=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let c=i.addMarker(i.ybase+i.y),u={data:e,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._dataByLinkId.set(u.id,u),u.id}let n=e,r=this._getEntryIdKey(n),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,i.ybase+i.y),s.id;let o=i.addMarker(i.ybase+i.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==i)){let r=this._bufferService.buffer.addMarker(i);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var i;return(i=this._dataByLinkId.get(e))==null?void 0:i.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};TS=Ut([be(0,yn)],TS);var QR=!1,mse=class extends We{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ph),this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onData=this._register(new me),this.onData=this._onData.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new me),this._instantiationService=new Nre,this.optionsService=this._register(new Hre(e)),this._instantiationService.setService(bn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(SS)),this._instantiationService.setService(yn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(bS)),this._instantiationService.setService(M6,this._logService),this.coreService=this._register(this._instantiationService.createInstance(xS)),this._instantiationService.setService(Bl,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(wS)),this._instantiationService.setService(E6,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(vl)),this._instantiationService.setService(Die,this.unicodeService),this._charsetService=this._instantiationService.createInstance(ese),this._instantiationService.setService(Lie,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(TS),this._instantiationService.setService(P6,this._oscLinkService),this._inputHandler=this._register(new use(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Gi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Gi.forward(this._bufferService.onResize,this._onResize)),this._register(Gi.forward(this.coreService.onData,this._onData)),this._register(Gi.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new pse((i,n)=>this._inputHandler.parse(i,n))),this._register(Gi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new me),this._onScroll.event(e=>{var i;(i=this._onScrollApi)==null||i.fire(e.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(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!QR&&(this._logService.warn("writeSync is unreliable and will be removed soon."),QR=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,cz),i=Math.max(i,hz),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(wR.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(wR(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Bt(()=>{for(let i of e)i.dispose()})}}},gse={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:["'",'"']};function Ose(t,e,i,n){var o;let r={type:0,cancel:!1,key:void 0},s=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?r.key=ce.ESC+"OA":r.key=ce.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?r.key=ce.ESC+"OD":r.key=ce.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?r.key=ce.ESC+"OC":r.key=ce.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?r.key=ce.ESC+"OB":r.key=ce.ESC+"[B");break;case 8:r.key=t.ctrlKey?"\b":ce.DEL,t.altKey&&(r.key=ce.ESC+r.key);break;case 9:if(t.shiftKey){r.key=ce.ESC+"[Z";break}r.key=ce.HT,r.cancel=!0;break;case 13:r.key=t.altKey?ce.ESC+ce.CR:ce.CR,r.cancel=!0;break;case 27:r.key=ce.ESC,t.altKey&&(r.key=ce.ESC+ce.ESC),r.cancel=!0;break;case 37:if(t.metaKey)break;s?r.key=ce.ESC+"[1;"+(s+1)+"D":e?r.key=ce.ESC+"OD":r.key=ce.ESC+"[D";break;case 39:if(t.metaKey)break;s?r.key=ce.ESC+"[1;"+(s+1)+"C":e?r.key=ce.ESC+"OC":r.key=ce.ESC+"[C";break;case 38:if(t.metaKey)break;s?r.key=ce.ESC+"[1;"+(s+1)+"A":e?r.key=ce.ESC+"OA":r.key=ce.ESC+"[A";break;case 40:if(t.metaKey)break;s?r.key=ce.ESC+"[1;"+(s+1)+"B":e?r.key=ce.ESC+"OB":r.key=ce.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(r.key=ce.ESC+"[2~");break;case 46:s?r.key=ce.ESC+"[3;"+(s+1)+"~":r.key=ce.ESC+"[3~";break;case 36:s?r.key=ce.ESC+"[1;"+(s+1)+"H":e?r.key=ce.ESC+"OH":r.key=ce.ESC+"[H";break;case 35:s?r.key=ce.ESC+"[1;"+(s+1)+"F":e?r.key=ce.ESC+"OF":r.key=ce.ESC+"[F";break;case 33:t.shiftKey?r.type=2:t.ctrlKey?r.key=ce.ESC+"[5;"+(s+1)+"~":r.key=ce.ESC+"[5~";break;case 34:t.shiftKey?r.type=3:t.ctrlKey?r.key=ce.ESC+"[6;"+(s+1)+"~":r.key=ce.ESC+"[6~";break;case 112:s?r.key=ce.ESC+"[1;"+(s+1)+"P":r.key=ce.ESC+"OP";break;case 113:s?r.key=ce.ESC+"[1;"+(s+1)+"Q":r.key=ce.ESC+"OQ";break;case 114:s?r.key=ce.ESC+"[1;"+(s+1)+"R":r.key=ce.ESC+"OR";break;case 115:s?r.key=ce.ESC+"[1;"+(s+1)+"S":r.key=ce.ESC+"OS";break;case 116:s?r.key=ce.ESC+"[15;"+(s+1)+"~":r.key=ce.ESC+"[15~";break;case 117:s?r.key=ce.ESC+"[17;"+(s+1)+"~":r.key=ce.ESC+"[17~";break;case 118:s?r.key=ce.ESC+"[18;"+(s+1)+"~":r.key=ce.ESC+"[18~";break;case 119:s?r.key=ce.ESC+"[19;"+(s+1)+"~":r.key=ce.ESC+"[19~";break;case 120:s?r.key=ce.ESC+"[20;"+(s+1)+"~":r.key=ce.ESC+"[20~";break;case 121:s?r.key=ce.ESC+"[21;"+(s+1)+"~":r.key=ce.ESC+"[21~";break;case 122:s?r.key=ce.ESC+"[23;"+(s+1)+"~":r.key=ce.ESC+"[23~";break;case 123:s?r.key=ce.ESC+"[24;"+(s+1)+"~":r.key=ce.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?r.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?r.key=ce.NUL:t.keyCode>=51&&t.keyCode<=55?r.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?r.key=ce.DEL:t.keyCode===219?r.key=ce.ESC:t.keyCode===220?r.key=ce.FS:t.keyCode===221&&(r.key=ce.GS);else if((!i||n)&&t.altKey&&!t.metaKey){let l=(o=gse[t.keyCode])==null?void 0:o[t.shiftKey?1:0];if(l)r.key=ce.ESC+l;else if(t.keyCode>=65&&t.keyCode<=90){let c=t.ctrlKey?t.keyCode-64:t.keyCode+32,u=String.fromCharCode(c);t.shiftKey&&(u=u.toUpperCase()),r.key=ce.ESC+u}else if(t.keyCode===32)r.key=ce.ESC+(t.ctrlKey?ce.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let c=t.code.slice(3,4);t.shiftKey||(c=c.toLowerCase()),r.key=ce.ESC+c,r.cancel=!0}}else i&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(r.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?r.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(r.key=ce.US),t.key==="@"&&(r.key=ce.NUL));break}return r}var Gt=0,vse=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new tO,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new tO,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,o)=>this._getKey(s)-this._getKey(o)),i=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<r.length;s++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(r[s]=e[i],i++):r[s]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(Gt=this._search(i),Gt===-1)||this._getKey(this._array[Gt])!==i)return!1;do if(this._array[Gt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Gt),!0;while(++Gt<this._array.length&&this._getKey(this._array[Gt])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,o)=>s-o),i=0,n=new Array(this._array.length-e.length),r=0;for(let s=0;s<this._array.length;s++)e[i]===s?i++:n[r++]=this._array[s];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Gt=this._search(e),!(Gt<0||Gt>=this._array.length)&&this._getKey(this._array[Gt])===e))do yield this._array[Gt];while(++Gt<this._array.length&&this._getKey(this._array[Gt])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Gt=this._search(e),!(Gt<0||Gt>=this._array.length)&&this._getKey(this._array[Gt])===e))do i(this._array[Gt]);while(++Gt<this._array.length&&this._getKey(this._array[Gt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let r=i+n>>1,s=this._getKey(this._array[r]);if(s>e)n=r-1;else if(s<e)i=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return i}},qy=0,LR=0,_se=class extends We{constructor(){super(),this._decorations=new vse(t=>t==null?void 0:t.marker.line),this._onDecorationRegistered=this._register(new me),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new me),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Bt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new yse(t);if(e){let i=e.marker.onDispose(()=>e.dispose()),n=e.onDispose(()=>{n.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),i.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,i){let n=0,r=0;for(let s of this._decorations.getKeyIterator(e))n=s.options.x??0,r=n+(s.options.width??1),t>=n&&t<r&&(!i||(s.options.layer??"bottom")===i)&&(yield s)}forEachDecorationAtCell(t,e,i,n){this._decorations.forEachByKey(e,r=>{qy=r.options.x??0,LR=qy+(r.options.width??1),t>=qy&&t<LR&&(!i||(r.options.layer??"bottom")===i)&&n(r)})}},yse=class extends ya{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new me),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new me),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=zt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=zt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},bse=1e3,Sse=class{constructor(e,i=bse){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=r-this._lastRefreshMs,o=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},DR=20,iO=class extends We{constructor(t,e,i,n){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new Sse(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(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
117
|
+
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Be(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Bt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<DR+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
|
|
118
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===DR+1&&(this._liveRegion.textContent+=Ub.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let i=this._terminal.buffer,n=i.lines.length.toString();for(let r=t;r<=e;r++){let s=i.lines.get(i.ydisp+r),o=[],l=(s==null?void 0:s.translateToString(!0,void 0,void 0,o))||"",c=(i.ydisp+r+1).toString(),u=this._rowElements[r];u&&(l.length===0?(u.textContent=" ",this._rowColumns.set(u,[0,1])):(u.textContent=l,this._rowColumns.set(u,o)),u.setAttribute("aria-posinset",c),u.setAttribute("aria-setsize",n),this._alignRowWidth(u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,n=this._rowElements[e===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),s=e===0?"1":`${this._terminal.buffer.lines.length}`;if(r===s||t.relatedTarget!==n)return;let o,l;if(e===0?(o=i,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{let c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){var l;if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===i.node&&e.offset>i.offset)&&([e,i]=[i,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:((l=n.textContent)==null?void 0:l.length)??0}),!this._rowContainer.contains(i.node))return;let r=({node:c,offset:u})=>{let d=c instanceof Text?c.parentNode:c,p=parseInt(d==null?void 0:d.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let g=this._rowColumns.get(d);if(!g)return console.warn("columns is null. Race condition?"),null;let O=u<g.length?g[u]:g.slice(-1)[0]+1;return O>=this._terminal.cols&&(++p,O=0),{row:p,column:O}},s=r(e),o=r(i);if(!(!s||!o)){if(s.row>o.row||s.row===o.row&&s.column>=o.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(o.row-s.row)*this._terminal.cols-s.column+o.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){var r,s;t.style.transform="";let e=t.getBoundingClientRect().width,i=(s=(r=this._rowColumns.get(t))==null?void 0:r.slice(-1))==null?void 0:s[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${n/e})`}};iO=Ut([be(1,Mw),be(2,xo),be(3,wo)],iO);var AS=class extends We{constructor(t,e,i,n,r){super(),this._element=t,this._mouseService=e,this._renderService=i,this._bufferService=n,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new me),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new me),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Bt(()=>{var s;El(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(s=this._activeProviderReplies)==null||s.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Be(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Be(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Be(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Be(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let i=t.composedPath();for(let n=0;n<i.length;n++){let r=i[n];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||e.x!==this._lastBufferCell.x||e.y!==this._lastBufferCell.y)&&(this._handleHover(e),this._lastBufferCell=e)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized){this._clearCurrentLink(),this._askForLink(t,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,e){var n,r;(!this._activeProviderReplies||!e)&&((n=this._activeProviderReplies)==null||n.forEach(s=>{s==null||s.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(let[s,o]of this._linkProviderService.linkProviders.entries())e?(r=this._activeProviderReplies)!=null&&r.get(s)&&(i=this._checkLinkProviderResult(s,t,i)):o.provideLinks(t.y,l=>{var u,d;if(this._isMouseOut)return;let c=l==null?void 0:l.map(p=>({link:p}));(u=this._activeProviderReplies)==null||u.set(s,c),i=this._checkLinkProviderResult(s,t,i),((d=this._activeProviderReplies)==null?void 0:d.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let i=new Set;for(let n=0;n<e.size;n++){let r=e.get(n);if(r)for(let s=0;s<r.length;s++){let o=r[s],l=o.link.range.start.y<t?0:o.link.range.start.x,c=o.link.range.end.y>t?this._bufferService.cols:o.link.range.end.x;for(let u=l;u<=c;u++){if(i.has(u)){r.splice(s--,1);break}i.add(u)}}}}_checkLinkProviderResult(t,e,i){var s;if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(t),r=!1;for(let o=0;o<t;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(r=!0);if(!r&&n){let o=n.find(l=>this._linkAtPosition(l.link,e));o&&(i=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let o=0;o<this._activeProviderReplies.size;o++){let l=(s=this._activeProviderReplies.get(o))==null?void 0:s.find(c=>this._linkAtPosition(c.link,e));if(l){i=!0,this._handleNewLink(l);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&xse(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,El(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>{var i,n;return(n=(i=this._currentLink)==null?void 0:i.state)==null?void 0:n.decorations.pointerCursor},set:i=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>{var i,n;return(n=(i=this._currentLink)==null?void 0:i.state)==null?void 0:n.decorations.underline},set:i=>{var n,r,s;(n=this._currentLink)!=null&&n.state&&((s=(r=this._currentLink)==null?void 0:r.state)==null?void 0:s.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(n,r),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(t,e,i){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(t,e){let i=t.range,n=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(t,e,i){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(t,e){let i=t.range.start.y*this._bufferService.cols+t.range.start.x,n=t.range.end.y*this._bufferService.cols+t.range.end.x,r=e.y*this._bufferService.cols+e.x;return i<=r&&r<=n}_positionFromMouseEvent(t,e,i){let n=i.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,i,n,r){return{x1:t,y1:e,x2:i,y2:n,cols:this._bufferService.cols,fg:r}}};AS=Ut([be(1,Pw),be(2,wo),be(3,yn),be(4,Q6)],AS);function xse(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var wse=class extends mse{constructor(e={}){super(e),this._linkifier=this._register(new ph),this.browser=K6,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ph),this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new me),this.onKey=this._onKey.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new me),this.onBell=this._onBell.event,this._onFocus=this._register(new me),this._onBlur=this._register(new me),this._onA11yCharEmitter=this._register(new me),this._onA11yTabEmitter=this._register(new me),this._onWillOpen=this._register(new me),this._setup(),this._decorationService=this._instantiationService.createInstance(_se),this._instantiationService.setService(Sd,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(dre),this._instantiationService.setService(Q6,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Hb)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh((i==null?void 0:i.start)??0,(i==null?void 0:i.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(Gi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Gi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Gi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Gi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(Bt(()=>{var i,n;this._customKeyEventHandler=void 0,(n=(i=this.element)==null?void 0:i.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,r="";switch(i.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+i.index}switch(i.type){case 0:let s=Pt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ce.ESC}]${r};${cse(s)}${F6.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(o=>o.ansi[i.index]=ci.toColor(...i.color));else{let o=n;this._themeService.modifyColors(l=>l[o]=ci.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(iO,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,s=i.getWidth(n),o=this._renderService.dimensions.css.cell.width*s,l=this.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=c+"px",this.textarea.style.top=l+"px",this.textarea.style.width=o+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Be(this.element,"copy",i=>{this.hasSelection()&&Aie(i,this._selectionService)}));let e=i=>Eie(i,this.textarea,this.coreService,this.optionsService);this._register(Be(this.textarea,"paste",e)),this._register(Be(this.element,"paste",e)),J6?this._register(Be(this.element,"mousedown",i=>{i.button===2&&qP(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Be(this.element,"contextmenu",i=>{qP(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Nw&&this._register(Be(this.element,"auxclick",i=>{i.button===1&&w6(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Be(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Be(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Be(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Be(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Be(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Be(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Be(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var s;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((s=this.element)==null?void 0:s.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Be(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Wb.get()),iz||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(ure,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(xo,this._coreBrowserService),this._register(Be(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(Be(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(gS,this._document,this._helperContainer),this._instantiationService.setService(TO,this._charSizeService),this._themeService=this._instantiationService.createInstance(yS),this._instantiationService.setService(wh,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Jg),this._instantiationService.setService(R6,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(vS,this.rows,this.screenElement)),this._instantiationService.setService(wo,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(dS,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(OS),this._instantiationService.setService(Pw,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(AS,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(uS,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(_S,this.element,this.screenElement,r)),this._instantiationService.setService($ie,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(Gi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var o;this._selectionService.refresh(),(o=this._viewport)==null||o.queueSync()})),this._register(this._instantiationService.createInstance(fS,this.screenElement)),this._register(Be(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(iO,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Kg,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Kg,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(mS,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(o){var d,p,g,O,_;let l=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!l)return!1;let c,u;switch(o.overrideType||o.type){case"mousemove":u=32,o.buttons===void 0?(c=3,o.button!==void 0&&(c=o.button<3?o.button:3)):c=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":u=0,c=o.button<3?o.button:3;break;case"mousedown":u=1,c=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let b=o.deltaY;if(b===0||e.coreMouseService.consumeWheelEvent(o,(O=(g=(p=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:p.device)==null?void 0:g.cell)==null?void 0:O.height,(_=e._coreBrowserService)==null?void 0:_.dpr)===0)return!1;u=b<0?0:1,c=4;break;default:return!1}return u===void 0||c===void 0||c>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:c,action:u,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:o=>(n(o),o.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(o)),wheel:o=>(n(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&n(o)},mousemove:o=>{o.buttons||n(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),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()),o&8?r.mousemove||(i.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(i.removeEventListener("mousemove",r.mousemove),r.mousemove=null),o&16?r.wheel||(i.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(i.removeEventListener("wheel",r.wheel),r.wheel=null),o&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),o&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Be(i,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return n(o),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(o)})),this._register(Be(i,"wheel",o=>{var l,c,u,d,p;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,(d=(u=(c=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:c.device)==null?void 0:u.cell)==null?void 0:d.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(o,!0);let g=ce.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(g,!0),this.cancel(o,!0)}}},{passive:!1}))}refresh(e,i){var n;(n=this._renderService)==null||n.refreshRows(e,i)}updateCursorStyle(e){var i;(i=this._selectionService)!=null&&i.shouldColumnSelect(e)?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(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){x6(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,i){var n;(n=this._selectionService)==null||n.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=Ose(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===ce.ETX||n.key===ce.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Cse(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){var n;(n=this._charSizeService)==null||n.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(oi));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var i;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(i=this._selectionService)==null||i.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ce.ESC+"[I"):this.coreService.triggerDataEvent(ce.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[4;${n};${i}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[6;${s};${r}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function Cse(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var kse=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},Tse=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new Rr)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},BR=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,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(t){let e=this._buffer.lines.get(t);if(e)return new Tse(e)}getNullCell(){return new Rr}},Ase=class extends We{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new me),this.onBufferChange=this._onBufferChange.event,this._normal=new BR(this._core.buffers.normal,"normal"),this._alternate=new BR(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)}},Ese=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i=>e(i.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i,n)=>e(i,n.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},Mse=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},Pse=["cols","rows"],cs=0,Rse=class extends We{constructor(t){super(),this._core=this._register(new wse(t)),this._addonManager=this._register(new kse),this._publicOptions={...this._core.options};let e=n=>this._core.options[n],i=(n,r)=>{this._checkReadonlyOptions(n),this._core.options[n]=r};for(let n in this._core.options){let r={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,r)}}_checkReadonlyOptions(t){if(Pse.includes(t))throw new Error(`Option "${t}" 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 Ese(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Mse(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 Ase(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i){this._verifyIntegers(t,e,i),this._core.select(t,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r
|
|
119
|
+
`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return Wb.get()},set promptLabel(t){Wb.set(t)},get tooMuchOutput(){return Ub.get()},set tooMuchOutput(t){Ub.set(t)}}}_verifyIntegers(...t){for(cs of t)if(cs===1/0||isNaN(cs)||cs%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(cs of t)if(cs&&(cs===1/0||isNaN(cs)||cs%1!==0||cs<0))throw new Error("This API only accepts positive integers")}};/**
|
|
120
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
121
|
+
* @license MIT
|
|
122
|
+
*
|
|
123
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
124
|
+
* @license MIT
|
|
125
|
+
*
|
|
126
|
+
* Originally forked from (with the author's permission):
|
|
127
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
128
|
+
* http://bellard.org/jslinux/
|
|
129
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
130
|
+
*/var Qse=2,Lse=1,Dse=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){var p;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:((p=this._terminal.options.overviewRuler)==null?void 0:p.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},l=o.top+o.bottom,c=o.right+o.left,u=n-l,d=r-c-e;return{cols:Math.max(Qse,Math.floor(d/t.css.cell.width)),rows:Math.max(Lse,Math.floor(u/t.css.cell.height))}}};/**
|
|
131
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
132
|
+
* @license MIT
|
|
133
|
+
*
|
|
134
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
135
|
+
* @license MIT
|
|
136
|
+
*
|
|
137
|
+
* Originally forked from (with the author's permission):
|
|
138
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
139
|
+
* http://bellard.org/jslinux/
|
|
140
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
141
|
+
*/var Bse=(t,e,i,n)=>{for(var r=e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(r=o(r)||r);return r},$se=(t,e)=>(i,n)=>e(i,n,t),zse=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?$R.isErrorNoTelemetry(t)?new $R(t.message+`
|
|
142
|
+
|
|
143
|
+
`+t.stack):new Error(t.message+`
|
|
144
|
+
|
|
145
|
+
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},Nse=new zse;function Wy(t){jse(t)||Nse.onUnexpectedError(t)}var ES="Canceled";function jse(t){return t instanceof Ise?!0:t instanceof Error&&t.name===ES&&t.message===ES}var Ise=class extends Error{constructor(){super(ES),this.name=this.message}},$R=class MS extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof MS)return e;let i=new MS;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Vse;(t=>{function e(s){return s<0}t.isLessThan=e;function i(s){return s<=0}t.isLessThanOrEqual=i;function n(s){return s>0}t.isGreaterThan=n;function r(s){return s===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Vse||(Vse={}));function Xse(t,e){let i=this,n=!1,r;return function(){return n||(n=!0,e||(r=t.apply(i,arguments))),r}}var fz;(t=>{function e(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*r(A){yield A}t.single=r;function s(A){return e(A)?A:r(A)}t.wrap=s;function o(A){return A||i}t.from=o;function*l(A){for(let L=A.length-1;L>=0;L--)yield A[L]}t.reverse=l;function c(A){return!A||A[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(A){return A[Symbol.iterator]().next().value}t.first=u;function d(A,L){let E=0;for(let N of A)if(L(N,E++))return!0;return!1}t.some=d;function p(A,L){for(let E of A)if(L(E))return E}t.find=p;function*g(A,L){for(let E of A)L(E)&&(yield E)}t.filter=g;function*O(A,L){let E=0;for(let N of A)yield L(N,E++)}t.map=O;function*_(A,L){let E=0;for(let N of A)yield*L(N,E++)}t.flatMap=_;function*b(...A){for(let L of A)yield*L}t.concat=b;function x(A,L,E){let N=E;for(let z of A)N=L(N,z);return N}t.reduce=x;function*w(A,L,E=A.length){for(L<0&&(L+=A.length),E<0?E+=A.length:E>A.length&&(E=A.length);L<E;L++)yield A[L]}t.slice=w;function k(A,L=Number.POSITIVE_INFINITY){let E=[];if(L===0)return[E,A];let N=A[Symbol.iterator]();for(let z=0;z<L;z++){let Z=N.next();if(Z.done)return[E,t.empty()];E.push(Z.value)}return[E,{[Symbol.iterator](){return N}}]}t.consume=k;async function T(A){let L=[];for await(let E of A)L.push(E);return Promise.resolve(L)}t.asyncToArray=T})(fz||(fz={}));function dz(t){if(fz.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function pz(...t){return rn(()=>dz(t))}function rn(t){return{dispose:Xse(()=>{t()})}}var mz=class gz{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{dz(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?gz.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};mz.DISABLE_DISPOSED_WARNING=!1;var Jc=mz,Fr=class{constructor(){this._store=new Jc,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Fr.None=Object.freeze({dispose(){}});var ju=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var e;this._isDisposed||t===this._value||((e=this._value)==null||e.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,(t=this._value)==null||t.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},jw=typeof process<"u"&&"title"in process,MO=jw?"node":navigator.userAgent,Zse=jw?"node":navigator.platform,qse=MO.includes("Firefox"),Wse=MO.includes("Edge"),Oz=/^((?!chrome|android).)*safari/i.test(MO);function Use(){if(!Oz)return 0;let t=MO.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}Zse.indexOf("Linux")>=0;var Yse="",Ai=0,Ei=0,Mi=0,qt=0,yr={css:"#00000000",rgba:0},gn;(t=>{function e(r,s,o,l){return l!==void 0?`#${il(r)}${il(s)}${il(o)}${il(l)}`:`#${il(r)}${il(s)}${il(o)}`}t.toCss=e;function i(r,s,o,l=255){return(r<<24|s<<16|o<<8|l)>>>0}t.toRgba=i;function n(r,s,o,l){return{css:t.toCss(r,s,o,l),rgba:t.toRgba(r,s,o,l)}}t.toColor=n})(gn||(gn={}));var of;(t=>{function e(c,u){if(qt=(u.rgba&255)/255,qt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Ai=O+Math.round((d-O)*qt),Ei=_+Math.round((p-_)*qt),Mi=b+Math.round((g-b)*qt);let x=gn.toCss(Ai,Ei,Mi),w=gn.toRgba(Ai,Ei,Mi);return{css:x,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=xl.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return gn.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function r(c){let u=(c.rgba|255)>>>0;return[Ai,Ei,Mi]=xl.toChannels(u),{css:gn.toCss(Ai,Ei,Mi),rgba:u}}t.opaque=r;function s(c,u){return qt=Math.round(u*255),[Ai,Ei,Mi]=xl.toChannels(c.rgba),{css:gn.toCss(Ai,Ei,Mi,qt),rgba:gn.toRgba(Ai,Ei,Mi,qt)}}t.opacity=s;function o(c,u){return qt=c.rgba&255,s(c,qt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(of||(of={}));var Hse;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let s=r.getContext("2d",{willReadFrequently:!0});s&&(e=s,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Ai=parseInt(r.slice(1,2).repeat(2),16),Ei=parseInt(r.slice(2,3).repeat(2),16),Mi=parseInt(r.slice(3,4).repeat(2),16),gn.toColor(Ai,Ei,Mi);case 5:return Ai=parseInt(r.slice(1,2).repeat(2),16),Ei=parseInt(r.slice(2,3).repeat(2),16),Mi=parseInt(r.slice(3,4).repeat(2),16),qt=parseInt(r.slice(4,5).repeat(2),16),gn.toColor(Ai,Ei,Mi,qt);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}}let s=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(s)return Ai=parseInt(s[1]),Ei=parseInt(s[2]),Mi=parseInt(s[3]),qt=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),gn.toColor(Ai,Ei,Mi,qt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=r,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Ai,Ei,Mi,qt]=e.getImageData(0,0,1,1).data,qt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gn.toRgba(Ai,Ei,Mi,qt),css:r}}t.toColor=n})(Hse||(Hse={}));var dn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,r,s){let o=n/255,l=r/255,c=s/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(dn||(dn={}));var xl;(t=>{function e(o,l){if(qt=(l&255)/255,qt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Ai=p+Math.round((c-p)*qt),Ei=g+Math.round((u-g)*qt),Mi=O+Math.round((d-O)*qt),gn.toRgba(Ai,Ei,Mi)}t.blend=e;function i(o,l,c){let u=dn.relativeLuminance(o>>8),d=dn.relativeLuminance(l>>8);if(ro(u,d)<c){if(d<u){let O=n(o,l,c),_=ro(u,dn.relativeLuminance(O>>8));if(_<c){let b=r(o,l,c),x=ro(u,dn.relativeLuminance(b>>8));return _>x?O:b}return O}let p=r(o,l,c),g=ro(u,dn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=ro(u,dn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function r(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=r;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=s})(xl||(xl={}));function il(t){let e=t.toString(16);return e.length<2?"0"+e:e}function ro(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}function li(t){if(!t)throw new Error("value must not be falsy");return t}function Iw(t){return 57508<=t&&t<=57558}function Fse(t){return 57520<=t&&t<=57527}function Gse(t){return 57344<=t&&t<=63743}function Kse(t){return 9472<=t&&t<=9631}function Jse(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function eoe(t,e,i,n){return e===1&&i>Math.ceil(n*1.5)&&t!==void 0&&t>255&&!Jse(t)&&!Iw(t)&&!Gse(t)}function vz(t){return Iw(t)||Kse(t)}function toe(){return{css:{canvas:Am(),cell:Am()},device:{canvas:Am(),cell:Am(),char:{width:0,height:0,left:0,top:0}}}}function Am(){return{width:0,height:0}}function ioe(t,e,i=0){return(t-(Math.round(e)*2-i))%(Math.round(e)*2)}var Xi=0,xi=0,hs=!1,so=!1,Em=!1,Pn,Uy=0,noe=class{constructor(t,e,i,n,r,s){this._terminal=t,this._optionService=e,this._selectionRenderModel=i,this._decorationService=n,this._coreBrowserService=r,this._themeService=s,this.result={fg:0,bg:0,ext:0}}resolve(t,e,i,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,xi=0,Xi=0,so=!1,hs=!1,Em=!1,Pn=this._themeService.colors,Uy=0,t.getCode()!==0&&t.extended.underlineStyle===4){let r=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Uy=e*n%(Math.round(r)*2)}if(this._decorationService.forEachDecorationAtCell(e,i,"bottom",r=>{r.backgroundColorRGB&&(xi=r.backgroundColorRGB.rgba>>8&16777215,so=!0),r.foregroundColorRGB&&(Xi=r.foregroundColorRGB.rgba>>8&16777215,hs=!0)}),Em=this._selectionRenderModel.isCellSelected(this._terminal,e,i),Em){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:xi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:xi=(this.result.fg&16777215)<<8|255;break;case 0:default:xi=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:xi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:xi=(this.result.bg&16777215)<<8|255;break}xi=xl.blend(xi,(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else xi=(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(so=!0,Pn.selectionForeground&&(Xi=Pn.selectionForeground.rgba>>8&16777215,hs=!0),vz(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Xi=(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Xi=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Xi=(this.result.fg&16777215)<<8|255;break;case 0:default:Xi=this._themeService.colors.foreground.rgba}Xi=xl.blend(Xi,(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}hs=!0}}this._decorationService.forEachDecorationAtCell(e,i,"top",r=>{r.backgroundColorRGB&&(xi=r.backgroundColorRGB.rgba>>8&16777215,so=!0),r.foregroundColorRGB&&(Xi=r.foregroundColorRGB.rgba>>8&16777215,hs=!0)}),so&&(Em?xi=t.bg&-16777216&-134217729|xi|50331648:xi=t.bg&-16777216|xi|50331648),hs&&(Xi=t.fg&-16777216&-67108865|Xi|50331648),this.result.fg&67108864&&(so&&!hs&&((this.result.bg&50331648)===0?Xi=this.result.fg&-134217728|Pn.background.rgba>>8&16777215&16777215|50331648:Xi=this.result.fg&-134217728|this.result.bg&67108863,hs=!0),!so&&hs&&((this.result.fg&50331648)===0?xi=this.result.bg&-67108864|Pn.foreground.rgba>>8&16777215&16777215|50331648:xi=this.result.bg&-67108864|this.result.fg&67108863,so=!0)),Pn=void 0,this.result.bg=so?xi:this.result.bg,this.result.fg=hs?Xi:this.result.fg,this.result.ext&=536870911,this.result.ext|=Uy<<29&3758096384}},roe=.5,_z=qse||Wse?"bottom":"ideographic",soe={"▀":[{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}]},ooe={"░":[[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]]},aoe={"─":{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:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},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:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},nd={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{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}};nd[""]=nd[""];nd[""]=nd[""];function loe(t,e,i,n,r,s,o,l){let c=soe[e];if(c)return coe(t,c,i,n,r,s),!0;let u=ooe[e];if(u)return hoe(t,u,i,n,r,s),!0;let d=aoe[e];if(d)return uoe(t,d,i,n,r,s,l),!0;let p=nd[e];return p?(foe(t,p,i,n,r,s,o,l),!0):!1}function coe(t,e,i,n,r,s){for(let o=0;o<e.length;o++){let l=e[o],c=r/8,u=s/8;t.fillRect(i+l.x*c,n+l.y*u,l.w*c,l.h*u)}}var zR=new Map;function hoe(t,e,i,n,r,s){let o=zR.get(e);o||(o=new Map,zR.set(e,o));let l=t.fillStyle;if(typeof l!="string")throw new Error(`Unexpected fillStyle type "${l}"`);let c=o.get(l);if(!c){let u=e[0].length,d=e.length,p=t.canvas.ownerDocument.createElement("canvas");p.width=u,p.height=d;let g=li(p.getContext("2d")),O=new ImageData(u,d),_,b,x,w;if(l.startsWith("#"))_=parseInt(l.slice(1,3),16),b=parseInt(l.slice(3,5),16),x=parseInt(l.slice(5,7),16),w=l.length>7&&parseInt(l.slice(7,9),16)||1;else if(l.startsWith("rgba"))[_,b,x,w]=l.substring(5,l.length-1).split(",").map(k=>parseFloat(k));else throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);for(let k=0;k<d;k++)for(let T=0;T<u;T++)O.data[(k*u+T)*4]=_,O.data[(k*u+T)*4+1]=b,O.data[(k*u+T)*4+2]=x,O.data[(k*u+T)*4+3]=e[k][T]*(w*255);g.putImageData(O,0,0),c=li(t.createPattern(p,null)),o.set(l,c)}t.fillStyle=c,t.fillRect(i,n,r,s)}function uoe(t,e,i,n,r,s,o){t.strokeStyle=t.fillStyle;for(let[l,c]of Object.entries(e)){t.beginPath(),t.lineWidth=o*Number.parseInt(l);let u;if(typeof c=="function"){let d=.15/s*r;u=c(.15,d)}else u=c;for(let d of u.split(" ")){let p=d[0],g=yz[p];if(!g){console.error(`Could not find drawing instructions for "${p}"`);continue}let O=d.substring(1).split(",");!O[0]||!O[1]||g(t,bz(O,r,s,i,n,!0,o))}t.stroke(),t.closePath()}}function foe(t,e,i,n,r,s,o,l){let c=new Path2D;c.rect(i,n,r,s),t.clip(c),t.beginPath();let u=o/12;t.lineWidth=l*u;for(let d of e.d.split(" ")){let p=d[0],g=yz[p];if(!g){console.error(`Could not find drawing instructions for "${p}"`);continue}let O=d.substring(1).split(",");!O[0]||!O[1]||g(t,bz(O,r,s,i,n,!1,l,(e.leftPadding??0)*(u/2),(e.rightPadding??0)*(u/2)))}e.type===1?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}function NR(t,e,i=0){return Math.max(Math.min(t,e),i)}var yz={C:(t,e)=>t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function bz(t,e,i,n,r,s,o,l=0,c=0){let u=t.map(d=>parseFloat(d)||parseInt(d));if(u.length<2)throw new Error("Too few arguments for instruction");for(let d=0;d<u.length;d+=2)u[d]*=e-l*o-c*o,s&&u[d]!==0&&(u[d]=NR(Math.round(u[d]+.5)-.5,e,0)),u[d]+=n+l*o;for(let d=1;d<u.length;d+=2)u[d]*=i,s&&u[d]!==0&&(u[d]=NR(Math.round(u[d]+.5)-.5,i,0)),u[d]+=r;return u}var jR=class{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}},IR=class{constructor(){this._data=new jR}set(t,e,i,n,r){this._data.get(t,e)||this._data.set(t,e,new jR),this._data.get(t,e).set(i,n,r)}get(t,e,i,n){var r;return(r=this._data.get(t,e))==null?void 0:r.get(i,n)}clear(){this._data.clear()}},Sz=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),r=t.timeRemaining(),i*1.5>r){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=r}this.clear()}},doe=class extends Sz{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},poe=class extends Sz{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},moe=!jw&&"requestIdleCallback"in window?poe:doe,Vc=class xz{constructor(){this.fg=0,this.bg=0,this.extended=new wz}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new xz;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},wz=class Cz{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new Cz(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},goe=globalThis.performance&&typeof globalThis.performance.now=="function",Ooe=class kz{static create(e){return new kz(e)}constructor(e){this._now=goe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},po;(t=>{t.None=()=>Fr.None;function e(R,B){return p(R,()=>{},0,void 0,!0,void 0,B)}t.defer=e;function i(R){return(B,D=null,j)=>{let $=!1,X;return X=R(H=>{if(!$)return X?X.dispose():$=!0,B.call(D,H)},null,j),$&&X.dispose(),X}}t.once=i;function n(R,B,D){return u((j,$=null,X)=>R(H=>j.call($,B(H)),null,X),D)}t.map=n;function r(R,B,D){return u((j,$=null,X)=>R(H=>{B(H),j.call($,H)},null,X),D)}t.forEach=r;function s(R,B,D){return u((j,$=null,X)=>R(H=>B(H)&&j.call($,H),null,X),D)}t.filter=s;function o(R){return R}t.signal=o;function l(...R){return(B,D=null,j)=>{let $=pz(...R.map(X=>X(H=>B.call(D,H))));return d($,j)}}t.any=l;function c(R,B,D,j){let $=D;return n(R,X=>($=B($,X),$),j)}t.reduce=c;function u(R,B){let D,j={onWillAddFirstListener(){D=R($.fire,$)},onDidRemoveLastListener(){D==null||D.dispose()}},$=new Rt(j);return B==null||B.add($),$.event}function d(R,B){return B instanceof Array?B.push(R):B&&B.add(R),R}function p(R,B,D=100,j=!1,$=!1,X,H){let F,M,I,K=0,Q,ue={leakWarningThreshold:X,onWillAddFirstListener(){F=R(fe=>{K++,M=B(M,fe),j&&!I&&(he.fire(M),M=void 0),Q=()=>{let Oe=M;M=void 0,I=void 0,(!j||K>1)&&he.fire(Oe),K=0},typeof D=="number"?(clearTimeout(I),I=setTimeout(Q,D)):I===void 0&&(I=0,queueMicrotask(Q))})},onWillRemoveListener(){$&&K>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,F.dispose()}},he=new Rt(ue);return H==null||H.add(he),he.event}t.debounce=p;function g(R,B=0,D){return t.debounce(R,(j,$)=>j?(j.push($),j):[$],B,void 0,!0,void 0,D)}t.accumulate=g;function O(R,B=(j,$)=>j===$,D){let j=!0,$;return s(R,X=>{let H=j||!B(X,$);return j=!1,$=X,H},D)}t.latch=O;function _(R,B,D){return[t.filter(R,B,D),t.filter(R,j=>!B(j),D)]}t.split=_;function b(R,B=!1,D=[],j){let $=D.slice(),X=R(M=>{$?$.push(M):F.fire(M)});j&&j.add(X);let H=()=>{$==null||$.forEach(M=>F.fire(M)),$=null},F=new Rt({onWillAddFirstListener(){X||(X=R(M=>F.fire(M)),j&&j.add(X))},onDidAddFirstListener(){$&&(B?setTimeout(H):H())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return j&&j.add(F),F.event}t.buffer=b;function x(R,B){return(D,j,$)=>{let X=B(new k);return R(function(H){let F=X.evaluate(H);F!==w&&D.call(j,F)},void 0,$)}}t.chain=x;let w=Symbol("HaltChainable");class k{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(D=>(B(D),D)),this}filter(B){return this.steps.push(D=>B(D)?D:w),this}reduce(B,D){let j=D;return this.steps.push($=>(j=B(j,$),j)),this}latch(B=(D,j)=>D===j){let D=!0,j;return this.steps.push($=>{let X=D||!B($,j);return D=!1,j=$,X?$:w}),this}evaluate(B){for(let D of this.steps)if(B=D(B),B===w)break;return B}}function T(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.on(B,j),X=()=>R.removeListener(B,j),H=new Rt({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromNodeEventEmitter=T;function A(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.addEventListener(B,j),X=()=>R.removeEventListener(B,j),H=new Rt({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromDOMEventEmitter=A;function L(R){return new Promise(B=>i(R)(B))}t.toPromise=L;function E(R){let B=new Rt;return R.then(D=>{B.fire(D)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}t.fromPromise=E;function N(R,B){return R(D=>B.fire(D))}t.forward=N;function z(R,B,D){return B(D),R(j=>B(j))}t.runAndSubscribe=z;class Z{constructor(B,D){this._observable=B,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new Rt(j),D&&D.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,D){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function J(R,B){return new Z(R,B).emitter.event}t.fromObservable=J;function U(R){return(B,D,j)=>{let $=0,X=!1,H={beginUpdate(){$++},endUpdate(){$--,$===0&&(R.reportChanges(),X&&(X=!1,B.call(D)))},handlePossibleChange(){},handleChange(){X=!0}};R.addObserver(H),R.reportChanges();let F={dispose(){R.removeObserver(H)}};return j instanceof Jc?j.add(F):Array.isArray(j)&&j.push(F),F}}t.fromObservableLight=U})(po||(po={}));var PS=class RS{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${RS._idPool++}`,RS.all.add(this)}start(e){this._stopWatch=new Ooe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};PS.all=new Set,PS._idPool=0;var voe=PS,_oe=-1,Tz=class Az{constructor(e,i,n=(Az._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(s);let c=new Soe(l,s);this._errorHandler(c)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,r]of this._stacks)(!e||i<r)&&(e=[n,r],i=r);return e}};Tz._idPool=1;var yoe=Tz,boe=class Ez{constructor(e){this.value=e}static create(){let e=new Error;return new Ez(e.stack??"")}print(){console.warn(this.value.split(`
|
|
146
|
+
`).slice(2).join(`
|
|
147
|
+
`))}},Soe=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},xoe=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},woe=0,Yy=class{constructor(t){this.value=t,this.id=woe++}},Coe=2,koe,Rt=class{constructor(e){var i,n,r,s;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new yoe((e==null?void 0:e.onListenerError)??Wy,((n=this._options)==null?void 0:n.leakWarningThreshold)??_oe):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new voe(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,i,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||n.call(i),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,i,n)=>{var l,c,u,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let O=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],_=new xoe(`${g}. HINT: Stack shows most frequent listener (${O[1]}-times)`,O[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Wy)(_),Fr.None}if(this._disposed)return Fr.None;i&&(e=e.bind(i));let r=new Yy(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=boe.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Yy?(this._deliveryQueue??(this._deliveryQueue=new Toe),this._listeners=[this._listeners,r]):this._listeners.push(r):((u=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||u.call(c,this),this._listeners=r,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let o=rn(()=>{s==null||s(),this._removeListener(r)});return n instanceof Jc?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var s,o,l,c;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||c.call(l,this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Coe<=i.length){let u=0;for(let d=0;d<i.length;d++)i[d]?i[u++]=i[d]:r&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=u}}_deliver(e,i){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||Wy;if(!n){e.value(i);return}try{e.value(i)}catch(s){n(s)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){var i,n,r,s;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof Yy)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},Toe=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},VR={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}},Iu=2,Vu,ha=class Rc{constructor(e,i,n){this._document=e,this._config=i,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new IR,this._cacheMapCombined=new IR,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Vc,this._textureSize=512,this._onAddTextureAtlasCanvas=new Rt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Rt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Mz(e,this._config.deviceCellWidth*4+Iu*2,this._config.deviceCellHeight+Iu*2),this._tmpCtx=li(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new moe;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let n=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,n)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Rc.maxAtlasPages&&this._pages.length>=Math.max(4,Rc.maxAtlasPages)){let i=this._pages.filter(u=>u.canvas.width*2<=(Rc.maxTextureSize||4096)).sort((u,d)=>d.canvas.width!==u.canvas.width?d.canvas.width-u.canvas.width:d.percentageUsed-u.percentageUsed),n=-1,r=0;for(let u=0;u<i.length;u++)if(i[u].canvas.width!==r)n=u,r=i[u].canvas.width;else if(u-n===3)break;let s=i.slice(n,n+4),o=s.map(u=>u.glyphs[0].texturePage).sort((u,d)=>u>d?1:-1),l=this.pages.length-s.length,c=this._mergePages(s,l);c.version++;for(let u=o.length-1;u>=0;u--)this._deletePage(o[u]);this.pages.push(c),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(c.canvas)}let e=new Hy(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,i){let n=e[0].canvas.width*2,r=new Hy(this._document,n,e);for(let[s,o]of e.entries()){let l=s*o.canvas.width%n,c=Math.floor(s/2)*o.canvas.height;r.ctx.drawImage(o.canvas,l,c);for(let d of o.glyphs)d.texturePage=i,d.sizeClipSpace.x=d.size.x/n,d.sizeClipSpace.y=d.size.y/n,d.texturePosition.x+=l,d.texturePosition.y+=c,d.texturePositionClipSpace.x=d.texturePosition.x/n,d.texturePositionClipSpace.y=d.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(o.canvas);let u=this._activePages.indexOf(o);u!==-1&&this._activePages.splice(u,1)}return r}_deletePage(e){this._pages.splice(e,1);for(let i=e;i<this._pages.length;i++){let n=this._pages[i];for(let r of n.glyphs)r.texturePage--;n.version++}}getRasterizedGlyphCombinedChar(e,i,n,r,s,o){return this._getFromCacheMap(this._cacheMapCombined,e,i,n,r,s,o)}getRasterizedGlyph(e,i,n,r,s,o){return this._getFromCacheMap(this._cacheMap,e,i,n,r,s,o)}_getFromCacheMap(e,i,n,r,s,o,l){return Vu=e.get(i,n,r,s),Vu||(Vu=this._drawToCache(i,n,r,s,o,l),e.set(i,n,r,s,Vu)),Vu}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,i,n,r){if(this._config.allowTransparency)return yr;let s;switch(e){case 16777216:case 33554432:s=this._getColorFromAnsiIndex(i);break;case 50331648:let o=Vc.toColorRGB(i);s=gn.toColor(o[0],o[1],o[2]);break;case 0:default:n?s=of.opaque(this._config.colors.foreground):s=this._config.colors.background;break}return this._config.allowTransparency||(s=of.opaque(s)),s}_getForegroundColor(e,i,n,r,s,o,l,c,u,d){let p=this._getMinimumContrastColor(e,i,n,r,s,o,l,u,c,d);if(p)return p;let g;switch(s){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&u&&o<8&&(o+=8),g=this._getColorFromAnsiIndex(o);break;case 50331648:let O=Vc.toColorRGB(o);g=gn.toColor(O[0],O[1],O[2]);break;case 0:default:l?g=this._config.colors.background:g=this._config.colors.foreground}return this._config.allowTransparency&&(g=of.opaque(g)),c&&(g=of.multiplyOpacity(g,roe)),g}_resolveBackgroundRgba(e,i,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,i,n,r){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,i,n,r,s,o,l,c,u,d){if(this._config.minimumContrastRatio===1||d)return;let p=this._getContrastCache(u),g=p.getColor(e,r);if(g!==void 0)return g||void 0;let O=this._resolveBackgroundRgba(i,n,l),_=this._resolveForegroundRgba(s,o,l,c),b=xl.ensureContrastRatio(O,_,this._config.minimumContrastRatio/(u?2:1));if(!b){p.setColor(e,r,null);return}let x=gn.toColor(b>>24&255,b>>16&255,b>>8&255);return p.setColor(e,r,x),x}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,i,n,r,s,o){let l=typeof e=="number"?String.fromCharCode(e):e;o&&this._tmpCanvas.parentElement!==o&&(this._tmpCanvas.style.display="none",o.append(this._tmpCanvas));let c=Math.min(this._config.deviceCellWidth*Math.max(l.length,2)+Iu*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<c&&(this._tmpCanvas.width=c);let u=Math.min(this._config.deviceCellHeight+Iu*4,this._textureSize);if(this._tmpCanvas.height<u&&(this._tmpCanvas.height=u),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=r,!!this._workAttributeData.isInvisible())return VR;let d=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),g=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),_=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),x=!!this._workAttributeData.isOverline(),w=this._workAttributeData.getFgColor(),k=this._workAttributeData.getFgColorMode(),T=this._workAttributeData.getBgColor(),A=this._workAttributeData.getBgColorMode();if(p){let M=w;w=T,T=M;let I=k;k=A,A=I}let L=this._getBackgroundColor(A,T,p,g);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let E=d?this._config.fontWeightBold:this._config.fontWeight,N=O?"italic":"";this._tmpCtx.font=`${N} ${E} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=_z;let z=l.length===1&&Iw(l.charCodeAt(0)),Z=l.length===1&&Fse(l.charCodeAt(0)),J=this._getForegroundColor(i,A,T,n,k,w,p,g,d,vz(l.charCodeAt(0)));this._tmpCtx.fillStyle=J.css;let U=Z?0:Iu*2,R=!1;this._config.customGlyphs!==!1&&(R=loe(this._tmpCtx,l,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let B=!z,D;if(typeof e=="number"?D=this._unicodeService.wcwidth(e):D=this._unicodeService.getStringCellWidth(e),_){this._tmpCtx.save();let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=M%2===1?.5:0;if(this._tmpCtx.lineWidth=M,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())B=!1,this._tmpCtx.strokeStyle=`rgb(${Vc.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{B=!1;let Oe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Oe<8&&(Oe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Oe).css}this._tmpCtx.beginPath();let K=U,Q=Math.ceil(U+this._config.deviceCharHeight)-I-(s?M*2:0),ue=Q+M,he=Q+M*2,fe=this._workAttributeData.getUnderlineVariantOffset();for(let Oe=0;Oe<D;Oe++){this._tmpCtx.save();let Ce=K+Oe*this._config.deviceCellWidth,ye=K+(Oe+1)*this._config.deviceCellWidth,nt=Ce+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(ye,Q),this._tmpCtx.moveTo(Ce,he),this._tmpCtx.lineTo(ye,he);break;case 3:let Qt=M<=1?he:Math.ceil(U+this._config.deviceCharHeight-M/2)-I,Yt=M<=1?Q:Math.ceil(U+this._config.deviceCharHeight+M/2)-I,ei=new Path2D;ei.rect(Ce,Q,this._config.deviceCellWidth,he-Q),this._tmpCtx.clip(ei),this._tmpCtx.moveTo(Ce-this._config.deviceCellWidth/2,ue),this._tmpCtx.bezierCurveTo(Ce-this._config.deviceCellWidth/2,Yt,Ce,Yt,Ce,ue),this._tmpCtx.bezierCurveTo(Ce,Qt,nt,Qt,nt,ue),this._tmpCtx.bezierCurveTo(nt,Yt,ye,Yt,ye,ue),this._tmpCtx.bezierCurveTo(ye,Qt,ye+this._config.deviceCellWidth/2,Qt,ye+this._config.deviceCellWidth/2,ue);break;case 4:let Le=fe===0?0:fe>=M?M*2-fe:M-fe;fe>=M||Le===0?(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(Ce+Le,Q),this._tmpCtx.lineTo(ye,Q)):(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(Ce+Le,Q),this._tmpCtx.moveTo(Ce+Le+M,Q),this._tmpCtx.lineTo(ye,Q)),fe=ioe(ye-Ce,M,fe);break;case 5:let ar=.6,Co=.3,ko=ye-Ce,Qa=Math.floor(ar*ko),Ds=Math.floor(Co*ko),To=ko-Qa-Ds;this._tmpCtx.setLineDash([Qa,Ds,To]),this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(ye,Q);break;case 1:default:this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(ye,Q);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!R&&this._config.fontSize>=12&&!this._config.allowTransparency&&l!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Oe=this._tmpCtx.measureText(l);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Oe&&Oe.actualBoundingBoxDescent>0){this._tmpCtx.save();let Ce=new Path2D;Ce.rect(K,Q-Math.ceil(M/2),this._config.deviceCellWidth*D,he-Q+Math.ceil(M/2)),this._tmpCtx.clip(Ce),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(l,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(x){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=M%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+I),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*D,U+I),this._tmpCtx.stroke()}if(R||this._tmpCtx.fillText(l,U,U+this._config.deviceCharHeight),l==="_"&&!this._config.allowTransparency){let M=Fy(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),L,J,B);if(M)for(let I=1;I<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(l,U,U+this._config.deviceCharHeight-I),M=Fy(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),L,J,B),!!M);I++);}if(b){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),I=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*D,U+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.stroke()}this._tmpCtx.restore();let j=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),$;if(this._config.allowTransparency?$=Aoe(j):$=Fy(j,L,J,B),$)return VR;let X=this._findGlyphBoundingBox(j,this._workBoundingBox,c,Z,R,U),H,F;for(;;){if(this._activePages.length===0){let M=this._createNewPage();H=M,F=M.currentRow,F.height=X.size.y;break}H=this._activePages[this._activePages.length-1],F=H.currentRow;for(let M of this._activePages)X.size.y<=M.currentRow.height&&(H=M,F=M.currentRow);for(let M=this._activePages.length-1;M>=0;M--)for(let I of this._activePages[M].fixedRows)I.height<=F.height&&X.size.y<=I.height&&(H=this._activePages[M],F=I);if(X.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Hy(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),H=this._overflowSizePage,F=this._overflowSizePage.currentRow,F.x+X.size.x>=H.canvas.width&&(F.x=0,F.y+=F.height,F.height=0);break}if(F.y+X.size.y>=H.canvas.height||F.height>X.size.y+2){let M=!1;if(H.currentRow.y+H.currentRow.height+X.size.y>=H.canvas.height){let I;for(let K of this._activePages)if(K.currentRow.y+K.currentRow.height+X.size.y<K.canvas.height){I=K;break}if(I)H=I;else if(Rc.maxAtlasPages&&this._pages.length>=Rc.maxAtlasPages&&F.y+X.size.y<=H.canvas.height&&F.height>=X.size.y&&F.x+X.size.x<=H.canvas.width)M=!0;else{let K=this._createNewPage();H=K,F=K.currentRow,F.height=X.size.y,M=!0}}M||(H.currentRow.height>0&&H.fixedRows.push(H.currentRow),F={x:0,y:H.currentRow.y+H.currentRow.height,height:X.size.y},H.fixedRows.push(F),H.currentRow={x:0,y:F.y+F.height,height:0})}if(F.x+X.size.x<=H.canvas.width)break;F===H.currentRow?(F.x=0,F.y+=F.height,F.height=0):H.fixedRows.splice(H.fixedRows.indexOf(F),1)}return X.texturePage=this._pages.indexOf(H),X.texturePosition.x=F.x,X.texturePosition.y=F.y,X.texturePositionClipSpace.x=F.x/H.canvas.width,X.texturePositionClipSpace.y=F.y/H.canvas.height,X.sizeClipSpace.x/=H.canvas.width,X.sizeClipSpace.y/=H.canvas.height,F.height=Math.max(F.height,X.size.y),F.x+=X.size.x,H.ctx.putImageData(j,X.texturePosition.x-this._workBoundingBox.left,X.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,X.size.x,X.size.y),H.addGlyph(X),H.version++,X}_findGlyphBoundingBox(e,i,n,r,s,o){i.top=0;let l=r?this._config.deviceCellHeight:this._tmpCanvas.height,c=r?this._config.deviceCellWidth:n,u=!1;for(let d=0;d<l;d++){for(let p=0;p<c;p++){let g=d*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.top=d,u=!0;break}}if(u)break}i.left=0,u=!1;for(let d=0;d<o+c;d++){for(let p=0;p<l;p++){let g=p*this._tmpCanvas.width*4+d*4+3;if(e.data[g]!==0){i.left=d,u=!0;break}}if(u)break}i.right=c,u=!1;for(let d=o+c-1;d>=o;d--){for(let p=0;p<l;p++){let g=p*this._tmpCanvas.width*4+d*4+3;if(e.data[g]!==0){i.right=d,u=!0;break}}if(u)break}i.bottom=l,u=!1;for(let d=l-1;d>=0;d--){for(let p=0;p<c;p++){let g=d*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.bottom=d,u=!0;break}}if(u)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+o+(r||s?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+o+(r||s?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Hy=class{constructor(t,e,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let n of i)this._glyphs.push(...n.glyphs),this._usedPixels+=n._usedPixels;this.canvas=Mz(t,e,e),this.ctx=li(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(t){this._glyphs.push(t),this._usedPixels+=t.size.x*t.size.y}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 Fy(t,e,i,n){let r=e.rgba>>>24,s=e.rgba>>>16&255,o=e.rgba>>>8&255,l=i.rgba>>>24,c=i.rgba>>>16&255,u=i.rgba>>>8&255,d=Math.floor((Math.abs(r-l)+Math.abs(s-c)+Math.abs(o-u))/12),p=!0;for(let g=0;g<t.data.length;g+=4)t.data[g]===r&&t.data[g+1]===s&&t.data[g+2]===o||n&&Math.abs(t.data[g]-r)+Math.abs(t.data[g+1]-s)+Math.abs(t.data[g+2]-o)<d?t.data[g+3]=0:p=!1;return p}function Aoe(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}function Mz(t,e,i){let n=t.createElement("canvas");return n.width=e,n.height=i,n}function Eoe(t,e,i,n,r,s,o,l){let c={foreground:s.foreground,background:s.background,cursor:yr,cursorAccent:yr,selectionForeground:yr,selectionBackgroundTransparent:yr,selectionBackgroundOpaque:yr,selectionInactiveBackgroundTransparent:yr,selectionInactiveBackgroundOpaque:yr,overviewRulerBorder:yr,scrollbarSliderBackground:yr,scrollbarSliderHoverBackground:yr,scrollbarSliderActiveBackground:yr,ansi:s.ansi.slice(),contrastCache:s.contrastCache,halfContrastCache:s.halfContrastCache};return{customGlyphs:r.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:l,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:i,deviceCharHeight:n,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,drawBoldTextInBrightColors:r.drawBoldTextInBrightColors,minimumContrastRatio:r.minimumContrastRatio,colors:c}}function XR(t,e){for(let i=0;i<t.colors.ansi.length;i++)if(t.colors.ansi[i].rgba!==e.colors.ansi[i].rgba)return!1;return t.devicePixelRatio===e.devicePixelRatio&&t.customGlyphs===e.customGlyphs&&t.lineHeight===e.lineHeight&&t.letterSpacing===e.letterSpacing&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.deviceCharWidth===e.deviceCharWidth&&t.deviceCharHeight===e.deviceCharHeight&&t.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&t.minimumContrastRatio===e.minimumContrastRatio&&t.colors.foreground.rgba===e.colors.foreground.rgba&&t.colors.background.rgba===e.colors.background.rgba}function Moe(t){return(t&50331648)===16777216||(t&50331648)===33554432}var xr=[];function Pz(t,e,i,n,r,s,o,l,c){let u=Eoe(n,r,s,o,e,i,l,c);for(let g=0;g<xr.length;g++){let O=xr[g],_=O.ownedBy.indexOf(t);if(_>=0){if(XR(O.config,u))return O.atlas;O.ownedBy.length===1?(O.atlas.dispose(),xr.splice(g,1)):O.ownedBy.splice(_,1);break}}for(let g=0;g<xr.length;g++){let O=xr[g];if(XR(O.config,u))return O.ownedBy.push(t),O.atlas}let d=t._core,p={atlas:new ha(document,u,d.unicodeService),config:u,ownedBy:[t]};return xr.push(p),p.atlas}function ZR(t){for(let e=0;e<xr.length;e++){let i=xr[e].ownedBy.indexOf(t);if(i!==-1){xr[e].ownedBy.length===1?(xr[e].atlas.dispose(),xr.splice(e,1)):xr[e].ownedBy.splice(i,1);break}}}var Mm=600,Poe=class{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,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(t=Mm){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=Mm-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=Mm-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Mm)},t)}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()}};function qR(t,e,i){let n=new e.ResizeObserver(r=>{let s=r.find(c=>c.target===t);if(!s)return;if(!("devicePixelContentBoxSize"in s)){n==null||n.disconnect(),n=void 0;return}let o=s.devicePixelContentBoxSize[0].inlineSize,l=s.devicePixelContentBoxSize[0].blockSize;o>0&&l>0&&i(o,l)});try{n.observe(t,{box:["device-pixel-content-box"]})}catch{n.disconnect(),n=void 0}return rn(()=>n==null?void 0:n.disconnect())}function Roe(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var WR=class Rz extends Vc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new wz,this.combinedData=""}static fromCharData(e){let i=new Rz;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Roe(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Qz=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function Lz(t,e,i){let n=li(t.createProgram());if(t.attachShader(n,li(UR(t,t.VERTEX_SHADER,e))),t.attachShader(n,li(UR(t,t.FRAGMENT_SHADER,i))),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS))return n;console.error(t.getProgramInfoLog(n)),t.deleteProgram(n)}function UR(t,e,i){let n=li(t.createShader(e));if(t.shaderSource(n,i),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;console.error(t.getShaderInfoLog(n)),t.deleteShader(n)}function Qoe(t,e){let i=Math.min(t.length*2,e),n=new Float32Array(i);for(let r=0;r<t.length;r++)n[r]=t[r];return n}var Loe=class{constructor(t){this.texture=t,this.version=-1}},Doe=`#version 300 es
|
|
148
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
149
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
150
|
+
layout (location = 2) in vec2 a_offset;
|
|
151
|
+
layout (location = 3) in vec2 a_size;
|
|
152
|
+
layout (location = 4) in float a_texpage;
|
|
153
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
154
|
+
layout (location = 6) in vec2 a_texsize;
|
|
155
|
+
|
|
156
|
+
uniform mat4 u_projection;
|
|
157
|
+
uniform vec2 u_resolution;
|
|
158
|
+
|
|
159
|
+
out vec2 v_texcoord;
|
|
160
|
+
flat out int v_texpage;
|
|
161
|
+
|
|
162
|
+
void main() {
|
|
163
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
164
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
165
|
+
v_texpage = int(a_texpage);
|
|
166
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
167
|
+
}`;function Boe(t){let e="";for(let i=1;i<t;i++)e+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
|
|
168
|
+
precision lowp float;
|
|
169
|
+
|
|
170
|
+
in vec2 v_texcoord;
|
|
171
|
+
flat in int v_texpage;
|
|
172
|
+
|
|
173
|
+
uniform sampler2D u_texture[${t}];
|
|
174
|
+
|
|
175
|
+
out vec4 outColor;
|
|
176
|
+
|
|
177
|
+
void main() {
|
|
178
|
+
if (v_texpage == 0) {
|
|
179
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
180
|
+
} ${e}
|
|
181
|
+
}`}var ua=11,Cc=ua*Float32Array.BYTES_PER_ELEMENT,$oe=2,Vt=0,Mt,Gy=0,Xu=0,zoe=class extends Fr{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._optionsService=n,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let r=this._gl;ha.maxAtlasPages===void 0&&(ha.maxAtlasPages=Math.min(32,li(r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS))),ha.maxTextureSize=li(r.getParameter(r.MAX_TEXTURE_SIZE))),this._program=li(Lz(r,Doe,Boe(ha.maxAtlasPages))),this._register(rn(()=>r.deleteProgram(this._program))),this._projectionLocation=li(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=li(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=li(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let s=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(rn(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,s,r.STATIC_DRAW),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),c=r.createBuffer();this._register(rn(()=>r.deleteBuffer(c))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,c),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=li(r.createBuffer()),this._register(rn(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,Cc,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,Cc,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,1,r.FLOAT,!1,Cc,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,Cc,5*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(6),r.vertexAttribPointer(6,2,r.FLOAT,!1,Cc,7*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(6,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,Cc,9*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.useProgram(this._program);let u=new Int32Array(ha.maxAtlasPages);for(let d=0;d<ha.maxAtlasPages;d++)u[d]=d;r.uniform1iv(this._textureLocation,u),r.uniformMatrix4fv(this._projectionLocation,!1,Qz),this._atlasTextures=[];for(let d=0;d<ha.maxAtlasPages;d++){let p=new Loe(li(r.createTexture()));this._register(rn(()=>r.deleteTexture(p.texture))),r.activeTexture(r.TEXTURE0+d),r.bindTexture(r.TEXTURE_2D,p.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,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[d]=p}r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,i,n,r,s,o,l,c){this._updateCell(this._vertices.attributes,t,e,i,n,r,s,o,l,c)}_updateCell(t,e,i,n,r,s,o,l,c,u){if(Vt=(i*this._terminal.cols+e)*ua,n===0||n===void 0){t.fill(0,Vt,Vt+ua-1-$oe);return}this._atlas&&(l&&l.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(l,r,s,o,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(n,r,s,o,!1,this._terminal.element),Gy=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r!==u&&Mt.offset.x>Gy?(Xu=Mt.offset.x-Gy,t[Vt]=-(Mt.offset.x-Xu)+this._dimensions.device.char.left,t[Vt+1]=-Mt.offset.y+this._dimensions.device.char.top,t[Vt+2]=(Mt.size.x-Xu)/this._dimensions.device.canvas.width,t[Vt+3]=Mt.size.y/this._dimensions.device.canvas.height,t[Vt+4]=Mt.texturePage,t[Vt+5]=Mt.texturePositionClipSpace.x+Xu/this._atlas.pages[Mt.texturePage].canvas.width,t[Vt+6]=Mt.texturePositionClipSpace.y,t[Vt+7]=Mt.sizeClipSpace.x-Xu/this._atlas.pages[Mt.texturePage].canvas.width,t[Vt+8]=Mt.sizeClipSpace.y):(t[Vt]=-Mt.offset.x+this._dimensions.device.char.left,t[Vt+1]=-Mt.offset.y+this._dimensions.device.char.top,t[Vt+2]=Mt.size.x/this._dimensions.device.canvas.width,t[Vt+3]=Mt.size.y/this._dimensions.device.canvas.height,t[Vt+4]=Mt.texturePage,t[Vt+5]=Mt.texturePositionClipSpace.x,t[Vt+6]=Mt.texturePositionClipSpace.y,t[Vt+7]=Mt.sizeClipSpace.x,t[Vt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&eoe(n,c,Mt.size.x,this._dimensions.device.cell.width)&&(t[Vt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*ua;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==e?this._vertices.attributesBuffers[i]=new Float32Array(e):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=e,i=0;for(let n=0;n<t.rows;n++)for(let r=0;r<t.cols;r++)this._vertices.attributes[i+9]=r/t.cols,this._vertices.attributes[i+10]=n/t.rows,i+=ua}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],n=0;for(let r=0;r<t.lineLengths.length;r++){let s=r*this._terminal.cols*ua,o=this._vertices.attributes.subarray(s,s+t.lineLengths[r]*ua);i.set(o,n),n+=o.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,n),e.STREAM_DRAW);for(let r=0;r<this._atlas.pages.length;r++)this._atlas.pages[r].version!==this._atlasTextures[r].version&&this._bindAtlasPageTexture(e,this._atlas,r);e.drawElementsInstanced(e.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,n/ua)}setAtlas(t){this._atlas=t;for(let e of this._atlasTextures)e.version=-1}_bindAtlasPageTexture(t,e,i){t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[i].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.pages[i].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[i].version=e.pages[i].version}setDimensions(t){this._dimensions=t}},Noe=class{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(t,e,i,n=!1){if(this.selectionStart=e,this.selectionEnd=i,!e||!i||e[0]===i[0]&&e[1]===i[1]){this.clear();return}let r=t.buffers.active.ydisp,s=e[1]-r,o=i[1]-r,l=Math.max(s,0),c=Math.min(o,t.rows-1);if(l>=t.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=s,this.viewportEndRow=o,this.viewportCappedStartRow=l,this.viewportCappedEndRow=c,this.startCol=e[0],this.endCol=i[0]}isCellSelected(t,e,i){return this.hasSelection?(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i>=this.viewportCappedStartRow&&e<this.endCol&&i<=this.viewportCappedEndRow:e<this.startCol&&i>=this.viewportCappedStartRow&&e>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol):!1}};function joe(){return new Noe}var nO=4,sg=1,og=2,Ky=3,Ioe=2147483648,Voe=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=joe()}resize(t,e){let i=t*e*nO;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},Xoe=`#version 300 es
|
|
182
|
+
layout (location = 0) in vec2 a_position;
|
|
183
|
+
layout (location = 1) in vec2 a_size;
|
|
184
|
+
layout (location = 2) in vec4 a_color;
|
|
185
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
186
|
+
|
|
187
|
+
uniform mat4 u_projection;
|
|
188
|
+
|
|
189
|
+
out vec4 v_color;
|
|
190
|
+
|
|
191
|
+
void main() {
|
|
192
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
193
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
194
|
+
v_color = a_color;
|
|
195
|
+
}`,Zoe=`#version 300 es
|
|
196
|
+
precision lowp float;
|
|
197
|
+
|
|
198
|
+
in vec4 v_color;
|
|
199
|
+
|
|
200
|
+
out vec4 outColor;
|
|
201
|
+
|
|
202
|
+
void main() {
|
|
203
|
+
outColor = v_color;
|
|
204
|
+
}`,co=8,Jy=co*Float32Array.BYTES_PER_ELEMENT,qoe=20*co,YR=class{constructor(){this.attributes=new Float32Array(qoe),this.count=0}},oo=0,HR=0,FR=0,GR=0,KR=0,JR=0,eQ=0,Woe=class extends Fr{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=n,this._vertices=new YR,this._verticesCursor=new YR;let r=this._gl;this._program=li(Lz(r,Xoe,Zoe)),this._register(rn(()=>r.deleteProgram(this._program))),this._projectionLocation=li(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let s=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(rn(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,s,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),c=r.createBuffer();this._register(rn(()=>r.deleteBuffer(c))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,c),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=li(r.createBuffer()),this._register(rn(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,Jy,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,Jy,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,Jy,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(n.colors),this._register(this._themeService.onChangeColors(u=>{this._updateCachedColors(u),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,Qz),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.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(t){let e=this._terminal,i=this._vertices,n=1,r,s,o,l,c,u,d,p,g,O,_;for(r=0;r<e.rows;r++){for(o=-1,l=0,c=0,u=!1,s=0;s<e.cols;s++)d=(r*e.cols+s)*nO,p=t.cells[d+sg],g=t.cells[d+og],O=!!(g&67108864),(p!==l||g!==c&&(u||O))&&((l!==0||u&&c!==0)&&(_=n++*co,this._updateRectangle(i,_,c,l,o,s,r)),o=s,l=p,c=g,u=O);(l!==0||u&&c!==0)&&(_=n++*co,this._updateRectangle(i,_,c,l,o,e.cols,r))}i.count=n}updateCursor(t){let e=this._verticesCursor,i=t.cursor;if(!i||i.style==="block"){e.count=0;return}let n,r=0;(i.style==="bar"||i.style==="outline")&&(n=r++*co,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(n=r++*co,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(n=r++*co,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),n=r++*co,this._addRectangleFloat(e.attributes,n,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),e.count=r}_updateRectangle(t,e,i,n,r,s,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:oo=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:oo=(i&16777215)<<8;break;case 0:default:oo=this._themeService.colors.foreground.rgba}else switch(n&50331648){case 16777216:case 33554432:oo=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:oo=(n&16777215)<<8;break;case 0:default:oo=this._themeService.colors.background.rgba}t.attributes.length<e+4&&(t.attributes=Qoe(t.attributes,this._terminal.rows*this._terminal.cols*co)),HR=r*this._dimensions.device.cell.width,FR=o*this._dimensions.device.cell.height,GR=(oo>>24&255)/255,KR=(oo>>16&255)/255,JR=(oo>>8&255)/255,eQ=1,this._addRectangle(t.attributes,e,HR,FR,(s-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,GR,KR,JR,eQ)}_addRectangle(t,e,i,n,r,s,o,l,c,u){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=r/this._dimensions.device.canvas.width,t[e+3]=s/this._dimensions.device.canvas.height,t[e+4]=o,t[e+5]=l,t[e+6]=c,t[e+7]=u}_addRectangleFloat(t,e,i,n,r,s,o){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=r/this._dimensions.device.canvas.width,t[e+3]=s/this._dimensions.device.canvas.height,t[e+4]=o[0],t[e+5]=o[1],t[e+6]=o[2],t[e+7]=o[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},Uoe=class extends Fr{constructor(t,e,i,n,r,s,o,l){super(),this._container=e,this._alpha=r,this._coreBrowserService=s,this._optionsService=o,this._themeService=l,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-${i}-layer`),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(c=>{this._refreshCharAtlas(t,c),this.reset(t)})),this._register(rn(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=li(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,i){}handleSelectionChanged(t,e,i,n=!1){}_setTransparency(t,e){if(e===this._alpha)return;let i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Pz(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*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(t,e,i,n){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight))}_fillCharTrueColor(t,e,i,n){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=_z,this._clipCell(i,n,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,n*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,i){let n=e?t.options.fontWeightBold:t.options.fontWeight;return`${i?"italic":""} ${n} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},Yoe=class extends Uoe{constructor(t,e,i,n,r,s,o){super(i,t,"link",e,!0,r,s,o),this._register(n.onShowLinkUnderline(l=>this._handleShowLinkUnderline(l))),this._register(n.onHideLinkUnderline(l=>this._handleHideLinkUnderline(l)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&Moe(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e<t.y2;e++)this._fillBottomLineAtCells(0,e,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_handleHideLinkUnderline(t){this._clearCurrentLink()}},_l=typeof window=="object"?window:globalThis,QS=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Rt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Rt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};QS.INSTANCE=new QS;var Dz=QS;function Hoe(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}Dz.INSTANCE.onDidChangeZoomLevel;Dz.INSTANCE.onDidChangeFullscreen;var kh=typeof navigator=="object"?navigator.userAgent:"";kh.indexOf("Firefox")>=0;kh.indexOf("AppleWebKit")>=0;var Foe=kh.indexOf("Chrome")>=0;!Foe&&kh.indexOf("Safari")>=0;kh.indexOf("Electron/")>=0;kh.indexOf("Android")>=0;var e1=!1;if(typeof _l.matchMedia=="function"){let t=_l.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=_l.matchMedia("(display-mode: fullscreen)");e1=t.matches,Hoe(_l,t,({matches:i})=>{e1&&e.matches||(e1=i)})}var Xc="en",t1=!1,Bz=!1,Pm,ag=Xc,tQ=Xc,Goe,Vr,wl=globalThis,Yi,JQ;typeof wl.vscode<"u"&&typeof wl.vscode.process<"u"?Yi=wl.vscode.process:typeof process<"u"&&typeof((JQ=process==null?void 0:process.versions)==null?void 0:JQ.node)=="string"&&(Yi=process);var eL,Koe=typeof((eL=Yi==null?void 0:Yi.versions)==null?void 0:eL.electron)=="string",Joe=Koe&&(Yi==null?void 0:Yi.type)==="renderer",tL;if(typeof Yi=="object"){Yi.platform,Yi.platform,t1=Yi.platform==="linux",t1&&Yi.env.SNAP&&Yi.env.SNAP_REVISION,Yi.env.CI||Yi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Pm=Xc,ag=Xc;let t=Yi.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Pm=e.userLocale,tQ=e.osLocale,ag=e.resolvedLanguage||Xc,Goe=(tL=e.languagePack)==null?void 0:tL.translationsConfigFile}catch{}Bz=!0}else typeof navigator=="object"&&!Joe?(Vr=navigator.userAgent,Vr.indexOf("Windows")>=0,Vr.indexOf("Macintosh")>=0,(Vr.indexOf("Macintosh")>=0||Vr.indexOf("iPad")>=0||Vr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,t1=Vr.indexOf("Linux")>=0,(Vr==null?void 0:Vr.indexOf("Mobi"))>=0,ag=globalThis._VSCODE_NLS_LANGUAGE||Xc,Pm=navigator.language.toLowerCase(),tQ=Pm):console.error("Unable to resolve platform.");var iQ=Bz,Ms=Vr,oa=ag,eae;(t=>{function e(){return oa}t.value=e;function i(){return oa.length===2?oa==="en":oa.length>=3?oa[0]==="e"&&oa[1]==="n"&&oa[2]==="-":!1}t.isDefaultVariant=i;function n(){return oa==="en"}t.isDefault=n})(eae||(eae={}));var tae=typeof wl.postMessage=="function"&&!wl.importScripts;(()=>{if(tae){let t=[];wl.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,r=t.length;n<r;n++){let s=t[n];if(s.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),s.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),wl.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var iae=!!(Ms&&Ms.indexOf("Chrome")>=0);Ms&&Ms.indexOf("Firefox")>=0;!iae&&Ms&&Ms.indexOf("Safari")>=0;Ms&&Ms.indexOf("Edg/")>=0;Ms&&Ms.indexOf("Android")>=0;var kc=typeof navigator=="object"?navigator:{};iQ||document.queryCommandSupported&&document.queryCommandSupported("copy")||kc&&kc.clipboard&&kc.clipboard.writeText,iQ||kc&&kc.clipboard&&kc.clipboard.readText;var Vw=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},i1=new Vw,nQ=new Vw,rQ=new Vw;new Array(230);var nae;(t=>{function e(l){return i1.keyCodeToStr(l)}t.toString=e;function i(l){return i1.strToKeyCode(l)}t.fromString=i;function n(l){return nQ.keyCodeToStr(l)}t.toUserSettingsUS=n;function r(l){return rQ.keyCodeToStr(l)}t.toUserSettingsGeneral=r;function s(l){return nQ.strToKeyCode(l)||rQ.strToKeyCode(l)}t.fromUserSettings=s;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return i1.keyCodeToStr(l)}t.toElectronAccelerator=o})(nae||(nae={}));var $z=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),rae;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof sae?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:po.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$z})})(rae||(rae={}));var sae=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?$z:(this._emitter||(this._emitter=new Rt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},oae;(t=>{async function e(n){let r,s=await Promise.all(n.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return s}t.settled=e;function i(n){return new Promise(async(r,s)=>{try{await n(r,s)}catch(o){s(o)}})}t.withAsyncBody=i})(oae||(oae={}));var sQ=class br{static fromArray(e){return new br(i=>{i.emitMany(e)})}static fromPromise(e){return new br(async i=>{i.emitMany(await e)})}static fromPromises(e){return new br(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new br(async i=>{await Promise.all(e.map(async n=>{for await(let r of n)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Rt,queueMicrotask(async()=>{let n={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(n)),this.resolve()}catch(r){this.reject(r)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await po.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(e,i){return new br(async n=>{for await(let r of e)n.emitOne(i(r))})}map(e){return br.map(this,e)}static filter(e,i){return new br(async n=>{for await(let r of e)i(r)&&n.emitOne(r)})}filter(e){return br.filter(this,e)}static coalesce(e){return br.filter(e,i=>!!i)}coalesce(){return br.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return br.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};sQ.EMPTY=sQ.fromArray([]);var{getWindow:aae}=(function(){let t=new Map,e={window:_l,disposables:new Jc};t.set(_l.vscodeWindowId,e);let i=new Rt,n=new Rt,r=new Rt;function s(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:n.event,registerWindow(o){if(t.has(o.vscodeWindowId))return Fr.None;let l=new Jc,c={window:o,disposables:l.add(new Jc)};return t.set(o.vscodeWindowId,c),l.add(rn(()=>{t.delete(o.vscodeWindowId),n.fire(o)})),l.add(LS(o,cae.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(c),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:s,getWindow(o){var u;let l=o;if((u=l==null?void 0:l.ownerDocument)!=null&&u.defaultView)return l.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:_l},getDocument(o){return aae(o).document}}})(),lae=class{constructor(t,e,i,n){this._node=t,this._type=e,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function LS(t,e,i,n){return new lae(t,e,i,n)}var cae={BEFORE_UNLOAD:"beforeunload"},hae=class extends Fr{constructor(t,e,i,n,r,s,o,l,c){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=i,this._coreBrowserService=n,this._coreService=r,this._decorationService=s,this._optionsService=o,this._themeService=l,this._cursorBlinkStateManager=new ju,this._charAtlasDisposable=this._register(new ju),this._observerDisposable=this._register(new ju),this._model=new Voe,this._workCell=new WR,this._workCell2=new WR,this._rectangleRenderer=this._register(new ju),this._glyphRenderer=this._register(new ju),this._onChangeTextureAtlas=this._register(new Rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Rt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Rt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let u={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext("webgl2",u),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new noe(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Yoe(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=toe(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(LS(this._canvas,"webglcontextlost",d=>{console.log("webglcontextlost event received"),d.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(d)},3e3)})),this._register(LS(this._canvas,"webglcontextrestored",d=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,ZR(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=qR(this._canvas,this._coreBrowserService.window,(d,p)=>this._setCanvasDevicePixelDimensions(d,p)),this._register(this._coreBrowserService.onWindowChange(d=>{this._observerDisposable.value=qR(this._canvas,d,(p,g)=>this._setCanvasDevicePixelDimensions(p,g))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(rn(()=>{var d;for(let p of this._renderLayers)p.dispose();(d=this._canvas.parentElement)==null||d.removeChild(this._canvas),ZR(this._terminal)}))}get textureAtlas(){var t;return(t=this._charAtlas)==null?void 0:t.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(t,e){var i,n,r,s;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let o of this._renderLayers)o.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`,(i=this._rectangleRenderer.value)==null||i.setDimensions(this.dimensions),(n=this._rectangleRenderer.value)==null||n.handleResize(),(r=this._glyphRenderer.value)==null||r.setDimensions(this.dimensions),(s=this._glyphRenderer.value)==null||s.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var t;for(let e of this._renderLayers)e.handleBlur(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.pause(),this._requestRedrawViewport()}handleFocus(){var t;for(let e of this._renderLayers)e.handleFocus(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,i){for(let n of this._renderLayers)n.handleSelectionChanged(this._terminal,t,e,i);this._model.selection.update(this._core,t,e,i),this._requestRedrawViewport()}handleCursorMove(){var t;for(let e of this._renderLayers)e.handleCursorMove(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Woe(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new zoe(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var e;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=Pz(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._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=pz(po.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),po.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),(e=this._glyphRenderer.value)==null||e.setAtlas(this._charAtlas)}_clearModel(t){var e;this._model.clear(),t&&((e=this._glyphRenderer.value)==null||e.clear())}clearTextureAtlas(){var t;(t=this._charAtlas)==null||t.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var t;this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){var i;if(!this._isAttached)if((i=this._core.screenElement)!=null&&i.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let n of this._renderLayers)n.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new Poe(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let i=this._core,n=this._workCell,r,s,o,l,c,u,d=0,p=!0,g,O,_,b,x,w,k,T,A;t=oQ(t,i.rows-1,0),e=oQ(e,i.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",E=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,N=E-i.buffer.ydisp,z=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),Z=-1,J=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let U=!1;for(s=t;s<=e;s++)for(o=s+i.buffer.ydisp,l=i.buffer.lines.get(o),this._model.lineLengths[s]=0,_=E===o,d=0,c=this._characterJoinerService.getJoinedCharacters(o),T=0;T<i.cols;T++){if(r=this._cellColorResolver.result.bg,l.loadCell(T,n),T===0&&(r=this._cellColorResolver.result.bg),u=!1,p=T>=d,g=T,c.length>0&&T===c[0][0]&&p){O=c.shift();let R=this._model.selection.isCellSelected(this._terminal,O[0],o);for(k=O[0]+1;k<O[1];k++)p&&(p=R===this._model.selection.isCellSelected(this._terminal,k,o));p&&(p=!_||z<O[0]||z>=O[1]),p?(u=!0,n=new uae(n,l.translateToString(!0,O[0],O[1]),O[1]-O[0]),g=O[1]-1):d=O[1]}if(b=n.getChars(),x=n.getCode(),k=(s*i.cols+T)*nO,this._cellColorResolver.resolve(n,T,o,this.dimensions.device.cell.width),J&&o===E&&(T===z&&(this._model.cursor={x:z,y:N,width:n.getWidth(),style:this._coreBrowserService.isFocused?L:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},Z=z+n.getWidth()-1),T>=z&&T<=Z&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&i.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)),x!==0&&(this._model.lineLengths[s]=T+1),!(this._model.cells[k]===x&&this._model.cells[k+sg]===this._cellColorResolver.result.bg&&this._model.cells[k+og]===this._cellColorResolver.result.fg&&this._model.cells[k+Ky]===this._cellColorResolver.result.ext)&&(U=!0,b.length>1&&(x|=Ioe),this._model.cells[k]=x,this._model.cells[k+sg]=this._cellColorResolver.result.bg,this._model.cells[k+og]=this._cellColorResolver.result.fg,this._model.cells[k+Ky]=this._cellColorResolver.result.ext,w=n.getWidth(),this._glyphRenderer.value.updateCell(T,s,x,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,w,r),u)){for(n=this._workCell,T++;T<=g;T++)A=(s*i.cols+T)*nO,this._glyphRenderer.value.updateCell(T,s,0,0,0,0,Yse,0,0),this._model.cells[A]=0,this._model.cells[A+sg]=this._cellColorResolver.result.bg,this._model.cells[A+og]=this._cellColorResolver.result.fg,this._model.cells[A+Ky]=this._cellColorResolver.result.ext;T--}}U&&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(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},uae=class extends Vc{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function oQ(t,e,i=0){return Math.max(Math.min(t,e),i)}var aQ="di$target",lQ="di$dependencies",n1=new Map;function Ls(t){if(n1.has(t))return n1.get(t);let e=function(i,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");fae(e,i,r)};return e._id=t,n1.set(t,e),e}function fae(t,e,i){e[aQ]===e?e[lQ].push({id:t,index:i}):(e[lQ]=[{id:t,index:i}],e[aQ]=e)}Ls("BufferService");Ls("CoreMouseService");Ls("CoreService");Ls("CharsetService");Ls("InstantiationService");Ls("LogService");var dae=Ls("OptionsService");Ls("OscLinkService");Ls("UnicodeService");Ls("DecorationService");var pae={trace:0,debug:1,info:2,warn:3,error:4,off:5},mae="xterm.js: ",cQ=class extends Fr{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=pae[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)typeof t[e]=="function"&&(t[e]=t[e]())}_log(t,e,i){this._evalLazyOptionalParams(i),t.call(console,(this._optionsService.options.logger?"":mae)+e,...i)}trace(t,...e){var i;this._logLevel<=0&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,t,e)}debug(t,...e){var i;this._logLevel<=1&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,t,e)}info(t,...e){var i;this._logLevel<=2&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,t,e)}warn(t,...e){var i;this._logLevel<=3&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,t,e)}error(t,...e){var i;this._logLevel<=4&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,t,e)}};cQ=Bse([$se(0,dae)],cQ);var gae=class extends Fr{constructor(t){if(Oz&&Use()<16){let e={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",e))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=this._register(new Rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Rt),this.onContextLoss=this._onContextLoss.event}activate(t){let e=t._core;if(!t.element){this._register(e.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let i=e.coreService,n=e.optionsService,r=e,s=r._renderService,o=r._characterJoinerService,l=r._charSizeService,c=r._coreBrowserService,u=r._decorationService;r._logService;let d=r._themeService;this._renderer=this._register(new hae(t,o,l,c,i,u,n,d,this._preserveDrawingBuffer)),this._register(po.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(po.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(po.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(po.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),s.setRenderer(this._renderer),this._register(rn(()=>{if(this._terminal._core._store._isDisposed)return;let p=this._terminal._core._renderService;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(t.cols,t.rows)}))}get textureAtlas(){var t;return(t=this._renderer)==null?void 0:t.textureAtlas}clearTextureAtlas(){var t;(t=this._renderer)==null||t.clearTextureAtlas()}};/**
|
|
205
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
206
|
+
* @license MIT
|
|
207
|
+
*
|
|
208
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
209
|
+
* @license MIT
|
|
210
|
+
*
|
|
211
|
+
* Originally forked from (with the author's permission):
|
|
212
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
213
|
+
* http://bellard.org/jslinux/
|
|
214
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
215
|
+
*/var Pi=0,Ri=0,Qi=0,Wt=0,nn;(t=>{function e(r,s,o,l){return l!==void 0?`#${nl(r)}${nl(s)}${nl(o)}${nl(l)}`:`#${nl(r)}${nl(s)}${nl(o)}`}t.toCss=e;function i(r,s,o,l=255){return(r<<24|s<<16|o<<8|l)>>>0}t.toRgba=i;function n(r,s,o,l){return{css:t.toCss(r,s,o,l),rgba:t.toRgba(r,s,o,l)}}t.toColor=n})(nn||(nn={}));var Oae;(t=>{function e(c,u){if(Wt=(u.rgba&255)/255,Wt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Pi=O+Math.round((d-O)*Wt),Ri=_+Math.round((p-_)*Wt),Qi=b+Math.round((g-b)*Wt);let x=nn.toCss(Pi,Ri,Qi),w=nn.toRgba(Pi,Ri,Qi);return{css:x,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=lg.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return nn.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function r(c){let u=(c.rgba|255)>>>0;return[Pi,Ri,Qi]=lg.toChannels(u),{css:nn.toCss(Pi,Ri,Qi),rgba:u}}t.opaque=r;function s(c,u){return Wt=Math.round(u*255),[Pi,Ri,Qi]=lg.toChannels(c.rgba),{css:nn.toCss(Pi,Ri,Qi,Wt),rgba:nn.toRgba(Pi,Ri,Qi,Wt)}}t.opacity=s;function o(c,u){return Wt=c.rgba&255,s(c,Wt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(Oae||(Oae={}));var Zi;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let s=r.getContext("2d",{willReadFrequently:!0});s&&(e=s,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Pi=parseInt(r.slice(1,2).repeat(2),16),Ri=parseInt(r.slice(2,3).repeat(2),16),Qi=parseInt(r.slice(3,4).repeat(2),16),nn.toColor(Pi,Ri,Qi);case 5:return Pi=parseInt(r.slice(1,2).repeat(2),16),Ri=parseInt(r.slice(2,3).repeat(2),16),Qi=parseInt(r.slice(3,4).repeat(2),16),Wt=parseInt(r.slice(4,5).repeat(2),16),nn.toColor(Pi,Ri,Qi,Wt);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}}let s=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(s)return Pi=parseInt(s[1]),Ri=parseInt(s[2]),Qi=parseInt(s[3]),Wt=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),nn.toColor(Pi,Ri,Qi,Wt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=r,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Pi,Ri,Qi,Wt]=e.getImageData(0,0,1,1).data,Wt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:nn.toRgba(Pi,Ri,Qi,Wt),css:r}}t.toColor=n})(Zi||(Zi={}));var pn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,r,s){let o=n/255,l=r/255,c=s/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(pn||(pn={}));var lg;(t=>{function e(o,l){if(Wt=(l&255)/255,Wt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Pi=p+Math.round((c-p)*Wt),Ri=g+Math.round((u-g)*Wt),Qi=O+Math.round((d-O)*Wt),nn.toRgba(Pi,Ri,Qi)}t.blend=e;function i(o,l,c){let u=pn.relativeLuminance(o>>8),d=pn.relativeLuminance(l>>8);if(ao(u,d)<c){if(d<u){let O=n(o,l,c),_=ao(u,pn.relativeLuminance(O>>8));if(_<c){let b=r(o,l,c),x=ao(u,pn.relativeLuminance(b>>8));return _>x?O:b}return O}let p=r(o,l,c),g=ao(u,pn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=ao(u,pn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function r(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=r;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=s})(lg||(lg={}));function nl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function ao(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var vae=Object.freeze((()=>{let t=[Zi.toColor("#2e3436"),Zi.toColor("#cc0000"),Zi.toColor("#4e9a06"),Zi.toColor("#c4a000"),Zi.toColor("#3465a4"),Zi.toColor("#75507b"),Zi.toColor("#06989a"),Zi.toColor("#d3d7cf"),Zi.toColor("#555753"),Zi.toColor("#ef2929"),Zi.toColor("#8ae234"),Zi.toColor("#fce94f"),Zi.toColor("#729fcf"),Zi.toColor("#ad7fa8"),Zi.toColor("#34e2e2"),Zi.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],r=e[i/6%6|0],s=e[i%6];t.push({css:nn.toCss(n,r,s),rgba:nn.toRgba(n,r,s)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:nn.toCss(n,n,n),rgba:nn.toRgba(n,n,n)})}return t})());function hQ(t,e,i){return Math.max(e,Math.min(t,i))}function _ae(t){switch(t){case"&":return"&";case"<":return"<"}return t}var zz=class{constructor(t){this._buffer=t}serialize(t,e){let i=this._buffer.getNullCell(),n=this._buffer.getNullCell(),r=i,s=t.start.y,o=t.end.y,l=t.start.x,c=t.end.x;this._beforeSerialize(o-s,s,o);for(let u=s;u<=o;u++){let d=this._buffer.getLine(u);if(d){let p=u===t.start.y?l:0,g=u===t.end.y?c:d.length;for(let O=p;O<g;O++){let _=d.getCell(O,r===i?n:i);if(!_){console.warn(`Can't get cell at row=${u}, col=${O}`);continue}this._nextCell(_,r,u,O),r=_}}this._rowEnd(u,u===o)}return this._afterSerialize(),this._serializeString(e)}_nextCell(t,e,i,n){}_rowEnd(t,e){}_beforeSerialize(t,e,i){}_afterSerialize(){}_serializeString(t){return""}};function Nz(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function lo(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function jz(t,e){return t.isInverse()===e.isInverse()&&t.isBold()===e.isBold()&&t.isUnderline()===e.isUnderline()&&t.isOverline()===e.isOverline()&&t.isBlink()===e.isBlink()&&t.isInvisible()===e.isInvisible()&&t.isItalic()===e.isItalic()&&t.isDim()===e.isDim()&&t.isStrikethrough()===e.isStrikethrough()}var yae=class extends zz{constructor(t,e){super(t),this._terminal=e,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,e,i){this._allRows=new Array(t),this._lastContentCursorRow=e,this._lastCursorRow=e,this._firstRow=e}_rowEnd(t,e){var n;this._nullCellCount>0&&!lo(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let i="";if(!e){t-this._firstRow>=this._terminal.rows&&((n=this._buffer.getLine(this._cursorStyleRow))==null||n.getCell(this._cursorStyleCol,this._backgroundCell));let r=this._buffer.getLine(t),s=this._buffer.getLine(t+1);if(!s.isWrapped)i=`\r
|
|
216
|
+
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{i="";let o=r.getCell(r.length-1,this._thisRowLastChar),l=r.getCell(r.length-2,this._thisRowLastSecondChar),c=s.getCell(0,this._nextRowFirstChar),u=c.getWidth()>1,d=!1;(c.getChars()&&u?this._nullCellCount<=1:this._nullCellCount<=0)&&((o.getChars()||o.getWidth()===0)&&lo(o,c)&&(d=!0),u&&(l.getChars()||l.getWidth()===0)&&lo(o,c)&&lo(l,c)&&(d=!0)),d||(i="-".repeat(this._nullCellCount+1),i+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(i+="\x1B[A",i+=`\x1B[${r.length-this._nullCellCount}C`,i+=`\x1B[${this._nullCellCount}X`,i+=`\x1B[${r.length-this._nullCellCount}D`,i+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=i,this._currentRow="",this._nullCellCount=0}_diffStyle(t,e){let i=[],n=!Nz(t,e),r=!lo(t,e),s=!jz(t,e);if(n||r||s)if(t.isAttributeDefault())e.isAttributeDefault()||i.push(0);else{if(n){let o=t.getFgColor();t.isFgRGB()?i.push(38,2,o>>>16&255,o>>>8&255,o&255):t.isFgPalette()?o>=16?i.push(38,5,o):i.push(o&8?90+(o&7):30+(o&7)):i.push(39)}if(r){let o=t.getBgColor();t.isBgRGB()?i.push(48,2,o>>>16&255,o>>>8&255,o&255):t.isBgPalette()?o>=16?i.push(48,5,o):i.push(o&8?100+(o&7):40+(o&7)):i.push(49)}s&&(t.isInverse()!==e.isInverse()&&i.push(t.isInverse()?7:27),t.isBold()!==e.isBold()&&i.push(t.isBold()?1:22),t.isUnderline()!==e.isUnderline()&&i.push(t.isUnderline()?4:24),t.isOverline()!==e.isOverline()&&i.push(t.isOverline()?53:55),t.isBlink()!==e.isBlink()&&i.push(t.isBlink()?5:25),t.isInvisible()!==e.isInvisible()&&i.push(t.isInvisible()?8:28),t.isItalic()!==e.isItalic()&&i.push(t.isItalic()?3:23),t.isDim()!==e.isDim()&&i.push(t.isDim()?2:22),t.isStrikethrough()!==e.isStrikethrough()&&i.push(t.isStrikethrough()?9:29))}return i}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let r=t.getChars()==="",s=this._diffStyle(t,this._cursorStyle);if(r?!lo(this._cursorStyle,t):s.length>0){this._nullCellCount>0&&(lo(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n,this._currentRow+=`\x1B[${s.join(";")}m`;let o=this._buffer.getLine(i);o!==void 0&&(o.getCell(n,this._cursorStyle),this._cursorStyleRow=i,this._cursorStyleCol=n)}r?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(lo(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n+t.getWidth())}_serializeString(t){let e=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(e=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let i="";for(let s=0;s<e;s++)i+=this._allRows[s],s+1<e&&(i+=this._allRowSeparators[s]);if(!t){let s=this._buffer.baseY+this._buffer.cursorY,o=this._buffer.cursorX,l=s!==this._lastCursorRow||o!==this._lastCursorCol,c=u=>{u>0?i+=`\x1B[${u}C`:u<0&&(i+=`\x1B[${-u}D`)};l&&((u=>{u>0?i+=`\x1B[${u}B`:u<0&&(i+=`\x1B[${-u}A`)})(s-this._lastCursorRow),c(o-this._lastCursorCol))}let n=this._terminal._core._inputHandler._curAttrData,r=this._diffStyle(n,this._cursorStyle);return r.length>0&&(i+=`\x1B[${r.join(";")}m`),i}},bae=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,e,i){let n=e.length,r=i===void 0?n:hQ(i+t.rows,0,n);return this._serializeBufferByRange(t,e,{start:n-r,end:n-1},!1)}_serializeBufferByRange(t,e,i,n){return new yae(e,t).serialize({start:{x:0,y:typeof i.start=="number"?i.start:i.start.line},end:{x:t.cols,y:typeof i.end=="number"?i.end:i.end.line}},n)}_serializeBufferAsHTML(t,e){var l;let i=t.buffer.active,n=new Sae(i,t,e),r=e.onlySelection??!1,s=e.range;if(s)return n.serialize({start:{x:s.startCol,y:(s.startLine,s.startLine)},end:{x:t.cols,y:(s.endLine,s.endLine)}});if(!r){let c=i.length,u=e.scrollback,d=u===void 0?c:hQ(u+t.rows,0,c);return n.serialize({start:{x:0,y:c-d},end:{x:t.cols,y:c-1}})}let o=(l=this._terminal)==null?void 0:l.getSelectionPosition();return o!==void 0?n.serialize({start:{x:o.start.x,y:o.start.y},end:{x:o.end.x,y:o.end.y}}):""}_serializeModes(t){let e="",i=t.modes;if(i.applicationCursorKeysMode&&(e+="\x1B[?1h"),i.applicationKeypadMode&&(e+="\x1B[?66h"),i.bracketedPasteMode&&(e+="\x1B[?2004h"),i.insertMode&&(e+="\x1B[4h"),i.originMode&&(e+="\x1B[?6h"),i.reverseWraparoundMode&&(e+="\x1B[?45h"),i.sendFocusMode&&(e+="\x1B[?1004h"),i.wraparoundMode===!1&&(e+="\x1B[?7l"),i.mouseTrackingMode!=="none")switch(i.mouseTrackingMode){case"x10":e+="\x1B[?9h";break;case"vt200":e+="\x1B[?1000h";break;case"drag":e+="\x1B[?1002h";break;case"any":e+="\x1B[?1003h";break}return e}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let e=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let i=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);e+=`\x1B[?1049h\x1B[H${i}`}return t!=null&&t.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},Sae=class extends zz{constructor(t,e,i){super(t),this._terminal=e,this._options=i,this._currentRow="",this._htmlContent="",e._core._themeService?this._ansiColors=e._core._themeService.colors.ansi:this._ansiColors=vae}_padStart(t,e,i){return e=e>>0,i=i??" ",t.length>e?t:(e-=t.length,e>i.length&&(i+=i.repeat(e/i.length)),i.slice(0,e)+t)}_beforeSerialize(t,e,i){var o,l;this._htmlContent+="<html><body><!--StartFragment--><pre>";let n="#000000",r="#ffffff";(this._options.includeGlobalBackground??!1)&&(n=((o=this._terminal.options.theme)==null?void 0:o.foreground)??"#ffffff",r=((l=this._terminal.options.theme)==null?void 0:l.background)??"#000000");let s=[];s.push("color: "+n+";"),s.push("background-color: "+r+";"),s.push("font-family: "+this._terminal.options.fontFamily+";"),s.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+s.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,e){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,e){let i=e?t.getFgColor():t.getBgColor();if(e?t.isFgRGB():t.isBgRGB())return"#"+[i>>16&255,i>>8&255,i&255].map(n=>this._padStart(n.toString(16),2,"0")).join("");if(e?t.isFgPalette():t.isBgPalette())return this._ansiColors[i].css}_diffStyle(t,e){let i=[],n=!Nz(t,e),r=!lo(t,e),s=!jz(t,e);if(n||r||s){let o=this._getHexColor(t,!0);o&&i.push("color: "+o+";");let l=this._getHexColor(t,!1);return l&&i.push("background-color: "+l+";"),t.isInverse()&&i.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&i.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?i.push("text-decoration: overline underline;"):t.isUnderline()?i.push("text-decoration: underline;"):t.isOverline()&&i.push("text-decoration: overline;"),t.isBlink()&&i.push("text-decoration: blink;"),t.isInvisible()&&i.push("visibility: hidden;"),t.isItalic()&&i.push("font-style: italic;"),t.isDim()&&i.push("opacity: 0.5;"),t.isStrikethrough()&&i.push("text-decoration: line-through;"),i}}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let r=t.getChars()==="",s=this._diffStyle(t,e);s&&(this._currentRow+=s.length===0?"</span><span>":"</span><span style='"+s.join(" ")+"'>"),r?this._currentRow+=" ":this._currentRow+=_ae(t.getChars())}_serializeString(){return this._htmlContent}};const xae=10,wae=2e3;function Cae(t={}){const{autoSpawn:e=!1,skipPermissions:i=!1}=t,[n,r]=q.useState(!1),[s,o]=q.useState(!1),[l,c]=q.useState(null),[u,d]=q.useState(null),p=q.useRef(null),g=q.useRef(0),O=q.useRef(null),_=q.useRef(!0),b=q.useRef(null),x=q.useRef(null),w=q.useRef(e),k=q.useRef(i);w.current=e,k.current=i;const T=q.useCallback(z=>{const Z=p.current;Z&&Z.readyState===WebSocket.OPEN&&Z.send(JSON.stringify(z))},[]),A=q.useCallback(z=>{T({type:"spawn",skipPermissions:z})},[T]),L=q.useCallback(()=>{T({type:"kill"})},[T]),E=q.useCallback((z,Z)=>{T({type:"resize",cols:z,rows:Z})},[T]),N=q.useCallback(z=>{T({type:"input",data:z})},[T]);return q.useEffect(()=>{_.current=!0;function z(){if(!_.current)return;const J=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`,U=new WebSocket(J);p.current=U,U.onopen=()=>{_.current&&(r(!0),g.current=0,w.current&&U.send(JSON.stringify({type:"spawn",skipPermissions:k.current})))},U.onclose=()=>{_.current&&(r(!1),p.current=null,g.current<xae&&(g.current++,O.current=setTimeout(z,wae)))},U.onmessage=R=>{var B,D;if(_.current)try{const j=JSON.parse(R.data);switch(j.type){case"output":(B=b.current)==null||B.call(b,j.data);break;case"scrollback":(D=x.current)==null||D.call(x,j.data);break;case"status":c({pid:j.pid,uptime:j.uptime,cwd:j.cwd,memoryMB:j.memoryMB,isActive:j.isActive,skipPermissions:j.skipPermissions,alive:j.alive});break;case"exit":d(j.code??1);break;case"started":d(null);break;case"unavailable":o(!0);break}}catch{}},U.onerror=()=>{}}return z(),()=>{_.current=!1,O.current!==null&&(clearTimeout(O.current),O.current=null),p.current&&(p.current.onclose=null,p.current.close(),p.current=null)}},[]),{connected:n,unavailable:s,status:l,exitCode:u,send:T,spawn:A,kill:L,resize:E,writeInput:N,onOutput:b,onScrollback:x}}function kae(t){const e=Math.floor(t/60),i=t%60;return`${e}m ${i}s`}function Tae(t){const e=t.replace(/\\/g,"/").split("/").filter(Boolean);return e.length<=2?t:".../"+e.slice(-2).join("/")}function Aae({status:t,connected:e,exitCode:i,skipPermissions:n,onToggleSkipPermissions:r,onStop:s,onRestart:o}){const l=e&&(t==null?void 0:t.alive),c=e?l?"bg-green-500":"bg-yellow-500":"bg-red-500",u=e?l?`Running (PID ${(t==null?void 0:t.pid)??"?"})`:"Stopped":"Disconnected";return S.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-card px-3 py-1.5 font-mono text-xs text-muted-foreground",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:Fe("inline-block h-2 w-2 rounded-full",c),title:u}),S.jsx("span",{children:u}),t&&l&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-border",children:"|"}),S.jsx("span",{children:kae(t.uptime)}),S.jsx("span",{className:"text-border",children:"|"}),S.jsx("span",{title:t.cwd,children:Tae(t.cwd)}),S.jsx("span",{className:"text-border",children:"|"}),S.jsxs("span",{children:[t.memoryMB," MB"]})]})]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5",children:[S.jsx("input",{type:"checkbox",checked:n,onChange:r,className:"h-3 w-3 accent-accent"}),S.jsx("span",{children:"Skip Perms"})]}),l&&S.jsx("button",{type:"button",onClick:s,className:"rounded-sm px-2 py-0.5 text-red-400 transition-colors hover:bg-red-500/20",children:"Stop"}),S.jsx("button",{type:"button",onClick:o,className:"rounded-sm px-2 py-0.5 transition-colors hover:bg-accent/20",children:"Restart"})]})]})}const Eae=[{label:"Progress",command:"/maxsim:progress"},{label:"New Project",command:"/maxsim:new-project"},{label:"Discuss",command:"/maxsim:discuss-phase N"},{label:"Plan",command:"/maxsim:plan-phase N"},{label:"Execute",command:"/maxsim:execute-phase N"},{label:"Roadmap",command:"/maxsim:roadmap"},{label:"Verify",command:"/maxsim:verify-work"},{label:"Resume",command:"/maxsim:resume-work"}],Iz="maxsim-quick-commands",Mae=3e4;function Pae(){try{const t=localStorage.getItem(Iz);if(t)return JSON.parse(t)}catch{}return Eae}function Rae(t){localStorage.setItem(Iz,JSON.stringify(t))}function Qae({onSendCommand:t,isActive:e,isAlive:i,unavailable:n=!1}){const[r,s]=q.useState(!1),[o,l]=q.useState(Pae),[c,u]=q.useState(!1),[d,p]=q.useState(null),g=q.useRef(null),O=q.useCallback(async E=>{if(!E.includes(" N"))return E;const N=g.current;if(N&&Date.now()-N.ts<Mae)return E.replace(" N",` ${N.value}`);try{const z=await fetch("/api/state");if(z.ok){const Z=await z.json(),J=String(Z.currentPhase??"1");return g.current={value:J,ts:Date.now()},E.replace(" N",` ${J}`)}}catch{}return E},[]),_=n||!i,b=q.useCallback(async E=>{if(_)return;const N=await O(E.command);p({label:E.label,resolved:N})},[_,O]),x=q.useCallback(()=>{d&&(t(d.resolved+`\r
|
|
217
|
+
`),p(null))},[d,t]),w=q.useCallback(()=>{p(null)},[]);q.useEffect(()=>{if(!d)return;const E=N=>{N.key==="Enter"?(N.preventDefault(),x()):N.key==="Escape"&&w()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[d,x,w]);const[k,T]=q.useState([]),A=q.useCallback(()=>{T([...o]),u(!0)},[o]),L=q.useCallback(()=>{const E=k.filter(N=>N.label.trim()&&N.command.trim());l(E),Rae(E),u(!1)},[k]);return r?S.jsx("div",{className:"absolute bottom-2 right-2 z-20",children:S.jsx("button",{type:"button",onClick:()=>s(!1),className:"rounded-md bg-card/80 p-1.5 text-xs text-muted-foreground shadow-lg backdrop-blur-sm border border-border hover:text-foreground transition-colors",title:"Show quick actions",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M18 15l-6-6-6 6"})})})}):S.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex flex-col items-end gap-1",children:[d&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-2 text-xs mb-1 backdrop-blur-sm",children:[S.jsxs("p",{className:"text-muted-foreground mb-1.5",children:["Send"," ",S.jsx("span",{className:"font-mono text-foreground",children:d.resolved}),"?"]}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:x,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Confirm"}),S.jsx("button",{type:"button",onClick:w,className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})]})]}),c&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-3 text-xs mb-1 backdrop-blur-sm w-72 max-h-64 overflow-y-auto",children:[S.jsx("p",{className:"text-muted-foreground font-medium mb-2",children:"Quick Commands"}),k.map((E,N)=>S.jsxs("div",{className:"flex gap-1 mb-1",children:[S.jsx("input",{className:"flex-[1] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs text-foreground",value:E.label,onChange:z=>{const Z=[...k];Z[N]={...Z[N],label:z.target.value},T(Z)},placeholder:"Label"}),S.jsx("input",{className:"flex-[2] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs font-mono text-foreground",value:E.command,onChange:z=>{const Z=[...k];Z[N]={...Z[N],command:z.target.value},T(Z)},placeholder:"Command"}),S.jsx("button",{type:"button",onClick:()=>T(k.filter((z,Z)=>Z!==N)),className:"text-muted-foreground hover:text-destructive transition-colors px-0.5",title:"Remove",children:"x"})]},N)),S.jsxs("div",{className:"flex justify-between mt-2",children:[S.jsx("button",{type:"button",onClick:()=>T([...k,{label:"",command:""}]),className:"text-muted-foreground hover:text-foreground transition-colors",children:"+ Add"}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Save"})]})]})]}),S.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-card/80 border border-border shadow-lg p-1.5 backdrop-blur-sm",children:[o.map(E=>S.jsx("button",{type:"button",onClick:()=>b(E),disabled:_,className:"rounded-md px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed",title:n?"Terminal unavailable — node-pty not installed":E.command,children:E.label},E.label)),S.jsx("button",{type:"button",onClick:A,className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors ml-0.5",title:"Settings",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[S.jsx("circle",{cx:"12",cy:"12",r:"3"}),S.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.32 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}),S.jsx("button",{type:"button",onClick:()=>s(!0),className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Minimize",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M6 9l6 6 6-6"})})})]})]})}function Lae({onReady:t,writeInputRef:e}){const i=q.useRef(null),n=q.useRef(null),r=q.useRef(null),s=q.useRef(null),o=q.useRef(null),[l,c]=q.useState(!0),{connected:u,unavailable:d,status:p,exitCode:g,writeInput:O,resize:_,spawn:b,kill:x,onOutput:w,onScrollback:k}=Cae({autoSpawn:!0,skipPermissions:l});q.useEffect(()=>(e&&(e.current=O),()=>{e&&(e.current=null)}),[O,e]);const T=q.useCallback(z=>{var Z;(Z=n.current)==null||Z.write(z)},[]),A=q.useCallback(z=>{var Z;(Z=n.current)==null||Z.write(z)},[]);q.useEffect(()=>(w.current=T,k.current=A,()=>{w.current=null,k.current=null}),[T,A,w,k]),q.useEffect(()=>{if(!i.current)return;const z=new Rse({cursorBlink:!0,fontSize:14,lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0"}}),Z=new Dse,J=new bae;z.loadAddon(Z),z.loadAddon(J);try{z.loadAddon(new gae)}catch{}z.open(i.current),Z.fit(),n.current=z,r.current=Z;const U=z.onData(B=>{O(B)}),R=new ResizeObserver(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r.current&&n.current&&(r.current.fit(),_(n.current.cols,n.current.rows))},100)});return R.observe(i.current),s.current=R,t==null||t(z),()=>{U.dispose(),R.disconnect(),o.current&&clearTimeout(o.current),z.dispose(),n.current=null,r.current=null,s.current=null}},[]);const L=q.useCallback(()=>{b(l),setTimeout(()=>{var z;return(z=n.current)==null?void 0:z.focus()},100)},[b,l]),E=q.useCallback(()=>{x()},[x]),N=q.useCallback(()=>{c(z=>!z)},[]);return S.jsxs("div",{className:"flex h-full w-full flex-col",onWheel:z=>z.stopPropagation(),children:[S.jsxs("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[S.jsx("div",{ref:i,className:"h-full w-full"}),S.jsx(Qae,{onSendCommand:O,isActive:(p==null?void 0:p.isActive)??!1,isAlive:(p==null?void 0:p.alive)??!1,unavailable:d}),d&&S.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-card",children:S.jsxs("div",{className:"max-w-sm text-center",children:[S.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Terminal unavailable"}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:["node-pty is not installed. Run ",S.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm install node-pty"})," in the dashboard directory."]})]})}),!u&&g===null&&S.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/60",children:S.jsxs("div",{className:"flex items-center gap-3 font-mono text-sm text-muted-foreground",children:[S.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[S.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),S.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Reconnecting..."]})}),g!==null&&S.jsxs("div",{className:"absolute inset-x-0 bottom-0 z-10 flex items-center justify-between bg-card/90 px-4 py-2 font-mono text-sm backdrop-blur-sm",children:[S.jsxs("span",{className:"text-muted-foreground",children:["Process exited (code ",g,")"]}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-3 py-1 text-xs text-foreground transition-colors hover:bg-accent-glow",children:"Restart"})]})]}),S.jsx(Aae,{status:p,connected:u,exitCode:g,skipPermissions:l,onToggleSkipPermissions:N,onStop:E,onRestart:L})]})}function Dae(){const[t,e]=q.useState(!1),i=q.useCallback(()=>e(n=>!n),[]);return{splitMode:t,toggleSplit:i}}function Bae({splitMode:t,onToggle:e}){return S.jsx("button",{type:"button",onClick:e,title:t?"Full-height mode":"Split-panel mode",className:"absolute right-3 top-2 z-20 flex h-7 w-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:bg-card-hover hover:text-foreground",children:t?S.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"})}):S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),S.jsx("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1.5"})]})})}function $ae({mode:t,onToggle:e}){const[i,n]=q.useState(!1);function r(){n(!0),e(),setTimeout(()=>n(!1),420)}const s=t==="simple",o=s?"Switch to Advanced Mode":"Switch to Simple Mode";return S.jsx("button",{type:"button",onClick:r,title:o,"aria-label":o,className:"flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:S.jsx(vo.span,{animate:{rotate:i?360:0},transition:{duration:.4,ease:"easeInOut"},style:{display:"flex",alignItems:"center",justifyContent:"center"},children:s?S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"6"}),S.jsx("ellipse",{cx:"8",cy:"8",rx:"2.5",ry:"6"}),S.jsx("path",{d:"M2 8h12M3.5 5h9M3.5 11h9",strokeLinecap:"round"})]}):S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1"}),S.jsx("path",{d:"M4 6l2.5 2L4 10M8 10h4",strokeLinecap:"round",strokeLinejoin:"round"})]})})})}function zae({onChoose:t}){return S.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:[S.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-background/60"}),S.jsxs("div",{className:"relative z-10 border border-border bg-card p-8 max-w-lg w-full mx-4",children:[S.jsx("h2",{className:"font-bold text-lg tracking-tight text-foreground mb-1",children:"Choose Your Dashboard Mode"}),S.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"You can switch between modes at any time from the header toggle."}),S.jsxs("div",{className:"flex gap-4",children:[S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"12",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"8",y:"3",width:"30",height:"6",rx:"1",fill:"#14b8a6",fillOpacity:"0.6"}),S.jsx("rect",{x:"8",y:"18",width:"104",height:"8",rx:"1",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"8",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"62",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Simple Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Clean action cards. No terminal required."})]}),S.jsx("button",{type:"button",onClick:()=>t("simple"),className:"border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Use Simple Mode"})]}),S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"70",fill:"currentColor",fillOpacity:"0.03"}),S.jsx("rect",{x:"0",y:"0",width:"28",height:"70",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"3",y:"3",width:"22",height:"5",rx:"1",fill:"currentColor",fillOpacity:"0.2"}),S.jsx("rect",{x:"3",y:"12",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"3",y:"18",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"30",y:"4",width:"86",height:"28",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"30",y:"36",width:"86",height:"28",rx:"1",fill:"#3b82f6",fillOpacity:"0.1"}),S.jsx("rect",{x:"33",y:"39",width:"12",height:"2",rx:"0.5",fill:"#3b82f6",fillOpacity:"0.5"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Advanced Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Full dashboard with terminal and phase viewer."})]}),S.jsx("button",{type:"button",onClick:()=>t("advanced"),className:"border border-accent bg-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Use Advanced Mode"})]})]})]})]})}function rl(t){var e;return(((e=t==null?void 0:t.phases)==null?void 0:e.length)??0)>0}function uQ(t){var e;return((e=t==null?void 0:t.phases)==null?void 0:e.some(i=>i.disk_status==="partial"||i.disk_status==="planned"||i.disk_status==="discussed"||i.disk_status==="researched"))??!1}const DS=[{id:"plan-new-phase",tab:"plan",title:"Plan New Phase",description:"Create a detailed execution plan for the next phase",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M7 8h6M7 11h4M10 2v4",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:plan-phase",isAvailable:t=>rl(t),unavailableReason:"No phases found in ROADMAP.md — create a project first"},{id:"add-phase",tab:"plan",title:"Add Phase",description:"Insert a new phase into the roadmap",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M10 8v6M7 11h6",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:add-phase",isAvailable:t=>rl(t),unavailableReason:"No project loaded — create a project first"},{id:"discuss-phase",tab:"plan",title:"Discuss Phase",description:"Answer planning questions to define requirements for a phase",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 6a1 1 0 011-1h12a1 1 0 011 1v7a1 1 0 01-1 1H7l-4 3V6z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:discuss-phase",isAvailable:t=>uQ(t),unavailableReason:"No active phase to discuss — plan a phase first"},{id:"init-existing",tab:"plan",title:"Init Existing",description:"Set up MAXSIM planning for an existing project",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 3v10M10 13l-3-3M10 13l3-3",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 17h12",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:init-existing",isAvailable:()=>!0,unavailableReason:""},{id:"new-project",tab:"plan",title:"New Project",description:"Start a brand new MAXSIM project from scratch",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M10 4v12M4 10h12",strokeLinecap:"round"})}),requiresInput:!1,command:"/maxsim:quick",isAvailable:()=>!0,unavailableReason:""},{id:"execute-phase",tab:"execute",title:"Execute Phase",description:"Run the current phase plan and implement the changes",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M6 4l10 6-10 6V4z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:execute-phase",isAvailable:t=>uQ(t),unavailableReason:"No phase is currently planned — plan a phase first"},{id:"verify-work",tab:"execute",title:"Verify Work",description:"Check that completed phase work meets all acceptance criteria",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M4 10l4 4 8-8",strokeLinecap:"round",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:verify-work",isAvailable:t=>rl(t),unavailableReason:"No phases to verify — complete a phase first"},{id:"audit-milestone",tab:"execute",title:"Audit Milestone",description:"Review and archive a completed milestone",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M4 5h12M4 10h8M4 15h10",strokeLinecap:"round"}),S.jsx("circle",{cx:"16",cy:"14",r:"2.5"}),S.jsx("path",{d:"M18 16l1.5 1.5",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:audit-milestone",isAvailable:t=>rl(t),unavailableReason:"No milestone to audit — complete some phases first"},{id:"fix-gaps",tab:"execute",title:"Fix Gaps",description:"Create plans to close verification failures",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 4v6h6",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 10a6 6 0 1012 0",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:plan-phase --gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to fix — complete a verification first"},{id:"find-gaps",tab:"execute",title:"Find Gaps",description:"Identify missing requirements or unverified work",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"9",cy:"9",r:"5"}),S.jsx("path",{d:"M16 16l-3-3",strokeLinecap:"round"}),S.jsx("path",{d:"M9 7v2M9 11h.01",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:verify-work --find-gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to analyze — create some phases first"},{id:"view-roadmap",tab:"execute",title:"View Roadmap",description:"See all phases and their status inline",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 5h14M3 10h14M3 15h8",strokeLinecap:"round"})}),requiresInput:!1,command:"",isAvailable:t=>rl(t),unavailableReason:"No roadmap to display"}];function Nae(){var c,u;const{roadmap:t}=Pl(),{setTab:e,setExpanded:i}=oO(),n=(c=t==null?void 0:t.phases)==null?void 0:c.find(d=>d.number===(t==null?void 0:t.current_phase));let r=null;if(n){const d=n.disk_status;d==="empty"||d==="no_directory"||d==="discussed"||d==="researched"?r="plan-new-phase":d==="planned"||d==="partial"?r="execute-phase":d==="complete"&&(r="verify-work")}else(((u=t==null?void 0:t.phases)==null?void 0:u.length)??0)===0&&(r="new-project");if(!r)return null;const s=DS.find(d=>d.id===r);if(!s)return null;const o=n?`Phase ${n.number}: ${n.name}`:"your project";function l(){const d=s.tab;e(d),i(s.id)}return S.jsxs("div",{className:"border border-simple-accent/40 bg-simple-accent/5 p-4 flex items-center justify-between gap-4 mb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"text-xs uppercase tracking-widest text-simple-accent font-mono mb-1",children:"Recommended"}),S.jsxs("p",{className:"text-sm text-foreground",children:[S.jsx("span",{className:"font-medium",children:o})," is ready to"," ",S.jsx("span",{className:"text-simple-accent",children:s.title.toLowerCase()})]})]}),S.jsx("button",{type:"button",onClick:l,className:"shrink-0 border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:s.title})]})}function jae({action:t,onExecute:e}){const{inputValues:i,setInput:n,reset:r}=oO(),{roadmap:s}=Pl(),o=q.useRef(null),[l,c]=q.useState(!1),[u,d]=q.useState(!1),p=(()=>{var L;if(!t.requiresInput)return"";const A=(L=s==null?void 0:s.phases)==null?void 0:L.find(E=>!E.roadmap_complete&&(E.disk_status==="empty"||E.disk_status==="no_directory"));return A?`Phase ${A.number}: ${A.name}`:""})(),g=i[t.id]??p;q.useEffect(()=>{const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[g]);function O(){const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)}function _(A){n(t.id,A)}function b(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),w())}function x(){const A=g.trim();return t.command===""?"":A?`${t.command} "${A}"`:t.command}function w(){if(t.requiresInput&&!g.trim()||t.id==="view-roadmap")return;const A=x();A&&e(A)}function k(){u?(r(),d(!1),c(!1)):(d(!0),setTimeout(()=>d(!1),3e3))}const T=t.requiresInput&&!g.trim();return S.jsxs("div",{className:"flex flex-col gap-3 relative",children:[S.jsx("p",{className:"text-xs text-muted-foreground",children:t.requiresInput?"Describe what this phase should accomplish.":"Add optional context (or leave blank to use defaults)."}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 flex gap-2 items-start",children:S.jsx("textarea",{ref:o,value:g,onChange:A=>{_(A.target.value),O()},onKeyDown:b,placeholder:t.requiresInput?"e.g. Phase 31: Simple Mode UI Shell":"Additional context (optional)",rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground placeholder:text-muted-foreground outline-none leading-relaxed"})}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:w,disabled:T,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",T?"border-border text-muted-foreground cursor-not-allowed":"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background"),children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M2 2l8 4-8 4V2z"})}),"Run in Terminal"]}),S.jsxs("div",{className:"relative ml-auto",children:[S.jsx("button",{type:"button",onClick:()=>c(A=>!A),"aria-label":"More options",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[S.jsx("circle",{cx:"4",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"8",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"12",cy:"8",r:"1.2"})]})}),l&&S.jsx("div",{className:"absolute right-0 bottom-8 z-20 border border-border bg-card shadow-lg min-w-max",children:S.jsx("button",{type:"button",onClick:k,className:Fe("flex w-full items-center gap-2 px-4 py-2.5 text-xs text-left transition-colors",u?"text-danger hover:bg-danger/10":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:u?"Click again to confirm reset":"Reset Simple Mode"})})]})]})]})}function Iae({action:t,roadmap:e,onExecute:i}){var g,O;const{expandedCardId:n,setExpanded:r}=oO(),{roadmap:s}=Pl(),o=n===t.id,l=!t.isAvailable(e),c=(g=s==null?void 0:s.phases)==null?void 0:g.find(_=>_.number===(s==null?void 0:s.current_phase));let u=null;if(c){const _=c.disk_status;_==="empty"||_==="no_directory"||_==="discussed"||_==="researched"?u="plan-new-phase":_==="planned"||_==="partial"?u="execute-phase":_==="complete"&&(u="verify-work")}else(((O=s==null?void 0:s.phases)==null?void 0:O.length)??0)===0&&(u="new-project");const d=t.id===u;function p(){l||r(o?null:t.id)}return S.jsxs("div",{className:Fe("bg-card border-0 transition-all duration-200",l?"opacity-50":"cursor-pointer hover:shadow-md hover:-translate-y-px",o&&"ring-1 ring-simple-accent/40"),title:l?t.unavailableReason:void 0,children:[S.jsxs("button",{type:"button",disabled:l,onClick:p,className:"flex w-full items-start gap-3 p-4 text-left","aria-expanded":o,children:[S.jsx("span",{className:Fe("mt-0.5 shrink-0",l?"text-muted-foreground":"text-simple-accent"),children:t.icon}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.title}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:t.description}),d&&!l&&S.jsx("span",{className:"mt-1 inline-block bg-simple-accent/20 border border-simple-accent/40 px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent",children:"Recommended"})]}),S.jsx("svg",{className:Fe("mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",o&&"rotate-180"),viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M2 4l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),S.jsx(wx,{initial:!1,children:o&&S.jsx(vo.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden border-t border-border/60",children:S.jsx("div",{className:"p-4",children:S.jsx(jae,{action:t,onExecute:i})})},"expanded")})]})}const r1=6;function Vae({onExecute:t}){var T;const{roadmap:e}=Pl(),{activeTab:i,setTab:n}=oO(),r=q.useRef(i),[s,o]=q.useState({plan:!1,execute:!1}),l=e??null,c=DS.filter(A=>A.tab==="plan"),u=DS.filter(A=>A.tab==="execute"),d=(((T=e==null?void 0:e.phases)==null?void 0:T.length)??0)===0,p=d?c.filter(A=>A.id==="new-project"||A.id==="init-existing"):c,g=d?[]:u,O=i==="plan"?p:g,_=s[i],b=_?O:O.slice(0,r1),x=O.length>r1&&!_;function w(A){r.current=i,n(A)}const k=i==="plan"&&r.current==="execute"?-1:1;return S.jsxs("div",{className:"flex flex-col gap-0",children:[S.jsx("div",{className:"flex border-b border-border",children:["plan","execute"].map(A=>{const L=A==="plan"?p.length:g.length,E=A==="plan"?"Plan & Discuss":"Execute & Verify";return S.jsxs("button",{type:"button",onClick:()=>w(A),className:Fe("flex-1 py-2.5 text-xs font-mono uppercase tracking-widest transition-colors duration-200 border-b-2",i===A?"border-b-simple-accent text-simple-accent":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[E," (",L,")"]},A)})}),S.jsx("div",{className:"overflow-hidden",children:S.jsx(wx,{mode:"wait",initial:!1,children:S.jsx(vo.div,{initial:{x:k*20,opacity:0},animate:{x:0,opacity:1},exit:{x:k*-20,opacity:0},transition:{duration:.15},children:O.length===0?S.jsx("div",{className:"py-12 text-center",children:S.jsx("p",{className:"text-sm text-muted-foreground",children:"No actions available in this tab."})}):S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"grid grid-cols-2 gap-px bg-border lg:grid-cols-3",children:b.map(A=>S.jsx(Iae,{action:A,roadmap:l,onExecute:t},A.id))}),x&&S.jsxs("button",{type:"button",onClick:()=>o(A=>({...A,[i]:!0})),className:"w-full border-t border-border py-2.5 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:text-foreground hover:bg-card-hover",children:["Show more (",O.length-r1," more)"]})]})},i)})})]})}function Xae(t,e){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const Zae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wae={};function fQ(t,e){return(Wae.jsx?qae:Zae).test(t)}const Uae=/[ \t\n\f\r]/g;function Yae(t){return typeof t=="object"?t.type==="text"?dQ(t.value):!1:dQ(t)}function dQ(t){return t.replace(Uae,"")===""}class Cd{constructor(e,i,n){this.normal=i,this.property=e,n&&(this.space=n)}}Cd.prototype.normal={};Cd.prototype.property={};Cd.prototype.space=void 0;function Vz(t,e){const i={},n={};for(const r of t)Object.assign(i,r.property),Object.assign(n,r.normal);return new Cd(i,n,e)}function BS(t){return t.toLowerCase()}class jn{constructor(e,i){this.attribute=i,this.property=e}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let Hae=0;const Xe=$l(),si=$l(),$S=$l(),de=$l(),wt=$l(),eh=$l(),er=$l();function $l(){return 2**++Hae}const zS=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:si,commaOrSpaceSeparated:er,commaSeparated:eh,number:de,overloadedBoolean:$S,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),s1=Object.keys(zS);class Xw extends jn{constructor(e,i,n,r){let s=-1;if(super(e,i),pQ(this,"space",r),typeof n=="number")for(;++s<s1.length;){const o=s1[s];pQ(this,s1[s],(n&zS[o])===zS[o])}}}Xw.prototype.defined=!0;function pQ(t,e,i){i&&(t[e]=i)}function Th(t){const e={},i={};for(const[n,r]of Object.entries(t.properties)){const s=new Xw(n,t.transform(t.attributes||{},n),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),e[n]=s,i[BS(n)]=n,i[BS(s.attribute)]=n}return new Cd(e,i,t.space)}const Xz=Th({properties:{ariaActiveDescendant:null,ariaAtomic:si,ariaAutoComplete:null,ariaBusy:si,ariaChecked:si,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:si,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:si,ariaFlowTo:wt,ariaGrabbed:si,ariaHasPopup:null,ariaHidden:si,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:de,ariaLive:null,ariaModal:si,ariaMultiLine:si,ariaMultiSelectable:si,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:si,ariaReadOnly:si,ariaRelevant:null,ariaRequired:si,ariaRoleDescription:wt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:si,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Zz(t,e){return e in t?t[e]:e}function qz(t,e){return Zz(t,e.toLowerCase())}const Fae=Th({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:eh,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:wt,autoFocus:Xe,autoPlay:Xe,blocking:wt,capture:null,charSet:null,checked:Xe,cite:null,className:wt,cols:de,colSpan:null,content:null,contentEditable:si,controls:Xe,controlsList:wt,coords:de|eh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:$S,draggable:si,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:wt,height:de,hidden:$S,high:de,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:wt,itemRef:wt,itemScope:Xe,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,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:Xe,optimum:de,pattern:null,ping:wt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:wt,required:Xe,reversed:Xe,rows:de,rowSpan:de,sandbox:wt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:si,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:si,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:si,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:qz}),Gae=Th({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",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:er,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:wt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:eh,g2:eh,glyphName:eh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:er,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:er,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:er,rev:er,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:er,requiredFeatures:er,requiredFonts:er,requiredFormats:er,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:er,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:er,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:er,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Zz}),Wz=Th({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Uz=Th({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qz}),Yz=Th({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Kae={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"},Jae=/[A-Z]/g,mQ=/-[a-z]/g,ele=/^data[-\w.:]+$/i;function tle(t,e){const i=BS(e);let n=e,r=jn;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&ele.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(mQ,nle);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!mQ.test(s)){let o=s.replace(Jae,ile);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=Xw}return new r(n,e)}function ile(t){return"-"+t.toLowerCase()}function nle(t){return t.charAt(1).toUpperCase()}const rle=Vz([Xz,Fae,Wz,Uz,Yz],"html"),Zw=Vz([Xz,Gae,Wz,Uz,Yz],"svg");function sle(t){return t.join(" ").trim()}var Tc={},o1,gQ;function ole(){if(gQ)return o1;gQ=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,i=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
218
|
+
`,u="/",d="*",p="",g="comment",O="declaration";function _(x,w){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];w=w||{};var k=1,T=1;function A(D){var j=D.match(e);j&&(k+=j.length);var $=D.lastIndexOf(c);T=~$?D.length-$:T+D.length}function L(){var D={line:k,column:T};return function(j){return j.position=new E(D),Z(),j}}function E(D){this.start=D,this.end={line:k,column:T},this.source=w.source}E.prototype.content=x;function N(D){var j=new Error(w.source+":"+k+":"+T+": "+D);if(j.reason=D,j.filename=w.source,j.line=k,j.column=T,j.source=x,!w.silent)throw j}function z(D){var j=D.exec(x);if(j){var $=j[0];return A($),x=x.slice($.length),j}}function Z(){z(i)}function J(D){var j;for(D=D||[];j=U();)j!==!1&&D.push(j);return D}function U(){var D=L();if(!(u!=x.charAt(0)||d!=x.charAt(1))){for(var j=2;p!=x.charAt(j)&&(d!=x.charAt(j)||u!=x.charAt(j+1));)++j;if(j+=2,p===x.charAt(j-1))return N("End of comment missing");var $=x.slice(2,j-2);return T+=2,A($),x=x.slice(j),T+=2,D({type:g,comment:$})}}function R(){var D=L(),j=z(n);if(j){if(U(),!z(r))return N("property missing ':'");var $=z(s),X=D({type:O,property:b(j[0].replace(t,p)),value:$?b($[0].replace(t,p)):p});return z(o),X}}function B(){var D=[];J(D);for(var j;j=R();)j!==!1&&(D.push(j),J(D));return D}return Z(),B()}function b(x){return x?x.replace(l,p):p}return o1=_,o1}var OQ;function ale(){if(OQ)return Tc;OQ=1;var t=Tc&&Tc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.default=i;const e=t(ole());function i(n,r){let s=null;if(!n||typeof n!="string")return s;const o=(0,e.default)(n),l=typeof r=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:d}=c;l?r(u,d,c):d&&(s=s||{},s[u]=d)}),s}return Tc}var Zu={},vQ;function lle(){if(vQ)return Zu;vQ=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,i=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(u){return!u||i.test(u)||t.test(u)},o=function(u,d){return d.toUpperCase()},l=function(u,d){return"".concat(d,"-")},c=function(u,d){return d===void 0&&(d={}),s(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(r,l):u=u.replace(n,l),u.replace(e,o))};return Zu.camelCase=c,Zu}var qu,_Q;function cle(){if(_Q)return qu;_Q=1;var t=qu&&qu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(ale()),i=lle();function n(r,s){var o={};return!r||typeof r!="string"||(0,e.default)(r,function(l,c){l&&c&&(o[(0,i.camelCase)(l,s)]=c)}),o}return n.default=n,qu=n,qu}var hle=cle();const ule=WS(hle),Hz=Fz("end"),qw=Fz("start");function Fz(t){return e;function e(i){const n=i&&i.position&&i.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function fle(t){const e=qw(t),i=Hz(t);if(e&&i)return{start:e,end:i}}function bf(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?yQ(t.position):"start"in t||"end"in t?yQ(t):"line"in t||"column"in t?NS(t):""}function NS(t){return bQ(t&&t.line)+":"+bQ(t&&t.column)}function yQ(t){return NS(t&&t.start)+"-"+NS(t&&t.end)}function bQ(t){return t&&typeof t=="number"?t:1}class ln extends Error{constructor(e,i,n){super(),typeof i=="string"&&(n=i,i=void 0);let r="",s={},o=!1;if(i&&("line"in i&&"column"in i?s={place:i}:"start"in i&&"end"in i?s={place:i}:"type"in i?s={ancestors:[i],place:i.position}:s={...i}),typeof e=="string"?r=e:!s.cause&&e&&(o=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof n=="string"){const c=n.indexOf(":");c===-1?s.ruleId=n:(s.source=n.slice(0,c),s.ruleId=n.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=bf(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ln.prototype.file="";ln.prototype.name="";ln.prototype.reason="";ln.prototype.message="";ln.prototype.stack="";ln.prototype.column=void 0;ln.prototype.line=void 0;ln.prototype.ancestors=void 0;ln.prototype.cause=void 0;ln.prototype.fatal=void 0;ln.prototype.place=void 0;ln.prototype.ruleId=void 0;ln.prototype.source=void 0;const Ww={}.hasOwnProperty,dle=new Map,ple=/[A-Z]/g,mle=new Set(["table","tbody","thead","tfoot","tr"]),gle=new Set(["td","th"]),Gz="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ole(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Cle(i,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=wle(i,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Zw:rle,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Kz(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function Kz(t,e,i){if(e.type==="element")return vle(t,e,i);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return _le(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return ble(t,e,i);if(e.type==="mdxjsEsm")return yle(t,e);if(e.type==="root")return Sle(t,e,i);if(e.type==="text")return xle(t,e)}function vle(t,e,i){const n=t.schema;let r=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Zw,t.schema=r),t.ancestors.push(e);const s=eN(t,e.tagName,!1),o=kle(t,e);let l=Yw(t,e);return mle.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Yae(c):!0})),Jz(t,o,s,e),Uw(o,l),t.ancestors.pop(),t.schema=n,t.create(e,s,o,i)}function _le(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}rd(t,e.position)}function yle(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rd(t,e.position)}function ble(t,e,i){const n=t.schema;let r=n;e.name==="svg"&&n.space==="html"&&(r=Zw,t.schema=r),t.ancestors.push(e);const s=e.name===null?t.Fragment:eN(t,e.name,!0),o=Tle(t,e),l=Yw(t,e);return Jz(t,o,s,e),Uw(o,l),t.ancestors.pop(),t.schema=n,t.create(e,s,o,i)}function Sle(t,e,i){const n={};return Uw(n,Yw(t,e)),t.create(e,t.Fragment,n,i)}function xle(t,e){return e.value}function Jz(t,e,i,n){typeof i!="string"&&i!==t.Fragment&&t.passNode&&(e.node=n)}function Uw(t,e){if(e.length>0){const i=e.length>1?e:e[0];i&&(t.children=i)}}function wle(t,e,i){return n;function n(r,s,o,l){const u=Array.isArray(o.children)?i:e;return l?u(s,o,l):u(s,o)}}function Cle(t,e){return i;function i(n,r,s,o){const l=Array.isArray(s.children),c=qw(n);return e(r,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function kle(t,e){const i={};let n,r;for(r in e.properties)if(r!=="children"&&Ww.call(e.properties,r)){const s=Ale(t,r,e.properties[r]);if(s){const[o,l]=s;t.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&gle.has(e.tagName)?n=l:i[o]=l}}if(n){const s=i.style||(i.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return i}function Tle(t,e){const i={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const s=n.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(i,t.evaluater.evaluateExpression(l.argument))}else rd(t,e.position);else{const r=n.name;let s;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const l=n.value.data.estree.body[0];l.type,s=t.evaluater.evaluateExpression(l.expression)}else rd(t,e.position);else s=n.value===null?!0:n.value;i[r]=s}return i}function Yw(t,e){const i=[];let n=-1;const r=t.passKeys?new Map:dle;for(;++n<e.children.length;){const s=e.children[n];let o;if(t.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=r.get(c)||0;o=c+"-"+u,r.set(c,u+1)}}const l=Kz(t,s,o);l!==void 0&&i.push(l)}return i}function Ale(t,e,i){const n=tle(t.schema,e);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=n.commaSeparated?Xae(i):sle(i)),n.property==="style"){let r=typeof i=="object"?i:Ele(t,String(i));return t.stylePropertyNameCase==="css"&&(r=Mle(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&n.space?Kae[n.property]||n.property:n.attribute,i]}}function Ele(t,e){try{return ule(e,{reactCompat:!0})}catch(i){if(t.ignoreInvalidStyle)return{};const n=i,r=new ln("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=Gz+"#cannot-parse-style-attribute",r}}function eN(t,e,i){let n;if(!i)n={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let s=-1,o;for(;++s<r.length;){const l=fQ(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}n=o}else n=fQ(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const r=n.value;return Ww.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(n);rd(t)}function rd(t,e){const i=new ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Gz+"#cannot-handle-mdx-estrees-without-createevaluater",i}function Mle(t){const e={};let i;for(i in t)Ww.call(t,i)&&(e[Ple(i)]=t[i]);return e}function Ple(t){let e=t.replace(ple,Rle);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Rle(t){return"-"+t.toLowerCase()}const a1={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"]},Qle={};function Lle(t,e){const i=Qle,n=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,r=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return tN(t,n,r)}function tN(t,e,i){if(Dle(t)){if("value"in t)return t.type==="html"&&!i?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return SQ(t.children,e,i)}return Array.isArray(t)?SQ(t,e,i):""}function SQ(t,e,i){const n=[];let r=-1;for(;++r<t.length;)n[r]=tN(t[r],e,i);return n.join("")}function Dle(t){return!!(t&&typeof t=="object")}const xQ=document.createElement("i");function Hw(t){const e="&"+t+";";xQ.innerHTML=e;const i=xQ.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===e?!1:i}function Ps(t,e,i,n){const r=t.length;let s=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,i=i>0?i:0,n.length<1e4)o=Array.from(n),o.unshift(e,i),t.splice(...o);else for(i&&t.splice(e,i);s<n.length;)o=n.slice(s,s+1e4),o.unshift(e,0),t.splice(...o),s+=1e4,e+=1e4}function wr(t,e){return t.length>0?(Ps(t,t.length,0,e),t):e}const wQ={}.hasOwnProperty;function Ble(t){const e={};let i=-1;for(;++i<t.length;)$le(e,t[i]);return e}function $le(t,e){let i;for(i in e){const r=(wQ.call(t,i)?t[i]:void 0)||(t[i]={}),s=e[i];let o;if(s)for(o in s){wQ.call(r,o)||(r[o]=[]);const l=s[o];zle(r[o],Array.isArray(l)?l:l?[l]:[])}}}function zle(t,e){let i=-1;const n=[];for(;++i<e.length;)(e[i].add==="after"?t:n).push(e[i]);Ps(t,0,0,n)}function iN(t,e){const i=Number.parseInt(t,e);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function th(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vs=Ra(/[A-Za-z]/),sr=Ra(/[\dA-Za-z]/),Nle=Ra(/[#-'*+\--9=?A-Z^-~]/);function jS(t){return t!==null&&(t<32||t===127)}const IS=Ra(/\d/),jle=Ra(/[\dA-Fa-f]/),Ile=Ra(/[!-/:-@[-`{-~]/);function $e(t){return t!==null&&t<-2}function Nn(t){return t!==null&&(t<0||t===32)}function lt(t){return t===-2||t===-1||t===32}const Vle=Ra(new RegExp("\\p{P}|\\p{S}","u")),Xle=Ra(/\s/);function Ra(t){return e;function e(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function Ah(t){const e=[];let i=-1,n=0,r=0;for(;++i<t.length;){const s=t.charCodeAt(i);let o="";if(s===37&&sr(t.charCodeAt(i+1))&&sr(t.charCodeAt(i+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=t.charCodeAt(i+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),r=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(n,i),encodeURIComponent(o)),n=i+r+1,o=""),r&&(i+=r,r=0)}return e.join("")+t.slice(n)}function kt(t,e,i,n){const r=n?n-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return lt(c)?(t.enter(i),l(c)):e(c)}function l(c){return lt(c)&&s++<r?(t.consume(c),l):(t.exit(i),e(c))}}const Zle={tokenize:qle};function qle(t){const e=t.attempt(this.parser.constructs.contentInitial,n,r);let i;return e;function n(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),kt(t,e,"linePrefix")}function r(l){return t.enter("paragraph"),s(l)}function s(l){const c=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=c),i=c,o(l)}function o(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return $e(l)?(t.consume(l),t.exit("chunkText"),s):(t.consume(l),o)}}const Wle={tokenize:Ule},CQ={tokenize:Yle};function Ule(t){const e=this,i=[];let n=0,r,s,o;return l;function l(T){if(n<i.length){const A=i[n];return e.containerState=A[1],t.attempt(A[0].continuation,c,u)(T)}return u(T)}function c(T){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&k();const A=e.events.length;let L=A,E;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){E=e.events[L][1].end;break}w(n);let N=A;for(;N<e.events.length;)e.events[N][1].end={...E},N++;return Ps(e.events,L+1,0,e.events.slice(A)),e.events.length=N,u(T)}return l(T)}function u(T){if(n===i.length){if(!r)return g(T);if(r.currentConstruct&&r.currentConstruct.concrete)return _(T);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(CQ,d,p)(T)}function d(T){return r&&k(),w(n),g(T)}function p(T){return e.parser.lazy[e.now().line]=n!==i.length,o=e.now().offset,_(T)}function g(T){return e.containerState={},t.attempt(CQ,O,_)(T)}function O(T){return n++,i.push([e.currentConstruct,e.containerState]),g(T)}function _(T){if(T===null){r&&k(),w(0),t.consume(T);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),b(T)}function b(T){if(T===null){x(t.exit("chunkFlow"),!0),w(0),t.consume(T);return}return $e(T)?(t.consume(T),x(t.exit("chunkFlow")),n=0,e.interrupt=void 0,l):(t.consume(T),b)}function x(T,A){const L=e.sliceStream(T);if(A&&L.push(null),T.previous=s,s&&(s.next=T),s=T,r.defineSkip(T.start),r.write(L),e.parser.lazy[T.start.line]){let E=r.events.length;for(;E--;)if(r.events[E][1].start.offset<o&&(!r.events[E][1].end||r.events[E][1].end.offset>o))return;const N=e.events.length;let z=N,Z,J;for(;z--;)if(e.events[z][0]==="exit"&&e.events[z][1].type==="chunkFlow"){if(Z){J=e.events[z][1].end;break}Z=!0}for(w(n),E=N;E<e.events.length;)e.events[E][1].end={...J},E++;Ps(e.events,z+1,0,e.events.slice(N)),e.events.length=E}}function w(T){let A=i.length;for(;A-- >T;){const L=i[A];e.containerState=L[1],L[0].exit.call(e,t)}i.length=T}function k(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function Yle(t,e,i){return kt(t,t.attempt(this.parser.constructs.document,e,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kQ(t){if(t===null||Nn(t)||Xle(t))return 1;if(Vle(t))return 2}function Fw(t,e,i){const n=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!n.includes(s)&&(e=s(e,i),n.push(s))}return e}const VS={name:"attention",resolveAll:Hle,tokenize:Fle};function Hle(t,e){let i=-1,n,r,s,o,l,c,u,d;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(n=i;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[n][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;c=t[n][1].end.offset-t[n][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const p={...t[n][1].end},g={...t[i][1].start};TQ(p,-c),TQ(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...t[n][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:g},s={type:c>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[i][1].start}},r={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},t[n][1].end={...o.start},t[i][1].start={...l.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=wr(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=wr(u,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",s,e]]),u=wr(u,Fw(e.parser.constructs.insideSpan.null,t.slice(n+1,i),e)),u=wr(u,[["exit",s,e],["enter",l,e],["exit",l,e],["exit",r,e]]),t[i][1].end.offset-t[i][1].start.offset?(d=2,u=wr(u,[["enter",t[i][1],e],["exit",t[i][1],e]])):d=0,Ps(t,n-1,i-n+3,u),i=n+u.length-d-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function Fle(t,e){const i=this.parser.constructs.attentionMarkers.null,n=this.previous,r=kQ(n);let s;return o;function o(c){return s=c,t.enter("attentionSequence"),l(c)}function l(c){if(c===s)return t.consume(c),l;const u=t.exit("attentionSequence"),d=kQ(c),p=!d||d===2&&r||i.includes(c),g=!r||r===2&&d||i.includes(n);return u._open=!!(s===42?p:p&&(r||!g)),u._close=!!(s===42?g:g&&(d||!p)),e(c)}}function TQ(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Gle={name:"autolink",tokenize:Kle};function Kle(t,e,i){let n=0;return r;function r(O){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(O){return vs(O)?(t.consume(O),o):O===64?i(O):u(O)}function o(O){return O===43||O===45||O===46||sr(O)?(n=1,l(O)):u(O)}function l(O){return O===58?(t.consume(O),n=0,c):(O===43||O===45||O===46||sr(O))&&n++<32?(t.consume(O),l):(n=0,u(O))}function c(O){return O===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):O===null||O===32||O===60||jS(O)?i(O):(t.consume(O),c)}function u(O){return O===64?(t.consume(O),d):Nle(O)?(t.consume(O),u):i(O)}function d(O){return sr(O)?p(O):i(O)}function p(O){return O===46?(t.consume(O),n=0,d):O===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):g(O)}function g(O){if((O===45||sr(O))&&n++<63){const _=O===45?g:p;return t.consume(O),_}return i(O)}}const PO={partial:!0,tokenize:Jle};function Jle(t,e,i){return n;function n(s){return lt(s)?kt(t,r,"linePrefix")(s):r(s)}function r(s){return s===null||$e(s)?e(s):i(s)}}const nN={continuation:{tokenize:tce},exit:ice,name:"blockQuote",tokenize:ece};function ece(t,e,i){const n=this;return r;function r(o){if(o===62){const l=n.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),s}return i(o)}function s(o){return lt(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function tce(t,e,i){const n=this;return r;function r(o){return lt(o)?kt(t,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return t.attempt(nN,e,i)(o)}}function ice(t){t.exit("blockQuote")}const rN={name:"characterEscape",tokenize:nce};function nce(t,e,i){return n;function n(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),r}function r(s){return Ile(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):i(s)}}const sN={name:"characterReference",tokenize:rce};function rce(t,e,i){const n=this;let r=0,s,o;return l;function l(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),c}function c(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),s=31,o=sr,d(p))}function u(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,o=jle,d):(t.enter("characterReferenceValue"),s=7,o=IS,d(p))}function d(p){if(p===59&&r){const g=t.exit("characterReferenceValue");return o===sr&&!Hw(n.sliceSerialize(g))?i(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(p)&&r++<s?(t.consume(p),d):i(p)}}const AQ={partial:!0,tokenize:oce},EQ={concrete:!0,name:"codeFenced",tokenize:sce};function sce(t,e,i){const n=this,r={partial:!0,tokenize:L};let s=0,o=0,l;return c;function c(E){return u(E)}function u(E){const N=n.events[n.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,l=E,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===l?(o++,t.consume(E),d):o<3?i(E):(t.exit("codeFencedFenceSequence"),lt(E)?kt(t,p,"whitespace")(E):p(E))}function p(E){return E===null||$e(E)?(t.exit("codeFencedFence"),n.interrupt?e(E):t.check(AQ,b,A)(E)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(E)):lt(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),kt(t,O,"whitespace")(E)):E===96&&E===l?i(E):(t.consume(E),g)}function O(E){return E===null||$e(E)?p(E):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),_(E))}function _(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(E)):E===96&&E===l?i(E):(t.consume(E),_)}function b(E){return t.attempt(r,A,x)(E)}function x(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),w}function w(E){return s>0&<(E)?kt(t,k,"linePrefix",s+1)(E):k(E)}function k(E){return E===null||$e(E)?t.check(AQ,b,A)(E):(t.enter("codeFlowValue"),T(E))}function T(E){return E===null||$e(E)?(t.exit("codeFlowValue"),k(E)):(t.consume(E),T)}function A(E){return t.exit("codeFenced"),e(E)}function L(E,N,z){let Z=0;return J;function J(j){return E.enter("lineEnding"),E.consume(j),E.exit("lineEnding"),U}function U(j){return E.enter("codeFencedFence"),lt(j)?kt(E,R,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):R(j)}function R(j){return j===l?(E.enter("codeFencedFenceSequence"),B(j)):z(j)}function B(j){return j===l?(Z++,E.consume(j),B):Z>=o?(E.exit("codeFencedFenceSequence"),lt(j)?kt(E,D,"whitespace")(j):D(j)):z(j)}function D(j){return j===null||$e(j)?(E.exit("codeFencedFence"),N(j)):z(j)}}}function oce(t,e,i){const n=this;return r;function r(o){return o===null?i(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}const l1={name:"codeIndented",tokenize:lce},ace={partial:!0,tokenize:cce};function lce(t,e,i){const n=this;return r;function r(u){return t.enter("codeIndented"),kt(t,s,"linePrefix",5)(u)}function s(u){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):i(u)}function o(u){return u===null?c(u):$e(u)?t.attempt(ace,o,c)(u):(t.enter("codeFlowValue"),l(u))}function l(u){return u===null||$e(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),l)}function c(u){return t.exit("codeIndented"),e(u)}}function cce(t,e,i){const n=this;return r;function r(o){return n.parser.lazy[n.now().line]?i(o):$e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):kt(t,s,"linePrefix",5)(o)}function s(o){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):$e(o)?r(o):i(o)}}const hce={name:"codeText",previous:fce,resolve:uce,tokenize:dce};function uce(t){let e=t.length-4,i=3,n,r;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=i;++n<e;)if(t[n][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[e][1].type="codeTextPadding",i+=2,e-=2;break}}for(n=i-1,e++;++n<=e;)r===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(r=n):(n===e||t[n][1].type==="lineEnding")&&(t[r][1].type="codeTextData",n!==r+2&&(t[r][1].end=t[n-1][1].end,t.splice(r+2,n-r-2),e-=n-r-2,n=r+2),r=void 0);return t}function fce(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function dce(t,e,i){let n=0,r,s;return o;function o(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),n++,l):(t.exit("codeTextSequence"),c(p))}function c(p){return p===null?i(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),c):p===96?(s=t.enter("codeTextSequence"),r=0,d(p)):$e(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||$e(p)?(t.exit("codeTextData"),c(p)):(t.consume(p),u)}function d(p){return p===96?(t.consume(p),r++,d):r===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",u(p))}}class pce{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,i){const n=i??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,i,n){const r=i||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Wu(this.left,n),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Wu(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Wu(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const i=this.left.splice(e,Number.POSITIVE_INFINITY);Wu(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Wu(this.left,i.reverse())}}}function Wu(t,e){let i=0;if(e.length<1e4)t.push(...e);else for(;i<e.length;)t.push(...e.slice(i,i+1e4)),i+=1e4}function oN(t){const e={};let i=-1,n,r,s,o,l,c,u;const d=new pce(t);for(;++i<d.length;){for(;i in e;)i=e[i];if(n=d.get(i),i&&n[1].type==="chunkFlow"&&d.get(i-1)[1].type==="listItemPrefix"&&(c=n[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,mce(d,i)),i=e[i],u=!0);else if(n[1]._container){for(s=i,r=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(d.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(n[1].end={...d.get(r)[1].start},l=d.slice(r,i),l.unshift(n),d.splice(r,i-r+1,l))}}return Ps(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function mce(t,e){const i=t.get(e)[1],n=t.get(e)[2];let r=e-1;const s=[];let o=i._tokenizer;o||(o=n.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,p,g=-1,O=i,_=0,b=0;const x=[b];for(;O;){for(;t.get(++r)[1]!==O;);s.push(r),O._tokenizer||(d=n.sliceStream(O),O.next||d.push(null),p&&o.defineSkip(O.start),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=O,O=O.next}for(O=i;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(b=g+1,x.push(b),O._tokenizer=void 0,O.previous=void 0,O=O.next);for(o.events=[],O?(O._tokenizer=void 0,O.previous=void 0):x.pop(),g=x.length;g--;){const w=l.slice(x[g],x[g+1]),k=s.pop();c.push([k,k+w.length-1]),t.splice(k,2,w)}for(c.reverse(),g=-1;++g<c.length;)u[_+c[g][0]]=_+c[g][1],_+=c[g][1]-c[g][0]-1;return u}const gce={resolve:vce,tokenize:_ce},Oce={partial:!0,tokenize:yce};function vce(t){return oN(t),t}function _ce(t,e){let i;return n;function n(l){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?s(l):$e(l)?t.check(Oce,o,s)(l):(t.consume(l),r)}function s(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function o(l){return t.consume(l),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,r}}function yce(t,e,i){const n=this;return r;function r(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),kt(t,s,"linePrefix")}function s(o){if(o===null||$e(o))return i(o);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):t.interrupt(n.parser.constructs.flow,i,e)(o)}}function aN(t,e,i,n,r,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return p;function p(w){return w===60?(t.enter(n),t.enter(r),t.enter(s),t.consume(w),t.exit(s),g):w===null||w===32||w===41||jS(w)?i(w):(t.enter(n),t.enter(o),t.enter(l),t.enter("chunkString",{contentType:"string"}),b(w))}function g(w){return w===62?(t.enter(s),t.consume(w),t.exit(s),t.exit(r),t.exit(n),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),O(w))}function O(w){return w===62?(t.exit("chunkString"),t.exit(l),g(w)):w===null||w===60||$e(w)?i(w):(t.consume(w),w===92?_:O)}function _(w){return w===60||w===62||w===92?(t.consume(w),O):O(w)}function b(w){return!d&&(w===null||w===41||Nn(w))?(t.exit("chunkString"),t.exit(l),t.exit(o),t.exit(n),e(w)):d<u&&w===40?(t.consume(w),d++,b):w===41?(t.consume(w),d--,b):w===null||w===32||w===40||jS(w)?i(w):(t.consume(w),w===92?x:b)}function x(w){return w===40||w===41||w===92?(t.consume(w),b):b(w)}}function lN(t,e,i,n,r,s){const o=this;let l=0,c;return u;function u(O){return t.enter(n),t.enter(r),t.consume(O),t.exit(r),t.enter(s),d}function d(O){return l>999||O===null||O===91||O===93&&!c||O===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?i(O):O===93?(t.exit(s),t.enter(r),t.consume(O),t.exit(r),t.exit(n),e):$e(O)?(t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||O===91||O===93||$e(O)||l++>999?(t.exit("chunkString"),d(O)):(t.consume(O),c||(c=!lt(O)),O===92?g:p)}function g(O){return O===91||O===92||O===93?(t.consume(O),l++,p):p(O)}}function cN(t,e,i,n,r,s){let o;return l;function l(g){return g===34||g===39||g===40?(t.enter(n),t.enter(r),t.consume(g),t.exit(r),o=g===40?41:g,c):i(g)}function c(g){return g===o?(t.enter(r),t.consume(g),t.exit(r),t.exit(n),e):(t.enter(s),u(g))}function u(g){return g===o?(t.exit(s),c(o)):g===null?i(g):$e(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),kt(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===o||g===null||$e(g)?(t.exit("chunkString"),u(g)):(t.consume(g),g===92?p:d)}function p(g){return g===o||g===92?(t.consume(g),d):d(g)}}function Sf(t,e){let i;return n;function n(r){return $e(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),i=!0,n):lt(r)?kt(t,n,i?"linePrefix":"lineSuffix")(r):e(r)}}const bce={name:"definition",tokenize:xce},Sce={partial:!0,tokenize:wce};function xce(t,e,i){const n=this;let r;return s;function s(O){return t.enter("definition"),o(O)}function o(O){return lN.call(n,t,l,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(O)}function l(O){return r=th(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),O===58?(t.enter("definitionMarker"),t.consume(O),t.exit("definitionMarker"),c):i(O)}function c(O){return Nn(O)?Sf(t,u)(O):u(O)}function u(O){return aN(t,d,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(O)}function d(O){return t.attempt(Sce,p,p)(O)}function p(O){return lt(O)?kt(t,g,"whitespace")(O):g(O)}function g(O){return O===null||$e(O)?(t.exit("definition"),n.parser.defined.push(r),e(O)):i(O)}}function wce(t,e,i){return n;function n(l){return Nn(l)?Sf(t,r)(l):i(l)}function r(l){return cN(t,s,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return lt(l)?kt(t,o,"whitespace")(l):o(l)}function o(l){return l===null||$e(l)?e(l):i(l)}}const Cce={name:"hardBreakEscape",tokenize:kce};function kce(t,e,i){return n;function n(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return $e(s)?(t.exit("hardBreakEscape"),e(s)):i(s)}}const Tce={name:"headingAtx",resolve:Ace,tokenize:Ece};function Ace(t,e){let i=t.length-2,n=3,r,s;return t[n][1].type==="whitespace"&&(n+=2),i-2>n&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(n===i-1||i-4>n&&t[i-2][1].type==="whitespace")&&(i-=n+1===i?2:4),i>n&&(r={type:"atxHeadingText",start:t[n][1].start,end:t[i][1].end},s={type:"chunkText",start:t[n][1].start,end:t[i][1].end,contentType:"text"},Ps(t,n,i-n+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function Ece(t,e,i){let n=0;return r;function r(d){return t.enter("atxHeading"),s(d)}function s(d){return t.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&n++<6?(t.consume(d),o):d===null||Nn(d)?(t.exit("atxHeadingSequence"),l(d)):i(d)}function l(d){return d===35?(t.enter("atxHeadingSequence"),c(d)):d===null||$e(d)?(t.exit("atxHeading"),e(d)):lt(d)?kt(t,l,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function c(d){return d===35?(t.consume(d),c):(t.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Nn(d)?(t.exit("atxHeadingText"),l(d)):(t.consume(d),u)}}const Mce=["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"],MQ=["pre","script","style","textarea"],Pce={concrete:!0,name:"htmlFlow",resolveTo:Lce,tokenize:Dce},Rce={partial:!0,tokenize:$ce},Qce={partial:!0,tokenize:Bce};function Lce(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Dce(t,e,i){const n=this;let r,s,o,l,c;return u;function u(Q){return d(Q)}function d(Q){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(Q),p}function p(Q){return Q===33?(t.consume(Q),g):Q===47?(t.consume(Q),s=!0,b):Q===63?(t.consume(Q),r=3,n.interrupt?e:M):vs(Q)?(t.consume(Q),o=String.fromCharCode(Q),x):i(Q)}function g(Q){return Q===45?(t.consume(Q),r=2,O):Q===91?(t.consume(Q),r=5,l=0,_):vs(Q)?(t.consume(Q),r=4,n.interrupt?e:M):i(Q)}function O(Q){return Q===45?(t.consume(Q),n.interrupt?e:M):i(Q)}function _(Q){const ue="CDATA[";return Q===ue.charCodeAt(l++)?(t.consume(Q),l===ue.length?n.interrupt?e:R:_):i(Q)}function b(Q){return vs(Q)?(t.consume(Q),o=String.fromCharCode(Q),x):i(Q)}function x(Q){if(Q===null||Q===47||Q===62||Nn(Q)){const ue=Q===47,he=o.toLowerCase();return!ue&&!s&&MQ.includes(he)?(r=1,n.interrupt?e(Q):R(Q)):Mce.includes(o.toLowerCase())?(r=6,ue?(t.consume(Q),w):n.interrupt?e(Q):R(Q)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?i(Q):s?k(Q):T(Q))}return Q===45||sr(Q)?(t.consume(Q),o+=String.fromCharCode(Q),x):i(Q)}function w(Q){return Q===62?(t.consume(Q),n.interrupt?e:R):i(Q)}function k(Q){return lt(Q)?(t.consume(Q),k):J(Q)}function T(Q){return Q===47?(t.consume(Q),J):Q===58||Q===95||vs(Q)?(t.consume(Q),A):lt(Q)?(t.consume(Q),T):J(Q)}function A(Q){return Q===45||Q===46||Q===58||Q===95||sr(Q)?(t.consume(Q),A):L(Q)}function L(Q){return Q===61?(t.consume(Q),E):lt(Q)?(t.consume(Q),L):T(Q)}function E(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?i(Q):Q===34||Q===39?(t.consume(Q),c=Q,N):lt(Q)?(t.consume(Q),E):z(Q)}function N(Q){return Q===c?(t.consume(Q),c=null,Z):Q===null||$e(Q)?i(Q):(t.consume(Q),N)}function z(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Nn(Q)?L(Q):(t.consume(Q),z)}function Z(Q){return Q===47||Q===62||lt(Q)?T(Q):i(Q)}function J(Q){return Q===62?(t.consume(Q),U):i(Q)}function U(Q){return Q===null||$e(Q)?R(Q):lt(Q)?(t.consume(Q),U):i(Q)}function R(Q){return Q===45&&r===2?(t.consume(Q),$):Q===60&&r===1?(t.consume(Q),X):Q===62&&r===4?(t.consume(Q),I):Q===63&&r===3?(t.consume(Q),M):Q===93&&r===5?(t.consume(Q),F):$e(Q)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(Rce,K,B)(Q)):Q===null||$e(Q)?(t.exit("htmlFlowData"),B(Q)):(t.consume(Q),R)}function B(Q){return t.check(Qce,D,K)(Q)}function D(Q){return t.enter("lineEnding"),t.consume(Q),t.exit("lineEnding"),j}function j(Q){return Q===null||$e(Q)?B(Q):(t.enter("htmlFlowData"),R(Q))}function $(Q){return Q===45?(t.consume(Q),M):R(Q)}function X(Q){return Q===47?(t.consume(Q),o="",H):R(Q)}function H(Q){if(Q===62){const ue=o.toLowerCase();return MQ.includes(ue)?(t.consume(Q),I):R(Q)}return vs(Q)&&o.length<8?(t.consume(Q),o+=String.fromCharCode(Q),H):R(Q)}function F(Q){return Q===93?(t.consume(Q),M):R(Q)}function M(Q){return Q===62?(t.consume(Q),I):Q===45&&r===2?(t.consume(Q),M):R(Q)}function I(Q){return Q===null||$e(Q)?(t.exit("htmlFlowData"),K(Q)):(t.consume(Q),I)}function K(Q){return t.exit("htmlFlow"),e(Q)}}function Bce(t,e,i){const n=this;return r;function r(o){return $e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):i(o)}function s(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}function $ce(t,e,i){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(PO,e,i)}}const zce={name:"htmlText",tokenize:Nce};function Nce(t,e,i){const n=this;let r,s,o;return l;function l(M){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(M),c}function c(M){return M===33?(t.consume(M),u):M===47?(t.consume(M),L):M===63?(t.consume(M),T):vs(M)?(t.consume(M),z):i(M)}function u(M){return M===45?(t.consume(M),d):M===91?(t.consume(M),s=0,_):vs(M)?(t.consume(M),k):i(M)}function d(M){return M===45?(t.consume(M),O):i(M)}function p(M){return M===null?i(M):M===45?(t.consume(M),g):$e(M)?(o=p,X(M)):(t.consume(M),p)}function g(M){return M===45?(t.consume(M),O):p(M)}function O(M){return M===62?$(M):M===45?g(M):p(M)}function _(M){const I="CDATA[";return M===I.charCodeAt(s++)?(t.consume(M),s===I.length?b:_):i(M)}function b(M){return M===null?i(M):M===93?(t.consume(M),x):$e(M)?(o=b,X(M)):(t.consume(M),b)}function x(M){return M===93?(t.consume(M),w):b(M)}function w(M){return M===62?$(M):M===93?(t.consume(M),w):b(M)}function k(M){return M===null||M===62?$(M):$e(M)?(o=k,X(M)):(t.consume(M),k)}function T(M){return M===null?i(M):M===63?(t.consume(M),A):$e(M)?(o=T,X(M)):(t.consume(M),T)}function A(M){return M===62?$(M):T(M)}function L(M){return vs(M)?(t.consume(M),E):i(M)}function E(M){return M===45||sr(M)?(t.consume(M),E):N(M)}function N(M){return $e(M)?(o=N,X(M)):lt(M)?(t.consume(M),N):$(M)}function z(M){return M===45||sr(M)?(t.consume(M),z):M===47||M===62||Nn(M)?Z(M):i(M)}function Z(M){return M===47?(t.consume(M),$):M===58||M===95||vs(M)?(t.consume(M),J):$e(M)?(o=Z,X(M)):lt(M)?(t.consume(M),Z):$(M)}function J(M){return M===45||M===46||M===58||M===95||sr(M)?(t.consume(M),J):U(M)}function U(M){return M===61?(t.consume(M),R):$e(M)?(o=U,X(M)):lt(M)?(t.consume(M),U):Z(M)}function R(M){return M===null||M===60||M===61||M===62||M===96?i(M):M===34||M===39?(t.consume(M),r=M,B):$e(M)?(o=R,X(M)):lt(M)?(t.consume(M),R):(t.consume(M),D)}function B(M){return M===r?(t.consume(M),r=void 0,j):M===null?i(M):$e(M)?(o=B,X(M)):(t.consume(M),B)}function D(M){return M===null||M===34||M===39||M===60||M===61||M===96?i(M):M===47||M===62||Nn(M)?Z(M):(t.consume(M),D)}function j(M){return M===47||M===62||Nn(M)?Z(M):i(M)}function $(M){return M===62?(t.consume(M),t.exit("htmlTextData"),t.exit("htmlText"),e):i(M)}function X(M){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),H}function H(M){return lt(M)?kt(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return t.enter("htmlTextData"),o(M)}}const Gw={name:"labelEnd",resolveAll:Xce,resolveTo:Zce,tokenize:qce},jce={tokenize:Wce},Ice={tokenize:Uce},Vce={tokenize:Yce};function Xce(t){let e=-1;const i=[];for(;++e<t.length;){const n=t[e][1];if(i.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const r=n.type==="labelImage"?4:2;n.type="data",e+=r}}return t.length!==i.length&&Ps(t,0,t.length,i),t}function Zce(t,e){let i=t.length,n=0,r,s,o,l;for(;i--;)if(r=t[i][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[i][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(t[i][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=i,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(o=i);const c={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[s][1].start},end:{...t[o][1].end}},d={type:"labelText",start:{...t[s+n+2][1].end},end:{...t[o-2][1].start}};return l=[["enter",c,e],["enter",u,e]],l=wr(l,t.slice(s+1,s+n+3)),l=wr(l,[["enter",d,e]]),l=wr(l,Fw(e.parser.constructs.insideSpan.null,t.slice(s+n+4,o-3),e)),l=wr(l,[["exit",d,e],t[o-2],t[o-1],["exit",u,e]]),l=wr(l,t.slice(o+1)),l=wr(l,[["exit",c,e]]),Ps(t,s,t.length,l),t}function qce(t,e,i){const n=this;let r=n.events.length,s,o;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){s=n.events[r][1];break}return l;function l(g){return s?s._inactive?p(g):(o=n.parser.defined.includes(th(n.sliceSerialize({start:s.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),c):i(g)}function c(g){return g===40?t.attempt(jce,d,o?d:p)(g):g===91?t.attempt(Ice,d,o?u:p)(g):o?d(g):p(g)}function u(g){return t.attempt(Vce,d,p)(g)}function d(g){return e(g)}function p(g){return s._balanced=!0,i(g)}}function Wce(t,e,i){return n;function n(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),r}function r(p){return Nn(p)?Sf(t,s)(p):s(p)}function s(p){return p===41?d(p):aN(t,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Nn(p)?Sf(t,c)(p):d(p)}function l(p){return i(p)}function c(p){return p===34||p===39||p===40?cN(t,u,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function u(p){return Nn(p)?Sf(t,d)(p):d(p)}function d(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):i(p)}}function Uce(t,e,i){const n=this;return r;function r(l){return lN.call(n,t,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return n.parser.defined.includes(th(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(l):i(l)}function o(l){return i(l)}}function Yce(t,e,i){return n;function n(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),r}function r(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):i(s)}}const Hce={name:"labelStartImage",resolveAll:Gw.resolveAll,tokenize:Fce};function Fce(t,e,i){const n=this;return r;function r(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),s}function s(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),o):i(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(l):e(l)}}const Gce={name:"labelStartLink",resolveAll:Gw.resolveAll,tokenize:Kce};function Kce(t,e,i){const n=this;return r;function r(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(o):e(o)}}const c1={name:"lineEnding",tokenize:Jce};function Jce(t,e){return i;function i(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),kt(t,e,"linePrefix")}}const cg={name:"thematicBreak",tokenize:ehe};function ehe(t,e,i){let n=0,r;return s;function s(u){return t.enter("thematicBreak"),o(u)}function o(u){return r=u,l(u)}function l(u){return u===r?(t.enter("thematicBreakSequence"),c(u)):n>=3&&(u===null||$e(u))?(t.exit("thematicBreak"),e(u)):i(u)}function c(u){return u===r?(t.consume(u),n++,c):(t.exit("thematicBreakSequence"),lt(u)?kt(t,l,"whitespace")(u):l(u))}}const Rn={continuation:{tokenize:rhe},exit:ohe,name:"list",tokenize:nhe},the={partial:!0,tokenize:ahe},ihe={partial:!0,tokenize:she};function nhe(t,e,i){const n=this,r=n.events[n.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(O){const _=n.containerState.type||(O===42||O===43||O===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!n.containerState.marker||O===n.containerState.marker:IS(O)){if(n.containerState.type||(n.containerState.type=_,t.enter(_,{_container:!0})),_==="listUnordered")return t.enter("listItemPrefix"),O===42||O===45?t.check(cg,i,u)(O):u(O);if(!n.interrupt||O===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(O)}return i(O)}function c(O){return IS(O)&&++o<10?(t.consume(O),c):(!n.interrupt||o<2)&&(n.containerState.marker?O===n.containerState.marker:O===41||O===46)?(t.exit("listItemValue"),u(O)):i(O)}function u(O){return t.enter("listItemMarker"),t.consume(O),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||O,t.check(PO,n.interrupt?i:d,t.attempt(the,g,p))}function d(O){return n.containerState.initialBlankLine=!0,s++,g(O)}function p(O){return lt(O)?(t.enter("listItemPrefixWhitespace"),t.consume(O),t.exit("listItemPrefixWhitespace"),g):i(O)}function g(O){return n.containerState.size=s+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(O)}}function rhe(t,e,i){const n=this;return n.containerState._closeFlow=void 0,t.check(PO,r,s);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,kt(t,e,"listItemIndent",n.containerState.size+1)(l)}function s(l){return n.containerState.furtherBlankLines||!lt(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(ihe,e,o)(l))}function o(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,kt(t,t.attempt(Rn,e,i),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function she(t,e,i){const n=this;return kt(t,r,"listItemIndent",n.containerState.size+1);function r(s){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(s):i(s)}}function ohe(t){t.exit(this.containerState.type)}function ahe(t,e,i){const n=this;return kt(t,r,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=n.events[n.events.length-1];return!lt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):i(s)}}const PQ={name:"setextUnderline",resolveTo:lhe,tokenize:che};function lhe(t,e){let i=t.length,n,r,s;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){n=i;break}t[i][1].type==="paragraph"&&(r=i)}else t[i][1].type==="content"&&t.splice(i,1),!s&&t[i][1].type==="definition"&&(s=i);const o={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",o,e]),t.splice(s+1,0,["exit",t[n][1],e]),t[n][1].end={...t[s][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function che(t,e,i){const n=this;let r;return s;function s(u){let d=n.events.length,p;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){p=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(t.enter("setextHeadingLine"),r=u,o(u)):i(u)}function o(u){return t.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(t.consume(u),l):(t.exit("setextHeadingLineSequence"),lt(u)?kt(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||$e(u)?(t.exit("setextHeadingLine"),e(u)):i(u)}}const hhe={tokenize:uhe};function uhe(t){const e=this,i=t.attempt(PO,n,t.attempt(this.parser.constructs.flowInitial,r,kt(t,t.attempt(this.parser.constructs.flow,r,t.attempt(gce,r)),"linePrefix")));return i;function n(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,i}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,i}}const fhe={resolveAll:uN()},dhe=hN("string"),phe=hN("text");function hN(t){return{resolveAll:uN(t==="text"?mhe:void 0),tokenize:e};function e(i){const n=this,r=this.parser.constructs[t],s=i.attempt(r,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(d){if(d===null){i.consume(d);return}return i.enter("data"),i.consume(d),c}function c(d){return u(d)?(i.exit("data"),s(d)):(i.consume(d),c)}function u(d){if(d===null)return!0;const p=r[d];let g=-1;if(p)for(;++g<p.length;){const O=p[g];if(!O.previous||O.previous.call(n,n.previous))return!0}return!1}}}function uN(t){return e;function e(i,n){let r=-1,s;for(;++r<=i.length;)s===void 0?i[r]&&i[r][1].type==="data"&&(s=r,r++):(!i[r]||i[r][1].type!=="data")&&(r!==s+2&&(i[s][1].end=i[r-1][1].end,i.splice(s+2,r-s-2),r=s+2),s=void 0);return t?t(i,n):i}}function mhe(t,e){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const n=t[i-1][1],r=e.sliceStream(n);let s=r.length,o=-1,l=0,c;for(;s--;){const u=r[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){s++;break}}if(e._contentTypeTextTrailing&&i===t.length&&(l=0),l){const u={type:i===t.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:n.start._bufferIndex+o,_index:n.start._index+s,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(t.splice(i,0,["enter",u,e],["exit",u,e]),i+=2)}i++}return t}const ghe={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:nN},Ohe={91:bce},vhe={[-2]:l1,[-1]:l1,32:l1},_he={35:Tce,42:cg,45:[PQ,cg],60:Pce,61:PQ,95:cg,96:EQ,126:EQ},yhe={38:sN,92:rN},bhe={[-5]:c1,[-4]:c1,[-3]:c1,33:Hce,38:sN,42:VS,60:[Gle,zce],91:Gce,92:[Cce,rN],93:Gw,95:VS,96:hce},She={null:[VS,fhe]},xhe={null:[42,95]},whe={null:[]},Che=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:xhe,contentInitial:Ohe,disable:whe,document:ghe,flow:_he,flowInitial:vhe,insideSpan:She,string:yhe,text:bhe},Symbol.toStringTag,{value:"Module"}));function khe(t,e,i){let n={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const r={},s=[];let o=[],l=[];const c={attempt:N(L),check:N(E),consume:k,enter:T,exit:A,interrupt:N(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:_,parser:t,previous:null,sliceSerialize:g,sliceStream:O,write:p};let d=e.tokenize.call(u,c);return e.resolveAll&&s.push(e),u;function p(U){return o=wr(o,U),x(),o[o.length-1]!==null?[]:(z(e,0),u.events=Fw(s,u.events,u),u.events)}function g(U,R){return Ahe(O(U),R)}function O(U){return The(o,U)}function _(){const{_bufferIndex:U,_index:R,line:B,column:D,offset:j}=n;return{_bufferIndex:U,_index:R,line:B,column:D,offset:j}}function b(U){r[U.line]=U.column,J()}function x(){let U;for(;n._index<o.length;){const R=o[n._index];if(typeof R=="string")for(U=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===U&&n._bufferIndex<R.length;)w(R.charCodeAt(n._bufferIndex));else w(R)}}function w(U){d=d(U)}function k(U){$e(U)?(n.line++,n.column=1,n.offset+=U===-3?2:1,J()):U!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=U}function T(U,R){const B=R||{};return B.type=U,B.start=_(),u.events.push(["enter",B,u]),l.push(B),B}function A(U){const R=l.pop();return R.end=_(),u.events.push(["exit",R,u]),R}function L(U,R){z(U,R.from)}function E(U,R){R.restore()}function N(U,R){return B;function B(D,j,$){let X,H,F,M;return Array.isArray(D)?K(D):"tokenize"in D?K([D]):I(D);function I(fe){return Oe;function Oe(Ce){const ye=Ce!==null&&fe[Ce],nt=Ce!==null&&fe.null,Qt=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(nt)?nt:nt?[nt]:[]];return K(Qt)(Ce)}}function K(fe){return X=fe,H=0,fe.length===0?$:Q(fe[H])}function Q(fe){return Oe;function Oe(Ce){return M=Z(),F=fe,fe.partial||(u.currentConstruct=fe),fe.name&&u.parser.constructs.disable.null.includes(fe.name)?he():fe.tokenize.call(R?Object.assign(Object.create(u),R):u,c,ue,he)(Ce)}}function ue(fe){return U(F,M),j}function he(fe){return M.restore(),++H<X.length?Q(X[H]):$}}}function z(U,R){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&Ps(u.events,R,u.events.length-R,U.resolve(u.events.slice(R),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function Z(){const U=_(),R=u.previous,B=u.currentConstruct,D=u.events.length,j=Array.from(l);return{from:D,restore:$};function $(){n=U,u.previous=R,u.currentConstruct=B,u.events.length=D,l=j,J()}}function J(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function The(t,e){const i=e.start._index,n=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex;let o;if(i===r)o=[t[i].slice(n,s)];else{if(o=t.slice(i,r),n>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(n):o.shift()}s>0&&o.push(t[r].slice(0,s))}return o}function Ahe(t,e){let i=-1;const n=[];let r;for(;++i<t.length;){const s=t[i];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
219
|
+
`;break}case-3:{o=`\r
|
|
220
|
+
`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(s)}r=s===-2,n.push(o)}return n.join("")}function Ehe(t){const n={constructs:Ble([Che,...(t||{}).extensions||[]]),content:r(Zle),defined:[],document:r(Wle),flow:r(hhe),lazy:{},string:r(dhe),text:r(phe)};return n;function r(s){return o;function o(l){return khe(n,s,l)}}}function Mhe(t){for(;!oN(t););return t}const RQ=/[\0\t\n\r]/g;function Phe(){let t=1,e="",i=!0,n;return r;function r(s,o,l){const c=[];let u,d,p,g,O;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),p=0,e="",i&&(s.charCodeAt(0)===65279&&p++,i=void 0);p<s.length;){if(RQ.lastIndex=p,u=RQ.exec(s),g=u&&u.index!==void 0?u.index:s.length,O=s.charCodeAt(g),!u){e=s.slice(p);break}if(O===10&&p===g&&n)c.push(-3),n=void 0;else switch(n&&(c.push(-5),n=void 0),p<g&&(c.push(s.slice(p,g)),t+=g-p),O){case 0:{c.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,c.push(-2);t++<d;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:n=!0,t=1}p=g+1}return l&&(n&&c.push(-5),e&&c.push(e),c.push(null)),c}}const Rhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qhe(t){return t.replace(Rhe,Lhe)}function Lhe(t,e,i){if(e)return e;if(i.charCodeAt(0)===35){const r=i.charCodeAt(1),s=r===120||r===88;return iN(i.slice(s?2:1),s?16:10)}return Hw(i)||t}const fN={}.hasOwnProperty;function Dhe(t,e,i){return e&&typeof e=="object"&&(i=e,e=void 0),Bhe(i)(Mhe(Ehe(i).document().write(Phe()(t,e,!0))))}function Bhe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ds),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:s(ar),blockQuote:s(nt),characterEscape:Z,characterReference:Z,codeFenced:s(Qt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Qt,o),codeText:s(Yt,o),codeTextData:Z,data:Z,codeFlowValue:Z,definition:s(ei),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Le),hardBreakEscape:s(Co),hardBreakTrailing:s(Co),htmlFlow:s(ko,o),htmlFlowData:Z,htmlText:s(ko,o),htmlTextData:Z,image:s(Qa),label:o,link:s(Ds),listItem:s(Eh),listItemValue:g,listOrdered:s(To,p),listUnordered:s(To),paragraph:s(LO),reference:Q,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(ar),strong:s(DO),thematicBreak:s(BO)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ye,autolinkProtocol:Ce,blockQuote:c(),characterEscapeValue:J,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:fe,characterReference:Oe,codeFenced:c(x),codeFencedFence:b,codeFencedFenceInfo:O,codeFencedFenceMeta:_,codeFlowValue:J,codeIndented:c(w),codeText:c(j),codeTextData:J,data:J,definition:c(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:T,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(B),htmlFlowData:J,htmlText:c(D),htmlTextData:J,image:c(X),label:F,labelText:H,lineEnding:U,link:c($),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:M,resourceTitleString:I,resource:K,setextHeading:c(z),setextHeadingLineSequence:N,setextHeadingText:E,strong:c(),thematicBreak:c()}};dN(e,(t||{}).mdastExtensions||[]);const i={};return n;function n(oe){let ge={type:"root",children:[]};const De={stack:[ge],tokenStack:[],config:e,enter:l,exit:u,buffer:o,resume:d,data:i},Ue=[];let ht=-1;for(;++ht<oe.length;)if(oe[ht][1].type==="listOrdered"||oe[ht][1].type==="listUnordered")if(oe[ht][0]==="enter")Ue.push(ht);else{const In=Ue.pop();ht=r(oe,In,ht)}for(ht=-1;++ht<oe.length;){const In=e[oe[ht][0]];fN.call(In,oe[ht][1].type)&&In[oe[ht][1].type].call(Object.assign({sliceSerialize:oe[ht][2].sliceSerialize},De),oe[ht][1])}if(De.tokenStack.length>0){const In=De.tokenStack[De.tokenStack.length-1];(In[1]||QQ).call(De,void 0,In[0])}for(ge.position={start:aa(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:aa(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},ht=-1;++ht<e.transforms.length;)ge=e.transforms[ht](ge)||ge;return ge}function r(oe,ge,De){let Ue=ge-1,ht=-1,In=!1,Bs,hn,fi,Sn;for(;++Ue<=De;){const _t=oe[Ue];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?ht++:ht--,Sn=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&(Bs&&!Sn&&!ht&&!fi&&(fi=Ue),Sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Sn=void 0}if(!ht&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||ht===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if(Bs){let Ao=Ue;for(hn=void 0;Ao--;){const Br=oe[Ao];if(Br[1].type==="lineEnding"||Br[1].type==="lineEndingBlank"){if(Br[0]==="exit")continue;hn&&(oe[hn][1].type="lineEndingBlank",In=!0),Br[1].type="lineEnding",hn=Ao}else if(!(Br[1].type==="linePrefix"||Br[1].type==="blockQuotePrefix"||Br[1].type==="blockQuotePrefixWhitespace"||Br[1].type==="blockQuoteMarker"||Br[1].type==="listItemIndent"))break}fi&&(!hn||fi<hn)&&(Bs._spread=!0),Bs.end=Object.assign({},hn?oe[hn][1].start:_t[1].end),oe.splice(hn||Ue,0,["exit",Bs,_t[2]]),Ue++,De++}if(_t[1].type==="listItemPrefix"){const Ao={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};Bs=Ao,oe.splice(Ue,0,["enter",Ao,_t[2]]),Ue++,De++,fi=void 0,Sn=!0}}}return oe[ge][1]._spread=In,De}function s(oe,ge){return De;function De(Ue){l.call(this,oe(Ue),Ue),ge&&ge.call(this,Ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(oe,ge,De){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ge,De||void 0]),oe.position={start:aa(ge.start),end:void 0}}function c(oe){return ge;function ge(De){oe&&oe.call(this,De),u.call(this,De)}}function u(oe,ge){const De=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==oe.type&&(ge?ge.call(this,oe,Ue[0]):(Ue[1]||QQ).call(this,oe,Ue[0]));else throw new Error("Cannot close `"+oe.type+"` ("+bf({start:oe.start,end:oe.end})+"): it’s not open");De.position.end=aa(oe.end)}function d(){return Lle(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(oe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function O(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=oe}function _(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=oe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/(\r?\n|\r)$/g,"")}function k(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=th(this.sliceSerialize(oe)).toLowerCase()}function T(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function A(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function L(oe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const De=this.sliceSerialize(oe).length;ge.depth=De}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function N(oe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(oe){const De=this.stack[this.stack.length-1].children;let Ue=De[De.length-1];(!Ue||Ue.type!=="text")&&(Ue=cn(),Ue.position={start:aa(oe.start),end:void 0},De.push(Ue)),this.stack.push(Ue)}function J(oe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(oe),ge.position.end=aa(oe.end)}function U(oe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ge.children[ge.children.length-1];De.position.end=aa(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ge.type)&&(Z.call(this,oe),J.call(this,oe))}function R(){this.data.atHardBreak=!0}function B(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function D(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function j(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function $(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function X(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function H(oe){const ge=this.sliceSerialize(oe),De=this.stack[this.stack.length-2];De.label=Qhe(ge),De.identifier=th(ge).toLowerCase()}function F(){const oe=this.stack[this.stack.length-1],ge=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Ue=oe.children;De.children=Ue}else De.alt=ge}function M(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function I(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function K(){this.data.inReference=void 0}function Q(){this.data.referenceType="collapsed"}function ue(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=th(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function he(oe){this.data.characterReferenceType=oe.type}function fe(oe){const ge=this.sliceSerialize(oe),De=this.data.characterReferenceType;let Ue;De?(Ue=iN(ge,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=Hw(ge);const ht=this.stack[this.stack.length-1];ht.value+=Ue}function Oe(oe){const ge=this.stack.pop();ge.position.end=aa(oe.end)}function Ce(oe){J.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(oe)}function ye(oe){J.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(oe)}function nt(){return{type:"blockquote",children:[]}}function Qt(){return{type:"code",lang:null,meta:null,value:""}}function Yt(){return{type:"inlineCode",value:""}}function ei(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function ar(){return{type:"heading",depth:0,children:[]}}function Co(){return{type:"break"}}function ko(){return{type:"html",value:""}}function Qa(){return{type:"image",title:null,url:"",alt:null}}function Ds(){return{type:"link",title:null,url:"",children:[]}}function To(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Eh(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function LO(){return{type:"paragraph",children:[]}}function DO(){return{type:"strong",children:[]}}function cn(){return{type:"text",value:""}}function BO(){return{type:"thematicBreak"}}}function aa(t){return{line:t.line,column:t.column,offset:t.offset}}function dN(t,e){let i=-1;for(;++i<e.length;){const n=e[i];Array.isArray(n)?dN(t,n):$he(t,n)}}function $he(t,e){let i;for(i in e)if(fN.call(e,i))switch(i){case"canContainEols":{const n=e[i];n&&t[i].push(...n);break}case"transforms":{const n=e[i];n&&t[i].push(...n);break}case"enter":case"exit":{const n=e[i];n&&Object.assign(t[i],n);break}}}function QQ(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+bf({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+bf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+bf({start:e.start,end:e.end})+") is still open")}function zhe(t){const e=this;e.parser=i;function i(n){return Dhe(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Nhe(t,e){const i={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,i),t.applyData(e,i)}function jhe(t,e){const i={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,i),[t.applyData(e,i),{type:"text",value:`
|
|
221
|
+
`}]}function Ihe(t,e){const i=e.value?e.value+`
|
|
222
|
+
`:"",n={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(n.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:n,children:[{type:"text",value:i}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function Vhe(t,e){const i={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Xhe(t,e){const i={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Zhe(t,e){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),r=Ah(n.toLowerCase()),s=t.footnoteOrder.indexOf(n);let o,l=t.footnoteCounts.get(n);l===void 0?(l=0,t.footnoteOrder.push(n),o=t.footnoteOrder.length):o=s+1,l+=1,t.footnoteCounts.set(n,l);const c={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+r,id:i+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,u),t.applyData(e,u)}function qhe(t,e){const i={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Whe(t,e){if(t.options.allowDangerousHtml){const i={type:"raw",value:e.value};return t.patch(e,i),t.applyData(e,i)}}function pN(t,e){const i=e.referenceType;let n="]";if(i==="collapsed"?n+="[]":i==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=n:r.push({type:"text",value:n}),r}function Uhe(t,e){const i=String(e.identifier).toUpperCase(),n=t.definitionById.get(i);if(!n)return pN(t,e);const r={src:Ah(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)}function Yhe(t,e){const i={src:Ah(e.url)};e.alt!==null&&e.alt!==void 0&&(i.alt=e.alt),e.title!==null&&e.title!==void 0&&(i.title=e.title);const n={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,n),t.applyData(e,n)}function Hhe(t,e){const i={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,i);const n={type:"element",tagName:"code",properties:{},children:[i]};return t.patch(e,n),t.applyData(e,n)}function Fhe(t,e){const i=String(e.identifier).toUpperCase(),n=t.definitionById.get(i);if(!n)return pN(t,e);const r={href:Ah(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function Ghe(t,e){const i={href:Ah(e.url)};e.title!==null&&e.title!==void 0&&(i.title=e.title);const n={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Khe(t,e,i){const n=t.all(e),r=i?Jhe(i):mN(e),s={},o=[];if(typeof e.checked=="boolean"){const d=n[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},n.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const d=n[l];(r||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
223
|
+
`}),d.type==="element"&&d.tagName==="p"&&!r?o.push(...d.children):o.push(d)}const c=n[n.length-1];c&&(r||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
224
|
+
`});const u={type:"element",tagName:"li",properties:s,children:o};return t.patch(e,u),t.applyData(e,u)}function Jhe(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const i=t.children;let n=-1;for(;!e&&++n<i.length;)e=mN(i[n])}return e}function mN(t){const e=t.spread;return e??t.children.length>1}function eue(t,e){const i={},n=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(i.start=e.start);++r<n.length;){const o=n[r];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:i,children:t.wrap(n,!0)};return t.patch(e,s),t.applyData(e,s)}function tue(t,e){const i={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function iue(t,e){const i={type:"root",children:t.wrap(t.all(e))};return t.patch(e,i),t.applyData(e,i)}function nue(t,e){const i={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function rue(t,e){const i=t.all(e),n=i.shift(),r=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],o),r.push(o)}if(i.length>0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(i,!0)},l=qw(e.children[1]),c=Hz(e.children[e.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function sue(t,e,i){const n=i?i.children:void 0,s=(n?n.indexOf(e):1)===0?"th":"td",o=i&&i.type==="table"?i.align:void 0,l=o?o.length:e.children.length;let c=-1;const u=[];for(;++c<l;){const p=e.children[c],g={},O=o?o[c]:void 0;O&&(g.align=O);let _={type:"element",tagName:s,properties:g,children:[]};p&&(_.children=t.all(p),t.patch(p,_),_=t.applyData(p,_)),u.push(_)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,d),t.applyData(e,d)}function oue(t,e){const i={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}const LQ=9,DQ=32;function aue(t){const e=String(t),i=/\r?\n|\r/g;let n=i.exec(e),r=0;const s=[];for(;n;)s.push(BQ(e.slice(r,n.index),r>0,!0),n[0]),r=n.index+n[0].length,n=i.exec(e);return s.push(BQ(e.slice(r),r>0,!1)),s.join("")}function BQ(t,e,i){let n=0,r=t.length;if(e){let s=t.codePointAt(n);for(;s===LQ||s===DQ;)n++,s=t.codePointAt(n)}if(i){let s=t.codePointAt(r-1);for(;s===LQ||s===DQ;)r--,s=t.codePointAt(r-1)}return r>n?t.slice(n,r):""}function lue(t,e){const i={type:"text",value:aue(String(e.value))};return t.patch(e,i),t.applyData(e,i)}function cue(t,e){const i={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,i),t.applyData(e,i)}const hue={blockquote:Nhe,break:jhe,code:Ihe,delete:Vhe,emphasis:Xhe,footnoteReference:Zhe,heading:qhe,html:Whe,imageReference:Uhe,image:Yhe,inlineCode:Hhe,linkReference:Fhe,link:Ghe,listItem:Khe,list:eue,paragraph:tue,root:iue,strong:nue,table:rue,tableCell:oue,tableRow:sue,text:lue,thematicBreak:cue,toml:Rm,yaml:Rm,definition:Rm,footnoteDefinition:Rm};function Rm(){}const gN=-1,RO=0,xf=1,rO=2,Kw=3,Jw=4,eC=5,tC=6,ON=7,vN=8,$Q=typeof self=="object"?self:globalThis,uue=(t,e)=>{const i=(r,s)=>(t.set(s,r),r),n=r=>{if(t.has(r))return t.get(r);const[s,o]=e[r];switch(s){case RO:case gN:return i(o,r);case xf:{const l=i([],r);for(const c of o)l.push(n(c));return l}case rO:{const l=i({},r);for(const[c,u]of o)l[n(c)]=n(u);return l}case Kw:return i(new Date(o),r);case Jw:{const{source:l,flags:c}=o;return i(new RegExp(l,c),r)}case eC:{const l=i(new Map,r);for(const[c,u]of o)l.set(n(c),n(u));return l}case tC:{const l=i(new Set,r);for(const c of o)l.add(n(c));return l}case ON:{const{name:l,message:c}=o;return i(new $Q[l](c),r)}case vN:return i(BigInt(o),r);case"BigInt":return i(Object(BigInt(o)),r);case"ArrayBuffer":return i(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return i(new DataView(l),o)}}return i(new $Q[s](o),r)};return n},zQ=t=>uue(new Map,t)(0),Ac="",{toString:fue}={},{keys:due}=Object,Uu=t=>{const e=typeof t;if(e!=="object"||!t)return[RO,e];const i=fue.call(t).slice(8,-1);switch(i){case"Array":return[xf,Ac];case"Object":return[rO,Ac];case"Date":return[Kw,Ac];case"RegExp":return[Jw,Ac];case"Map":return[eC,Ac];case"Set":return[tC,Ac];case"DataView":return[xf,i]}return i.includes("Array")?[xf,i]:i.includes("Error")?[ON,i]:[rO,i]},Qm=([t,e])=>t===RO&&(e==="function"||e==="symbol"),pue=(t,e,i,n)=>{const r=(o,l)=>{const c=n.push(o)-1;return i.set(l,c),c},s=o=>{if(i.has(o))return i.get(o);let[l,c]=Uu(o);switch(l){case RO:{let d=o;switch(c){case"bigint":l=vN,d=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([gN],o)}return r([l,d],o)}case xf:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),r([c,[...g]],o)}const d=[],p=r([l,d],o);for(const g of o)d.push(s(g));return p}case rO:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const d=[],p=r([l,d],o);for(const g of due(o))(t||!Qm(Uu(o[g])))&&d.push([s(g),s(o[g])]);return p}case Kw:return r([l,o.toISOString()],o);case Jw:{const{source:d,flags:p}=o;return r([l,{source:d,flags:p}],o)}case eC:{const d=[],p=r([l,d],o);for(const[g,O]of o)(t||!(Qm(Uu(g))||Qm(Uu(O))))&&d.push([s(g),s(O)]);return p}case tC:{const d=[],p=r([l,d],o);for(const g of o)(t||!Qm(Uu(g)))&&d.push(s(g));return p}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},NQ=(t,{json:e,lossy:i}={})=>{const n=[];return pue(!(e||i),!!e,new Map,n)(t),n},sO=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?zQ(NQ(t,e)):structuredClone(t):(t,e)=>zQ(NQ(t,e));function mue(t,e){const i=[{type:"text",value:"↩"}];return e>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),i}function gue(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Oue(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=t.options.footnoteBackContent||mue,n=t.options.footnoteBackLabel||gue,r=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[c]);if(!u)continue;const d=t.all(u),p=String(u.identifier).toUpperCase(),g=Ah(p.toLowerCase());let O=0;const _=[],b=t.footnoteCounts.get(p);for(;b!==void 0&&++O<=b;){_.length>0&&_.push({type:"text",value:" "});let k=typeof i=="string"?i:i(c,O);typeof k=="string"&&(k={type:"text",value:k}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(O>1?"-"+O:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(c,O),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const k=x.children[x.children.length-1];k&&k.type==="text"?k.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(..._)}else d.push(..._);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(d,!0)};t.patch(u,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...sO(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
225
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:`
|
|
226
|
+
`}]}}const _N=(function(t){if(t==null)return bue;if(typeof t=="function")return QO(t);if(typeof t=="object")return Array.isArray(t)?vue(t):_ue(t);if(typeof t=="string")return yue(t);throw new Error("Expected function, string, or object as test")});function vue(t){const e=[];let i=-1;for(;++i<t.length;)e[i]=_N(t[i]);return QO(n);function n(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function _ue(t){const e=t;return QO(i);function i(n){const r=n;let s;for(s in t)if(r[s]!==e[s])return!1;return!0}}function yue(t){return QO(e);function e(i){return i&&i.type===t}}function QO(t){return e;function e(i,n,r){return!!(Sue(i)&&t.call(this,i,typeof n=="number"?n:void 0,r||void 0))}}function bue(){return!0}function Sue(t){return t!==null&&typeof t=="object"&&"type"in t}const yN=[],xue=!0,jQ=!1,wue="skip";function Cue(t,e,i,n){let r;typeof e=="function"&&typeof i!="function"?(n=i,i=e):r=e;const s=_N(r),o=n?-1:1;l(t,void 0,[])();function l(c,u,d){const p=c&&typeof c=="object"?c:{};if(typeof p.type=="string"){const O=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(O?"<"+O+">":""))+")"})}return g;function g(){let O=yN,_,b,x;if((!e||s(c,u,d[d.length-1]||void 0))&&(O=kue(i(c,d)),O[0]===jQ))return O;if("children"in c&&c.children){const w=c;if(w.children&&O[0]!==wue)for(b=(n?w.children.length:-1)+o,x=d.concat(w);b>-1&&b<w.children.length;){const k=w.children[b];if(_=l(k,b,x)(),_[0]===jQ)return _;b=typeof _[1]=="number"?_[1]:b+o}}return O}}}function kue(t){return Array.isArray(t)?t:typeof t=="number"?[xue,t]:t==null?yN:[t]}function bN(t,e,i,n){let r,s,o;typeof e=="function"&&typeof i!="function"?(s=void 0,o=e,r=i):(s=e,o=i,r=n),Cue(t,s,l,r);function l(c,u){const d=u[u.length-1],p=d?d.children.indexOf(c):void 0;return o(c,p,d)}}const XS={}.hasOwnProperty,Tue={};function Aue(t,e){const i=e||Tue,n=new Map,r=new Map,s=new Map,o={...hue,...i.handlers},l={all:u,applyData:Mue,definitionById:n,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:i,patch:Eue,wrap:Rue};return bN(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const p=d.type==="definition"?n:r,g=String(d.identifier).toUpperCase();p.has(g)||p.set(g,d)}}),l;function c(d,p){const g=d.type,O=l.handlers[g];if(XS.call(l.handlers,g)&&O)return O(l,d,p);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in d){const{children:b,...x}=d,w=sO(x);return w.children=l.all(d),w}return sO(d)}return(l.options.unknownHandler||Pue)(l,d,p)}function u(d){const p=[];if("children"in d){const g=d.children;let O=-1;for(;++O<g.length;){const _=l.one(g[O],d);if(_){if(O&&g[O-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=IQ(_.value)),!Array.isArray(_)&&_.type==="element")){const b=_.children[0];b&&b.type==="text"&&(b.value=IQ(b.value))}Array.isArray(_)?p.push(..._):p.push(_)}}}return p}}function Eue(t,e){t.position&&(e.position=fle(t))}function Mue(t,e){let i=e;if(t&&t.data){const n=t.data.hName,r=t.data.hChildren,s=t.data.hProperties;if(typeof n=="string")if(i.type==="element")i.tagName=n;else{const o="children"in i?i.children:[i];i={type:"element",tagName:n,properties:{},children:o}}i.type==="element"&&s&&Object.assign(i.properties,sO(s)),"children"in i&&i.children&&r!==null&&r!==void 0&&(i.children=r)}return i}function Pue(t,e){const i=e.data||{},n="value"in e&&!(XS.call(i,"hProperties")||XS.call(i,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Rue(t,e){const i=[];let n=-1;for(e&&i.push({type:"text",value:`
|
|
227
|
+
`});++n<t.length;)n&&i.push({type:"text",value:`
|
|
228
|
+
`}),i.push(t[n]);return e&&t.length>0&&i.push({type:"text",value:`
|
|
229
|
+
`}),i}function IQ(t){let e=0,i=t.charCodeAt(e);for(;i===9||i===32;)e++,i=t.charCodeAt(e);return t.slice(e)}function VQ(t,e){const i=Aue(t,e),n=i.one(t,void 0),r=Oue(i),s=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
|
|
230
|
+
`},r),s}function Que(t,e){return t&&"run"in t?async function(i,n){const r=VQ(i,{file:n,...e});await t.run(r,n)}:function(i,n){return VQ(i,{file:n,...t||e})}}function XQ(t){if(t)throw t}var h1,ZQ;function Lue(){if(ZQ)return h1;ZQ=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},s=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var d=t.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!p)return!1;var g;for(g in u);return typeof g>"u"||t.call(u,g)},o=function(u,d){i&&d.name==="__proto__"?i(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},l=function(u,d){if(d==="__proto__")if(t.call(u,d)){if(n)return n(u,d).value}else return;return u[d]};return h1=function c(){var u,d,p,g,O,_,b=arguments[0],x=1,w=arguments.length,k=!1;for(typeof b=="boolean"&&(k=b,b=arguments[1]||{},x=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});x<w;++x)if(u=arguments[x],u!=null)for(d in u)p=l(b,d),g=l(u,d),b!==g&&(k&&g&&(s(g)||(O=r(g)))?(O?(O=!1,_=p&&r(p)?p:[]):_=p&&s(p)?p:{},o(b,{name:d,newValue:c(k,_,g)})):typeof g<"u"&&o(b,{name:d,newValue:g}));return b},h1}var Due=Lue();const u1=WS(Due);function ZS(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Bue(){const t=[],e={run:i,use:n};return e;function i(...r){let s=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...r);function l(c,...u){const d=t[++s];let p=-1;if(c){o(c);return}for(;++p<r.length;)(u[p]===null||u[p]===void 0)&&(u[p]=r[p]);r=u,d?$ue(d,l)(...u):o(null,...u)}}function n(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function $ue(t,e){let i;return n;function n(...o){const l=t.length>o.length;let c;l&&o.push(r);try{c=t.apply(this,o)}catch(u){const d=u;if(l&&i)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){i||(i=!0,e(o,...l))}function s(o){r(null,o)}}const ps={basename:zue,dirname:Nue,extname:jue,join:Iue,sep:"/"};function zue(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');kd(t);let i=0,n=-1,r=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(s){i=r+1;break}}else n<0&&(s=!0,n=r+1);return n<0?"":t.slice(i,n)}if(e===t)return"";let o=-1,l=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(s){i=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(t.codePointAt(r)===e.codePointAt(l--)?l<0&&(n=r):(l=-1,n=o));return i===n?n=o:n<0&&(n=t.length),t.slice(i,n)}function Nue(t){if(kd(t),t.length===0)return".";let e=-1,i=t.length,n;for(;--i;)if(t.codePointAt(i)===47){if(n){e=i;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function jue(t){kd(t);let e=t.length,i=-1,n=0,r=-1,s=0,o;for(;e--;){const l=t.codePointAt(e);if(l===47){if(o){n=e+1;break}continue}i<0&&(o=!0,i=e+1),l===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||i<0||s===0||s===1&&r===i-1&&r===n+1?"":t.slice(r,i)}function Iue(...t){let e=-1,i;for(;++e<t.length;)kd(t[e]),t[e]&&(i=i===void 0?t[e]:i+"/"+t[e]);return i===void 0?".":Vue(i)}function Vue(t){kd(t);const e=t.codePointAt(0)===47;let i=Xue(t,!e);return i.length===0&&!e&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),e?"/"+i:i}function Xue(t,e){let i="",n=0,r=-1,s=0,o=-1,l,c;for(;++o<=t.length;){if(o<t.length)l=t.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(r===o-1||s===1))if(r!==o-1&&s===2){if(i.length<2||n!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=o,s=0;continue}}else if(i.length>0){i="",n=0,r=o,s=0;continue}}e&&(i=i.length>0?i+"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,o):i=t.slice(r+1,o),n=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return i}function kd(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Zue={cwd:que};function que(){return"/"}function qS(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Wue(t){if(typeof t=="string")t=new URL(t);else if(!qS(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Uue(t)}function Uue(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let i=-1;for(;++i<e.length;)if(e.codePointAt(i)===37&&e.codePointAt(i+1)===50){const n=e.codePointAt(i+2);if(n===70||n===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const f1=["history","path","basename","stem","extname","dirname"];class SN{constructor(e){let i;e?qS(e)?i={path:e}:typeof e=="string"||Yue(e)?i={value:e}:i=e:i={},this.cwd="cwd"in i?"":Zue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<f1.length;){const s=f1[n];s in i&&i[s]!==void 0&&i[s]!==null&&(this[s]=s==="history"?[...i[s]]:i[s])}let r;for(r in i)f1.includes(r)||(this[r]=i[r])}get basename(){return typeof this.path=="string"?ps.basename(this.path):void 0}set basename(e){p1(e,"basename"),d1(e,"basename"),this.path=ps.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ps.dirname(this.path):void 0}set dirname(e){qQ(this.basename,"dirname"),this.path=ps.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ps.extname(this.path):void 0}set extname(e){if(d1(e,"extname"),qQ(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ps.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){qS(e)&&(e=Wue(e)),p1(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ps.basename(this.path,this.extname):void 0}set stem(e){p1(e,"stem"),d1(e,"stem"),this.path=ps.join(this.dirname||"",e+(this.extname||""))}fail(e,i,n){const r=this.message(e,i,n);throw r.fatal=!0,r}info(e,i,n){const r=this.message(e,i,n);return r.fatal=void 0,r}message(e,i,n){const r=new ln(e,i,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function d1(t,e){if(t&&t.includes(ps.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ps.sep+"`")}function p1(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function qQ(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Yue(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Hue=(function(t){const n=this.constructor.prototype,r=n[t],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,n),s}),Fue={}.hasOwnProperty;class iC extends Hue{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=Bue()}copy(){const e=new iC;let i=-1;for(;++i<this.attachers.length;){const n=this.attachers[i];e.use(...n)}return e.data(u1(!0,{},this.namespace)),e}data(e,i){return typeof e=="string"?arguments.length===2?(O1("data",this.frozen),this.namespace[e]=i,this):Fue.call(this.namespace,e)&&this.namespace[e]||void 0:e?(O1("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const r=i.call(e,...n);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const i=Lm(e),n=this.parser||this.Parser;return m1("parse",n),n(String(i),i)}process(e,i){const n=this;return this.freeze(),m1("process",this.parser||this.Parser),g1("process",this.compiler||this.Compiler),i?r(void 0,i):new Promise(r);function r(s,o){const l=Lm(e),c=n.parse(l);n.run(c,l,function(d,p,g){if(d||!p||!g)return u(d);const O=p,_=n.stringify(O,g);Jue(_)?g.value=_:g.result=_,u(d,g)});function u(d,p){d||!p?o(d):s?s(p):i(void 0,p)}}}processSync(e){let i=!1,n;return this.freeze(),m1("processSync",this.parser||this.Parser),g1("processSync",this.compiler||this.Compiler),this.process(e,r),UQ("processSync","process",i),n;function r(s,o){i=!0,XQ(s),n=o}}run(e,i,n){WQ(e),this.freeze();const r=this.transformers;return!n&&typeof i=="function"&&(n=i,i=void 0),n?s(void 0,n):new Promise(s);function s(o,l){const c=Lm(i);r.run(e,c,u);function u(d,p,g){const O=p||e;d?l(d):o?o(O):n(void 0,O,g)}}}runSync(e,i){let n=!1,r;return this.run(e,i,s),UQ("runSync","run",n),r;function s(o,l){XQ(o),r=l,n=!0}}stringify(e,i){this.freeze();const n=Lm(i),r=this.compiler||this.Compiler;return g1("stringify",r),WQ(e),r(e,n)}use(e,...i){const n=this.attachers,r=this.namespace;if(O1("use",this.frozen),e!=null)if(typeof e=="function")c(e,i);else if(typeof e=="object")Array.isArray(e)?l(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...p]=u;c(d,p)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))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");l(u.plugins),u.settings&&(r.settings=u1(!0,r.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const p=u[d];s(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let p=-1,g=-1;for(;++p<n.length;)if(n[p][0]===u){g=p;break}if(g===-1)n.push([u,...d]);else if(d.length>0){let[O,..._]=d;const b=n[g][1];ZS(b)&&ZS(O)&&(O=u1(!0,b,O)),n[g]=[u,O,..._]}}}}const Gue=new iC().freeze();function m1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function g1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function O1(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function WQ(t){if(!ZS(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function UQ(t,e,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Lm(t){return Kue(t)?t:new SN(t)}function Kue(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Jue(t){return typeof t=="string"||efe(t)}function efe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const tfe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",YQ=[],HQ={allowDangerousHtml:!0},ife=/^(https?|ircs?|mailto|xmpp)$/i,nfe=[{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 xN(t){const e=rfe(t),i=sfe(t);return ofe(e.runSync(e.parse(i),i),t)}function rfe(t){const e=t.rehypePlugins||YQ,i=t.remarkPlugins||YQ,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...HQ}:HQ;return Gue().use(zhe).use(i).use(Que,n).use(e)}function sfe(t){const e=t.children||"",i=new SN;return typeof e=="string"&&(i.value=e),i}function ofe(t,e){const i=e.allowedElements,n=e.allowElement,r=e.components,s=e.disallowedElements,o=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||afe;for(const d of nfe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+tfe+d.id,void 0);return bN(t,u),Ole(t,{Fragment:S.Fragment,components:r,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function u(d,p,g){if(d.type==="raw"&&g&&typeof p=="number")return o?g.children.splice(p,1):g.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let O;for(O in a1)if(Object.hasOwn(a1,O)&&Object.hasOwn(d.properties,O)){const _=d.properties[O],b=a1[O];(b===null||b.includes(d.tagName))&&(d.properties[O]=c(String(_||""),O,d))}}if(d.type==="element"){let O=i?!i.includes(d.tagName):s?s.includes(d.tagName):!1;if(!O&&n&&typeof p=="number"&&(O=!n(d,p,g)),O&&g&&typeof p=="number")return l&&d.children?g.children.splice(p,1,...d.children):g.children.splice(p,1),p}}}function afe(t){const e=t.indexOf(":"),i=t.indexOf("?"),n=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||i!==-1&&e>i||n!==-1&&e>n||ife.test(t.slice(0,e))?t:""}function lfe({option:t,selected:e,variant:i,onSelect:n,onFocus:r,onBlur:s}){var p;const[o,l]=q.useState(!1),c=t.description.split(`
|
|
231
|
+
`),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return S.jsxs("button",{type:"button",onClick:n,onMouseEnter:r,onMouseLeave:s,onFocus:r,onBlur:s,className:Fe("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[S.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&S.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&S.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),S.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&S.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function cfe({markdown:t,visible:e}){return e?S.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:S.jsx(xN,{children:t})}):null}function hfe({question:t,onSubmit:e}){const[i,n]=q.useState(null),[r,s]=q.useState(new Set),[o,l]=q.useState(""),[c,u]=q.useState(null),d=q.useRef(null);q.useEffect(()=>{const k=d.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[o]),q.useEffect(()=>{n(null),s(new Set),l(""),u(null)},[t.id]);function p(k){t.multiSelect?s(T=>{const A=new Set(T);return A.has(k)?A.delete(k):A.add(k),A}):n(k)}function g(k){l(k),!t.multiSelect&&k.length>0&&n(null)}function O(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const k=t.options.filter(T=>r.has(T.id)).map(T=>T.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(r),selectedLabels:k,freeText:o.trim()})}else if(i){const k=t.options.find(T=>T.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:k?[k.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?r.size>0||o.trim().length>0:i!==null||o.trim().length>0,x=c?t.options.find(k=>k.id===c):null,w=(x==null?void 0:x.markdown)??"";return S.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[S.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),S.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:S.jsx(xN,{children:t.question})}),t.options.length>0&&S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(k=>{const T=t.multiSelect?r.has(k.id):i===k.id;return S.jsx(lfe,{option:k,selected:T,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(k.id),onFocus:()=>u(k.id),onBlur:()=>u(null)},k.id)})}),S.jsx(cfe,{markdown:w,visible:!!w})]}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:S.jsx("textarea",{ref:d,value:o,onChange:k=>g(k.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),S.jsx("button",{type:"button",onClick:_,disabled:!b,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function ufe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return S.jsx(vo.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),S.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),S.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function ffe(){return S.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[S.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),S.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("div",{className:"h-10 flex-1 bg-muted"}),S.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),S.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function dfe({onAskMore:t,onDoneExecute:e,disabled:i}){return S.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[S.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),S.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function pfe({open:t,onConfirm:e,onCancel:i}){return S.jsx(wx,{children:t&&S.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:S.jsxs(vo.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[S.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),S.jsxs("div",{className:"flex items-center justify-end gap-3",children:[S.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),S.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function mfe({answerCount:t}){return S.jsxs(vo.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[S.jsx("div",{className:"flex justify-center mb-3",children:S.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),S.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),S.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}const gfe=[{id:"mock-q5",header:"Deployment",question:"Where do you plan to deploy this service?",multiSelect:!1,options:[{id:"dep-cloud",label:"Cloud (AWS/GCP/Azure)",description:"Managed infrastructure with auto-scaling"},{id:"dep-vps",label:"VPS / Self-hosted",description:"Full control, lower cost, more ops overhead"},{id:"dep-serverless",label:"Serverless (Lambda/Functions)",description:"Zero idle cost, automatic scaling, cold start tradeoff"}]},{id:"mock-q6",header:"Team Size",question:"How many developers will work on this codebase?",multiSelect:!1,options:[{id:"team-solo",label:"Solo",description:"Single developer — keep it simple"},{id:"team-small",label:"2-5 developers",description:"Small team — lightweight conventions recommended"},{id:"team-large",label:"6+ developers",description:"Larger team — enforce patterns via tooling and code review"}]}],Ofe=[{id:"mock-q1",header:"Auth Method",question:`Which authentication approach do you want for your API?
|
|
232
|
+
|
|
233
|
+
Consider factors like **session management**, token expiry, and integration with third-party providers.`,multiSelect:!1,options:[{id:"opt-jwt",label:"JWT with refresh tokens",description:"Stateless authentication using signed tokens. Access token expires in 15 minutes, refresh token in 7 days.",markdown:"```typescript\n// Example JWT middleware\nconst decoded = jwt.verify(token, SECRET);\nreq.user = decoded;\n```"},{id:"opt-session",label:"Server-side sessions",description:"Traditional session-based auth with server-side storage. Requires a session store (Redis, DB)."},{id:"opt-oauth",label:"OAuth 2.0 with PKCE",description:"Delegate authentication to external providers (Google, GitHub). Best for apps that don't need custom credentials."}]},{id:"mock-q2",header:"Features",question:"Select the features you want included in the initial build:",multiSelect:!0,options:[{id:"feat-api",label:"REST API endpoints",description:"Standard CRUD endpoints with validation and error handling"},{id:"feat-ws",label:"WebSocket support",description:"Real-time bidirectional communication for live updates"},{id:"feat-queue",label:"Background job queue",description:"Async task processing with retries and dead letter queue. Uses BullMQ or similar."},{id:"feat-cache",label:"Caching layer",description:"Redis-based caching with TTL and invalidation patterns"}]},{id:"mock-q3",header:"Description",question:"Describe your project in a few sentences. What problem does it solve? Who are the primary users?",multiSelect:!1,options:[]},{id:"mock-q4",header:"Database",question:"Which database engine should we use?",multiSelect:!1,options:[{id:"db-pg",label:"PostgreSQL",description:"Relational database with strong ACID compliance and JSON support"},{id:"db-sqlite",label:"SQLite",description:"Embedded database, zero configuration, great for single-server deployments"}]}];function vfe(){const{phase:t,receiveQuestions:e}=YS(),i=q.useRef(!1),n=q.useRef(!1);q.useEffect(()=>{if(t==="loading"){if(!i.current){i.current=!0;const r=setTimeout(()=>e(Ofe),500);return()=>clearTimeout(r)}if(!n.current){n.current=!0;const r=setTimeout(()=>e(gfe),500);return()=>clearTimeout(r)}}t==="idle"&&(i.current=!1,n.current=!1)},[t,e])}function _fe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:r,askMore:s,doneExecute:o}=YS();vfe();const[l,c]=q.useState(!1),u=q.useRef(null);q.useEffect(()=>{t==="active"&&u.current&&u.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function d(){c(!0)}function p(){c(!1),o()}function g(){c(!1)}const O=t==="submitting"||t==="complete";return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:S.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),S.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:S.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(_=>S.jsx(ufe,{answer:_},_.questionId)),t==="active"&&e&&S.jsx("div",{ref:u,children:S.jsx(hfe,{question:e,onSubmit:r})}),t==="loading"&&S.jsx(ffe,{}),t==="complete"&&S.jsx(mfe,{answerCount:n})]})}),t!=="complete"&&S.jsx(dfe,{onAskMore:s,onDoneExecute:d,disabled:O}),S.jsx(pfe,{open:l,onConfirm:p,onCancel:g})]})}function yfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=YS(),r=e!=="idle";function s(o){if(o.startsWith("/maxsim:discuss-phase")){i();return}t(o)}return r?S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx("div",{className:"px-4 pt-3 sm:px-6",children:S.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]})}),S.jsx("div",{className:"flex-1 min-h-0",children:S.jsx(_fe,{})})]}):S.jsx("div",{className:"flex flex-col gap-0 h-full",children:S.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:S.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[S.jsx(Nae,{}),S.jsx(Vae,{onExecute:s})]})})})}function bfe(){return S.jsxs("div",{className:"flex flex-col gap-6",children:[S.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[S.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),S.jsxs("div",{className:"flex gap-10",children:[S.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),S.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),S.jsxs("div",{className:"ml-auto flex gap-8",children:[S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[S.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[S.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function Sfe({message:t,onRetry:e}){return S.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[S.jsx("p",{className:"font-mono text-sm text-danger",children:t}),S.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function xfe(){const{roadmap:t,state:e,todos:i,loading:n,error:r}=Pl(),{mode:s,setMode:o,initialized:l}=n7(),[c,u]=q.useState("overview"),[d,p]=q.useState(null),[g,O]=q.useState(!1),{splitMode:_,toggleSplit:b}=Dae(),x=q.useRef(null),w=q.useCallback(()=>{o(s==="simple"?"advanced":"simple")},[s,o]),k=l?S.jsx($ae,{mode:s,onToggle:w}):null,T=q.useRef({view:"overview",phaseId:null}),A=q.useCallback((D,j)=>{D!=="terminal"&&(T.current={view:D,phaseId:D==="phase"&&j?j:null}),u(D),D==="phase"&&j&&p(j),O(!1)},[]),L=q.useCallback(D=>{var j;(j=x.current)==null||j.call(x,D+"\r"),A("terminal")},[A]),E=q.useCallback(D=>{u("phase"),p(D)},[]),N=q.useCallback(()=>{u("overview"),p(null)},[]),z=q.useCallback(async(D,j)=>{try{const $=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:D,checked:j})});$.ok||console.error("[toggle-phase]",await $.text())}catch($){console.error("[toggle-phase]",$)}},[]),Z=((t==null?void 0:t.phases)??[]).map(D=>({number:D.number,name:D.name,goal:D.goal??"",dependsOn:D.depends_on?[D.depends_on]:[],planCount:D.plan_count,summaryCount:D.summary_count,diskStatus:D.disk_status,roadmapComplete:D.roadmap_complete,hasContext:D.has_context,hasResearch:D.has_research})),J=(t==null?void 0:t.current_phase)??null;function U(){if(n)return S.jsx(bfe,{});if(r)return S.jsx(Sfe,{message:r,onRetry:()=>window.location.reload()});switch(c){case"overview":return S.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[S.jsx(G9,{roadmap:t,state:e,todos:i}),S.jsx(tZ,{phases:Z,currentPhase:J,onPhaseClick:E,onToggleComplete:z})]});case"phase":return d?S.jsx("div",{className:"mx-auto max-w-4xl",children:S.jsx(Wte,{phaseId:d,onBack:N})}):null;case"todos":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Ute,{})});case"blockers":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Fte,{})});case"terminal":return null;default:return null}}const R=c==="terminal",B=s==="simple";return S.jsxs(Gte,{mobileMenuOpen:g,onMobileMenuToggle:()=>O(D=>!D),onMobileMenuClose:()=>O(!1),headerRight:k,simpleMode:B,sidebar:S.jsx("div",{style:{display:B?"none":"contents"},children:S.jsx(xie,{activeView:c,activePhaseId:d,onNavigate:A,logoAction:k})}),children:[l&&s===null&&S.jsx(zae,{onChoose:o}),B&&l&&S.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:S.jsx(yfe,{onExecute:L})}),S.jsxs("div",{style:{display:B?"none":"contents"},children:[S.jsx("div",{style:{display:R&&!_?"none":"block"},className:R&&_?"h-1/2 min-h-0 overflow-auto border-b border-border p-4 sm:p-6":"flex-1 overflow-y-auto p-4 sm:p-6",children:U()}),S.jsxs("div",{style:{display:R?"flex":"none"},className:`relative min-h-0 flex-col overflow-hidden ${R&&_?"h-1/2":"flex-1"}`,children:[S.jsx(Bae,{splitMode:_,onToggle:b}),S.jsx(Lae,{writeInputRef:x})]})]})]})}function wfe(){return S.jsx(Gj,{children:S.jsx(e7,{children:S.jsx(i7,{children:S.jsx(xfe,{})})})})}const wN=document.getElementById("root");if(!wN)throw new Error("Root element not found");Yj.createRoot(wN).render(S.jsx(q.StrictMode,{children:S.jsx(wfe,{})}));
|