maxsimcli 3.8.1 → 3.10.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 +22 -0
- package/dist/assets/dashboard/client/assets/index-DzJChB-D.css +32 -0
- package/dist/assets/dashboard/client/assets/index-c2U_AZL9.js +231 -0
- package/dist/assets/dashboard/client/index.html +2 -2
- package/dist/assets/dashboard/server.js +20558 -426
- package/dist/assets/templates/references/dashboard-bridge.md +59 -0
- package/dist/assets/templates/workflows/add-tests.md +1 -0
- package/dist/assets/templates/workflows/add-todo.md +1 -0
- package/dist/assets/templates/workflows/check-todos.md +1 -0
- package/dist/assets/templates/workflows/cleanup.md +1 -0
- package/dist/assets/templates/workflows/complete-milestone.md +1 -0
- package/dist/assets/templates/workflows/discovery-phase.md +4 -0
- package/dist/assets/templates/workflows/discuss-phase.md +12 -4
- package/dist/assets/templates/workflows/execute-phase.md +40 -2
- package/dist/assets/templates/workflows/execute-plan.md +6 -0
- package/dist/assets/templates/workflows/init-existing.md +1 -0
- package/dist/assets/templates/workflows/new-milestone.md +1 -0
- package/dist/assets/templates/workflows/new-project.md +1 -0
- package/dist/assets/templates/workflows/plan-phase.md +1 -0
- package/dist/assets/templates/workflows/quick.md +1 -0
- package/dist/assets/templates/workflows/settings.md +1 -0
- package/dist/assets/templates/workflows/update.md +1 -0
- package/dist/assets/templates/workflows/verify-work.md +18 -1
- package/package.json +1 -1
- package/dist/assets/dashboard/client/assets/index-BsuHkXQ_.css +0 -32
- package/dist/assets/dashboard/client/assets/index-DaoQD7tI.js +0 -217
|
@@ -1,217 +0,0 @@
|
|
|
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"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function i(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=i(r);fetch(r.href,n)}})();function Xz(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var U0={exports:{}},zc={};/**
|
|
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 p2;function Vz(){if(p2)return zc;p2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(s,r,n){var o=null;if(n!==void 0&&(o=""+n),r.key!==void 0&&(o=""+r.key),"key"in r){n={};for(var l in r)l!=="key"&&(n[l]=r[l])}else n=r;return r=n.ref,{$$typeof:t,type:s,key:o,ref:r!==void 0?r:null,props:n}}return zc.Fragment=e,zc.jsx=i,zc.jsxs=i,zc}var m2;function Zz(){return m2||(m2=1,U0.exports=Vz()),U0.exports}var S=Zz(),Y0={exports:{}},$e={};/**
|
|
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 g2;function Iz(){if(g2)return $e;g2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),n=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"),m=Symbol.for("react.activity"),g=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=g&&N[g]||N["@@iterator"],typeof N=="function"?N:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function C(N,G,se){this.props=N,this.context=G,this.refs=w,this.updater=se||y}C.prototype.isReactComponent={},C.prototype.setState=function(N,G){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,G,"setState")},C.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function T(){}T.prototype=C.prototype;function M(N,G,se){this.props=N,this.context=G,this.refs=w,this.updater=se||y}var k=M.prototype=new T;k.constructor=M,b(k,C.prototype),k.isPureReactComponent=!0;var P=Array.isArray;function E(){}var z={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function Z(N,G,se){var ce=se.ref;return{$$typeof:t,type:N,key:G,ref:ce!==void 0?ce:null,props:se}}function ie(N,G){return Z(N.type,G,N.props)}function F(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function R(N){var G={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(se){return G[se]})}var Q=/\/+/g;function D(N,G){return typeof N=="object"&&N!==null&&N.key!=null?R(""+N.key):G.toString(36)}function I(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(E,E):(N.status="pending",N.then(function(G){N.status==="pending"&&(N.status="fulfilled",N.value=G)},function(G){N.status==="pending"&&(N.status="rejected",N.reason=G)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function L(N,G,se,ce,he){var de=typeof N;(de==="undefined"||de==="boolean")&&(N=null);var ge=!1;if(N===null)ge=!0;else switch(de){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(N.$$typeof){case t:case e:ge=!0;break;case d:return ge=N._init,L(ge(N._payload),G,se,ce,he)}}if(ge)return he=he(N),ge=ce===""?"."+D(N,0):ce,P(he)?(se="",ge!=null&&(se=ge.replace(Q,"$&/")+"/"),L(he,G,se,"",function(mt){return mt})):he!=null&&(F(he)&&(he=ie(he,se+(he.key==null||N&&N.key===he.key?"":(""+he.key).replace(Q,"$&/")+"/")+ge)),G.push(he)),1;ge=0;var Me=ce===""?".":ce+":";if(P(N))for(var ye=0;ye<N.length;ye++)ce=N[ye],de=Me+D(ce,ye),ge+=L(ce,G,se,de,he);else if(ye=v(N),typeof ye=="function")for(N=ye.call(N),ye=0;!(ce=N.next()).done;)ce=ce.value,de=Me+D(ce,ye++),ge+=L(ce,G,se,de,he);else if(de==="object"){if(typeof N.then=="function")return L(I(N),G,se,ce,he);throw G=String(N),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ge}function j(N,G,se){if(N==null)return N;var ce=[],he=0;return L(N,ce,"","",function(de){return G.call(se,de,he++)}),ce}function U(N){if(N._status===-1){var G=N._result;G=G(),G.then(function(se){(N._status===0||N._status===-1)&&(N._status=1,N._result=se)},function(se){(N._status===0||N._status===-1)&&(N._status=2,N._result=se)}),N._status===-1&&(N._status=0,N._result=G)}if(N._status===1)return N._result.default;throw N._result}var Y=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},W={map:j,forEach:function(N,G,se){j(N,function(){G.apply(this,arguments)},se)},count:function(N){var G=0;return j(N,function(){G++}),G},toArray:function(N){return j(N,function(G){return G})||[]},only:function(N){if(!F(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return $e.Activity=m,$e.Children=W,$e.Component=C,$e.Fragment=i,$e.Profiler=r,$e.PureComponent=M,$e.StrictMode=s,$e.Suspense=c,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,$e.__COMPILER_RUNTIME={__proto__:null,c:function(N){return z.H.useMemoCache(N)}},$e.cache=function(N){return function(){return N.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(N,G,se){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ce=b({},N.props),he=N.key;if(G!=null)for(de in G.key!==void 0&&(he=""+G.key),G)!$.call(G,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&G.ref===void 0||(ce[de]=G[de]);var de=arguments.length-2;if(de===1)ce.children=se;else if(1<de){for(var ge=Array(de),Me=0;Me<de;Me++)ge[Me]=arguments[Me+2];ce.children=ge}return Z(N.type,he,ce)},$e.createContext=function(N){return N={$$typeof:o,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:n,_context:N},N},$e.createElement=function(N,G,se){var ce,he={},de=null;if(G!=null)for(ce in G.key!==void 0&&(de=""+G.key),G)$.call(G,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(he[ce]=G[ce]);var ge=arguments.length-2;if(ge===1)he.children=se;else if(1<ge){for(var Me=Array(ge),ye=0;ye<ge;ye++)Me[ye]=arguments[ye+2];he.children=Me}if(N&&N.defaultProps)for(ce in ge=N.defaultProps,ge)he[ce]===void 0&&(he[ce]=ge[ce]);return Z(N,de,he)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(N){return{$$typeof:l,render:N}},$e.isValidElement=F,$e.lazy=function(N){return{$$typeof:d,_payload:{_status:-1,_result:N},_init:U}},$e.memo=function(N,G){return{$$typeof:u,type:N,compare:G===void 0?null:G}},$e.startTransition=function(N){var G=z.T,se={};z.T=se;try{var ce=N(),he=z.S;he!==null&&he(se,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(E,Y)}catch(de){Y(de)}finally{G!==null&&se.types!==null&&(G.types=se.types),z.T=G}},$e.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},$e.use=function(N){return z.H.use(N)},$e.useActionState=function(N,G,se){return z.H.useActionState(N,G,se)},$e.useCallback=function(N,G){return z.H.useCallback(N,G)},$e.useContext=function(N){return z.H.useContext(N)},$e.useDebugValue=function(){},$e.useDeferredValue=function(N,G){return z.H.useDeferredValue(N,G)},$e.useEffect=function(N,G){return z.H.useEffect(N,G)},$e.useEffectEvent=function(N){return z.H.useEffectEvent(N)},$e.useId=function(){return z.H.useId()},$e.useImperativeHandle=function(N,G,se){return z.H.useImperativeHandle(N,G,se)},$e.useInsertionEffect=function(N,G){return z.H.useInsertionEffect(N,G)},$e.useLayoutEffect=function(N,G){return z.H.useLayoutEffect(N,G)},$e.useMemo=function(N,G){return z.H.useMemo(N,G)},$e.useOptimistic=function(N,G){return z.H.useOptimistic(N,G)},$e.useReducer=function(N,G,se){return z.H.useReducer(N,G,se)},$e.useRef=function(N){return z.H.useRef(N)},$e.useState=function(N){return z.H.useState(N)},$e.useSyncExternalStore=function(N,G,se){return z.H.useSyncExternalStore(N,G,se)},$e.useTransition=function(){return z.H.useTransition()},$e.version="19.2.4",$e}var O2;function bb(){return O2||(O2=1,Y0.exports=Iz()),Y0.exports}var X=bb(),H0={exports:{}},Nc={},F0={exports:{}},G0={};/**
|
|
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 v2;function qz(){return v2||(v2=1,(function(t){function e(L,j){var U=L.length;L.push(j);e:for(;0<U;){var Y=U-1>>>1,W=L[Y];if(0<r(W,j))L[Y]=j,L[U]=W,U=Y;else break e}}function i(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var j=L[0],U=L.pop();if(U!==j){L[0]=U;e:for(var Y=0,W=L.length,N=W>>>1;Y<N;){var G=2*(Y+1)-1,se=L[G],ce=G+1,he=L[ce];if(0>r(se,U))ce<W&&0>r(he,se)?(L[Y]=he,L[ce]=U,Y=ce):(L[Y]=se,L[G]=U,Y=G);else if(ce<W&&0>r(he,U))L[Y]=he,L[ce]=U,Y=ce;else break e}}return j}function r(L,j){var U=L.sortIndex-j.sortIndex;return U!==0?U:L.id-j.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;t.unstable_now=function(){return n.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,m=null,g=3,v=!1,y=!1,b=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function k(L){for(var j=i(u);j!==null;){if(j.callback===null)s(u);else if(j.startTime<=L)s(u),j.sortIndex=j.expirationTime,e(c,j);else break;j=i(u)}}function P(L){if(b=!1,k(L),!y)if(i(c)!==null)y=!0,E||(E=!0,R());else{var j=i(u);j!==null&&I(P,j.startTime-L)}}var E=!1,z=-1,$=5,Z=-1;function ie(){return w?!0:!(t.unstable_now()-Z<$)}function F(){if(w=!1,E){var L=t.unstable_now();Z=L;var j=!0;try{e:{y=!1,b&&(b=!1,T(z),z=-1),v=!0;var U=g;try{t:{for(k(L),m=i(c);m!==null&&!(m.expirationTime>L&&ie());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,g=m.priorityLevel;var W=Y(m.expirationTime<=L);if(L=t.unstable_now(),typeof W=="function"){m.callback=W,k(L),j=!0;break t}m===i(c)&&s(c),k(L)}else s(c);m=i(c)}if(m!==null)j=!0;else{var N=i(u);N!==null&&I(P,N.startTime-L),j=!1}}break e}finally{m=null,g=U,v=!1}j=void 0}}finally{j?R():E=!1}}}var R;if(typeof M=="function")R=function(){M(F)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,D=Q.port2;Q.port1.onmessage=F,R=function(){D.postMessage(null)}}else R=function(){C(F,0)};function I(L,j){z=C(function(){L(t.unstable_now())},j)}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(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(L){switch(g){case 1:case 2:case 3:var j=3;break;default:j=g}var U=g;g=j;try{return L()}finally{g=U}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(L,j){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var U=g;g=L;try{return j()}finally{g=U}},t.unstable_scheduleCallback=function(L,j,U){var Y=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?Y+U:Y):U=Y,L){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=U+W,L={id:d++,callback:j,priorityLevel:L,startTime:U,expirationTime:W,sortIndex:-1},U>Y?(L.sortIndex=U,e(u,L),i(c)===null&&L===i(u)&&(b?(T(z),z=-1):b=!0,I(P,U-Y))):(L.sortIndex=W,e(c,L),y||v||(y=!0,E||(E=!0,R()))),L},t.unstable_shouldYield=ie,t.unstable_wrapCallback=function(L){var j=g;return function(){var U=g;g=j;try{return L.apply(this,arguments)}finally{g=U}}}})(G0)),G0}var _2;function Wz(){return _2||(_2=1,F0.exports=qz()),F0.exports}var K0={exports:{}},Ni={};/**
|
|
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 y2;function Uz(){if(y2)return Ni;y2=1;var t=bb();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 s={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 n(c,u,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:m==null?null:""+m,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 Ni.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ni.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 n(c,u,null,d)},Ni.flushSync=function(c){var u=o.T,d=s.p;try{if(o.T=null,s.p=2,c)return c()}finally{o.T=u,s.p=d,s.d.f()}},Ni.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,s.d.C(c,u))},Ni.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},Ni.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,m=l(d,u.crossOrigin),g=typeof u.integrity=="string"?u.integrity:void 0,v=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?s.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:v}):d==="script"&&s.d.X(c,{crossOrigin:m,integrity:g,fetchPriority:v,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Ni.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);s.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&&s.d.M(c)},Ni.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,m=l(d,u.crossOrigin);s.d.L(c,d,{crossOrigin:m,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})}},Ni.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);s.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 s.d.m(c)},Ni.requestFormReset=function(c){s.d.r(c)},Ni.unstable_batchedUpdates=function(c,u){return c(u)},Ni.useFormState=function(c,u,d){return o.H.useFormState(c,u,d)},Ni.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ni.version="19.2.4",Ni}var b2;function Yz(){if(b2)return K0.exports;b2=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(),K0.exports=Uz(),K0.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 S2;function Hz(){if(S2)return Nc;S2=1;var t=Wz(),e=bb(),i=Yz();function s(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 n(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(n(a)!==a)throw Error(s(188))}function u(a){var h=a.alternate;if(!h){if(h=n(a),h===null)throw Error(s(188));return h!==a?null:a}for(var f=a,p=h;;){var O=f.return;if(O===null)break;var _=O.alternate;if(_===null){if(p=O.return,p!==null){f=p;continue}break}if(O.child===_.child){for(_=O.child;_;){if(_===f)return c(O),a;if(_===p)return c(O),h;_=_.sibling}throw Error(s(188))}if(f.return!==p.return)f=O,p=_;else{for(var x=!1,A=O.child;A;){if(A===f){x=!0,f=O,p=_;break}if(A===p){x=!0,p=O,f=_;break}A=A.sibling}if(!x){for(A=_.child;A;){if(A===f){x=!0,f=_,p=O;break}if(A===p){x=!0,p=_,f=O;break}A=A.sibling}if(!x)throw Error(s(189))}}if(f.alternate!==p)throw Error(s(190))}if(f.tag!==3)throw Error(s(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 m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),M=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function R(a){return a===null||typeof a!="object"?null:(a=F&&a[F]||a["@@iterator"],typeof a=="function"?a:null)}var Q=Symbol.for("react.client.reference");function D(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Q?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case b:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case P:return"Suspense";case E:return"SuspenseList";case Z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case y:return"Portal";case M:return a.displayName||"Context";case T:return(a._context.displayName||"Context")+".Consumer";case k:var h=a.render;return a=a.displayName,a||(a=h.displayName||h.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case z:return h=a.displayName||null,h!==null?h:D(a.type)||"Memo";case $:h=a._payload,a=a._init;try{return D(a(h))}catch{}}return null}var I=Array.isArray,L=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},Y=[],W=-1;function N(a){return{current:a}}function G(a){0>W||(a.current=Y[W],Y[W]=null,W--)}function se(a,h){W++,Y[W]=a.current,a.current=h}var ce=N(null),he=N(null),de=N(null),ge=N(null);function Me(a,h){switch(se(de,h),se(he,a),se(ce,null),h.nodeType){case 9:case 11:a=(a=h.documentElement)&&(a=a.namespaceURI)?Dk(a):0;break;default:if(a=h.tagName,h=h.namespaceURI)h=Dk(h),a=zk(h,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}G(ce),se(ce,a)}function ye(){G(ce),G(he),G(de)}function mt(a){a.memoizedState!==null&&se(ge,a);var h=ce.current,f=zk(h,a.type);h!==f&&(se(he,a),se(ce,f))}function Ft(a){he.current===a&&(G(ce),G(he)),ge.current===a&&(G(ge),Lc._currentValue=U)}var Gt,oi;function Pe(a){if(Gt===void 0)try{throw Error()}catch(f){var h=f.stack.trim().match(/\n( *(at )?)/);Gt=h&&h[1]||"",oi=-1<f.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Gt+a+oi}var ln=!1;function Vh(a,h){if(!a||ln)return"";ln=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(h){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(te){var ee=te}Reflect.construct(a,[],ae)}else{try{ae.call()}catch(te){ee=te}a.call(ae.prototype)}}else{try{throw Error()}catch(te){ee=te}(ae=a())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(te){if(te&&ee&&typeof te.stack=="string")return[te.stack,ee.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var O=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");O&&O.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=p.DetermineComponentFrameRoot(),x=_[0],A=_[1];if(x&&A){var V=x.split(`
|
|
44
|
-
`),J=A.split(`
|
|
45
|
-
`);for(O=p=0;p<V.length&&!V[p].includes("DetermineComponentFrameRoot");)p++;for(;O<J.length&&!J[O].includes("DetermineComponentFrameRoot");)O++;if(p===V.length||O===J.length)for(p=V.length-1,O=J.length-1;1<=p&&0<=O&&V[p]!==J[O];)O--;for(;1<=p&&0<=O;p--,O--)if(V[p]!==J[O]){if(p!==1||O!==1)do if(p--,O--,0>O||V[p]!==J[O]){var re=`
|
|
46
|
-
`+V[p].replace(" at new "," at ");return a.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",a.displayName)),re}while(1<=p&&0<=O);break}}}finally{ln=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Pe(f):""}function Zh(a,h){switch(a.tag){case 26:case 27:case 5:return Pe(a.type);case 16:return Pe("Lazy");case 13:return a.child!==h&&h!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return Vh(a.type,!1);case 11:return Vh(a.type.render,!1);case 1:return Vh(a.type,!0);case 31:return Pe("Activity");default:return""}}function Ih(a){try{var h="",f=null;do h+=Zh(a,f),f=a,a=a.return;while(a);return h}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var il=Object.prototype.hasOwnProperty,qh=t.unstable_scheduleCallback,Lg=t.unstable_cancelCallback,_4=t.unstable_shouldYield,y4=t.unstable_requestPaint,_s=t.unstable_now,b4=t.unstable_getCurrentPriorityLevel,mx=t.unstable_ImmediatePriority,gx=t.unstable_UserBlockingPriority,$f=t.unstable_NormalPriority,S4=t.unstable_LowPriority,Ox=t.unstable_IdlePriority,x4=t.log,w4=t.unstable_setDisableYieldValue,Wh=null,ys=null;function Hn(a){if(typeof x4=="function"&&w4(a),ys&&typeof ys.setStrictMode=="function")try{ys.setStrictMode(Wh,a)}catch{}}var bs=Math.clz32?Math.clz32:T4,C4=Math.log,k4=Math.LN2;function T4(a){return a>>>=0,a===0?32:31-(C4(a)/k4|0)|0}var Bf=256,Df=262144,zf=4194304;function Jo(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 Nf(a,h,f){var p=a.pendingLanes;if(p===0)return 0;var O=0,_=a.suspendedLanes,x=a.pingedLanes;a=a.warmLanes;var A=p&134217727;return A!==0?(p=A&~_,p!==0?O=Jo(p):(x&=A,x!==0?O=Jo(x):f||(f=A&~a,f!==0&&(O=Jo(f))))):(A=p&~_,A!==0?O=Jo(A):x!==0?O=Jo(x):f||(f=p&~a,f!==0&&(O=Jo(f)))),O===0?0:h!==0&&h!==O&&(h&_)===0&&(_=O&-O,f=h&-h,_>=f||_===32&&(f&4194048)!==0)?h:O}function Uh(a,h){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&h)===0}function M4(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 vx(){var a=zf;return zf<<=1,(zf&62914560)===0&&(zf=4194304),a}function $g(a){for(var h=[],f=0;31>f;f++)h.push(a);return h}function Yh(a,h){a.pendingLanes|=h,h!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function A4(a,h,f,p,O,_){var x=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 A=a.entanglements,V=a.expirationTimes,J=a.hiddenUpdates;for(f=x&~f;0<f;){var re=31-bs(f),ae=1<<re;A[re]=0,V[re]=-1;var ee=J[re];if(ee!==null)for(J[re]=null,re=0;re<ee.length;re++){var te=ee[re];te!==null&&(te.lane&=-536870913)}f&=~ae}p!==0&&_x(a,p,0),_!==0&&O===0&&a.tag!==0&&(a.suspendedLanes|=_&~(x&~h))}function _x(a,h,f){a.pendingLanes|=h,a.suspendedLanes&=~h;var p=31-bs(h);a.entangledLanes|=h,a.entanglements[p]=a.entanglements[p]|1073741824|f&261930}function yx(a,h){var f=a.entangledLanes|=h;for(a=a.entanglements;f;){var p=31-bs(f),O=1<<p;O&h|a[p]&h&&(a[p]|=h),f&=~O}}function bx(a,h){var f=h&-h;return f=(f&42)!==0?1:Bg(f),(f&(a.suspendedLanes|h))!==0?0:f}function Bg(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 Dg(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Sx(){var a=j.p;return a!==0?a:(a=window.event,a===void 0?32:a2(a.type))}function xx(a,h){var f=j.p;try{return j.p=a,h()}finally{j.p=f}}var Fn=Math.random().toString(36).slice(2),wi="__reactFiber$"+Fn,rs="__reactProps$"+Fn,sl="__reactContainer$"+Fn,zg="__reactEvents$"+Fn,E4="__reactListeners$"+Fn,P4="__reactHandles$"+Fn,wx="__reactResources$"+Fn,Hh="__reactMarker$"+Fn;function Ng(a){delete a[wi],delete a[rs],delete a[zg],delete a[E4],delete a[P4]}function rl(a){var h=a[wi];if(h)return h;for(var f=a.parentNode;f;){if(h=f[sl]||f[wi]){if(f=h.alternate,h.child!==null||f!==null&&f.child!==null)for(a=qk(a);a!==null;){if(f=a[wi])return f;a=qk(a)}return h}a=f,f=a.parentNode}return null}function nl(a){if(a=a[wi]||a[sl]){var h=a.tag;if(h===5||h===6||h===13||h===31||h===26||h===27||h===3)return a}return null}function Fh(a){var h=a.tag;if(h===5||h===26||h===27||h===6)return a.stateNode;throw Error(s(33))}function ol(a){var h=a[wx];return h||(h=a[wx]={hoistableStyles:new Map,hoistableScripts:new Map}),h}function ai(a){a[Hh]=!0}var Cx=new Set,kx={};function ea(a,h){al(a,h),al(a+"Capture",h)}function al(a,h){for(kx[a]=h,a=0;a<h.length;a++)Cx.add(h[a])}var R4=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]*$"),Tx={},Mx={};function Q4(a){return il.call(Mx,a)?!0:il.call(Tx,a)?!1:R4.test(a)?Mx[a]=!0:(Tx[a]=!0,!1)}function jf(a,h,f){if(Q4(h))if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(h);return;case"boolean":var p=h.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(h);return}}a.setAttribute(h,""+f)}}function Xf(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 hn(a,h,f,p){if(p===null)a.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(h,f,""+p)}}function Ns(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Ax(a){var h=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function L4(a,h,f){var p=Object.getOwnPropertyDescriptor(a.constructor.prototype,h);if(!a.hasOwnProperty(h)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var O=p.get,_=p.set;return Object.defineProperty(a,h,{configurable:!0,get:function(){return O.call(this)},set:function(x){f=""+x,_.call(this,x)}}),Object.defineProperty(a,h,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(x){f=""+x},stopTracking:function(){a._valueTracker=null,delete a[h]}}}}function jg(a){if(!a._valueTracker){var h=Ax(a)?"checked":"value";a._valueTracker=L4(a,h,""+a[h])}}function Ex(a){if(!a)return!1;var h=a._valueTracker;if(!h)return!0;var f=h.getValue(),p="";return a&&(p=Ax(a)?a.checked?"true":"false":a.value),a=p,a!==f?(h.setValue(a),!0):!1}function Vf(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 $4=/[\n"\\]/g;function js(a){return a.replace($4,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Xg(a,h,f,p,O,_,x,A){a.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?a.type=x:a.removeAttribute("type"),h!=null?x==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+Ns(h)):a.value!==""+Ns(h)&&(a.value=""+Ns(h)):x!=="submit"&&x!=="reset"||a.removeAttribute("value"),h!=null?Vg(a,x,Ns(h)):f!=null?Vg(a,x,Ns(f)):p!=null&&a.removeAttribute("value"),O==null&&_!=null&&(a.defaultChecked=!!_),O!=null&&(a.checked=O&&typeof O!="function"&&typeof O!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.name=""+Ns(A):a.removeAttribute("name")}function Px(a,h,f,p,O,_,x,A){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(a.type=_),h!=null||f!=null){if(!(_!=="submit"&&_!=="reset"||h!=null)){jg(a);return}f=f!=null?""+Ns(f):"",h=h!=null?""+Ns(h):f,A||h===a.value||(a.value=h),a.defaultValue=h}p=p??O,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=A?a.checked:!!p,a.defaultChecked=!!p,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.name=x),jg(a)}function Vg(a,h,f){h==="number"&&Vf(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function ll(a,h,f,p){if(a=a.options,h){h={};for(var O=0;O<f.length;O++)h["$"+f[O]]=!0;for(f=0;f<a.length;f++)O=h.hasOwnProperty("$"+a[f].value),a[f].selected!==O&&(a[f].selected=O),O&&p&&(a[f].defaultSelected=!0)}else{for(f=""+Ns(f),h=null,O=0;O<a.length;O++){if(a[O].value===f){a[O].selected=!0,p&&(a[O].defaultSelected=!0);return}h!==null||a[O].disabled||(h=a[O])}h!==null&&(h.selected=!0)}}function Rx(a,h,f){if(h!=null&&(h=""+Ns(h),h!==a.value&&(a.value=h),f==null)){a.defaultValue!==h&&(a.defaultValue=h);return}a.defaultValue=f!=null?""+Ns(f):""}function Qx(a,h,f,p){if(h==null){if(p!=null){if(f!=null)throw Error(s(92));if(I(p)){if(1<p.length)throw Error(s(93));p=p[0]}f=p}f==null&&(f=""),h=f}f=Ns(h),a.defaultValue=f,p=a.textContent,p===f&&p!==""&&p!==null&&(a.value=p),jg(a)}function hl(a,h){if(h){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=h;return}}a.textContent=h}var B4=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 Lx(a,h,f){var p=h.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?p?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="":p?a.setProperty(h,f):typeof f!="number"||f===0||B4.has(h)?h==="float"?a.cssFloat=f:a[h]=(""+f).trim():a[h]=f+"px"}function $x(a,h,f){if(h!=null&&typeof h!="object")throw Error(s(62));if(a=a.style,f!=null){for(var p in f)!f.hasOwnProperty(p)||h!=null&&h.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var O in h)p=h[O],h.hasOwnProperty(O)&&f[O]!==p&&Lx(a,O,p)}else for(var _ in h)h.hasOwnProperty(_)&&Lx(a,_,h[_])}function Zg(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 D4=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"]]),z4=/^[\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 Zf(a){return z4.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function cn(){}var Ig=null;function qg(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var cl=null,ul=null;function Bx(a){var h=nl(a);if(h&&(a=h.stateNode)){var f=a[rs]||null;e:switch(a=h.stateNode,h.type){case"input":if(Xg(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="'+js(""+h)+'"][type="radio"]'),h=0;h<f.length;h++){var p=f[h];if(p!==a&&p.form===a.form){var O=p[rs]||null;if(!O)throw Error(s(90));Xg(p,O.value,O.defaultValue,O.defaultValue,O.checked,O.defaultChecked,O.type,O.name)}}for(h=0;h<f.length;h++)p=f[h],p.form===a.form&&Ex(p)}break e;case"textarea":Rx(a,f.value,f.defaultValue);break e;case"select":h=f.value,h!=null&&ll(a,!!f.multiple,h,!1)}}}var Wg=!1;function Dx(a,h,f){if(Wg)return a(h,f);Wg=!0;try{var p=a(h);return p}finally{if(Wg=!1,(cl!==null||ul!==null)&&(Ed(),cl&&(h=cl,a=ul,ul=cl=null,Bx(h),a)))for(h=0;h<a.length;h++)Bx(a[h])}}function Gh(a,h){var f=a.stateNode;if(f===null)return null;var p=f[rs]||null;if(p===null)return null;f=p[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":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(s(231,h,typeof f));return f}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ug=!1;if(un)try{var Kh={};Object.defineProperty(Kh,"passive",{get:function(){Ug=!0}}),window.addEventListener("test",Kh,Kh),window.removeEventListener("test",Kh,Kh)}catch{Ug=!1}var Gn=null,Yg=null,If=null;function zx(){if(If)return If;var a,h=Yg,f=h.length,p,O="value"in Gn?Gn.value:Gn.textContent,_=O.length;for(a=0;a<f&&h[a]===O[a];a++);var x=f-a;for(p=1;p<=x&&h[f-p]===O[_-p];p++);return If=O.slice(a,1<p?1-p:void 0)}function qf(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 Wf(){return!0}function Nx(){return!1}function ns(a){function h(f,p,O,_,x){this._reactName=f,this._targetInst=O,this.type=p,this.nativeEvent=_,this.target=x,this.currentTarget=null;for(var A in a)a.hasOwnProperty(A)&&(f=a[A],this[A]=f?f(_):_[A]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Wf:Nx,this.isPropagationStopped=Nx,this}return m(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=Wf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Wf)},persist:function(){},isPersistent:Wf}),h}var ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uf=ns(ta),Jh=m({},ta,{view:0,detail:0}),N4=ns(Jh),Hg,Fg,ec,Yf=m({},Jh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kg,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!==ec&&(ec&&a.type==="mousemove"?(Hg=a.screenX-ec.screenX,Fg=a.screenY-ec.screenY):Fg=Hg=0,ec=a),Hg)},movementY:function(a){return"movementY"in a?a.movementY:Fg}}),jx=ns(Yf),j4=m({},Yf,{dataTransfer:0}),X4=ns(j4),V4=m({},Jh,{relatedTarget:0}),Gg=ns(V4),Z4=m({},ta,{animationName:0,elapsedTime:0,pseudoElement:0}),I4=ns(Z4),q4=m({},ta,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),W4=ns(q4),U4=m({},ta,{data:0}),Xx=ns(U4),Y4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},H4={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"},F4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G4(a){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(a):(a=F4[a])?!!h[a]:!1}function Kg(){return G4}var K4=m({},Jh,{key:function(a){if(a.key){var h=Y4[a.key]||a.key;if(h!=="Unidentified")return h}return a.type==="keypress"?(a=qf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?H4[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kg,charCode:function(a){return a.type==="keypress"?qf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?qf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),J4=ns(K4),e6=m({},Yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vx=ns(e6),t6=m({},Jh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kg}),i6=ns(t6),s6=m({},ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),r6=ns(s6),n6=m({},Yf,{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}),o6=ns(n6),a6=m({},ta,{newState:0,oldState:0}),l6=ns(a6),h6=[9,13,27,32],Jg=un&&"CompositionEvent"in window,tc=null;un&&"documentMode"in document&&(tc=document.documentMode);var c6=un&&"TextEvent"in window&&!tc,Zx=un&&(!Jg||tc&&8<tc&&11>=tc),Ix=" ",qx=!1;function Wx(a,h){switch(a){case"keyup":return h6.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ux(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var fl=!1;function u6(a,h){switch(a){case"compositionend":return Ux(h);case"keypress":return h.which!==32?null:(qx=!0,Ix);case"textInput":return a=h.data,a===Ix&&qx?null:a;default:return null}}function f6(a,h){if(fl)return a==="compositionend"||!Jg&&Wx(a,h)?(a=zx(),If=Yg=Gn=null,fl=!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 Zx&&h.locale!=="ko"?null:h.data;default:return null}}var d6={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 Yx(a){var h=a&&a.nodeName&&a.nodeName.toLowerCase();return h==="input"?!!d6[a.type]:h==="textarea"}function Hx(a,h,f,p){cl?ul?ul.push(p):ul=[p]:cl=p,h=Dd(h,"onChange"),0<h.length&&(f=new Uf("onChange","change",null,f,p),a.push({event:f,listeners:h}))}var ic=null,sc=null;function p6(a){Pk(a,0)}function Hf(a){var h=Fh(a);if(Ex(h))return a}function Fx(a,h){if(a==="change")return h}var Gx=!1;if(un){var eO;if(un){var tO="oninput"in document;if(!tO){var Kx=document.createElement("div");Kx.setAttribute("oninput","return;"),tO=typeof Kx.oninput=="function"}eO=tO}else eO=!1;Gx=eO&&(!document.documentMode||9<document.documentMode)}function Jx(){ic&&(ic.detachEvent("onpropertychange",ew),sc=ic=null)}function ew(a){if(a.propertyName==="value"&&Hf(sc)){var h=[];Hx(h,sc,a,qg(a)),Dx(p6,h)}}function m6(a,h,f){a==="focusin"?(Jx(),ic=h,sc=f,ic.attachEvent("onpropertychange",ew)):a==="focusout"&&Jx()}function g6(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Hf(sc)}function O6(a,h){if(a==="click")return Hf(h)}function v6(a,h){if(a==="input"||a==="change")return Hf(h)}function _6(a,h){return a===h&&(a!==0||1/a===1/h)||a!==a&&h!==h}var Ss=typeof Object.is=="function"?Object.is:_6;function rc(a,h){if(Ss(a,h))return!0;if(typeof a!="object"||a===null||typeof h!="object"||h===null)return!1;var f=Object.keys(a),p=Object.keys(h);if(f.length!==p.length)return!1;for(p=0;p<f.length;p++){var O=f[p];if(!il.call(h,O)||!Ss(a[O],h[O]))return!1}return!0}function tw(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function iw(a,h){var f=tw(a);a=0;for(var p;f;){if(f.nodeType===3){if(p=a+f.textContent.length,a<=h&&p>=h)return{node:f,offset:h-a};a=p}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=tw(f)}}function sw(a,h){return a&&h?a===h?!0:a&&a.nodeType===3?!1:h&&h.nodeType===3?sw(a,h.parentNode):"contains"in a?a.contains(h):a.compareDocumentPosition?!!(a.compareDocumentPosition(h)&16):!1:!1}function rw(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var h=Vf(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=Vf(a.document)}return h}function iO(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 y6=un&&"documentMode"in document&&11>=document.documentMode,dl=null,sO=null,nc=null,rO=!1;function nw(a,h,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;rO||dl==null||dl!==Vf(p)||(p=dl,"selectionStart"in p&&iO(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),nc&&rc(nc,p)||(nc=p,p=Dd(sO,"onSelect"),0<p.length&&(h=new Uf("onSelect","select",null,h,f),a.push({event:h,listeners:p}),h.target=dl)))}function ia(a,h){var f={};return f[a.toLowerCase()]=h.toLowerCase(),f["Webkit"+a]="webkit"+h,f["Moz"+a]="moz"+h,f}var pl={animationend:ia("Animation","AnimationEnd"),animationiteration:ia("Animation","AnimationIteration"),animationstart:ia("Animation","AnimationStart"),transitionrun:ia("Transition","TransitionRun"),transitionstart:ia("Transition","TransitionStart"),transitioncancel:ia("Transition","TransitionCancel"),transitionend:ia("Transition","TransitionEnd")},nO={},ow={};un&&(ow=document.createElement("div").style,"AnimationEvent"in window||(delete pl.animationend.animation,delete pl.animationiteration.animation,delete pl.animationstart.animation),"TransitionEvent"in window||delete pl.transitionend.transition);function sa(a){if(nO[a])return nO[a];if(!pl[a])return a;var h=pl[a],f;for(f in h)if(h.hasOwnProperty(f)&&f in ow)return nO[a]=h[f];return a}var aw=sa("animationend"),lw=sa("animationiteration"),hw=sa("animationstart"),b6=sa("transitionrun"),S6=sa("transitionstart"),x6=sa("transitioncancel"),cw=sa("transitionend"),uw=new Map,oO="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(" ");oO.push("scrollEnd");function fr(a,h){uw.set(a,h),ea(h,[a])}var Ff=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)},Xs=[],ml=0,aO=0;function Gf(){for(var a=ml,h=aO=ml=0;h<a;){var f=Xs[h];Xs[h++]=null;var p=Xs[h];Xs[h++]=null;var O=Xs[h];Xs[h++]=null;var _=Xs[h];if(Xs[h++]=null,p!==null&&O!==null){var x=p.pending;x===null?O.next=O:(O.next=x.next,x.next=O),p.pending=O}_!==0&&fw(f,O,_)}}function Kf(a,h,f,p){Xs[ml++]=a,Xs[ml++]=h,Xs[ml++]=f,Xs[ml++]=p,aO|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function lO(a,h,f,p){return Kf(a,h,f,p),Jf(a)}function ra(a,h){return Kf(a,null,null,h),Jf(a)}function fw(a,h,f){a.lanes|=f;var p=a.alternate;p!==null&&(p.lanes|=f);for(var O=!1,_=a.return;_!==null;)_.childLanes|=f,p=_.alternate,p!==null&&(p.childLanes|=f),_.tag===22&&(a=_.stateNode,a===null||a._visibility&1||(O=!0)),a=_,_=_.return;return a.tag===3?(_=a.stateNode,O&&h!==null&&(O=31-bs(f),a=_.hiddenUpdates,p=a[O],p===null?a[O]=[h]:p.push(h),h.lane=f|536870912),_):null}function Jf(a){if(50<Tc)throw Tc=0,O0=null,Error(s(185));for(var h=a.return;h!==null;)a=h,h=a.return;return a.tag===3?a.stateNode:null}var gl={};function w6(a,h,f,p){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=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xs(a,h,f,p){return new w6(a,h,f,p)}function hO(a){return a=a.prototype,!(!a||!a.isReactComponent)}function fn(a,h){var f=a.alternate;return f===null?(f=xs(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 dw(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 ed(a,h,f,p,O,_){var x=0;if(p=a,typeof a=="function")hO(a)&&(x=1);else if(typeof a=="string")x=Az(a,f,ce.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case Z:return a=xs(31,f,h,O),a.elementType=Z,a.lanes=_,a;case b:return na(f.children,O,_,h);case w:x=8,O|=24;break;case C:return a=xs(12,f,h,O|2),a.elementType=C,a.lanes=_,a;case P:return a=xs(13,f,h,O),a.elementType=P,a.lanes=_,a;case E:return a=xs(19,f,h,O),a.elementType=E,a.lanes=_,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:x=10;break e;case T:x=9;break e;case k:x=11;break e;case z:x=14;break e;case $:x=16,p=null;break e}x=29,f=Error(s(130,a===null?"null":typeof a,"")),p=null}return h=xs(x,f,h,O),h.elementType=a,h.type=p,h.lanes=_,h}function na(a,h,f,p){return a=xs(7,a,p,h),a.lanes=f,a}function cO(a,h,f){return a=xs(6,a,null,h),a.lanes=f,a}function pw(a){var h=xs(18,null,null,0);return h.stateNode=a,h}function uO(a,h,f){return h=xs(4,a.children!==null?a.children:[],a.key,h),h.lanes=f,h.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},h}var mw=new WeakMap;function Vs(a,h){if(typeof a=="object"&&a!==null){var f=mw.get(a);return f!==void 0?f:(h={value:a,source:h,stack:Ih(h)},mw.set(a,h),h)}return{value:a,source:h,stack:Ih(h)}}var Ol=[],vl=0,td=null,oc=0,Zs=[],Is=0,Kn=null,Ar=1,Er="";function dn(a,h){Ol[vl++]=oc,Ol[vl++]=td,td=a,oc=h}function gw(a,h,f){Zs[Is++]=Ar,Zs[Is++]=Er,Zs[Is++]=Kn,Kn=a;var p=Ar;a=Er;var O=32-bs(p)-1;p&=~(1<<O),f+=1;var _=32-bs(h)+O;if(30<_){var x=O-O%5;_=(p&(1<<x)-1).toString(32),p>>=x,O-=x,Ar=1<<32-bs(h)+O|f<<O|p,Er=_+a}else Ar=1<<_|f<<O|p,Er=a}function fO(a){a.return!==null&&(dn(a,1),gw(a,1,0))}function dO(a){for(;a===td;)td=Ol[--vl],Ol[vl]=null,oc=Ol[--vl],Ol[vl]=null;for(;a===Kn;)Kn=Zs[--Is],Zs[Is]=null,Er=Zs[--Is],Zs[Is]=null,Ar=Zs[--Is],Zs[Is]=null}function Ow(a,h){Zs[Is++]=Ar,Zs[Is++]=Er,Zs[Is++]=Kn,Ar=h.id,Er=h.overflow,Kn=a}var Ci=null,gt=null,Ue=!1,Jn=null,qs=!1,pO=Error(s(519));function eo(a){var h=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ac(Vs(h,a)),pO}function vw(a){var h=a.stateNode,f=a.type,p=a.memoizedProps;switch(h[wi]=a,h[rs]=p,f){case"dialog":Ve("cancel",h),Ve("close",h);break;case"iframe":case"object":case"embed":Ve("load",h);break;case"video":case"audio":for(f=0;f<Ac.length;f++)Ve(Ac[f],h);break;case"source":Ve("error",h);break;case"img":case"image":case"link":Ve("error",h),Ve("load",h);break;case"details":Ve("toggle",h);break;case"input":Ve("invalid",h),Px(h,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Ve("invalid",h);break;case"textarea":Ve("invalid",h),Qx(h,p.value,p.defaultValue,p.children)}f=p.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||h.textContent===""+f||p.suppressHydrationWarning===!0||$k(h.textContent,f)?(p.popover!=null&&(Ve("beforetoggle",h),Ve("toggle",h)),p.onScroll!=null&&Ve("scroll",h),p.onScrollEnd!=null&&Ve("scrollend",h),p.onClick!=null&&(h.onclick=cn),h=!0):h=!1,h||eo(a,!0)}function _w(a){for(Ci=a.return;Ci;)switch(Ci.tag){case 5:case 31:case 13:qs=!1;return;case 27:case 3:qs=!0;return;default:Ci=Ci.return}}function _l(a){if(a!==Ci)return!1;if(!Ue)return _w(a),Ue=!0,!1;var h=a.tag,f;if((f=h!==3&&h!==27)&&((f=h===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||R0(a.type,a.memoizedProps)),f=!f),f&>&&eo(a),_w(a),h===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));gt=Ik(a)}else if(h===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));gt=Ik(a)}else h===27?(h=gt,mo(a.type)?(a=D0,D0=null,gt=a):gt=h):gt=Ci?Us(a.stateNode.nextSibling):null;return!0}function oa(){gt=Ci=null,Ue=!1}function mO(){var a=Jn;return a!==null&&(hs===null?hs=a:hs.push.apply(hs,a),Jn=null),a}function ac(a){Jn===null?Jn=[a]:Jn.push(a)}var gO=N(null),aa=null,pn=null;function to(a,h,f){se(gO,h._currentValue),h._currentValue=f}function mn(a){a._currentValue=gO.current,G(gO)}function OO(a,h,f){for(;a!==null;){var p=a.alternate;if((a.childLanes&h)!==h?(a.childLanes|=h,p!==null&&(p.childLanes|=h)):p!==null&&(p.childLanes&h)!==h&&(p.childLanes|=h),a===f)break;a=a.return}}function vO(a,h,f,p){var O=a.child;for(O!==null&&(O.return=a);O!==null;){var _=O.dependencies;if(_!==null){var x=O.child;_=_.firstContext;e:for(;_!==null;){var A=_;_=O;for(var V=0;V<h.length;V++)if(A.context===h[V]){_.lanes|=f,A=_.alternate,A!==null&&(A.lanes|=f),OO(_.return,f,a),p||(x=null);break e}_=A.next}}else if(O.tag===18){if(x=O.return,x===null)throw Error(s(341));x.lanes|=f,_=x.alternate,_!==null&&(_.lanes|=f),OO(x,f,a),x=null}else x=O.child;if(x!==null)x.return=O;else for(x=O;x!==null;){if(x===a){x=null;break}if(O=x.sibling,O!==null){O.return=x.return,x=O;break}x=x.return}O=x}}function yl(a,h,f,p){a=null;for(var O=h,_=!1;O!==null;){if(!_){if((O.flags&524288)!==0)_=!0;else if((O.flags&262144)!==0)break}if(O.tag===10){var x=O.alternate;if(x===null)throw Error(s(387));if(x=x.memoizedProps,x!==null){var A=O.type;Ss(O.pendingProps.value,x.value)||(a!==null?a.push(A):a=[A])}}else if(O===ge.current){if(x=O.alternate,x===null)throw Error(s(387));x.memoizedState.memoizedState!==O.memoizedState.memoizedState&&(a!==null?a.push(Lc):a=[Lc])}O=O.return}a!==null&&vO(h,a,f,p),h.flags|=262144}function id(a){for(a=a.firstContext;a!==null;){if(!Ss(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function la(a){aa=a,pn=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ki(a){return yw(aa,a)}function sd(a,h){return aa===null&&la(a),yw(a,h)}function yw(a,h){var f=h._currentValue;if(h={context:h,memoizedValue:f,next:null},pn===null){if(a===null)throw Error(s(308));pn=h,a.dependencies={lanes:0,firstContext:h},a.flags|=524288}else pn=pn.next=h;return f}var C6=typeof AbortController<"u"?AbortController:function(){var a=[],h=this.signal={aborted:!1,addEventListener:function(f,p){a.push(p)}};this.abort=function(){h.aborted=!0,a.forEach(function(f){return f()})}},k6=t.unstable_scheduleCallback,T6=t.unstable_NormalPriority,jt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _O(){return{controller:new C6,data:new Map,refCount:0}}function lc(a){a.refCount--,a.refCount===0&&k6(T6,function(){a.controller.abort()})}var hc=null,yO=0,bl=0,Sl=null;function M6(a,h){if(hc===null){var f=hc=[];yO=0,bl=x0(),Sl={status:"pending",value:void 0,then:function(p){f.push(p)}}}return yO++,h.then(bw,bw),h}function bw(){if(--yO===0&&hc!==null){Sl!==null&&(Sl.status="fulfilled");var a=hc;hc=null,bl=0,Sl=null;for(var h=0;h<a.length;h++)(0,a[h])()}}function A6(a,h){var f=[],p={status:"pending",value:null,reason:null,then:function(O){f.push(O)}};return a.then(function(){p.status="fulfilled",p.value=h;for(var O=0;O<f.length;O++)(0,f[O])(h)},function(O){for(p.status="rejected",p.reason=O,O=0;O<f.length;O++)(0,f[O])(void 0)}),p}var Sw=L.S;L.S=function(a,h){nk=_s(),typeof h=="object"&&h!==null&&typeof h.then=="function"&&M6(a,h),Sw!==null&&Sw(a,h)};var ha=N(null);function bO(){var a=ha.current;return a!==null?a:ht.pooledCache}function rd(a,h){h===null?se(ha,ha.current):se(ha,h.pool)}function xw(){var a=bO();return a===null?null:{parent:jt._currentValue,pool:a}}var xl=Error(s(460)),SO=Error(s(474)),nd=Error(s(542)),od={then:function(){}};function ww(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Cw(a,h,f){switch(f=a[f],f===void 0?a.push(h):f!==h&&(h.then(cn,cn),h=f),h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,Tw(a),a;default:if(typeof h.status=="string")h.then(cn,cn);else{if(a=ht,a!==null&&100<a.shellSuspendCounter)throw Error(s(482));a=h,a.status="pending",a.then(function(p){if(h.status==="pending"){var O=h;O.status="fulfilled",O.value=p}},function(p){if(h.status==="pending"){var O=h;O.status="rejected",O.reason=p}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,Tw(a),a}throw ua=h,xl}}function ca(a){try{var h=a._init;return h(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(ua=f,xl):f}}var ua=null;function kw(){if(ua===null)throw Error(s(459));var a=ua;return ua=null,a}function Tw(a){if(a===xl||a===nd)throw Error(s(483))}var wl=null,cc=0;function ad(a){var h=cc;return cc+=1,wl===null&&(wl=[]),Cw(wl,a,h)}function uc(a,h){h=h.props.ref,a.ref=h!==void 0?h:null}function ld(a,h){throw h.$$typeof===g?Error(s(525)):(a=Object.prototype.toString.call(h),Error(s(31,a==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":a)))}function Mw(a){function h(H,q){if(a){var K=H.deletions;K===null?(H.deletions=[q],H.flags|=16):K.push(q)}}function f(H,q){if(!a)return null;for(;q!==null;)h(H,q),q=q.sibling;return null}function p(H){for(var q=new Map;H!==null;)H.key!==null?q.set(H.key,H):q.set(H.index,H),H=H.sibling;return q}function O(H,q){return H=fn(H,q),H.index=0,H.sibling=null,H}function _(H,q,K){return H.index=K,a?(K=H.alternate,K!==null?(K=K.index,K<q?(H.flags|=67108866,q):K):(H.flags|=67108866,q)):(H.flags|=1048576,q)}function x(H){return a&&H.alternate===null&&(H.flags|=67108866),H}function A(H,q,K,oe){return q===null||q.tag!==6?(q=cO(K,H.mode,oe),q.return=H,q):(q=O(q,K),q.return=H,q)}function V(H,q,K,oe){var Ae=K.type;return Ae===b?re(H,q,K.props.children,oe,K.key):q!==null&&(q.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===$&&ca(Ae)===q.type)?(q=O(q,K.props),uc(q,K),q.return=H,q):(q=ed(K.type,K.key,K.props,null,H.mode,oe),uc(q,K),q.return=H,q)}function J(H,q,K,oe){return q===null||q.tag!==4||q.stateNode.containerInfo!==K.containerInfo||q.stateNode.implementation!==K.implementation?(q=uO(K,H.mode,oe),q.return=H,q):(q=O(q,K.children||[]),q.return=H,q)}function re(H,q,K,oe,Ae){return q===null||q.tag!==7?(q=na(K,H.mode,oe,Ae),q.return=H,q):(q=O(q,K),q.return=H,q)}function ae(H,q,K){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=cO(""+q,H.mode,K),q.return=H,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return K=ed(q.type,q.key,q.props,null,H.mode,K),uc(K,q),K.return=H,K;case y:return q=uO(q,H.mode,K),q.return=H,q;case $:return q=ca(q),ae(H,q,K)}if(I(q)||R(q))return q=na(q,H.mode,K,null),q.return=H,q;if(typeof q.then=="function")return ae(H,ad(q),K);if(q.$$typeof===M)return ae(H,sd(H,q),K);ld(H,q)}return null}function ee(H,q,K,oe){var Ae=q!==null?q.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Ae!==null?null:A(H,q,""+K,oe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case v:return K.key===Ae?V(H,q,K,oe):null;case y:return K.key===Ae?J(H,q,K,oe):null;case $:return K=ca(K),ee(H,q,K,oe)}if(I(K)||R(K))return Ae!==null?null:re(H,q,K,oe,null);if(typeof K.then=="function")return ee(H,q,ad(K),oe);if(K.$$typeof===M)return ee(H,q,sd(H,K),oe);ld(H,K)}return null}function te(H,q,K,oe,Ae){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return H=H.get(K)||null,A(q,H,""+oe,Ae);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return H=H.get(oe.key===null?K:oe.key)||null,V(q,H,oe,Ae);case y:return H=H.get(oe.key===null?K:oe.key)||null,J(q,H,oe,Ae);case $:return oe=ca(oe),te(H,q,K,oe,Ae)}if(I(oe)||R(oe))return H=H.get(K)||null,re(q,H,oe,Ae,null);if(typeof oe.then=="function")return te(H,q,K,ad(oe),Ae);if(oe.$$typeof===M)return te(H,q,K,sd(q,oe),Ae);ld(q,oe)}return null}function be(H,q,K,oe){for(var Ae=null,Fe=null,Ce=q,De=q=0,qe=null;Ce!==null&&De<K.length;De++){Ce.index>De?(qe=Ce,Ce=null):qe=Ce.sibling;var Ge=ee(H,Ce,K[De],oe);if(Ge===null){Ce===null&&(Ce=qe);break}a&&Ce&&Ge.alternate===null&&h(H,Ce),q=_(Ge,q,De),Fe===null?Ae=Ge:Fe.sibling=Ge,Fe=Ge,Ce=qe}if(De===K.length)return f(H,Ce),Ue&&dn(H,De),Ae;if(Ce===null){for(;De<K.length;De++)Ce=ae(H,K[De],oe),Ce!==null&&(q=_(Ce,q,De),Fe===null?Ae=Ce:Fe.sibling=Ce,Fe=Ce);return Ue&&dn(H,De),Ae}for(Ce=p(Ce);De<K.length;De++)qe=te(Ce,H,De,K[De],oe),qe!==null&&(a&&qe.alternate!==null&&Ce.delete(qe.key===null?De:qe.key),q=_(qe,q,De),Fe===null?Ae=qe:Fe.sibling=qe,Fe=qe);return a&&Ce.forEach(function(yo){return h(H,yo)}),Ue&&dn(H,De),Ae}function Ee(H,q,K,oe){if(K==null)throw Error(s(151));for(var Ae=null,Fe=null,Ce=q,De=q=0,qe=null,Ge=K.next();Ce!==null&&!Ge.done;De++,Ge=K.next()){Ce.index>De?(qe=Ce,Ce=null):qe=Ce.sibling;var yo=ee(H,Ce,Ge.value,oe);if(yo===null){Ce===null&&(Ce=qe);break}a&&Ce&&yo.alternate===null&&h(H,Ce),q=_(yo,q,De),Fe===null?Ae=yo:Fe.sibling=yo,Fe=yo,Ce=qe}if(Ge.done)return f(H,Ce),Ue&&dn(H,De),Ae;if(Ce===null){for(;!Ge.done;De++,Ge=K.next())Ge=ae(H,Ge.value,oe),Ge!==null&&(q=_(Ge,q,De),Fe===null?Ae=Ge:Fe.sibling=Ge,Fe=Ge);return Ue&&dn(H,De),Ae}for(Ce=p(Ce);!Ge.done;De++,Ge=K.next())Ge=te(Ce,H,De,Ge.value,oe),Ge!==null&&(a&&Ge.alternate!==null&&Ce.delete(Ge.key===null?De:Ge.key),q=_(Ge,q,De),Fe===null?Ae=Ge:Fe.sibling=Ge,Fe=Ge);return a&&Ce.forEach(function(jz){return h(H,jz)}),Ue&&dn(H,De),Ae}function ot(H,q,K,oe){if(typeof K=="object"&&K!==null&&K.type===b&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case v:e:{for(var Ae=K.key;q!==null;){if(q.key===Ae){if(Ae=K.type,Ae===b){if(q.tag===7){f(H,q.sibling),oe=O(q,K.props.children),oe.return=H,H=oe;break e}}else if(q.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===$&&ca(Ae)===q.type){f(H,q.sibling),oe=O(q,K.props),uc(oe,K),oe.return=H,H=oe;break e}f(H,q);break}else h(H,q);q=q.sibling}K.type===b?(oe=na(K.props.children,H.mode,oe,K.key),oe.return=H,H=oe):(oe=ed(K.type,K.key,K.props,null,H.mode,oe),uc(oe,K),oe.return=H,H=oe)}return x(H);case y:e:{for(Ae=K.key;q!==null;){if(q.key===Ae)if(q.tag===4&&q.stateNode.containerInfo===K.containerInfo&&q.stateNode.implementation===K.implementation){f(H,q.sibling),oe=O(q,K.children||[]),oe.return=H,H=oe;break e}else{f(H,q);break}else h(H,q);q=q.sibling}oe=uO(K,H.mode,oe),oe.return=H,H=oe}return x(H);case $:return K=ca(K),ot(H,q,K,oe)}if(I(K))return be(H,q,K,oe);if(R(K)){if(Ae=R(K),typeof Ae!="function")throw Error(s(150));return K=Ae.call(K),Ee(H,q,K,oe)}if(typeof K.then=="function")return ot(H,q,ad(K),oe);if(K.$$typeof===M)return ot(H,q,sd(H,K),oe);ld(H,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,q!==null&&q.tag===6?(f(H,q.sibling),oe=O(q,K),oe.return=H,H=oe):(f(H,q),oe=cO(K,H.mode,oe),oe.return=H,H=oe),x(H)):f(H,q)}return function(H,q,K,oe){try{cc=0;var Ae=ot(H,q,K,oe);return wl=null,Ae}catch(Ce){if(Ce===xl||Ce===nd)throw Ce;var Fe=xs(29,Ce,null,H.mode);return Fe.lanes=oe,Fe.return=H,Fe}finally{}}}var fa=Mw(!0),Aw=Mw(!1),io=!1;function xO(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wO(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 so(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ro(a,h,f){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(Ke&2)!==0){var O=p.pending;return O===null?h.next=h:(h.next=O.next,O.next=h),p.pending=h,h=Jf(a),fw(a,null,f),h}return Kf(a,p,h,f),Jf(a)}function fc(a,h,f){if(h=h.updateQueue,h!==null&&(h=h.shared,(f&4194048)!==0)){var p=h.lanes;p&=a.pendingLanes,f|=p,h.lanes=f,yx(a,f)}}function CO(a,h){var f=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var O=null,_=null;if(f=f.firstBaseUpdate,f!==null){do{var x={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};_===null?O=_=x:_=_.next=x,f=f.next}while(f!==null);_===null?O=_=h:_=_.next=h}else O=_=h;f={baseState:p.baseState,firstBaseUpdate:O,lastBaseUpdate:_,shared:p.shared,callbacks:p.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=h:a.next=h,f.lastBaseUpdate=h}var kO=!1;function dc(){if(kO){var a=Sl;if(a!==null)throw a}}function pc(a,h,f,p){kO=!1;var O=a.updateQueue;io=!1;var _=O.firstBaseUpdate,x=O.lastBaseUpdate,A=O.shared.pending;if(A!==null){O.shared.pending=null;var V=A,J=V.next;V.next=null,x===null?_=J:x.next=J,x=V;var re=a.alternate;re!==null&&(re=re.updateQueue,A=re.lastBaseUpdate,A!==x&&(A===null?re.firstBaseUpdate=J:A.next=J,re.lastBaseUpdate=V))}if(_!==null){var ae=O.baseState;x=0,re=J=V=null,A=_;do{var ee=A.lane&-536870913,te=ee!==A.lane;if(te?(Ie&ee)===ee:(p&ee)===ee){ee!==0&&ee===bl&&(kO=!0),re!==null&&(re=re.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var be=a,Ee=A;ee=h;var ot=f;switch(Ee.tag){case 1:if(be=Ee.payload,typeof be=="function"){ae=be.call(ot,ae,ee);break e}ae=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Ee.payload,ee=typeof be=="function"?be.call(ot,ae,ee):be,ee==null)break e;ae=m({},ae,ee);break e;case 2:io=!0}}ee=A.callback,ee!==null&&(a.flags|=64,te&&(a.flags|=8192),te=O.callbacks,te===null?O.callbacks=[ee]:te.push(ee))}else te={lane:ee,tag:A.tag,payload:A.payload,callback:A.callback,next:null},re===null?(J=re=te,V=ae):re=re.next=te,x|=ee;if(A=A.next,A===null){if(A=O.shared.pending,A===null)break;te=A,A=te.next,te.next=null,O.lastBaseUpdate=te,O.shared.pending=null}}while(!0);re===null&&(V=ae),O.baseState=V,O.firstBaseUpdate=J,O.lastBaseUpdate=re,_===null&&(O.shared.lanes=0),ho|=x,a.lanes=x,a.memoizedState=ae}}function Ew(a,h){if(typeof a!="function")throw Error(s(191,a));a.call(h)}function Pw(a,h){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)Ew(f[a],h)}var Cl=N(null),hd=N(0);function Rw(a,h){a=wn,se(hd,a),se(Cl,h),wn=a|h.baseLanes}function TO(){se(hd,wn),se(Cl,Cl.current)}function MO(){wn=hd.current,G(Cl),G(hd)}var ws=N(null),Ws=null;function no(a){var h=a.alternate;se($t,$t.current&1),se(ws,a),Ws===null&&(h===null||Cl.current!==null||h.memoizedState!==null)&&(Ws=a)}function AO(a){se($t,$t.current),se(ws,a),Ws===null&&(Ws=a)}function Qw(a){a.tag===22?(se($t,$t.current),se(ws,a),Ws===null&&(Ws=a)):oo()}function oo(){se($t,$t.current),se(ws,ws.current)}function Cs(a){G(ws),Ws===a&&(Ws=null),G($t)}var $t=N(0);function cd(a){for(var h=a;h!==null;){if(h.tag===13){var f=h.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||$0(f)||B0(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 gn=0,Be=null,rt=null,Xt=null,ud=!1,kl=!1,da=!1,fd=0,mc=0,Tl=null,E6=0;function Tt(){throw Error(s(321))}function EO(a,h){if(h===null)return!1;for(var f=0;f<h.length&&f<a.length;f++)if(!Ss(a[f],h[f]))return!1;return!0}function PO(a,h,f,p,O,_){return gn=_,Be=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,L.H=a===null||a.memoizedState===null?gC:WO,da=!1,_=f(p,O),da=!1,kl&&(_=$w(h,f,p,O)),Lw(a),_}function Lw(a){L.H=vc;var h=rt!==null&&rt.next!==null;if(gn=0,Xt=rt=Be=null,ud=!1,mc=0,Tl=null,h)throw Error(s(300));a===null||Vt||(a=a.dependencies,a!==null&&id(a)&&(Vt=!0))}function $w(a,h,f,p){Be=a;var O=0;do{if(kl&&(Tl=null),mc=0,kl=!1,25<=O)throw Error(s(301));if(O+=1,Xt=rt=null,a.updateQueue!=null){var _=a.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}L.H=OC,_=h(f,p)}while(kl);return _}function P6(){var a=L.H,h=a.useState()[0];return h=typeof h.then=="function"?gc(h):h,a=a.useState()[0],(rt!==null?rt.memoizedState:null)!==a&&(Be.flags|=1024),h}function RO(){var a=fd!==0;return fd=0,a}function QO(a,h,f){h.updateQueue=a.updateQueue,h.flags&=-2053,a.lanes&=~f}function LO(a){if(ud){for(a=a.memoizedState;a!==null;){var h=a.queue;h!==null&&(h.pending=null),a=a.next}ud=!1}gn=0,Xt=rt=Be=null,kl=!1,mc=fd=0,Tl=null}function Ui(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Be.memoizedState=Xt=a:Xt=Xt.next=a,Xt}function Bt(){if(rt===null){var a=Be.alternate;a=a!==null?a.memoizedState:null}else a=rt.next;var h=Xt===null?Be.memoizedState:Xt.next;if(h!==null)Xt=h,rt=a;else{if(a===null)throw Be.alternate===null?Error(s(467)):Error(s(310));rt=a,a={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Xt===null?Be.memoizedState=Xt=a:Xt=Xt.next=a}return Xt}function dd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gc(a){var h=mc;return mc+=1,Tl===null&&(Tl=[]),a=Cw(Tl,a,h),h=Be,(Xt===null?h.memoizedState:Xt.next)===null&&(h=h.alternate,L.H=h===null||h.memoizedState===null?gC:WO),a}function pd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return gc(a);if(a.$$typeof===M)return ki(a)}throw Error(s(438,String(a)))}function $O(a){var h=null,f=Be.updateQueue;if(f!==null&&(h=f.memoCache),h==null){var p=Be.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(h={data:p.data.map(function(O){return O.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),f===null&&(f=dd(),Be.updateQueue=f),f.memoCache=h,f=h.data[h.index],f===void 0)for(f=h.data[h.index]=Array(a),p=0;p<a;p++)f[p]=ie;return h.index++,f}function On(a,h){return typeof h=="function"?h(a):h}function md(a){var h=Bt();return BO(h,rt,a)}function BO(a,h,f){var p=a.queue;if(p===null)throw Error(s(311));p.lastRenderedReducer=f;var O=a.baseQueue,_=p.pending;if(_!==null){if(O!==null){var x=O.next;O.next=_.next,_.next=x}h.baseQueue=O=_,p.pending=null}if(_=a.baseState,O===null)a.memoizedState=_;else{h=O.next;var A=x=null,V=null,J=h,re=!1;do{var ae=J.lane&-536870913;if(ae!==J.lane?(Ie&ae)===ae:(gn&ae)===ae){var ee=J.revertLane;if(ee===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ae===bl&&(re=!0);else if((gn&ee)===ee){J=J.next,ee===bl&&(re=!0);continue}else ae={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},V===null?(A=V=ae,x=_):V=V.next=ae,Be.lanes|=ee,ho|=ee;ae=J.action,da&&f(_,ae),_=J.hasEagerState?J.eagerState:f(_,ae)}else ee={lane:ae,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},V===null?(A=V=ee,x=_):V=V.next=ee,Be.lanes|=ae,ho|=ae;J=J.next}while(J!==null&&J!==h);if(V===null?x=_:V.next=A,!Ss(_,a.memoizedState)&&(Vt=!0,re&&(f=Sl,f!==null)))throw f;a.memoizedState=_,a.baseState=x,a.baseQueue=V,p.lastRenderedState=_}return O===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function DO(a){var h=Bt(),f=h.queue;if(f===null)throw Error(s(311));f.lastRenderedReducer=a;var p=f.dispatch,O=f.pending,_=h.memoizedState;if(O!==null){f.pending=null;var x=O=O.next;do _=a(_,x.action),x=x.next;while(x!==O);Ss(_,h.memoizedState)||(Vt=!0),h.memoizedState=_,h.baseQueue===null&&(h.baseState=_),f.lastRenderedState=_}return[_,p]}function Bw(a,h,f){var p=Be,O=Bt(),_=Ue;if(_){if(f===void 0)throw Error(s(407));f=f()}else f=h();var x=!Ss((rt||O).memoizedState,f);if(x&&(O.memoizedState=f,Vt=!0),O=O.queue,jO(Nw.bind(null,p,O,a),[a]),O.getSnapshot!==h||x||Xt!==null&&Xt.memoizedState.tag&1){if(p.flags|=2048,Ml(9,{destroy:void 0},zw.bind(null,p,O,f,h),null),ht===null)throw Error(s(349));_||(gn&127)!==0||Dw(p,h,f)}return f}function Dw(a,h,f){a.flags|=16384,a={getSnapshot:h,value:f},h=Be.updateQueue,h===null?(h=dd(),Be.updateQueue=h,h.stores=[a]):(f=h.stores,f===null?h.stores=[a]:f.push(a))}function zw(a,h,f,p){h.value=f,h.getSnapshot=p,jw(h)&&Xw(a)}function Nw(a,h,f){return f(function(){jw(h)&&Xw(a)})}function jw(a){var h=a.getSnapshot;a=a.value;try{var f=h();return!Ss(a,f)}catch{return!0}}function Xw(a){var h=ra(a,2);h!==null&&cs(h,a,2)}function zO(a){var h=Ui();if(typeof a=="function"){var f=a;if(a=f(),da){Hn(!0);try{f()}finally{Hn(!1)}}}return h.memoizedState=h.baseState=a,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:a},h}function Vw(a,h,f,p){return a.baseState=f,BO(a,rt,typeof p=="function"?p:On)}function R6(a,h,f,p,O){if(vd(a))throw Error(s(485));if(a=h.action,a!==null){var _={payload:O,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){_.listeners.push(x)}};L.T!==null?f(!0):_.isTransition=!1,p(_),f=h.pending,f===null?(_.next=h.pending=_,Zw(h,_)):(_.next=f.next,h.pending=f.next=_)}}function Zw(a,h){var f=h.action,p=h.payload,O=a.state;if(h.isTransition){var _=L.T,x={};L.T=x;try{var A=f(O,p),V=L.S;V!==null&&V(x,A),Iw(a,h,A)}catch(J){NO(a,h,J)}finally{_!==null&&x.types!==null&&(_.types=x.types),L.T=_}}else try{_=f(O,p),Iw(a,h,_)}catch(J){NO(a,h,J)}}function Iw(a,h,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){qw(a,h,p)},function(p){return NO(a,h,p)}):qw(a,h,f)}function qw(a,h,f){h.status="fulfilled",h.value=f,Ww(h),a.state=f,h=a.pending,h!==null&&(f=h.next,f===h?a.pending=null:(f=f.next,h.next=f,Zw(a,f)))}function NO(a,h,f){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do h.status="rejected",h.reason=f,Ww(h),h=h.next;while(h!==p)}a.action=null}function Ww(a){a=a.listeners;for(var h=0;h<a.length;h++)(0,a[h])()}function Uw(a,h){return h}function Yw(a,h){if(Ue){var f=ht.formState;if(f!==null){e:{var p=Be;if(Ue){if(gt){t:{for(var O=gt,_=qs;O.nodeType!==8;){if(!_){O=null;break t}if(O=Us(O.nextSibling),O===null){O=null;break t}}_=O.data,O=_==="F!"||_==="F"?O:null}if(O){gt=Us(O.nextSibling),p=O.data==="F!";break e}}eo(p)}p=!1}p&&(h=f[0])}}return f=Ui(),f.memoizedState=f.baseState=h,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uw,lastRenderedState:h},f.queue=p,f=dC.bind(null,Be,p),p.dispatch=f,p=zO(!1),_=qO.bind(null,Be,!1,p.queue),p=Ui(),O={state:h,dispatch:null,action:a,pending:null},p.queue=O,f=R6.bind(null,Be,O,_,f),O.dispatch=f,p.memoizedState=a,[h,f,!1]}function Hw(a){var h=Bt();return Fw(h,rt,a)}function Fw(a,h,f){if(h=BO(a,h,Uw)[0],a=md(On)[0],typeof h=="object"&&h!==null&&typeof h.then=="function")try{var p=gc(h)}catch(x){throw x===xl?nd:x}else p=h;h=Bt();var O=h.queue,_=O.dispatch;return f!==h.memoizedState&&(Be.flags|=2048,Ml(9,{destroy:void 0},Q6.bind(null,O,f),null)),[p,_,a]}function Q6(a,h){a.action=h}function Gw(a){var h=Bt(),f=rt;if(f!==null)return Fw(h,f,a);Bt(),h=h.memoizedState,f=Bt();var p=f.queue.dispatch;return f.memoizedState=a,[h,p,!1]}function Ml(a,h,f,p){return a={tag:a,create:f,deps:p,inst:h,next:null},h=Be.updateQueue,h===null&&(h=dd(),Be.updateQueue=h),f=h.lastEffect,f===null?h.lastEffect=a.next=a:(p=f.next,f.next=a,a.next=p,h.lastEffect=a),a}function Kw(){return Bt().memoizedState}function gd(a,h,f,p){var O=Ui();Be.flags|=a,O.memoizedState=Ml(1|h,{destroy:void 0},f,p===void 0?null:p)}function Od(a,h,f,p){var O=Bt();p=p===void 0?null:p;var _=O.memoizedState.inst;rt!==null&&p!==null&&EO(p,rt.memoizedState.deps)?O.memoizedState=Ml(h,_,f,p):(Be.flags|=a,O.memoizedState=Ml(1|h,_,f,p))}function Jw(a,h){gd(8390656,8,a,h)}function jO(a,h){Od(2048,8,a,h)}function L6(a){Be.flags|=4;var h=Be.updateQueue;if(h===null)h=dd(),Be.updateQueue=h,h.events=[a];else{var f=h.events;f===null?h.events=[a]:f.push(a)}}function eC(a){var h=Bt().memoizedState;return L6({ref:h,nextImpl:a}),function(){if((Ke&2)!==0)throw Error(s(440));return h.impl.apply(void 0,arguments)}}function tC(a,h){return Od(4,2,a,h)}function iC(a,h){return Od(4,4,a,h)}function sC(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 rC(a,h,f){f=f!=null?f.concat([a]):null,Od(4,4,sC.bind(null,h,a),f)}function XO(){}function nC(a,h){var f=Bt();h=h===void 0?null:h;var p=f.memoizedState;return h!==null&&EO(h,p[1])?p[0]:(f.memoizedState=[a,h],a)}function oC(a,h){var f=Bt();h=h===void 0?null:h;var p=f.memoizedState;if(h!==null&&EO(h,p[1]))return p[0];if(p=a(),da){Hn(!0);try{a()}finally{Hn(!1)}}return f.memoizedState=[p,h],p}function VO(a,h,f){return f===void 0||(gn&1073741824)!==0&&(Ie&261930)===0?a.memoizedState=h:(a.memoizedState=f,a=ak(),Be.lanes|=a,ho|=a,f)}function aC(a,h,f,p){return Ss(f,h)?f:Cl.current!==null?(a=VO(a,f,p),Ss(a,h)||(Vt=!0),a):(gn&42)===0||(gn&1073741824)!==0&&(Ie&261930)===0?(Vt=!0,a.memoizedState=f):(a=ak(),Be.lanes|=a,ho|=a,h)}function lC(a,h,f,p,O){var _=j.p;j.p=_!==0&&8>_?_:8;var x=L.T,A={};L.T=A,qO(a,!1,h,f);try{var V=O(),J=L.S;if(J!==null&&J(A,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var re=A6(V,p);Oc(a,h,re,Ms(a))}else Oc(a,h,p,Ms(a))}catch(ae){Oc(a,h,{then:function(){},status:"rejected",reason:ae},Ms())}finally{j.p=_,x!==null&&A.types!==null&&(x.types=A.types),L.T=x}}function $6(){}function ZO(a,h,f,p){if(a.tag!==5)throw Error(s(476));var O=hC(a).queue;lC(a,O,h,U,f===null?$6:function(){return cC(a),f(p)})}function hC(a){var h=a.memoizedState;if(h!==null)return h;h={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:U},next:null};var f={};return h.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:f},next:null},a.memoizedState=h,a=a.alternate,a!==null&&(a.memoizedState=h),h}function cC(a){var h=hC(a);h.next===null&&(h=a.alternate.memoizedState),Oc(a,h.next.queue,{},Ms())}function IO(){return ki(Lc)}function uC(){return Bt().memoizedState}function fC(){return Bt().memoizedState}function B6(a){for(var h=a.return;h!==null;){switch(h.tag){case 24:case 3:var f=Ms();a=so(f);var p=ro(h,a,f);p!==null&&(cs(p,h,f),fc(p,h,f)),h={cache:_O()},a.payload=h;return}h=h.return}}function D6(a,h,f){var p=Ms();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},vd(a)?pC(h,f):(f=lO(a,h,f,p),f!==null&&(cs(f,a,p),mC(f,h,p)))}function dC(a,h,f){var p=Ms();Oc(a,h,f,p)}function Oc(a,h,f,p){var O={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(vd(a))pC(h,O);else{var _=a.alternate;if(a.lanes===0&&(_===null||_.lanes===0)&&(_=h.lastRenderedReducer,_!==null))try{var x=h.lastRenderedState,A=_(x,f);if(O.hasEagerState=!0,O.eagerState=A,Ss(A,x))return Kf(a,h,O,0),ht===null&&Gf(),!1}catch{}finally{}if(f=lO(a,h,O,p),f!==null)return cs(f,a,p),mC(f,h,p),!0}return!1}function qO(a,h,f,p){if(p={lane:2,revertLane:x0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},vd(a)){if(h)throw Error(s(479))}else h=lO(a,f,p,2),h!==null&&cs(h,a,2)}function vd(a){var h=a.alternate;return a===Be||h!==null&&h===Be}function pC(a,h){kl=ud=!0;var f=a.pending;f===null?h.next=h:(h.next=f.next,f.next=h),a.pending=h}function mC(a,h,f){if((f&4194048)!==0){var p=h.lanes;p&=a.pendingLanes,f|=p,h.lanes=f,yx(a,f)}}var vc={readContext:ki,use:pd,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};vc.useEffectEvent=Tt;var gC={readContext:ki,use:pd,useCallback:function(a,h){return Ui().memoizedState=[a,h===void 0?null:h],a},useContext:ki,useEffect:Jw,useImperativeHandle:function(a,h,f){f=f!=null?f.concat([a]):null,gd(4194308,4,sC.bind(null,h,a),f)},useLayoutEffect:function(a,h){return gd(4194308,4,a,h)},useInsertionEffect:function(a,h){gd(4,2,a,h)},useMemo:function(a,h){var f=Ui();h=h===void 0?null:h;var p=a();if(da){Hn(!0);try{a()}finally{Hn(!1)}}return f.memoizedState=[p,h],p},useReducer:function(a,h,f){var p=Ui();if(f!==void 0){var O=f(h);if(da){Hn(!0);try{f(h)}finally{Hn(!1)}}}else O=h;return p.memoizedState=p.baseState=O,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:O},p.queue=a,a=a.dispatch=D6.bind(null,Be,a),[p.memoizedState,a]},useRef:function(a){var h=Ui();return a={current:a},h.memoizedState=a},useState:function(a){a=zO(a);var h=a.queue,f=dC.bind(null,Be,h);return h.dispatch=f,[a.memoizedState,f]},useDebugValue:XO,useDeferredValue:function(a,h){var f=Ui();return VO(f,a,h)},useTransition:function(){var a=zO(!1);return a=lC.bind(null,Be,a.queue,!0,!1),Ui().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,h,f){var p=Be,O=Ui();if(Ue){if(f===void 0)throw Error(s(407));f=f()}else{if(f=h(),ht===null)throw Error(s(349));(Ie&127)!==0||Dw(p,h,f)}O.memoizedState=f;var _={value:f,getSnapshot:h};return O.queue=_,Jw(Nw.bind(null,p,_,a),[a]),p.flags|=2048,Ml(9,{destroy:void 0},zw.bind(null,p,_,f,h),null),f},useId:function(){var a=Ui(),h=ht.identifierPrefix;if(Ue){var f=Er,p=Ar;f=(p&~(1<<32-bs(p)-1)).toString(32)+f,h="_"+h+"R_"+f,f=fd++,0<f&&(h+="H"+f.toString(32)),h+="_"}else f=E6++,h="_"+h+"r_"+f.toString(32)+"_";return a.memoizedState=h},useHostTransitionStatus:IO,useFormState:Yw,useActionState:Yw,useOptimistic:function(a){var h=Ui();h.memoizedState=h.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=f,h=qO.bind(null,Be,!0,f),f.dispatch=h,[a,h]},useMemoCache:$O,useCacheRefresh:function(){return Ui().memoizedState=B6.bind(null,Be)},useEffectEvent:function(a){var h=Ui(),f={impl:a};return h.memoizedState=f,function(){if((Ke&2)!==0)throw Error(s(440));return f.impl.apply(void 0,arguments)}}},WO={readContext:ki,use:pd,useCallback:nC,useContext:ki,useEffect:jO,useImperativeHandle:rC,useInsertionEffect:tC,useLayoutEffect:iC,useMemo:oC,useReducer:md,useRef:Kw,useState:function(){return md(On)},useDebugValue:XO,useDeferredValue:function(a,h){var f=Bt();return aC(f,rt.memoizedState,a,h)},useTransition:function(){var a=md(On)[0],h=Bt().memoizedState;return[typeof a=="boolean"?a:gc(a),h]},useSyncExternalStore:Bw,useId:uC,useHostTransitionStatus:IO,useFormState:Hw,useActionState:Hw,useOptimistic:function(a,h){var f=Bt();return Vw(f,rt,a,h)},useMemoCache:$O,useCacheRefresh:fC};WO.useEffectEvent=eC;var OC={readContext:ki,use:pd,useCallback:nC,useContext:ki,useEffect:jO,useImperativeHandle:rC,useInsertionEffect:tC,useLayoutEffect:iC,useMemo:oC,useReducer:DO,useRef:Kw,useState:function(){return DO(On)},useDebugValue:XO,useDeferredValue:function(a,h){var f=Bt();return rt===null?VO(f,a,h):aC(f,rt.memoizedState,a,h)},useTransition:function(){var a=DO(On)[0],h=Bt().memoizedState;return[typeof a=="boolean"?a:gc(a),h]},useSyncExternalStore:Bw,useId:uC,useHostTransitionStatus:IO,useFormState:Gw,useActionState:Gw,useOptimistic:function(a,h){var f=Bt();return rt!==null?Vw(f,rt,a,h):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:$O,useCacheRefresh:fC};OC.useEffectEvent=eC;function UO(a,h,f,p){h=a.memoizedState,f=f(p,h),f=f==null?h:m({},h,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var YO={enqueueSetState:function(a,h,f){a=a._reactInternals;var p=Ms(),O=so(p);O.payload=h,f!=null&&(O.callback=f),h=ro(a,O,p),h!==null&&(cs(h,a,p),fc(h,a,p))},enqueueReplaceState:function(a,h,f){a=a._reactInternals;var p=Ms(),O=so(p);O.tag=1,O.payload=h,f!=null&&(O.callback=f),h=ro(a,O,p),h!==null&&(cs(h,a,p),fc(h,a,p))},enqueueForceUpdate:function(a,h){a=a._reactInternals;var f=Ms(),p=so(f);p.tag=2,h!=null&&(p.callback=h),h=ro(a,p,f),h!==null&&(cs(h,a,f),fc(h,a,f))}};function vC(a,h,f,p,O,_,x){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,_,x):h.prototype&&h.prototype.isPureReactComponent?!rc(f,p)||!rc(O,_):!0}function _C(a,h,f,p){a=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(f,p),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(f,p),h.state!==a&&YO.enqueueReplaceState(h,h.state,null)}function pa(a,h){var f=h;if("ref"in h){f={};for(var p in h)p!=="ref"&&(f[p]=h[p])}if(a=a.defaultProps){f===h&&(f=m({},f));for(var O in a)f[O]===void 0&&(f[O]=a[O])}return f}function yC(a){Ff(a)}function bC(a){console.error(a)}function SC(a){Ff(a)}function _d(a,h){try{var f=a.onUncaughtError;f(h.value,{componentStack:h.stack})}catch(p){setTimeout(function(){throw p})}}function xC(a,h,f){try{var p=a.onCaughtError;p(f.value,{componentStack:f.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(O){setTimeout(function(){throw O})}}function HO(a,h,f){return f=so(f),f.tag=3,f.payload={element:null},f.callback=function(){_d(a,h)},f}function wC(a){return a=so(a),a.tag=3,a}function CC(a,h,f,p){var O=f.type.getDerivedStateFromError;if(typeof O=="function"){var _=p.value;a.payload=function(){return O(_)},a.callback=function(){xC(h,f,p)}}var x=f.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(a.callback=function(){xC(h,f,p),typeof O!="function"&&(co===null?co=new Set([this]):co.add(this));var A=p.stack;this.componentDidCatch(p.value,{componentStack:A!==null?A:""})})}function z6(a,h,f,p,O){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(h=f.alternate,h!==null&&yl(h,f,O,!0),f=ws.current,f!==null){switch(f.tag){case 31:case 13:return Ws===null?Pd():f.alternate===null&&Mt===0&&(Mt=3),f.flags&=-257,f.flags|=65536,f.lanes=O,p===od?f.flags|=16384:(h=f.updateQueue,h===null?f.updateQueue=new Set([p]):h.add(p),y0(a,p,O)),!1;case 22:return f.flags|=65536,p===od?f.flags|=16384:(h=f.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([p])},f.updateQueue=h):(f=h.retryQueue,f===null?h.retryQueue=new Set([p]):f.add(p)),y0(a,p,O)),!1}throw Error(s(435,f.tag))}return y0(a,p,O),Pd(),!1}if(Ue)return h=ws.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=O,p!==pO&&(a=Error(s(422),{cause:p}),ac(Vs(a,f)))):(p!==pO&&(h=Error(s(423),{cause:p}),ac(Vs(h,f))),a=a.current.alternate,a.flags|=65536,O&=-O,a.lanes|=O,p=Vs(p,f),O=HO(a.stateNode,p,O),CO(a,O),Mt!==4&&(Mt=2)),!1;var _=Error(s(520),{cause:p});if(_=Vs(_,f),kc===null?kc=[_]:kc.push(_),Mt!==4&&(Mt=2),h===null)return!0;p=Vs(p,f),f=h;do{switch(f.tag){case 3:return f.flags|=65536,a=O&-O,f.lanes|=a,a=HO(f.stateNode,p,a),CO(f,a),!1;case 1:if(h=f.type,_=f.stateNode,(f.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(co===null||!co.has(_))))return f.flags|=65536,O&=-O,f.lanes|=O,O=wC(O),CC(O,a,f,p),CO(f,O),!1}f=f.return}while(f!==null);return!1}var FO=Error(s(461)),Vt=!1;function Ti(a,h,f,p){h.child=a===null?Aw(h,null,f,p):fa(h,a.child,f,p)}function kC(a,h,f,p,O){f=f.render;var _=h.ref;if("ref"in p){var x={};for(var A in p)A!=="ref"&&(x[A]=p[A])}else x=p;return la(h),p=PO(a,h,f,x,_,O),A=RO(),a!==null&&!Vt?(QO(a,h,O),vn(a,h,O)):(Ue&&A&&fO(h),h.flags|=1,Ti(a,h,p,O),h.child)}function TC(a,h,f,p,O){if(a===null){var _=f.type;return typeof _=="function"&&!hO(_)&&_.defaultProps===void 0&&f.compare===null?(h.tag=15,h.type=_,MC(a,h,_,p,O)):(a=ed(f.type,null,p,h,h.mode,O),a.ref=h.ref,a.return=h,h.child=a)}if(_=a.child,!r0(a,O)){var x=_.memoizedProps;if(f=f.compare,f=f!==null?f:rc,f(x,p)&&a.ref===h.ref)return vn(a,h,O)}return h.flags|=1,a=fn(_,p),a.ref=h.ref,a.return=h,h.child=a}function MC(a,h,f,p,O){if(a!==null){var _=a.memoizedProps;if(rc(_,p)&&a.ref===h.ref)if(Vt=!1,h.pendingProps=p=_,r0(a,O))(a.flags&131072)!==0&&(Vt=!0);else return h.lanes=a.lanes,vn(a,h,O)}return GO(a,h,f,p,O)}function AC(a,h,f,p){var O=p.children,_=a!==null?a.memoizedState:null;if(a===null&&h.stateNode===null&&(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((h.flags&128)!==0){if(_=_!==null?_.baseLanes|f:f,a!==null){for(p=h.child=a.child,O=0;p!==null;)O=O|p.lanes|p.childLanes,p=p.sibling;p=O&~_}else p=0,h.child=null;return EC(a,h,_,f,p)}if((f&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},a!==null&&rd(h,_!==null?_.cachePool:null),_!==null?Rw(h,_):TO(),Qw(h);else return p=h.lanes=536870912,EC(a,h,_!==null?_.baseLanes|f:f,f,p)}else _!==null?(rd(h,_.cachePool),Rw(h,_),oo(),h.memoizedState=null):(a!==null&&rd(h,null),TO(),oo());return Ti(a,h,O,f),h.child}function _c(a,h){return a!==null&&a.tag===22||h.stateNode!==null||(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.sibling}function EC(a,h,f,p,O){var _=bO();return _=_===null?null:{parent:jt._currentValue,pool:_},h.memoizedState={baseLanes:f,cachePool:_},a!==null&&rd(h,null),TO(),Qw(h),a!==null&&yl(a,h,p,!0),h.childLanes=O,null}function yd(a,h){return h=Sd({mode:h.mode,children:h.children},a.mode),h.ref=a.ref,a.child=h,h.return=a,h}function PC(a,h,f){return fa(h,a.child,null,f),a=yd(h,h.pendingProps),a.flags|=2,Cs(h),h.memoizedState=null,a}function N6(a,h,f){var p=h.pendingProps,O=(h.flags&128)!==0;if(h.flags&=-129,a===null){if(Ue){if(p.mode==="hidden")return a=yd(h,p),h.lanes=536870912,_c(null,a);if(AO(h),(a=gt)?(a=Zk(a,qs),a=a!==null&&a.data==="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Kn!==null?{id:Ar,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},f=pw(a),f.return=h,h.child=f,Ci=h,gt=null)):a=null,a===null)throw eo(h);return h.lanes=536870912,null}return yd(h,p)}var _=a.memoizedState;if(_!==null){var x=_.dehydrated;if(AO(h),O)if(h.flags&256)h.flags&=-257,h=PC(a,h,f);else if(h.memoizedState!==null)h.child=a.child,h.flags|=128,h=null;else throw Error(s(558));else if(Vt||yl(a,h,f,!1),O=(f&a.childLanes)!==0,Vt||O){if(p=ht,p!==null&&(x=bx(p,f),x!==0&&x!==_.retryLane))throw _.retryLane=x,ra(a,x),cs(p,a,x),FO;Pd(),h=PC(a,h,f)}else a=_.treeContext,gt=Us(x.nextSibling),Ci=h,Ue=!0,Jn=null,qs=!1,a!==null&&Ow(h,a),h=yd(h,p),h.flags|=4096;return h}return a=fn(a.child,{mode:p.mode,children:p.children}),a.ref=h.ref,h.child=a,a.return=h,a}function bd(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(s(284));(a===null||a.ref!==f)&&(h.flags|=4194816)}}function GO(a,h,f,p,O){return la(h),f=PO(a,h,f,p,void 0,O),p=RO(),a!==null&&!Vt?(QO(a,h,O),vn(a,h,O)):(Ue&&p&&fO(h),h.flags|=1,Ti(a,h,f,O),h.child)}function RC(a,h,f,p,O,_){return la(h),h.updateQueue=null,f=$w(h,p,f,O),Lw(a),p=RO(),a!==null&&!Vt?(QO(a,h,_),vn(a,h,_)):(Ue&&p&&fO(h),h.flags|=1,Ti(a,h,f,_),h.child)}function QC(a,h,f,p,O){if(la(h),h.stateNode===null){var _=gl,x=f.contextType;typeof x=="object"&&x!==null&&(_=ki(x)),_=new f(p,_),h.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=YO,h.stateNode=_,_._reactInternals=h,_=h.stateNode,_.props=p,_.state=h.memoizedState,_.refs={},xO(h),x=f.contextType,_.context=typeof x=="object"&&x!==null?ki(x):gl,_.state=h.memoizedState,x=f.getDerivedStateFromProps,typeof x=="function"&&(UO(h,f,x,p),_.state=h.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(x=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),x!==_.state&&YO.enqueueReplaceState(_,_.state,null),pc(h,p,_,O),dc(),_.state=h.memoizedState),typeof _.componentDidMount=="function"&&(h.flags|=4194308),p=!0}else if(a===null){_=h.stateNode;var A=h.memoizedProps,V=pa(f,A);_.props=V;var J=_.context,re=f.contextType;x=gl,typeof re=="object"&&re!==null&&(x=ki(re));var ae=f.getDerivedStateFromProps;re=typeof ae=="function"||typeof _.getSnapshotBeforeUpdate=="function",A=h.pendingProps!==A,re||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(A||J!==x)&&_C(h,_,p,x),io=!1;var ee=h.memoizedState;_.state=ee,pc(h,p,_,O),dc(),J=h.memoizedState,A||ee!==J||io?(typeof ae=="function"&&(UO(h,f,ae,p),J=h.memoizedState),(V=io||vC(h,f,V,p,ee,J,x))?(re||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(h.flags|=4194308)):(typeof _.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=p,h.memoizedState=J),_.props=p,_.state=J,_.context=x,p=V):(typeof _.componentDidMount=="function"&&(h.flags|=4194308),p=!1)}else{_=h.stateNode,wO(a,h),x=h.memoizedProps,re=pa(f,x),_.props=re,ae=h.pendingProps,ee=_.context,J=f.contextType,V=gl,typeof J=="object"&&J!==null&&(V=ki(J)),A=f.getDerivedStateFromProps,(J=typeof A=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(x!==ae||ee!==V)&&_C(h,_,p,V),io=!1,ee=h.memoizedState,_.state=ee,pc(h,p,_,O),dc();var te=h.memoizedState;x!==ae||ee!==te||io||a!==null&&a.dependencies!==null&&id(a.dependencies)?(typeof A=="function"&&(UO(h,f,A,p),te=h.memoizedState),(re=io||vC(h,f,re,p,ee,te,V)||a!==null&&a.dependencies!==null&&id(a.dependencies))?(J||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(p,te,V),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(p,te,V)),typeof _.componentDidUpdate=="function"&&(h.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof _.componentDidUpdate!="function"||x===a.memoizedProps&&ee===a.memoizedState||(h.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||x===a.memoizedProps&&ee===a.memoizedState||(h.flags|=1024),h.memoizedProps=p,h.memoizedState=te),_.props=p,_.state=te,_.context=V,p=re):(typeof _.componentDidUpdate!="function"||x===a.memoizedProps&&ee===a.memoizedState||(h.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||x===a.memoizedProps&&ee===a.memoizedState||(h.flags|=1024),p=!1)}return _=p,bd(a,h),p=(h.flags&128)!==0,_||p?(_=h.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:_.render(),h.flags|=1,a!==null&&p?(h.child=fa(h,a.child,null,O),h.child=fa(h,null,f,O)):Ti(a,h,f,O),h.memoizedState=_.state,a=h.child):a=vn(a,h,O),a}function LC(a,h,f,p){return oa(),h.flags|=256,Ti(a,h,f,p),h.child}var KO={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function JO(a){return{baseLanes:a,cachePool:xw()}}function e0(a,h,f){return a=a!==null?a.childLanes&~f:0,h&&(a|=Ts),a}function $C(a,h,f){var p=h.pendingProps,O=!1,_=(h.flags&128)!==0,x;if((x=_)||(x=a!==null&&a.memoizedState===null?!1:($t.current&2)!==0),x&&(O=!0,h.flags&=-129),x=(h.flags&32)!==0,h.flags&=-33,a===null){if(Ue){if(O?no(h):oo(),(a=gt)?(a=Zk(a,qs),a=a!==null&&a.data!=="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Kn!==null?{id:Ar,overflow:Er}:null,retryLane:536870912,hydrationErrors:null},f=pw(a),f.return=h,h.child=f,Ci=h,gt=null)):a=null,a===null)throw eo(h);return B0(a)?h.lanes=32:h.lanes=536870912,null}var A=p.children;return p=p.fallback,O?(oo(),O=h.mode,A=Sd({mode:"hidden",children:A},O),p=na(p,O,f,null),A.return=h,p.return=h,A.sibling=p,h.child=A,p=h.child,p.memoizedState=JO(f),p.childLanes=e0(a,x,f),h.memoizedState=KO,_c(null,p)):(no(h),t0(h,A))}var V=a.memoizedState;if(V!==null&&(A=V.dehydrated,A!==null)){if(_)h.flags&256?(no(h),h.flags&=-257,h=i0(a,h,f)):h.memoizedState!==null?(oo(),h.child=a.child,h.flags|=128,h=null):(oo(),A=p.fallback,O=h.mode,p=Sd({mode:"visible",children:p.children},O),A=na(A,O,f,null),A.flags|=2,p.return=h,A.return=h,p.sibling=A,h.child=p,fa(h,a.child,null,f),p=h.child,p.memoizedState=JO(f),p.childLanes=e0(a,x,f),h.memoizedState=KO,h=_c(null,p));else if(no(h),B0(A)){if(x=A.nextSibling&&A.nextSibling.dataset,x)var J=x.dgst;x=J,p=Error(s(419)),p.stack="",p.digest=x,ac({value:p,source:null,stack:null}),h=i0(a,h,f)}else if(Vt||yl(a,h,f,!1),x=(f&a.childLanes)!==0,Vt||x){if(x=ht,x!==null&&(p=bx(x,f),p!==0&&p!==V.retryLane))throw V.retryLane=p,ra(a,p),cs(x,a,p),FO;$0(A)||Pd(),h=i0(a,h,f)}else $0(A)?(h.flags|=192,h.child=a.child,h=null):(a=V.treeContext,gt=Us(A.nextSibling),Ci=h,Ue=!0,Jn=null,qs=!1,a!==null&&Ow(h,a),h=t0(h,p.children),h.flags|=4096);return h}return O?(oo(),A=p.fallback,O=h.mode,V=a.child,J=V.sibling,p=fn(V,{mode:"hidden",children:p.children}),p.subtreeFlags=V.subtreeFlags&65011712,J!==null?A=fn(J,A):(A=na(A,O,f,null),A.flags|=2),A.return=h,p.return=h,p.sibling=A,h.child=p,_c(null,p),p=h.child,A=a.child.memoizedState,A===null?A=JO(f):(O=A.cachePool,O!==null?(V=jt._currentValue,O=O.parent!==V?{parent:V,pool:V}:O):O=xw(),A={baseLanes:A.baseLanes|f,cachePool:O}),p.memoizedState=A,p.childLanes=e0(a,x,f),h.memoizedState=KO,_c(a.child,p)):(no(h),f=a.child,a=f.sibling,f=fn(f,{mode:"visible",children:p.children}),f.return=h,f.sibling=null,a!==null&&(x=h.deletions,x===null?(h.deletions=[a],h.flags|=16):x.push(a)),h.child=f,h.memoizedState=null,f)}function t0(a,h){return h=Sd({mode:"visible",children:h},a.mode),h.return=a,a.child=h}function Sd(a,h){return a=xs(22,a,null,h),a.lanes=0,a}function i0(a,h,f){return fa(h,a.child,null,f),a=t0(h,h.pendingProps.children),a.flags|=2,h.memoizedState=null,a}function BC(a,h,f){a.lanes|=h;var p=a.alternate;p!==null&&(p.lanes|=h),OO(a.return,h,f)}function s0(a,h,f,p,O,_){var x=a.memoizedState;x===null?a.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:O,treeForkCount:_}:(x.isBackwards=h,x.rendering=null,x.renderingStartTime=0,x.last=p,x.tail=f,x.tailMode=O,x.treeForkCount=_)}function DC(a,h,f){var p=h.pendingProps,O=p.revealOrder,_=p.tail;p=p.children;var x=$t.current,A=(x&2)!==0;if(A?(x=x&1|2,h.flags|=128):x&=1,se($t,x),Ti(a,h,p,f),p=Ue?oc:0,!A&&a!==null&&(a.flags&128)!==0)e:for(a=h.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&BC(a,f,h);else if(a.tag===19)BC(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(O){case"forwards":for(f=h.child,O=null;f!==null;)a=f.alternate,a!==null&&cd(a)===null&&(O=f),f=f.sibling;f=O,f===null?(O=h.child,h.child=null):(O=f.sibling,f.sibling=null),s0(h,!1,O,f,_,p);break;case"backwards":case"unstable_legacy-backwards":for(f=null,O=h.child,h.child=null;O!==null;){if(a=O.alternate,a!==null&&cd(a)===null){h.child=O;break}a=O.sibling,O.sibling=f,f=O,O=a}s0(h,!0,f,null,_,p);break;case"together":s0(h,!1,null,null,void 0,p);break;default:h.memoizedState=null}return h.child}function vn(a,h,f){if(a!==null&&(h.dependencies=a.dependencies),ho|=h.lanes,(f&h.childLanes)===0)if(a!==null){if(yl(a,h,f,!1),(f&h.childLanes)===0)return null}else return null;if(a!==null&&h.child!==a.child)throw Error(s(153));if(h.child!==null){for(a=h.child,f=fn(a,a.pendingProps),h.child=f,f.return=h;a.sibling!==null;)a=a.sibling,f=f.sibling=fn(a,a.pendingProps),f.return=h;f.sibling=null}return h.child}function r0(a,h){return(a.lanes&h)!==0?!0:(a=a.dependencies,!!(a!==null&&id(a)))}function j6(a,h,f){switch(h.tag){case 3:Me(h,h.stateNode.containerInfo),to(h,jt,a.memoizedState.cache),oa();break;case 27:case 5:mt(h);break;case 4:Me(h,h.stateNode.containerInfo);break;case 10:to(h,h.type,h.memoizedProps.value);break;case 31:if(h.memoizedState!==null)return h.flags|=128,AO(h),null;break;case 13:var p=h.memoizedState;if(p!==null)return p.dehydrated!==null?(no(h),h.flags|=128,null):(f&h.child.childLanes)!==0?$C(a,h,f):(no(h),a=vn(a,h,f),a!==null?a.sibling:null);no(h);break;case 19:var O=(a.flags&128)!==0;if(p=(f&h.childLanes)!==0,p||(yl(a,h,f,!1),p=(f&h.childLanes)!==0),O){if(p)return DC(a,h,f);h.flags|=128}if(O=h.memoizedState,O!==null&&(O.rendering=null,O.tail=null,O.lastEffect=null),se($t,$t.current),p)break;return null;case 22:return h.lanes=0,AC(a,h,f,h.pendingProps);case 24:to(h,jt,a.memoizedState.cache)}return vn(a,h,f)}function zC(a,h,f){if(a!==null)if(a.memoizedProps!==h.pendingProps)Vt=!0;else{if(!r0(a,f)&&(h.flags&128)===0)return Vt=!1,j6(a,h,f);Vt=(a.flags&131072)!==0}else Vt=!1,Ue&&(h.flags&1048576)!==0&&gw(h,oc,h.index);switch(h.lanes=0,h.tag){case 16:e:{var p=h.pendingProps;if(a=ca(h.elementType),h.type=a,typeof a=="function")hO(a)?(p=pa(a,p),h.tag=1,h=QC(null,h,a,p,f)):(h.tag=0,h=GO(null,h,a,p,f));else{if(a!=null){var O=a.$$typeof;if(O===k){h.tag=11,h=kC(null,h,a,p,f);break e}else if(O===z){h.tag=14,h=TC(null,h,a,p,f);break e}}throw h=D(a)||a,Error(s(306,h,""))}}return h;case 0:return GO(a,h,h.type,h.pendingProps,f);case 1:return p=h.type,O=pa(p,h.pendingProps),QC(a,h,p,O,f);case 3:e:{if(Me(h,h.stateNode.containerInfo),a===null)throw Error(s(387));p=h.pendingProps;var _=h.memoizedState;O=_.element,wO(a,h),pc(h,p,null,f);var x=h.memoizedState;if(p=x.cache,to(h,jt,p),p!==_.cache&&vO(h,[jt],f,!0),dc(),p=x.element,_.isDehydrated)if(_={element:p,isDehydrated:!1,cache:x.cache},h.updateQueue.baseState=_,h.memoizedState=_,h.flags&256){h=LC(a,h,p,f);break e}else if(p!==O){O=Vs(Error(s(424)),h),ac(O),h=LC(a,h,p,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(gt=Us(a.firstChild),Ci=h,Ue=!0,Jn=null,qs=!0,f=Aw(h,null,p,f),h.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(oa(),p===O){h=vn(a,h,f);break e}Ti(a,h,p,f)}h=h.child}return h;case 26:return bd(a,h),a===null?(f=Hk(h.type,null,h.pendingProps,null))?h.memoizedState=f:Ue||(f=h.type,a=h.pendingProps,p=zd(de.current).createElement(f),p[wi]=h,p[rs]=a,Mi(p,f,a),ai(p),h.stateNode=p):h.memoizedState=Hk(h.type,a.memoizedProps,h.pendingProps,a.memoizedState),null;case 27:return mt(h),a===null&&Ue&&(p=h.stateNode=Wk(h.type,h.pendingProps,de.current),Ci=h,qs=!0,O=gt,mo(h.type)?(D0=O,gt=Us(p.firstChild)):gt=O),Ti(a,h,h.pendingProps.children,f),bd(a,h),a===null&&(h.flags|=4194304),h.child;case 5:return a===null&&Ue&&((O=p=gt)&&(p=gz(p,h.type,h.pendingProps,qs),p!==null?(h.stateNode=p,Ci=h,gt=Us(p.firstChild),qs=!1,O=!0):O=!1),O||eo(h)),mt(h),O=h.type,_=h.pendingProps,x=a!==null?a.memoizedProps:null,p=_.children,R0(O,_)?p=null:x!==null&&R0(O,x)&&(h.flags|=32),h.memoizedState!==null&&(O=PO(a,h,P6,null,null,f),Lc._currentValue=O),bd(a,h),Ti(a,h,p,f),h.child;case 6:return a===null&&Ue&&((a=f=gt)&&(f=Oz(f,h.pendingProps,qs),f!==null?(h.stateNode=f,Ci=h,gt=null,a=!0):a=!1),a||eo(h)),null;case 13:return $C(a,h,f);case 4:return Me(h,h.stateNode.containerInfo),p=h.pendingProps,a===null?h.child=fa(h,null,p,f):Ti(a,h,p,f),h.child;case 11:return kC(a,h,h.type,h.pendingProps,f);case 7:return Ti(a,h,h.pendingProps,f),h.child;case 8:return Ti(a,h,h.pendingProps.children,f),h.child;case 12:return Ti(a,h,h.pendingProps.children,f),h.child;case 10:return p=h.pendingProps,to(h,h.type,p.value),Ti(a,h,p.children,f),h.child;case 9:return O=h.type._context,p=h.pendingProps.children,la(h),O=ki(O),p=p(O),h.flags|=1,Ti(a,h,p,f),h.child;case 14:return TC(a,h,h.type,h.pendingProps,f);case 15:return MC(a,h,h.type,h.pendingProps,f);case 19:return DC(a,h,f);case 31:return N6(a,h,f);case 22:return AC(a,h,f,h.pendingProps);case 24:return la(h),p=ki(jt),a===null?(O=bO(),O===null&&(O=ht,_=_O(),O.pooledCache=_,_.refCount++,_!==null&&(O.pooledCacheLanes|=f),O=_),h.memoizedState={parent:p,cache:O},xO(h),to(h,jt,O)):((a.lanes&f)!==0&&(wO(a,h),pc(h,null,null,f),dc()),O=a.memoizedState,_=h.memoizedState,O.parent!==p?(O={parent:p,cache:p},h.memoizedState=O,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=O),to(h,jt,p)):(p=_.cache,to(h,jt,p),p!==O.cache&&vO(h,[jt],f,!0))),Ti(a,h,h.pendingProps.children,f),h.child;case 29:throw h.pendingProps}throw Error(s(156,h.tag))}function _n(a){a.flags|=4}function n0(a,h,f,p,O){if((h=(a.mode&32)!==0)&&(h=!1),h){if(a.flags|=16777216,(O&335544128)===O)if(a.stateNode.complete)a.flags|=8192;else if(uk())a.flags|=8192;else throw ua=od,SO}else a.flags&=-16777217}function NC(a,h){if(h.type!=="stylesheet"||(h.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!e2(h))if(uk())a.flags|=8192;else throw ua=od,SO}function xd(a,h){h!==null&&(a.flags|=4),a.flags&16384&&(h=a.tag!==22?vx():536870912,a.lanes|=h,Rl|=h)}function yc(a,h){if(!Ue)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 p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?h||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function Ot(a){var h=a.alternate!==null&&a.alternate.child===a.child,f=0,p=0;if(h)for(var O=a.child;O!==null;)f|=O.lanes|O.childLanes,p|=O.subtreeFlags&65011712,p|=O.flags&65011712,O.return=a,O=O.sibling;else for(O=a.child;O!==null;)f|=O.lanes|O.childLanes,p|=O.subtreeFlags,p|=O.flags,O.return=a,O=O.sibling;return a.subtreeFlags|=p,a.childLanes=f,h}function X6(a,h,f){var p=h.pendingProps;switch(dO(h),h.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(h),null;case 1:return Ot(h),null;case 3:return f=h.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),h.memoizedState.cache!==p&&(h.flags|=2048),mn(jt),ye(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(_l(h)?_n(h):a===null||a.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,mO())),Ot(h),null;case 26:var O=h.type,_=h.memoizedState;return a===null?(_n(h),_!==null?(Ot(h),NC(h,_)):(Ot(h),n0(h,O,null,p,f))):_?_!==a.memoizedState?(_n(h),Ot(h),NC(h,_)):(Ot(h),h.flags&=-16777217):(a=a.memoizedProps,a!==p&&_n(h),Ot(h),n0(h,O,a,p,f)),null;case 27:if(Ft(h),f=de.current,O=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==p&&_n(h);else{if(!p){if(h.stateNode===null)throw Error(s(166));return Ot(h),null}a=ce.current,_l(h)?vw(h):(a=Wk(O,p,f),h.stateNode=a,_n(h))}return Ot(h),null;case 5:if(Ft(h),O=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==p&&_n(h);else{if(!p){if(h.stateNode===null)throw Error(s(166));return Ot(h),null}if(_=ce.current,_l(h))vw(h);else{var x=zd(de.current);switch(_){case 1:_=x.createElementNS("http://www.w3.org/2000/svg",O);break;case 2:_=x.createElementNS("http://www.w3.org/1998/Math/MathML",O);break;default:switch(O){case"svg":_=x.createElementNS("http://www.w3.org/2000/svg",O);break;case"math":_=x.createElementNS("http://www.w3.org/1998/Math/MathML",O);break;case"script":_=x.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof p.is=="string"?x.createElement("select",{is:p.is}):x.createElement("select"),p.multiple?_.multiple=!0:p.size&&(_.size=p.size);break;default:_=typeof p.is=="string"?x.createElement(O,{is:p.is}):x.createElement(O)}}_[wi]=h,_[rs]=p;e:for(x=h.child;x!==null;){if(x.tag===5||x.tag===6)_.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===h)break e;for(;x.sibling===null;){if(x.return===null||x.return===h)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}h.stateNode=_;e:switch(Mi(_,O,p),O){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&_n(h)}}return Ot(h),n0(h,h.type,a===null?null:a.memoizedProps,h.pendingProps,f),null;case 6:if(a&&h.stateNode!=null)a.memoizedProps!==p&&_n(h);else{if(typeof p!="string"&&h.stateNode===null)throw Error(s(166));if(a=de.current,_l(h)){if(a=h.stateNode,f=h.memoizedProps,p=null,O=Ci,O!==null)switch(O.tag){case 27:case 5:p=O.memoizedProps}a[wi]=h,a=!!(a.nodeValue===f||p!==null&&p.suppressHydrationWarning===!0||$k(a.nodeValue,f)),a||eo(h,!0)}else a=zd(a).createTextNode(p),a[wi]=h,h.stateNode=a}return Ot(h),null;case 31:if(f=h.memoizedState,a===null||a.memoizedState!==null){if(p=_l(h),f!==null){if(a===null){if(!p)throw Error(s(318));if(a=h.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(557));a[wi]=h}else oa(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Ot(h),a=!1}else f=mO(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return h.flags&256?(Cs(h),h):(Cs(h),null);if((h.flags&128)!==0)throw Error(s(558))}return Ot(h),null;case 13:if(p=h.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(O=_l(h),p!==null&&p.dehydrated!==null){if(a===null){if(!O)throw Error(s(318));if(O=h.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(s(317));O[wi]=h}else oa(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Ot(h),O=!1}else O=mO(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=O),O=!0;if(!O)return h.flags&256?(Cs(h),h):(Cs(h),null)}return Cs(h),(h.flags&128)!==0?(h.lanes=f,h):(f=p!==null,a=a!==null&&a.memoizedState!==null,f&&(p=h.child,O=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(O=p.alternate.memoizedState.cachePool.pool),_=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(_=p.memoizedState.cachePool.pool),_!==O&&(p.flags|=2048)),f!==a&&f&&(h.child.flags|=8192),xd(h,h.updateQueue),Ot(h),null);case 4:return ye(),a===null&&T0(h.stateNode.containerInfo),Ot(h),null;case 10:return mn(h.type),Ot(h),null;case 19:if(G($t),p=h.memoizedState,p===null)return Ot(h),null;if(O=(h.flags&128)!==0,_=p.rendering,_===null)if(O)yc(p,!1);else{if(Mt!==0||a!==null&&(a.flags&128)!==0)for(a=h.child;a!==null;){if(_=cd(a),_!==null){for(h.flags|=128,yc(p,!1),a=_.updateQueue,h.updateQueue=a,xd(h,a),h.subtreeFlags=0,a=f,f=h.child;f!==null;)dw(f,a),f=f.sibling;return se($t,$t.current&1|2),Ue&&dn(h,p.treeForkCount),h.child}a=a.sibling}p.tail!==null&&_s()>Md&&(h.flags|=128,O=!0,yc(p,!1),h.lanes=4194304)}else{if(!O)if(a=cd(_),a!==null){if(h.flags|=128,O=!0,a=a.updateQueue,h.updateQueue=a,xd(h,a),yc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!_.alternate&&!Ue)return Ot(h),null}else 2*_s()-p.renderingStartTime>Md&&f!==536870912&&(h.flags|=128,O=!0,yc(p,!1),h.lanes=4194304);p.isBackwards?(_.sibling=h.child,h.child=_):(a=p.last,a!==null?a.sibling=_:h.child=_,p.last=_)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=_s(),a.sibling=null,f=$t.current,se($t,O?f&1|2:f&1),Ue&&dn(h,p.treeForkCount),a):(Ot(h),null);case 22:case 23:return Cs(h),MO(),p=h.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(h.flags|=8192):p&&(h.flags|=8192),p?(f&536870912)!==0&&(h.flags&128)===0&&(Ot(h),h.subtreeFlags&6&&(h.flags|=8192)):Ot(h),f=h.updateQueue,f!==null&&xd(h,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),p=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(p=h.memoizedState.cachePool.pool),p!==f&&(h.flags|=2048),a!==null&&G(ha),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),h.memoizedState.cache!==f&&(h.flags|=2048),mn(jt),Ot(h),null;case 25:return null;case 30:return null}throw Error(s(156,h.tag))}function V6(a,h){switch(dO(h),h.tag){case 1:return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 3:return mn(jt),ye(),a=h.flags,(a&65536)!==0&&(a&128)===0?(h.flags=a&-65537|128,h):null;case 26:case 27:case 5:return Ft(h),null;case 31:if(h.memoizedState!==null){if(Cs(h),h.alternate===null)throw Error(s(340));oa()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 13:if(Cs(h),a=h.memoizedState,a!==null&&a.dehydrated!==null){if(h.alternate===null)throw Error(s(340));oa()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 19:return G($t),null;case 4:return ye(),null;case 10:return mn(h.type),null;case 22:case 23:return Cs(h),MO(),a!==null&&G(ha),a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 24:return mn(jt),null;case 25:return null;default:return null}}function jC(a,h){switch(dO(h),h.tag){case 3:mn(jt),ye();break;case 26:case 27:case 5:Ft(h);break;case 4:ye();break;case 31:h.memoizedState!==null&&Cs(h);break;case 13:Cs(h);break;case 19:G($t);break;case 10:mn(h.type);break;case 22:case 23:Cs(h),MO(),a!==null&&G(ha);break;case 24:mn(jt)}}function bc(a,h){try{var f=h.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var O=p.next;f=O;do{if((f.tag&a)===a){p=void 0;var _=f.create,x=f.inst;p=_(),x.destroy=p}f=f.next}while(f!==O)}}catch(A){st(h,h.return,A)}}function ao(a,h,f){try{var p=h.updateQueue,O=p!==null?p.lastEffect:null;if(O!==null){var _=O.next;p=_;do{if((p.tag&a)===a){var x=p.inst,A=x.destroy;if(A!==void 0){x.destroy=void 0,O=h;var V=f,J=A;try{J()}catch(re){st(O,V,re)}}}p=p.next}while(p!==_)}}catch(re){st(h,h.return,re)}}function XC(a){var h=a.updateQueue;if(h!==null){var f=a.stateNode;try{Pw(h,f)}catch(p){st(a,a.return,p)}}}function VC(a,h,f){f.props=pa(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(p){st(a,h,p)}}function Sc(a,h){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof f=="function"?a.refCleanup=f(p):f.current=p}}catch(O){st(a,h,O)}}function Pr(a,h){var f=a.ref,p=a.refCleanup;if(f!==null)if(typeof p=="function")try{p()}catch(O){st(a,h,O)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(O){st(a,h,O)}else f.current=null}function ZC(a){var h=a.type,f=a.memoizedProps,p=a.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":f.autoFocus&&p.focus();break e;case"img":f.src?p.src=f.src:f.srcSet&&(p.srcset=f.srcSet)}}catch(O){st(a,a.return,O)}}function o0(a,h,f){try{var p=a.stateNode;cz(p,a.type,f,h),p[rs]=h}catch(O){st(a,a.return,O)}}function IC(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&mo(a.type)||a.tag===4}function a0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||IC(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&&mo(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 l0(a,h,f){var p=a.tag;if(p===5||p===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=cn));else if(p!==4&&(p===27&&mo(a.type)&&(f=a.stateNode,h=null),a=a.child,a!==null))for(l0(a,h,f),a=a.sibling;a!==null;)l0(a,h,f),a=a.sibling}function wd(a,h,f){var p=a.tag;if(p===5||p===6)a=a.stateNode,h?f.insertBefore(a,h):f.appendChild(a);else if(p!==4&&(p===27&&mo(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(wd(a,h,f),a=a.sibling;a!==null;)wd(a,h,f),a=a.sibling}function qC(a){var h=a.stateNode,f=a.memoizedProps;try{for(var p=a.type,O=h.attributes;O.length;)h.removeAttributeNode(O[0]);Mi(h,p,f),h[wi]=a,h[rs]=f}catch(_){st(a,a.return,_)}}var yn=!1,Zt=!1,h0=!1,WC=typeof WeakSet=="function"?WeakSet:Set,li=null;function Z6(a,h){if(a=a.containerInfo,E0=qd,a=rw(a),iO(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var p=f.getSelection&&f.getSelection();if(p&&p.rangeCount!==0){f=p.anchorNode;var O=p.anchorOffset,_=p.focusNode;p=p.focusOffset;try{f.nodeType,_.nodeType}catch{f=null;break e}var x=0,A=-1,V=-1,J=0,re=0,ae=a,ee=null;t:for(;;){for(var te;ae!==f||O!==0&&ae.nodeType!==3||(A=x+O),ae!==_||p!==0&&ae.nodeType!==3||(V=x+p),ae.nodeType===3&&(x+=ae.nodeValue.length),(te=ae.firstChild)!==null;)ee=ae,ae=te;for(;;){if(ae===a)break t;if(ee===f&&++J===O&&(A=x),ee===_&&++re===p&&(V=x),(te=ae.nextSibling)!==null)break;ae=ee,ee=ae.parentNode}ae=te}f=A===-1||V===-1?null:{start:A,end:V}}else f=null}f=f||{start:0,end:0}}else f=null;for(P0={focusedElem:a,selectionRange:f},qd=!1,li=h;li!==null;)if(h=li,a=h.child,(h.subtreeFlags&1028)!==0&&a!==null)a.return=h,li=a;else for(;li!==null;){switch(h=li,_=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++)O=a[f],O.ref.impl=O.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&_!==null){a=void 0,f=h,O=_.memoizedProps,_=_.memoizedState,p=f.stateNode;try{var be=pa(f.type,O);a=p.getSnapshotBeforeUpdate(be,_),p.__reactInternalSnapshotBeforeUpdate=a}catch(Ee){st(f,f.return,Ee)}}break;case 3:if((a&1024)!==0){if(a=h.stateNode.containerInfo,f=a.nodeType,f===9)L0(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":L0(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(s(163))}if(a=h.sibling,a!==null){a.return=h.return,li=a;break}li=h.return}}function UC(a,h,f){var p=f.flags;switch(f.tag){case 0:case 11:case 15:Sn(a,f),p&4&&bc(5,f);break;case 1:if(Sn(a,f),p&4)if(a=f.stateNode,h===null)try{a.componentDidMount()}catch(x){st(f,f.return,x)}else{var O=pa(f.type,h.memoizedProps);h=h.memoizedState;try{a.componentDidUpdate(O,h,a.__reactInternalSnapshotBeforeUpdate)}catch(x){st(f,f.return,x)}}p&64&&XC(f),p&512&&Sc(f,f.return);break;case 3:if(Sn(a,f),p&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{Pw(a,h)}catch(x){st(f,f.return,x)}}break;case 27:h===null&&p&4&&qC(f);case 26:case 5:Sn(a,f),h===null&&p&4&&ZC(f),p&512&&Sc(f,f.return);break;case 12:Sn(a,f);break;case 31:Sn(a,f),p&4&&FC(a,f);break;case 13:Sn(a,f),p&4&&GC(a,f),p&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=K6.bind(null,f),vz(a,f))));break;case 22:if(p=f.memoizedState!==null||yn,!p){h=h!==null&&h.memoizedState!==null||Zt,O=yn;var _=Zt;yn=p,(Zt=h)&&!_?xn(a,f,(f.subtreeFlags&8772)!==0):Sn(a,f),yn=O,Zt=_}break;case 30:break;default:Sn(a,f)}}function YC(a){var h=a.alternate;h!==null&&(a.alternate=null,YC(h)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(h=a.stateNode,h!==null&&Ng(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 bt=null,os=!1;function bn(a,h,f){for(f=f.child;f!==null;)HC(a,h,f),f=f.sibling}function HC(a,h,f){if(ys&&typeof ys.onCommitFiberUnmount=="function")try{ys.onCommitFiberUnmount(Wh,f)}catch{}switch(f.tag){case 26:Zt||Pr(f,h),bn(a,h,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:Zt||Pr(f,h);var p=bt,O=os;mo(f.type)&&(bt=f.stateNode,os=!1),bn(a,h,f),Pc(f.stateNode),bt=p,os=O;break;case 5:Zt||Pr(f,h);case 6:if(p=bt,O=os,bt=null,bn(a,h,f),bt=p,os=O,bt!==null)if(os)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(f.stateNode)}catch(_){st(f,h,_)}else try{bt.removeChild(f.stateNode)}catch(_){st(f,h,_)}break;case 18:bt!==null&&(os?(a=bt,Xk(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),jl(a)):Xk(bt,f.stateNode));break;case 4:p=bt,O=os,bt=f.stateNode.containerInfo,os=!0,bn(a,h,f),bt=p,os=O;break;case 0:case 11:case 14:case 15:ao(2,f,h),Zt||ao(4,f,h),bn(a,h,f);break;case 1:Zt||(Pr(f,h),p=f.stateNode,typeof p.componentWillUnmount=="function"&&VC(f,h,p)),bn(a,h,f);break;case 21:bn(a,h,f);break;case 22:Zt=(p=Zt)||f.memoizedState!==null,bn(a,h,f),Zt=p;break;default:bn(a,h,f)}}function FC(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{jl(a)}catch(f){st(h,h.return,f)}}}function GC(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{jl(a)}catch(f){st(h,h.return,f)}}function I6(a){switch(a.tag){case 31:case 13:case 19:var h=a.stateNode;return h===null&&(h=a.stateNode=new WC),h;case 22:return a=a.stateNode,h=a._retryCache,h===null&&(h=a._retryCache=new WC),h;default:throw Error(s(435,a.tag))}}function Cd(a,h){var f=I6(a);h.forEach(function(p){if(!f.has(p)){f.add(p);var O=J6.bind(null,a,p);p.then(O,O)}})}function as(a,h){var f=h.deletions;if(f!==null)for(var p=0;p<f.length;p++){var O=f[p],_=a,x=h,A=x;e:for(;A!==null;){switch(A.tag){case 27:if(mo(A.type)){bt=A.stateNode,os=!1;break e}break;case 5:bt=A.stateNode,os=!1;break e;case 3:case 4:bt=A.stateNode.containerInfo,os=!0;break e}A=A.return}if(bt===null)throw Error(s(160));HC(_,x,O),bt=null,os=!1,_=O.alternate,_!==null&&(_.return=null),O.return=null}if(h.subtreeFlags&13886)for(h=h.child;h!==null;)KC(h,a),h=h.sibling}var dr=null;function KC(a,h){var f=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:as(h,a),ls(a),p&4&&(ao(3,a,a.return),bc(3,a),ao(5,a,a.return));break;case 1:as(h,a),ls(a),p&512&&(Zt||f===null||Pr(f,f.return)),p&64&&yn&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?p:f.concat(p))));break;case 26:var O=dr;if(as(h,a),ls(a),p&512&&(Zt||f===null||Pr(f,f.return)),p&4){var _=f!==null?f.memoizedState:null;if(p=a.memoizedState,f===null)if(p===null)if(a.stateNode===null){e:{p=a.type,f=a.memoizedProps,O=O.ownerDocument||O;t:switch(p){case"title":_=O.getElementsByTagName("title")[0],(!_||_[Hh]||_[wi]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=O.createElement(p),O.head.insertBefore(_,O.querySelector("head > title"))),Mi(_,p,f),_[wi]=a,ai(_),p=_;break e;case"link":var x=Kk("link","href",O).get(p+(f.href||""));if(x){for(var A=0;A<x.length;A++)if(_=x[A],_.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&_.getAttribute("rel")===(f.rel==null?null:f.rel)&&_.getAttribute("title")===(f.title==null?null:f.title)&&_.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){x.splice(A,1);break t}}_=O.createElement(p),Mi(_,p,f),O.head.appendChild(_);break;case"meta":if(x=Kk("meta","content",O).get(p+(f.content||""))){for(A=0;A<x.length;A++)if(_=x[A],_.getAttribute("content")===(f.content==null?null:""+f.content)&&_.getAttribute("name")===(f.name==null?null:f.name)&&_.getAttribute("property")===(f.property==null?null:f.property)&&_.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&_.getAttribute("charset")===(f.charSet==null?null:f.charSet)){x.splice(A,1);break t}}_=O.createElement(p),Mi(_,p,f),O.head.appendChild(_);break;default:throw Error(s(468,p))}_[wi]=a,ai(_),p=_}a.stateNode=p}else Jk(O,a.type,a.stateNode);else a.stateNode=Gk(O,p,a.memoizedProps);else _!==p?(_===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):_.count--,p===null?Jk(O,a.type,a.stateNode):Gk(O,p,a.memoizedProps)):p===null&&a.stateNode!==null&&o0(a,a.memoizedProps,f.memoizedProps)}break;case 27:as(h,a),ls(a),p&512&&(Zt||f===null||Pr(f,f.return)),f!==null&&p&4&&o0(a,a.memoizedProps,f.memoizedProps);break;case 5:if(as(h,a),ls(a),p&512&&(Zt||f===null||Pr(f,f.return)),a.flags&32){O=a.stateNode;try{hl(O,"")}catch(be){st(a,a.return,be)}}p&4&&a.stateNode!=null&&(O=a.memoizedProps,o0(a,O,f!==null?f.memoizedProps:O)),p&1024&&(h0=!0);break;case 6:if(as(h,a),ls(a),p&4){if(a.stateNode===null)throw Error(s(162));p=a.memoizedProps,f=a.stateNode;try{f.nodeValue=p}catch(be){st(a,a.return,be)}}break;case 3:if(Xd=null,O=dr,dr=Nd(h.containerInfo),as(h,a),dr=O,ls(a),p&4&&f!==null&&f.memoizedState.isDehydrated)try{jl(h.containerInfo)}catch(be){st(a,a.return,be)}h0&&(h0=!1,JC(a));break;case 4:p=dr,dr=Nd(a.stateNode.containerInfo),as(h,a),ls(a),dr=p;break;case 12:as(h,a),ls(a);break;case 31:as(h,a),ls(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Cd(a,p)));break;case 13:as(h,a),ls(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Td=_s()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Cd(a,p)));break;case 22:O=a.memoizedState!==null;var V=f!==null&&f.memoizedState!==null,J=yn,re=Zt;if(yn=J||O,Zt=re||V,as(h,a),Zt=re,yn=J,ls(a),p&8192)e:for(h=a.stateNode,h._visibility=O?h._visibility&-2:h._visibility|1,O&&(f===null||V||yn||Zt||ma(a)),f=null,h=a;;){if(h.tag===5||h.tag===26){if(f===null){V=f=h;try{if(_=V.stateNode,O)x=_.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{A=V.stateNode;var ae=V.memoizedProps.style,ee=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;A.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(be){st(V,V.return,be)}}}else if(h.tag===6){if(f===null){V=h;try{V.stateNode.nodeValue=O?"":V.memoizedProps}catch(be){st(V,V.return,be)}}}else if(h.tag===18){if(f===null){V=h;try{var te=V.stateNode;O?Vk(te,!0):Vk(V.stateNode,!1)}catch(be){st(V,V.return,be)}}}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}p&4&&(p=a.updateQueue,p!==null&&(f=p.retryQueue,f!==null&&(p.retryQueue=null,Cd(a,f))));break;case 19:as(h,a),ls(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Cd(a,p)));break;case 30:break;case 21:break;default:as(h,a),ls(a)}}function ls(a){var h=a.flags;if(h&2){try{for(var f,p=a.return;p!==null;){if(IC(p)){f=p;break}p=p.return}if(f==null)throw Error(s(160));switch(f.tag){case 27:var O=f.stateNode,_=a0(a);wd(a,_,O);break;case 5:var x=f.stateNode;f.flags&32&&(hl(x,""),f.flags&=-33);var A=a0(a);wd(a,A,x);break;case 3:case 4:var V=f.stateNode.containerInfo,J=a0(a);l0(a,J,V);break;default:throw Error(s(161))}}catch(re){st(a,a.return,re)}a.flags&=-3}h&4096&&(a.flags&=-4097)}function JC(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var h=a;JC(h),h.tag===5&&h.flags&1024&&h.stateNode.reset(),a=a.sibling}}function Sn(a,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)UC(a,h.alternate,h),h=h.sibling}function ma(a){for(a=a.child;a!==null;){var h=a;switch(h.tag){case 0:case 11:case 14:case 15:ao(4,h,h.return),ma(h);break;case 1:Pr(h,h.return);var f=h.stateNode;typeof f.componentWillUnmount=="function"&&VC(h,h.return,f),ma(h);break;case 27:Pc(h.stateNode);case 26:case 5:Pr(h,h.return),ma(h);break;case 22:h.memoizedState===null&&ma(h);break;case 30:ma(h);break;default:ma(h)}a=a.sibling}}function xn(a,h,f){for(f=f&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var p=h.alternate,O=a,_=h,x=_.flags;switch(_.tag){case 0:case 11:case 15:xn(O,_,f),bc(4,_);break;case 1:if(xn(O,_,f),p=_,O=p.stateNode,typeof O.componentDidMount=="function")try{O.componentDidMount()}catch(J){st(p,p.return,J)}if(p=_,O=p.updateQueue,O!==null){var A=p.stateNode;try{var V=O.shared.hiddenCallbacks;if(V!==null)for(O.shared.hiddenCallbacks=null,O=0;O<V.length;O++)Ew(V[O],A)}catch(J){st(p,p.return,J)}}f&&x&64&&XC(_),Sc(_,_.return);break;case 27:qC(_);case 26:case 5:xn(O,_,f),f&&p===null&&x&4&&ZC(_),Sc(_,_.return);break;case 12:xn(O,_,f);break;case 31:xn(O,_,f),f&&x&4&&FC(O,_);break;case 13:xn(O,_,f),f&&x&4&&GC(O,_);break;case 22:_.memoizedState===null&&xn(O,_,f),Sc(_,_.return);break;case 30:break;default:xn(O,_,f)}h=h.sibling}}function c0(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&&lc(f))}function u0(a,h){a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&lc(a))}function pr(a,h,f,p){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)ek(a,h,f,p),h=h.sibling}function ek(a,h,f,p){var O=h.flags;switch(h.tag){case 0:case 11:case 15:pr(a,h,f,p),O&2048&&bc(9,h);break;case 1:pr(a,h,f,p);break;case 3:pr(a,h,f,p),O&2048&&(a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&lc(a)));break;case 12:if(O&2048){pr(a,h,f,p),a=h.stateNode;try{var _=h.memoizedProps,x=_.id,A=_.onPostCommit;typeof A=="function"&&A(x,h.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(V){st(h,h.return,V)}}else pr(a,h,f,p);break;case 31:pr(a,h,f,p);break;case 13:pr(a,h,f,p);break;case 23:break;case 22:_=h.stateNode,x=h.alternate,h.memoizedState!==null?_._visibility&2?pr(a,h,f,p):xc(a,h):_._visibility&2?pr(a,h,f,p):(_._visibility|=2,Al(a,h,f,p,(h.subtreeFlags&10256)!==0||!1)),O&2048&&c0(x,h);break;case 24:pr(a,h,f,p),O&2048&&u0(h.alternate,h);break;default:pr(a,h,f,p)}}function Al(a,h,f,p,O){for(O=O&&((h.subtreeFlags&10256)!==0||!1),h=h.child;h!==null;){var _=a,x=h,A=f,V=p,J=x.flags;switch(x.tag){case 0:case 11:case 15:Al(_,x,A,V,O),bc(8,x);break;case 23:break;case 22:var re=x.stateNode;x.memoizedState!==null?re._visibility&2?Al(_,x,A,V,O):xc(_,x):(re._visibility|=2,Al(_,x,A,V,O)),O&&J&2048&&c0(x.alternate,x);break;case 24:Al(_,x,A,V,O),O&&J&2048&&u0(x.alternate,x);break;default:Al(_,x,A,V,O)}h=h.sibling}}function xc(a,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var f=a,p=h,O=p.flags;switch(p.tag){case 22:xc(f,p),O&2048&&c0(p.alternate,p);break;case 24:xc(f,p),O&2048&&u0(p.alternate,p);break;default:xc(f,p)}h=h.sibling}}var wc=8192;function El(a,h,f){if(a.subtreeFlags&wc)for(a=a.child;a!==null;)tk(a,h,f),a=a.sibling}function tk(a,h,f){switch(a.tag){case 26:El(a,h,f),a.flags&wc&&a.memoizedState!==null&&Ez(f,dr,a.memoizedState,a.memoizedProps);break;case 5:El(a,h,f);break;case 3:case 4:var p=dr;dr=Nd(a.stateNode.containerInfo),El(a,h,f),dr=p;break;case 22:a.memoizedState===null&&(p=a.alternate,p!==null&&p.memoizedState!==null?(p=wc,wc=16777216,El(a,h,f),wc=p):El(a,h,f));break;default:El(a,h,f)}}function ik(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 Cc(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var p=h[f];li=p,rk(p,a)}ik(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)sk(a),a=a.sibling}function sk(a){switch(a.tag){case 0:case 11:case 15:Cc(a),a.flags&2048&&ao(9,a,a.return);break;case 3:Cc(a);break;case 12:Cc(a);break;case 22:var h=a.stateNode;a.memoizedState!==null&&h._visibility&2&&(a.return===null||a.return.tag!==13)?(h._visibility&=-3,kd(a)):Cc(a);break;default:Cc(a)}}function kd(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var p=h[f];li=p,rk(p,a)}ik(a)}for(a=a.child;a!==null;){switch(h=a,h.tag){case 0:case 11:case 15:ao(8,h,h.return),kd(h);break;case 22:f=h.stateNode,f._visibility&2&&(f._visibility&=-3,kd(h));break;default:kd(h)}a=a.sibling}}function rk(a,h){for(;li!==null;){var f=li;switch(f.tag){case 0:case 11:case 15:ao(8,f,h);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var p=f.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:lc(f.memoizedState.cache)}if(p=f.child,p!==null)p.return=f,li=p;else e:for(f=a;li!==null;){p=li;var O=p.sibling,_=p.return;if(YC(p),p===f){li=null;break e}if(O!==null){O.return=_,li=O;break e}li=_}}}var q6={getCacheForType:function(a){var h=ki(jt),f=h.data.get(a);return f===void 0&&(f=a(),h.data.set(a,f)),f},cacheSignal:function(){return ki(jt).controller.signal}},W6=typeof WeakMap=="function"?WeakMap:Map,Ke=0,ht=null,Xe=null,Ie=0,it=0,ks=null,lo=!1,Pl=!1,f0=!1,wn=0,Mt=0,ho=0,ga=0,d0=0,Ts=0,Rl=0,kc=null,hs=null,p0=!1,Td=0,nk=0,Md=1/0,Ad=null,co=null,Kt=0,uo=null,Ql=null,Cn=0,m0=0,g0=null,ok=null,Tc=0,O0=null;function Ms(){return(Ke&2)!==0&&Ie!==0?Ie&-Ie:L.T!==null?x0():Sx()}function ak(){if(Ts===0)if((Ie&536870912)===0||Ue){var a=Df;Df<<=1,(Df&3932160)===0&&(Df=262144),Ts=a}else Ts=536870912;return a=ws.current,a!==null&&(a.flags|=32),Ts}function cs(a,h,f){(a===ht&&(it===2||it===9)||a.cancelPendingCommit!==null)&&(Ll(a,0),fo(a,Ie,Ts,!1)),Yh(a,f),((Ke&2)===0||a!==ht)&&(a===ht&&((Ke&2)===0&&(ga|=f),Mt===4&&fo(a,Ie,Ts,!1)),Rr(a))}function lk(a,h,f){if((Ke&6)!==0)throw Error(s(327));var p=!f&&(h&127)===0&&(h&a.expiredLanes)===0||Uh(a,h),O=p?H6(a,h):_0(a,h,!0),_=p;do{if(O===0){Pl&&!p&&fo(a,h,0,!1);break}else{if(f=a.current.alternate,_&&!U6(f)){O=_0(a,h,!1),_=!1;continue}if(O===2){if(_=h,a.errorRecoveryDisabledLanes&_)var x=0;else x=a.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){h=x;e:{var A=a;O=kc;var V=A.current.memoizedState.isDehydrated;if(V&&(Ll(A,x).flags|=256),x=_0(A,x,!1),x!==2){if(f0&&!V){A.errorRecoveryDisabledLanes|=_,ga|=_,O=4;break e}_=hs,hs=O,_!==null&&(hs===null?hs=_:hs.push.apply(hs,_))}O=x}if(_=!1,O!==2)continue}}if(O===1){Ll(a,0),fo(a,h,0,!0);break}e:{switch(p=a,_=O,_){case 0:case 1:throw Error(s(345));case 4:if((h&4194048)!==h)break;case 6:fo(p,h,Ts,!lo);break e;case 2:hs=null;break;case 3:case 5:break;default:throw Error(s(329))}if((h&62914560)===h&&(O=Td+300-_s(),10<O)){if(fo(p,h,Ts,!lo),Nf(p,0,!0)!==0)break e;Cn=h,p.timeoutHandle=Nk(hk.bind(null,p,f,hs,Ad,p0,h,Ts,ga,Rl,lo,_,"Throttled",-0,0),O);break e}hk(p,f,hs,Ad,p0,h,Ts,ga,Rl,lo,_,null,-0,0)}}break}while(!0);Rr(a)}function hk(a,h,f,p,O,_,x,A,V,J,re,ae,ee,te){if(a.timeoutHandle=-1,ae=h.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cn},tk(h,_,ae);var be=(_&62914560)===_?Td-_s():(_&4194048)===_?nk-_s():0;if(be=Pz(ae,be),be!==null){Cn=_,a.cancelPendingCommit=be(Ok.bind(null,a,h,_,f,p,O,x,A,V,re,ae,null,ee,te)),fo(a,_,x,!J);return}}Ok(a,h,_,f,p,O,x,A,V)}function U6(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 p=0;p<f.length;p++){var O=f[p],_=O.getSnapshot;O=O.value;try{if(!Ss(_(),O))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 fo(a,h,f,p){h&=~d0,h&=~ga,a.suspendedLanes|=h,a.pingedLanes&=~h,p&&(a.warmLanes|=h),p=a.expirationTimes;for(var O=h;0<O;){var _=31-bs(O),x=1<<_;p[_]=-1,O&=~x}f!==0&&_x(a,f,h)}function Ed(){return(Ke&6)===0?(Mc(0),!1):!0}function v0(){if(Xe!==null){if(it===0)var a=Xe.return;else a=Xe,pn=aa=null,LO(a),wl=null,cc=0,a=Xe;for(;a!==null;)jC(a.alternate,a),a=a.return;Xe=null}}function Ll(a,h){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,dz(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),Cn=0,v0(),ht=a,Xe=f=fn(a.current,null),Ie=h,it=0,ks=null,lo=!1,Pl=Uh(a,h),f0=!1,Rl=Ts=d0=ga=ho=Mt=0,hs=kc=null,p0=!1,(h&8)!==0&&(h|=h&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=h;0<p;){var O=31-bs(p),_=1<<O;h|=a[O],p&=~_}return wn=h,Gf(),f}function ck(a,h){Be=null,L.H=vc,h===xl||h===nd?(h=kw(),it=3):h===SO?(h=kw(),it=4):it=h===FO?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,ks=h,Xe===null&&(Mt=1,_d(a,Vs(h,a.current)))}function uk(){var a=ws.current;return a===null?!0:(Ie&4194048)===Ie?Ws===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?a===Ws:!1}function fk(){var a=L.H;return L.H=vc,a===null?vc:a}function dk(){var a=L.A;return L.A=q6,a}function Pd(){Mt=4,lo||(Ie&4194048)!==Ie&&ws.current!==null||(Pl=!0),(ho&134217727)===0&&(ga&134217727)===0||ht===null||fo(ht,Ie,Ts,!1)}function _0(a,h,f){var p=Ke;Ke|=2;var O=fk(),_=dk();(ht!==a||Ie!==h)&&(Ad=null,Ll(a,h)),h=!1;var x=Mt;e:do try{if(it!==0&&Xe!==null){var A=Xe,V=ks;switch(it){case 8:v0(),x=6;break e;case 3:case 2:case 9:case 6:ws.current===null&&(h=!0);var J=it;if(it=0,ks=null,$l(a,A,V,J),f&&Pl){x=0;break e}break;default:J=it,it=0,ks=null,$l(a,A,V,J)}}Y6(),x=Mt;break}catch(re){ck(a,re)}while(!0);return h&&a.shellSuspendCounter++,pn=aa=null,Ke=p,L.H=O,L.A=_,Xe===null&&(ht=null,Ie=0,Gf()),x}function Y6(){for(;Xe!==null;)pk(Xe)}function H6(a,h){var f=Ke;Ke|=2;var p=fk(),O=dk();ht!==a||Ie!==h?(Ad=null,Md=_s()+500,Ll(a,h)):Pl=Uh(a,h);e:do try{if(it!==0&&Xe!==null){h=Xe;var _=ks;t:switch(it){case 1:it=0,ks=null,$l(a,h,_,1);break;case 2:case 9:if(ww(_)){it=0,ks=null,mk(h);break}h=function(){it!==2&&it!==9||ht!==a||(it=7),Rr(a)},_.then(h,h);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:ww(_)?(it=0,ks=null,mk(h)):(it=0,ks=null,$l(a,h,_,7));break;case 5:var x=null;switch(Xe.tag){case 26:x=Xe.memoizedState;case 5:case 27:var A=Xe;if(x?e2(x):A.stateNode.complete){it=0,ks=null;var V=A.sibling;if(V!==null)Xe=V;else{var J=A.return;J!==null?(Xe=J,Rd(J)):Xe=null}break t}}it=0,ks=null,$l(a,h,_,5);break;case 6:it=0,ks=null,$l(a,h,_,6);break;case 8:v0(),Mt=6;break e;default:throw Error(s(462))}}F6();break}catch(re){ck(a,re)}while(!0);return pn=aa=null,L.H=p,L.A=O,Ke=f,Xe!==null?0:(ht=null,Ie=0,Gf(),Mt)}function F6(){for(;Xe!==null&&!_4();)pk(Xe)}function pk(a){var h=zC(a.alternate,a,wn);a.memoizedProps=a.pendingProps,h===null?Rd(a):Xe=h}function mk(a){var h=a,f=h.alternate;switch(h.tag){case 15:case 0:h=RC(f,h,h.pendingProps,h.type,void 0,Ie);break;case 11:h=RC(f,h,h.pendingProps,h.type.render,h.ref,Ie);break;case 5:LO(h);default:jC(f,h),h=Xe=dw(h,wn),h=zC(f,h,wn)}a.memoizedProps=a.pendingProps,h===null?Rd(a):Xe=h}function $l(a,h,f,p){pn=aa=null,LO(h),wl=null,cc=0;var O=h.return;try{if(z6(a,O,h,f,Ie)){Mt=1,_d(a,Vs(f,a.current)),Xe=null;return}}catch(_){if(O!==null)throw Xe=O,_;Mt=1,_d(a,Vs(f,a.current)),Xe=null;return}h.flags&32768?(Ue||p===1?a=!0:Pl||(Ie&536870912)!==0?a=!1:(lo=a=!0,(p===2||p===9||p===3||p===6)&&(p=ws.current,p!==null&&p.tag===13&&(p.flags|=16384))),gk(h,a)):Rd(h)}function Rd(a){var h=a;do{if((h.flags&32768)!==0){gk(h,lo);return}a=h.return;var f=X6(h.alternate,h,wn);if(f!==null){Xe=f;return}if(h=h.sibling,h!==null){Xe=h;return}Xe=h=a}while(h!==null);Mt===0&&(Mt=5)}function gk(a,h){do{var f=V6(a.alternate,a);if(f!==null){f.flags&=32767,Xe=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!h&&(a=a.sibling,a!==null)){Xe=a;return}Xe=a=f}while(a!==null);Mt=6,Xe=null}function Ok(a,h,f,p,O,_,x,A,V){a.cancelPendingCommit=null;do Qd();while(Kt!==0);if((Ke&6)!==0)throw Error(s(327));if(h!==null){if(h===a.current)throw Error(s(177));if(_=h.lanes|h.childLanes,_|=aO,A4(a,f,_,x,A,V),a===ht&&(Xe=ht=null,Ie=0),Ql=h,uo=a,Cn=f,m0=_,g0=O,ok=p,(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,ez($f,function(){return Sk(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(h.flags&13878)!==0,(h.subtreeFlags&13878)!==0||p){p=L.T,L.T=null,O=j.p,j.p=2,x=Ke,Ke|=4;try{Z6(a,h,f)}finally{Ke=x,j.p=O,L.T=p}}Kt=1,vk(),_k(),yk()}}function vk(){if(Kt===1){Kt=0;var a=uo,h=Ql,f=(h.flags&13878)!==0;if((h.subtreeFlags&13878)!==0||f){f=L.T,L.T=null;var p=j.p;j.p=2;var O=Ke;Ke|=4;try{KC(h,a);var _=P0,x=rw(a.containerInfo),A=_.focusedElem,V=_.selectionRange;if(x!==A&&A&&A.ownerDocument&&sw(A.ownerDocument.documentElement,A)){if(V!==null&&iO(A)){var J=V.start,re=V.end;if(re===void 0&&(re=J),"selectionStart"in A)A.selectionStart=J,A.selectionEnd=Math.min(re,A.value.length);else{var ae=A.ownerDocument||document,ee=ae&&ae.defaultView||window;if(ee.getSelection){var te=ee.getSelection(),be=A.textContent.length,Ee=Math.min(V.start,be),ot=V.end===void 0?Ee:Math.min(V.end,be);!te.extend&&Ee>ot&&(x=ot,ot=Ee,Ee=x);var H=iw(A,Ee),q=iw(A,ot);if(H&&q&&(te.rangeCount!==1||te.anchorNode!==H.node||te.anchorOffset!==H.offset||te.focusNode!==q.node||te.focusOffset!==q.offset)){var K=ae.createRange();K.setStart(H.node,H.offset),te.removeAllRanges(),Ee>ot?(te.addRange(K),te.extend(q.node,q.offset)):(K.setEnd(q.node,q.offset),te.addRange(K))}}}}for(ae=[],te=A;te=te.parentNode;)te.nodeType===1&&ae.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ae.length;A++){var oe=ae[A];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}qd=!!E0,P0=E0=null}finally{Ke=O,j.p=p,L.T=f}}a.current=h,Kt=2}}function _k(){if(Kt===2){Kt=0;var a=uo,h=Ql,f=(h.flags&8772)!==0;if((h.subtreeFlags&8772)!==0||f){f=L.T,L.T=null;var p=j.p;j.p=2;var O=Ke;Ke|=4;try{UC(a,h.alternate,h)}finally{Ke=O,j.p=p,L.T=f}}Kt=3}}function yk(){if(Kt===4||Kt===3){Kt=0,y4();var a=uo,h=Ql,f=Cn,p=ok;(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?Kt=5:(Kt=0,Ql=uo=null,bk(a,a.pendingLanes));var O=a.pendingLanes;if(O===0&&(co=null),Dg(f),h=h.stateNode,ys&&typeof ys.onCommitFiberRoot=="function")try{ys.onCommitFiberRoot(Wh,h,void 0,(h.current.flags&128)===128)}catch{}if(p!==null){h=L.T,O=j.p,j.p=2,L.T=null;try{for(var _=a.onRecoverableError,x=0;x<p.length;x++){var A=p[x];_(A.value,{componentStack:A.stack})}}finally{L.T=h,j.p=O}}(Cn&3)!==0&&Qd(),Rr(a),O=a.pendingLanes,(f&261930)!==0&&(O&42)!==0?a===O0?Tc++:(Tc=0,O0=a):Tc=0,Mc(0)}}function bk(a,h){(a.pooledCacheLanes&=h)===0&&(h=a.pooledCache,h!=null&&(a.pooledCache=null,lc(h)))}function Qd(){return vk(),_k(),yk(),Sk()}function Sk(){if(Kt!==5)return!1;var a=uo,h=m0;m0=0;var f=Dg(Cn),p=L.T,O=j.p;try{j.p=32>f?32:f,L.T=null,f=g0,g0=null;var _=uo,x=Cn;if(Kt=0,Ql=uo=null,Cn=0,(Ke&6)!==0)throw Error(s(331));var A=Ke;if(Ke|=4,sk(_.current),ek(_,_.current,x,f),Ke=A,Mc(0,!1),ys&&typeof ys.onPostCommitFiberRoot=="function")try{ys.onPostCommitFiberRoot(Wh,_)}catch{}return!0}finally{j.p=O,L.T=p,bk(a,h)}}function xk(a,h,f){h=Vs(f,h),h=HO(a.stateNode,h,2),a=ro(a,h,2),a!==null&&(Yh(a,2),Rr(a))}function st(a,h,f){if(a.tag===3)xk(a,a,f);else for(;h!==null;){if(h.tag===3){xk(h,a,f);break}else if(h.tag===1){var p=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(co===null||!co.has(p))){a=Vs(f,a),f=wC(2),p=ro(h,f,2),p!==null&&(CC(f,p,h,a),Yh(p,2),Rr(p));break}}h=h.return}}function y0(a,h,f){var p=a.pingCache;if(p===null){p=a.pingCache=new W6;var O=new Set;p.set(h,O)}else O=p.get(h),O===void 0&&(O=new Set,p.set(h,O));O.has(f)||(f0=!0,O.add(f),a=G6.bind(null,a,h,f),h.then(a,a))}function G6(a,h,f){var p=a.pingCache;p!==null&&p.delete(h),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,ht===a&&(Ie&f)===f&&(Mt===4||Mt===3&&(Ie&62914560)===Ie&&300>_s()-Td?(Ke&2)===0&&Ll(a,0):d0|=f,Rl===Ie&&(Rl=0)),Rr(a)}function wk(a,h){h===0&&(h=vx()),a=ra(a,h),a!==null&&(Yh(a,h),Rr(a))}function K6(a){var h=a.memoizedState,f=0;h!==null&&(f=h.retryLane),wk(a,f)}function J6(a,h){var f=0;switch(a.tag){case 31:case 13:var p=a.stateNode,O=a.memoizedState;O!==null&&(f=O.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(s(314))}p!==null&&p.delete(h),wk(a,f)}function ez(a,h){return qh(a,h)}var Ld=null,Bl=null,b0=!1,$d=!1,S0=!1,po=0;function Rr(a){a!==Bl&&a.next===null&&(Bl===null?Ld=Bl=a:Bl=Bl.next=a),$d=!0,b0||(b0=!0,iz())}function Mc(a,h){if(!S0&&$d){S0=!0;do for(var f=!1,p=Ld;p!==null;){if(a!==0){var O=p.pendingLanes;if(O===0)var _=0;else{var x=p.suspendedLanes,A=p.pingedLanes;_=(1<<31-bs(42|a)+1)-1,_&=O&~(x&~A),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(f=!0,Mk(p,_))}else _=Ie,_=Nf(p,p===ht?_:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(_&3)===0||Uh(p,_)||(f=!0,Mk(p,_));p=p.next}while(f);S0=!1}}function tz(){Ck()}function Ck(){$d=b0=!1;var a=0;po!==0&&fz()&&(a=po);for(var h=_s(),f=null,p=Ld;p!==null;){var O=p.next,_=kk(p,h);_===0?(p.next=null,f===null?Ld=O:f.next=O,O===null&&(Bl=f)):(f=p,(a!==0||(_&3)!==0)&&($d=!0)),p=O}Kt!==0&&Kt!==5||Mc(a),po!==0&&(po=0)}function kk(a,h){for(var f=a.suspendedLanes,p=a.pingedLanes,O=a.expirationTimes,_=a.pendingLanes&-62914561;0<_;){var x=31-bs(_),A=1<<x,V=O[x];V===-1?((A&f)===0||(A&p)!==0)&&(O[x]=M4(A,h)):V<=h&&(a.expiredLanes|=A),_&=~A}if(h=ht,f=Ie,f=Nf(a,a===h?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,f===0||a===h&&(it===2||it===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&Lg(p),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||Uh(a,f)){if(h=f&-f,h===a.callbackPriority)return h;switch(p!==null&&Lg(p),Dg(f)){case 2:case 8:f=gx;break;case 32:f=$f;break;case 268435456:f=Ox;break;default:f=$f}return p=Tk.bind(null,a),f=qh(f,p),a.callbackPriority=h,a.callbackNode=f,h}return p!==null&&p!==null&&Lg(p),a.callbackPriority=2,a.callbackNode=null,2}function Tk(a,h){if(Kt!==0&&Kt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(Qd()&&a.callbackNode!==f)return null;var p=Ie;return p=Nf(a,a===ht?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(lk(a,p,h),kk(a,_s()),a.callbackNode!=null&&a.callbackNode===f?Tk.bind(null,a):null)}function Mk(a,h){if(Qd())return null;lk(a,h,!0)}function iz(){pz(function(){(Ke&6)!==0?qh(mx,tz):Ck()})}function x0(){if(po===0){var a=bl;a===0&&(a=Bf,Bf<<=1,(Bf&261888)===0&&(Bf=256)),po=a}return po}function Ak(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Zf(""+a)}function Ek(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 sz(a,h,f,p,O){if(h==="submit"&&f&&f.stateNode===O){var _=Ak((O[rs]||null).action),x=p.submitter;x&&(h=(h=x[rs]||null)?Ak(h.formAction):x.getAttribute("formAction"),h!==null&&(_=h,x=null));var A=new Uf("action","action",null,p,O);a.push({event:A,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(po!==0){var V=x?Ek(O,x):new FormData(O);ZO(f,{pending:!0,data:V,method:O.method,action:_},null,V)}}else typeof _=="function"&&(A.preventDefault(),V=x?Ek(O,x):new FormData(O),ZO(f,{pending:!0,data:V,method:O.method,action:_},_,V))},currentTarget:O}]})}}for(var w0=0;w0<oO.length;w0++){var C0=oO[w0],rz=C0.toLowerCase(),nz=C0[0].toUpperCase()+C0.slice(1);fr(rz,"on"+nz)}fr(aw,"onAnimationEnd"),fr(lw,"onAnimationIteration"),fr(hw,"onAnimationStart"),fr("dblclick","onDoubleClick"),fr("focusin","onFocus"),fr("focusout","onBlur"),fr(b6,"onTransitionRun"),fr(S6,"onTransitionStart"),fr(x6,"onTransitionCancel"),fr(cw,"onTransitionEnd"),al("onMouseEnter",["mouseout","mouseover"]),al("onMouseLeave",["mouseout","mouseover"]),al("onPointerEnter",["pointerout","pointerover"]),al("onPointerLeave",["pointerout","pointerover"]),ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ea("onBeforeInput",["compositionend","keypress","textInput","paste"]),ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ac="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(" "),oz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ac));function Pk(a,h){h=(h&4)!==0;for(var f=0;f<a.length;f++){var p=a[f],O=p.event;p=p.listeners;e:{var _=void 0;if(h)for(var x=p.length-1;0<=x;x--){var A=p[x],V=A.instance,J=A.currentTarget;if(A=A.listener,V!==_&&O.isPropagationStopped())break e;_=A,O.currentTarget=J;try{_(O)}catch(re){Ff(re)}O.currentTarget=null,_=V}else for(x=0;x<p.length;x++){if(A=p[x],V=A.instance,J=A.currentTarget,A=A.listener,V!==_&&O.isPropagationStopped())break e;_=A,O.currentTarget=J;try{_(O)}catch(re){Ff(re)}O.currentTarget=null,_=V}}}}function Ve(a,h){var f=h[zg];f===void 0&&(f=h[zg]=new Set);var p=a+"__bubble";f.has(p)||(Rk(h,a,2,!1),f.add(p))}function k0(a,h,f){var p=0;h&&(p|=4),Rk(f,a,p,h)}var Bd="_reactListening"+Math.random().toString(36).slice(2);function T0(a){if(!a[Bd]){a[Bd]=!0,Cx.forEach(function(f){f!=="selectionchange"&&(oz.has(f)||k0(f,!1,a),k0(f,!0,a))});var h=a.nodeType===9?a:a.ownerDocument;h===null||h[Bd]||(h[Bd]=!0,k0("selectionchange",!1,h))}}function Rk(a,h,f,p){switch(a2(h)){case 2:var O=Lz;break;case 8:O=$z;break;default:O=V0}f=O.bind(null,h,f,a),O=void 0,!Ug||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(O=!0),p?O!==void 0?a.addEventListener(h,f,{capture:!0,passive:O}):a.addEventListener(h,f,!0):O!==void 0?a.addEventListener(h,f,{passive:O}):a.addEventListener(h,f,!1)}function M0(a,h,f,p,O){var _=p;if((h&1)===0&&(h&2)===0&&p!==null)e:for(;;){if(p===null)return;var x=p.tag;if(x===3||x===4){var A=p.stateNode.containerInfo;if(A===O)break;if(x===4)for(x=p.return;x!==null;){var V=x.tag;if((V===3||V===4)&&x.stateNode.containerInfo===O)return;x=x.return}for(;A!==null;){if(x=rl(A),x===null)return;if(V=x.tag,V===5||V===6||V===26||V===27){p=_=x;continue e}A=A.parentNode}}p=p.return}Dx(function(){var J=_,re=qg(f),ae=[];e:{var ee=uw.get(a);if(ee!==void 0){var te=Uf,be=a;switch(a){case"keypress":if(qf(f)===0)break e;case"keydown":case"keyup":te=J4;break;case"focusin":be="focus",te=Gg;break;case"focusout":be="blur",te=Gg;break;case"beforeblur":case"afterblur":te=Gg;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":te=jx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=X4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=i6;break;case aw:case lw:case hw:te=I4;break;case cw:te=r6;break;case"scroll":case"scrollend":te=N4;break;case"wheel":te=o6;break;case"copy":case"cut":case"paste":te=W4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Vx;break;case"toggle":case"beforetoggle":te=l6}var Ee=(h&4)!==0,ot=!Ee&&(a==="scroll"||a==="scrollend"),H=Ee?ee!==null?ee+"Capture":null:ee;Ee=[];for(var q=J,K;q!==null;){var oe=q;if(K=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||K===null||H===null||(oe=Gh(q,H),oe!=null&&Ee.push(Ec(q,oe,K))),ot)break;q=q.return}0<Ee.length&&(ee=new te(ee,be,null,f,re),ae.push({event:ee,listeners:Ee}))}}if((h&7)===0){e:{if(ee=a==="mouseover"||a==="pointerover",te=a==="mouseout"||a==="pointerout",ee&&f!==Ig&&(be=f.relatedTarget||f.fromElement)&&(rl(be)||be[sl]))break e;if((te||ee)&&(ee=re.window===re?re:(ee=re.ownerDocument)?ee.defaultView||ee.parentWindow:window,te?(be=f.relatedTarget||f.toElement,te=J,be=be?rl(be):null,be!==null&&(ot=n(be),Ee=be.tag,be!==ot||Ee!==5&&Ee!==27&&Ee!==6)&&(be=null)):(te=null,be=J),te!==be)){if(Ee=jx,oe="onMouseLeave",H="onMouseEnter",q="mouse",(a==="pointerout"||a==="pointerover")&&(Ee=Vx,oe="onPointerLeave",H="onPointerEnter",q="pointer"),ot=te==null?ee:Fh(te),K=be==null?ee:Fh(be),ee=new Ee(oe,q+"leave",te,f,re),ee.target=ot,ee.relatedTarget=K,oe=null,rl(re)===J&&(Ee=new Ee(H,q+"enter",be,f,re),Ee.target=K,Ee.relatedTarget=ot,oe=Ee),ot=oe,te&&be)t:{for(Ee=az,H=te,q=be,K=0,oe=H;oe;oe=Ee(oe))K++;oe=0;for(var Ae=q;Ae;Ae=Ee(Ae))oe++;for(;0<K-oe;)H=Ee(H),K--;for(;0<oe-K;)q=Ee(q),oe--;for(;K--;){if(H===q||q!==null&&H===q.alternate){Ee=H;break t}H=Ee(H),q=Ee(q)}Ee=null}else Ee=null;te!==null&&Qk(ae,ee,te,Ee,!1),be!==null&&ot!==null&&Qk(ae,ot,be,Ee,!0)}}e:{if(ee=J?Fh(J):window,te=ee.nodeName&&ee.nodeName.toLowerCase(),te==="select"||te==="input"&&ee.type==="file")var Fe=Fx;else if(Yx(ee))if(Gx)Fe=v6;else{Fe=g6;var Ce=m6}else te=ee.nodeName,!te||te.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?J&&Zg(J.elementType)&&(Fe=Fx):Fe=O6;if(Fe&&(Fe=Fe(a,J))){Hx(ae,Fe,f,re);break e}Ce&&Ce(a,ee,J),a==="focusout"&&J&&ee.type==="number"&&J.memoizedProps.value!=null&&Vg(ee,"number",ee.value)}switch(Ce=J?Fh(J):window,a){case"focusin":(Yx(Ce)||Ce.contentEditable==="true")&&(dl=Ce,sO=J,nc=null);break;case"focusout":nc=sO=dl=null;break;case"mousedown":rO=!0;break;case"contextmenu":case"mouseup":case"dragend":rO=!1,nw(ae,f,re);break;case"selectionchange":if(y6)break;case"keydown":case"keyup":nw(ae,f,re)}var De;if(Jg)e:{switch(a){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else fl?Wx(a,f)&&(qe="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(qe="onCompositionStart");qe&&(Zx&&f.locale!=="ko"&&(fl||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&fl&&(De=zx()):(Gn=re,Yg="value"in Gn?Gn.value:Gn.textContent,fl=!0)),Ce=Dd(J,qe),0<Ce.length&&(qe=new Xx(qe,a,null,f,re),ae.push({event:qe,listeners:Ce}),De?qe.data=De:(De=Ux(f),De!==null&&(qe.data=De)))),(De=c6?u6(a,f):f6(a,f))&&(qe=Dd(J,"onBeforeInput"),0<qe.length&&(Ce=new Xx("onBeforeInput","beforeinput",null,f,re),ae.push({event:Ce,listeners:qe}),Ce.data=De)),sz(ae,a,J,f,re)}Pk(ae,h)})}function Ec(a,h,f){return{instance:a,listener:h,currentTarget:f}}function Dd(a,h){for(var f=h+"Capture",p=[];a!==null;){var O=a,_=O.stateNode;if(O=O.tag,O!==5&&O!==26&&O!==27||_===null||(O=Gh(a,f),O!=null&&p.unshift(Ec(a,O,_)),O=Gh(a,h),O!=null&&p.push(Ec(a,O,_))),a.tag===3)return p;a=a.return}return[]}function az(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Qk(a,h,f,p,O){for(var _=h._reactName,x=[];f!==null&&f!==p;){var A=f,V=A.alternate,J=A.stateNode;if(A=A.tag,V!==null&&V===p)break;A!==5&&A!==26&&A!==27||J===null||(V=J,O?(J=Gh(f,_),J!=null&&x.unshift(Ec(f,J,V))):O||(J=Gh(f,_),J!=null&&x.push(Ec(f,J,V)))),f=f.return}x.length!==0&&a.push({event:h,listeners:x})}var lz=/\r\n?/g,hz=/\u0000|\uFFFD/g;function Lk(a){return(typeof a=="string"?a:""+a).replace(lz,`
|
|
49
|
-
`).replace(hz,"")}function $k(a,h){return h=Lk(h),Lk(a)===h}function nt(a,h,f,p,O,_){switch(f){case"children":typeof p=="string"?h==="body"||h==="textarea"&&p===""||hl(a,p):(typeof p=="number"||typeof p=="bigint")&&h!=="body"&&hl(a,""+p);break;case"className":Xf(a,"class",p);break;case"tabIndex":Xf(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Xf(a,f,p);break;case"style":$x(a,p,_);break;case"data":if(h!=="object"){Xf(a,"data",p);break}case"src":case"href":if(p===""&&(h!=="a"||f!=="href")){a.removeAttribute(f);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(f);break}p=Zf(""+p),a.setAttribute(f,p);break;case"action":case"formAction":if(typeof p=="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 _=="function"&&(f==="formAction"?(h!=="input"&&nt(a,h,"name",O.name,O,null),nt(a,h,"formEncType",O.formEncType,O,null),nt(a,h,"formMethod",O.formMethod,O,null),nt(a,h,"formTarget",O.formTarget,O,null)):(nt(a,h,"encType",O.encType,O,null),nt(a,h,"method",O.method,O,null),nt(a,h,"target",O.target,O,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(f);break}p=Zf(""+p),a.setAttribute(f,p);break;case"onClick":p!=null&&(a.onclick=cn);break;case"onScroll":p!=null&&Ve("scroll",a);break;case"onScrollEnd":p!=null&&Ve("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(f=p.__html,f!=null){if(O.children!=null)throw Error(s(60));a.innerHTML=f}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}f=Zf(""+p),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":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(f,""+p):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":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":p===!0?a.setAttribute(f,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(f,p):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(f,p):a.removeAttribute(f);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(f):a.setAttribute(f,p);break;case"popover":Ve("beforetoggle",a),Ve("toggle",a),jf(a,"popover",p);break;case"xlinkActuate":hn(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":hn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":hn(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":hn(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":hn(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":hn(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":hn(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":hn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":hn(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":jf(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=D4.get(f)||f,jf(a,f,p))}}function A0(a,h,f,p,O,_){switch(f){case"style":$x(a,p,_);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(f=p.__html,f!=null){if(O.children!=null)throw Error(s(60));a.innerHTML=f}}break;case"children":typeof p=="string"?hl(a,p):(typeof p=="number"||typeof p=="bigint")&&hl(a,""+p);break;case"onScroll":p!=null&&Ve("scroll",a);break;case"onScrollEnd":p!=null&&Ve("scrollend",a);break;case"onClick":p!=null&&(a.onclick=cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kx.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(O=f.endsWith("Capture"),h=f.slice(2,O?f.length-7:void 0),_=a[rs]||null,_=_!=null?_[f]:null,typeof _=="function"&&a.removeEventListener(h,_,O),typeof p=="function")){typeof _!="function"&&_!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(h,p,O);break e}f in a?a[f]=p:p===!0?a.setAttribute(f,""):jf(a,f,p)}}}function Mi(a,h,f){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",a),Ve("load",a);var p=!1,O=!1,_;for(_ in f)if(f.hasOwnProperty(_)){var x=f[_];if(x!=null)switch(_){case"src":p=!0;break;case"srcSet":O=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,h));default:nt(a,h,_,x,f,null)}}O&&nt(a,h,"srcSet",f.srcSet,f,null),p&&nt(a,h,"src",f.src,f,null);return;case"input":Ve("invalid",a);var A=_=x=O=null,V=null,J=null;for(p in f)if(f.hasOwnProperty(p)){var re=f[p];if(re!=null)switch(p){case"name":O=re;break;case"type":x=re;break;case"checked":V=re;break;case"defaultChecked":J=re;break;case"value":_=re;break;case"defaultValue":A=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(s(137,h));break;default:nt(a,h,p,re,f,null)}}Px(a,_,A,V,J,x,O,!1);return;case"select":Ve("invalid",a),p=x=_=null;for(O in f)if(f.hasOwnProperty(O)&&(A=f[O],A!=null))switch(O){case"value":_=A;break;case"defaultValue":x=A;break;case"multiple":p=A;default:nt(a,h,O,A,f,null)}h=_,f=x,a.multiple=!!p,h!=null?ll(a,!!p,h,!1):f!=null&&ll(a,!!p,f,!0);return;case"textarea":Ve("invalid",a),_=O=p=null;for(x in f)if(f.hasOwnProperty(x)&&(A=f[x],A!=null))switch(x){case"value":p=A;break;case"defaultValue":O=A;break;case"children":_=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(s(91));break;default:nt(a,h,x,A,f,null)}Qx(a,p,O,_);return;case"option":for(V in f)if(f.hasOwnProperty(V)&&(p=f[V],p!=null))switch(V){case"selected":a.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:nt(a,h,V,p,f,null)}return;case"dialog":Ve("beforetoggle",a),Ve("toggle",a),Ve("cancel",a),Ve("close",a);break;case"iframe":case"object":Ve("load",a);break;case"video":case"audio":for(p=0;p<Ac.length;p++)Ve(Ac[p],a);break;case"image":Ve("error",a),Ve("load",a);break;case"details":Ve("toggle",a);break;case"embed":case"source":case"link":Ve("error",a),Ve("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(J in f)if(f.hasOwnProperty(J)&&(p=f[J],p!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,h));default:nt(a,h,J,p,f,null)}return;default:if(Zg(h)){for(re in f)f.hasOwnProperty(re)&&(p=f[re],p!==void 0&&A0(a,h,re,p,f,void 0));return}}for(A in f)f.hasOwnProperty(A)&&(p=f[A],p!=null&&nt(a,h,A,p,f,null))}function cz(a,h,f,p){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var O=null,_=null,x=null,A=null,V=null,J=null,re=null;for(te in f){var ae=f[te];if(f.hasOwnProperty(te)&&ae!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":V=ae;default:p.hasOwnProperty(te)||nt(a,h,te,null,p,ae)}}for(var ee in p){var te=p[ee];if(ae=f[ee],p.hasOwnProperty(ee)&&(te!=null||ae!=null))switch(ee){case"type":_=te;break;case"name":O=te;break;case"checked":J=te;break;case"defaultChecked":re=te;break;case"value":x=te;break;case"defaultValue":A=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,h));break;default:te!==ae&&nt(a,h,ee,te,p,ae)}}Xg(a,x,A,V,J,re,_,O);return;case"select":te=x=A=ee=null;for(_ in f)if(V=f[_],f.hasOwnProperty(_)&&V!=null)switch(_){case"value":break;case"multiple":te=V;default:p.hasOwnProperty(_)||nt(a,h,_,null,p,V)}for(O in p)if(_=p[O],V=f[O],p.hasOwnProperty(O)&&(_!=null||V!=null))switch(O){case"value":ee=_;break;case"defaultValue":A=_;break;case"multiple":x=_;default:_!==V&&nt(a,h,O,_,p,V)}h=A,f=x,p=te,ee!=null?ll(a,!!f,ee,!1):!!p!=!!f&&(h!=null?ll(a,!!f,h,!0):ll(a,!!f,f?[]:"",!1));return;case"textarea":te=ee=null;for(A in f)if(O=f[A],f.hasOwnProperty(A)&&O!=null&&!p.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:nt(a,h,A,null,p,O)}for(x in p)if(O=p[x],_=f[x],p.hasOwnProperty(x)&&(O!=null||_!=null))switch(x){case"value":ee=O;break;case"defaultValue":te=O;break;case"children":break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(s(91));break;default:O!==_&&nt(a,h,x,O,p,_)}Rx(a,ee,te);return;case"option":for(var be in f)if(ee=f[be],f.hasOwnProperty(be)&&ee!=null&&!p.hasOwnProperty(be))switch(be){case"selected":a.selected=!1;break;default:nt(a,h,be,null,p,ee)}for(V in p)if(ee=p[V],te=f[V],p.hasOwnProperty(V)&&ee!==te&&(ee!=null||te!=null))switch(V){case"selected":a.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:nt(a,h,V,ee,p,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ee in f)ee=f[Ee],f.hasOwnProperty(Ee)&&ee!=null&&!p.hasOwnProperty(Ee)&&nt(a,h,Ee,null,p,ee);for(J in p)if(ee=p[J],te=f[J],p.hasOwnProperty(J)&&ee!==te&&(ee!=null||te!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(s(137,h));break;default:nt(a,h,J,ee,p,te)}return;default:if(Zg(h)){for(var ot in f)ee=f[ot],f.hasOwnProperty(ot)&&ee!==void 0&&!p.hasOwnProperty(ot)&&A0(a,h,ot,void 0,p,ee);for(re in p)ee=p[re],te=f[re],!p.hasOwnProperty(re)||ee===te||ee===void 0&&te===void 0||A0(a,h,re,ee,p,te);return}}for(var H in f)ee=f[H],f.hasOwnProperty(H)&&ee!=null&&!p.hasOwnProperty(H)&&nt(a,h,H,null,p,ee);for(ae in p)ee=p[ae],te=f[ae],!p.hasOwnProperty(ae)||ee===te||ee==null&&te==null||nt(a,h,ae,ee,p,te)}function Bk(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uz(){if(typeof performance.getEntriesByType=="function"){for(var a=0,h=0,f=performance.getEntriesByType("resource"),p=0;p<f.length;p++){var O=f[p],_=O.transferSize,x=O.initiatorType,A=O.duration;if(_&&A&&Bk(x)){for(x=0,A=O.responseEnd,p+=1;p<f.length;p++){var V=f[p],J=V.startTime;if(J>A)break;var re=V.transferSize,ae=V.initiatorType;re&&Bk(ae)&&(V=V.responseEnd,x+=re*(V<A?1:(A-J)/(V-J)))}if(--p,h+=8*(_+x)/(O.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 E0=null,P0=null;function zd(a){return a.nodeType===9?a:a.ownerDocument}function Dk(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 zk(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 R0(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 Q0=null;function fz(){var a=window.event;return a&&a.type==="popstate"?a===Q0?!1:(Q0=a,!0):(Q0=null,!1)}var Nk=typeof setTimeout=="function"?setTimeout:void 0,dz=typeof clearTimeout=="function"?clearTimeout:void 0,jk=typeof Promise=="function"?Promise:void 0,pz=typeof queueMicrotask=="function"?queueMicrotask:typeof jk<"u"?function(a){return jk.resolve(null).then(a).catch(mz)}:Nk;function mz(a){setTimeout(function(){throw a})}function mo(a){return a==="head"}function Xk(a,h){var f=h,p=0;do{var O=f.nextSibling;if(a.removeChild(f),O&&O.nodeType===8)if(f=O.data,f==="/$"||f==="/&"){if(p===0){a.removeChild(O),jl(h);return}p--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")p++;else if(f==="html")Pc(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,Pc(f);for(var _=f.firstChild;_;){var x=_.nextSibling,A=_.nodeName;_[Hh]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&_.rel.toLowerCase()==="stylesheet"||f.removeChild(_),_=x}}else f==="body"&&Pc(a.ownerDocument.body);f=O}while(f);jl(h)}function Vk(a,h){var f=a;a=0;do{var p=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||""),p&&p.nodeType===8)if(f=p.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=p}while(f)}function L0(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":L0(f),Ng(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function gz(a,h,f,p){for(;a.nodeType===1;){var O=f;if(a.nodeName.toLowerCase()!==h.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[Hh])switch(h){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(_=a.getAttribute("rel"),_==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(_!==O.rel||a.getAttribute("href")!==(O.href==null||O.href===""?null:O.href)||a.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin)||a.getAttribute("title")!==(O.title==null?null:O.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(_=a.getAttribute("src"),(_!==(O.src==null?null:O.src)||a.getAttribute("type")!==(O.type==null?null:O.type)||a.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin))&&_&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(h==="input"&&a.type==="hidden"){var _=O.name==null?null:""+O.name;if(O.type==="hidden"&&a.getAttribute("name")===_)return a}else return a;if(a=Us(a.nextSibling),a===null)break}return null}function Oz(a,h,f){if(h==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=Us(a.nextSibling),a===null))return null;return a}function Zk(a,h){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=Us(a.nextSibling),a===null))return null;return a}function $0(a){return a.data==="$?"||a.data==="$~"}function B0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function vz(a,h){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=h;else if(a.data!=="$?"||f.readyState!=="loading")h();else{var p=function(){h(),f.removeEventListener("DOMContentLoaded",p)};f.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function Us(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 D0=null;function Ik(a){a=a.nextSibling;for(var h=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(h===0)return Us(a.nextSibling);h--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||h++}a=a.nextSibling}return null}function qk(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 Wk(a,h,f){switch(h=zd(f),a){case"html":if(a=h.documentElement,!a)throw Error(s(452));return a;case"head":if(a=h.head,!a)throw Error(s(453));return a;case"body":if(a=h.body,!a)throw Error(s(454));return a;default:throw Error(s(451))}}function Pc(a){for(var h=a.attributes;h.length;)a.removeAttributeNode(h[0]);Ng(a)}var Ys=new Map,Uk=new Set;function Nd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var kn=j.d;j.d={f:_z,r:yz,D:bz,C:Sz,L:xz,m:wz,X:kz,S:Cz,M:Tz};function _z(){var a=kn.f(),h=Ed();return a||h}function yz(a){var h=nl(a);h!==null&&h.tag===5&&h.type==="form"?cC(h):kn.r(a)}var Dl=typeof document>"u"?null:document;function Yk(a,h,f){var p=Dl;if(p&&typeof h=="string"&&h){var O=js(h);O='link[rel="'+a+'"][href="'+O+'"]',typeof f=="string"&&(O+='[crossorigin="'+f+'"]'),Uk.has(O)||(Uk.add(O),a={rel:a,crossOrigin:f,href:h},p.querySelector(O)===null&&(h=p.createElement("link"),Mi(h,"link",a),ai(h),p.head.appendChild(h)))}}function bz(a){kn.D(a),Yk("dns-prefetch",a,null)}function Sz(a,h){kn.C(a,h),Yk("preconnect",a,h)}function xz(a,h,f){kn.L(a,h,f);var p=Dl;if(p&&a&&h){var O='link[rel="preload"][as="'+js(h)+'"]';h==="image"&&f&&f.imageSrcSet?(O+='[imagesrcset="'+js(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(O+='[imagesizes="'+js(f.imageSizes)+'"]')):O+='[href="'+js(a)+'"]';var _=O;switch(h){case"style":_=zl(a);break;case"script":_=Nl(a)}Ys.has(_)||(a=m({rel:"preload",href:h==="image"&&f&&f.imageSrcSet?void 0:a,as:h},f),Ys.set(_,a),p.querySelector(O)!==null||h==="style"&&p.querySelector(Rc(_))||h==="script"&&p.querySelector(Qc(_))||(h=p.createElement("link"),Mi(h,"link",a),ai(h),p.head.appendChild(h)))}}function wz(a,h){kn.m(a,h);var f=Dl;if(f&&a){var p=h&&typeof h.as=="string"?h.as:"script",O='link[rel="modulepreload"][as="'+js(p)+'"][href="'+js(a)+'"]',_=O;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Nl(a)}if(!Ys.has(_)&&(a=m({rel:"modulepreload",href:a},h),Ys.set(_,a),f.querySelector(O)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Qc(_)))return}p=f.createElement("link"),Mi(p,"link",a),ai(p),f.head.appendChild(p)}}}function Cz(a,h,f){kn.S(a,h,f);var p=Dl;if(p&&a){var O=ol(p).hoistableStyles,_=zl(a);h=h||"default";var x=O.get(_);if(!x){var A={loading:0,preload:null};if(x=p.querySelector(Rc(_)))A.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":h},f),(f=Ys.get(_))&&z0(a,f);var V=x=p.createElement("link");ai(V),Mi(V,"link",a),V._p=new Promise(function(J,re){V.onload=J,V.onerror=re}),V.addEventListener("load",function(){A.loading|=1}),V.addEventListener("error",function(){A.loading|=2}),A.loading|=4,jd(x,h,p)}x={type:"stylesheet",instance:x,count:1,state:A},O.set(_,x)}}}function kz(a,h){kn.X(a,h);var f=Dl;if(f&&a){var p=ol(f).hoistableScripts,O=Nl(a),_=p.get(O);_||(_=f.querySelector(Qc(O)),_||(a=m({src:a,async:!0},h),(h=Ys.get(O))&&N0(a,h),_=f.createElement("script"),ai(_),Mi(_,"link",a),f.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},p.set(O,_))}}function Tz(a,h){kn.M(a,h);var f=Dl;if(f&&a){var p=ol(f).hoistableScripts,O=Nl(a),_=p.get(O);_||(_=f.querySelector(Qc(O)),_||(a=m({src:a,async:!0,type:"module"},h),(h=Ys.get(O))&&N0(a,h),_=f.createElement("script"),ai(_),Mi(_,"link",a),f.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},p.set(O,_))}}function Hk(a,h,f,p){var O=(O=de.current)?Nd(O):null;if(!O)throw Error(s(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(h=zl(f.href),f=ol(O).hoistableStyles,p=f.get(h),p||(p={type:"style",instance:null,count:0,state:null},f.set(h,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=zl(f.href);var _=ol(O).hoistableStyles,x=_.get(a);if(x||(O=O.ownerDocument||O,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(a,x),(_=O.querySelector(Rc(a)))&&!_._p&&(x.instance=_,x.state.loading=5),Ys.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},Ys.set(a,f),_||Mz(O,a,f,x.state))),h&&p===null)throw Error(s(528,""));return x}if(h&&p!==null)throw Error(s(529,""));return null;case"script":return h=f.async,f=f.src,typeof f=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Nl(f),f=ol(O).hoistableScripts,p=f.get(h),p||(p={type:"script",instance:null,count:0,state:null},f.set(h,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,a))}}function zl(a){return'href="'+js(a)+'"'}function Rc(a){return'link[rel="stylesheet"]['+a+"]"}function Fk(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function Mz(a,h,f,p){a.querySelector('link[rel="preload"][as="style"]['+h+"]")?p.loading=1:(h=a.createElement("link"),p.preload=h,h.addEventListener("load",function(){return p.loading|=1}),h.addEventListener("error",function(){return p.loading|=2}),Mi(h,"link",f),ai(h),a.head.appendChild(h))}function Nl(a){return'[src="'+js(a)+'"]'}function Qc(a){return"script[async]"+a}function Gk(a,h,f){if(h.count++,h.instance===null)switch(h.type){case"style":var p=a.querySelector('style[data-href~="'+js(f.href)+'"]');if(p)return h.instance=p,ai(p),p;var O=m({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),ai(p),Mi(p,"style",O),jd(p,f.precedence,a),h.instance=p;case"stylesheet":O=zl(f.href);var _=a.querySelector(Rc(O));if(_)return h.state.loading|=4,h.instance=_,ai(_),_;p=Fk(f),(O=Ys.get(O))&&z0(p,O),_=(a.ownerDocument||a).createElement("link"),ai(_);var x=_;return x._p=new Promise(function(A,V){x.onload=A,x.onerror=V}),Mi(_,"link",p),h.state.loading|=4,jd(_,f.precedence,a),h.instance=_;case"script":return _=Nl(f.src),(O=a.querySelector(Qc(_)))?(h.instance=O,ai(O),O):(p=f,(O=Ys.get(_))&&(p=m({},f),N0(p,O)),a=a.ownerDocument||a,O=a.createElement("script"),ai(O),Mi(O,"link",p),a.head.appendChild(O),h.instance=O);case"void":return null;default:throw Error(s(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(p=h.instance,h.state.loading|=4,jd(p,f.precedence,a));return h.instance}function jd(a,h,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),O=p.length?p[p.length-1]:null,_=O,x=0;x<p.length;x++){var A=p[x];if(A.dataset.precedence===h)_=A;else if(_!==O)break}_?_.parentNode.insertBefore(a,_.nextSibling):(h=f.nodeType===9?f.head:f,h.insertBefore(a,h.firstChild))}function z0(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.title==null&&(a.title=h.title)}function N0(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.integrity==null&&(a.integrity=h.integrity)}var Xd=null;function Kk(a,h,f){if(Xd===null){var p=new Map,O=Xd=new Map;O.set(f,p)}else O=Xd,p=O.get(f),p||(p=new Map,O.set(f,p));if(p.has(a))return p;for(p.set(a,null),f=f.getElementsByTagName(a),O=0;O<f.length;O++){var _=f[O];if(!(_[Hh]||_[wi]||a==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var x=_.getAttribute(h)||"";x=a+x;var A=p.get(x);A?A.push(_):p.set(x,[_])}}return p}function Jk(a,h,f){a=a.ownerDocument||a,a.head.insertBefore(f,h==="title"?a.querySelector("head > title"):null)}function Az(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 e2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function Ez(a,h,f,p){if(f.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var O=zl(p.href),_=h.querySelector(Rc(O));if(_){h=_._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(a.count++,a=Vd.bind(a),h.then(a,a)),f.state.loading|=4,f.instance=_,ai(_);return}_=h.ownerDocument||h,p=Fk(p),(O=Ys.get(O))&&z0(p,O),_=_.createElement("link"),ai(_);var x=_;x._p=new Promise(function(A,V){x.onload=A,x.onerror=V}),Mi(_,"link",p),f.instance=_}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,h),(h=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Vd.bind(a),h.addEventListener("load",f),h.addEventListener("error",f))}}var j0=0;function Pz(a,h){return a.stylesheets&&a.count===0&&Id(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var p=setTimeout(function(){if(a.stylesheets&&Id(a,a.stylesheets),a.unsuspend){var _=a.unsuspend;a.unsuspend=null,_()}},6e4+h);0<a.imgBytes&&j0===0&&(j0=62500*uz());var O=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Id(a,a.stylesheets),a.unsuspend)){var _=a.unsuspend;a.unsuspend=null,_()}},(a.imgBytes>j0?50:800)+h);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(p),clearTimeout(O)}}:null}function Vd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Id(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Zd=null;function Id(a,h){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Zd=new Map,h.forEach(Rz,a),Zd=null,Vd.call(a))}function Rz(a,h){if(!(h.state.loading&4)){var f=Zd.get(a);if(f)var p=f.get(null);else{f=new Map,Zd.set(a,f);for(var O=a.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<O.length;_++){var x=O[_];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(f.set(x.dataset.precedence,x),p=x)}p&&f.set(null,p)}O=h.instance,x=O.getAttribute("data-precedence"),_=f.get(x)||p,_===p&&f.set(null,O),f.set(x,O),this.count++,p=Vd.bind(this),O.addEventListener("load",p),O.addEventListener("error",p),_?_.parentNode.insertBefore(O,_.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(O,a.firstChild)),h.state.loading|=4}}var Lc={$$typeof:M,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function Qz(a,h,f,p,O,_,x,A,V){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=$g(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$g(0),this.hiddenUpdates=$g(null),this.identifierPrefix=p,this.onUncaughtError=O,this.onCaughtError=_,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function t2(a,h,f,p,O,_,x,A,V,J,re,ae){return a=new Qz(a,h,f,x,V,J,re,ae,A),h=1,_===!0&&(h|=24),_=xs(3,null,null,h),a.current=_,_.stateNode=a,h=_O(),h.refCount++,a.pooledCache=h,h.refCount++,_.memoizedState={element:p,isDehydrated:f,cache:h},xO(_),a}function i2(a){return a?(a=gl,a):gl}function s2(a,h,f,p,O,_){O=i2(O),p.context===null?p.context=O:p.pendingContext=O,p=so(h),p.payload={element:f},_=_===void 0?null:_,_!==null&&(p.callback=_),f=ro(a,p,h),f!==null&&(cs(f,a,h),fc(f,a,h))}function r2(a,h){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<h?f:h}}function X0(a,h){r2(a,h),(a=a.alternate)&&r2(a,h)}function n2(a){if(a.tag===13||a.tag===31){var h=ra(a,67108864);h!==null&&cs(h,a,67108864),X0(a,67108864)}}function o2(a){if(a.tag===13||a.tag===31){var h=Ms();h=Bg(h);var f=ra(a,h);f!==null&&cs(f,a,h),X0(a,h)}}var qd=!0;function Lz(a,h,f,p){var O=L.T;L.T=null;var _=j.p;try{j.p=2,V0(a,h,f,p)}finally{j.p=_,L.T=O}}function $z(a,h,f,p){var O=L.T;L.T=null;var _=j.p;try{j.p=8,V0(a,h,f,p)}finally{j.p=_,L.T=O}}function V0(a,h,f,p){if(qd){var O=Z0(p);if(O===null)M0(a,h,p,Wd,f),l2(a,p);else if(Dz(O,a,h,f,p))p.stopPropagation();else if(l2(a,p),h&4&&-1<Bz.indexOf(a)){for(;O!==null;){var _=nl(O);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var x=Jo(_.pendingLanes);if(x!==0){var A=_;for(A.pendingLanes|=2,A.entangledLanes|=2;x;){var V=1<<31-bs(x);A.entanglements[1]|=V,x&=~V}Rr(_),(Ke&6)===0&&(Md=_s()+500,Mc(0))}}break;case 31:case 13:A=ra(_,2),A!==null&&cs(A,_,2),Ed(),X0(_,2)}if(_=Z0(p),_===null&&M0(a,h,p,Wd,f),_===O)break;O=_}O!==null&&p.stopPropagation()}else M0(a,h,p,null,f)}}function Z0(a){return a=qg(a),I0(a)}var Wd=null;function I0(a){if(Wd=null,a=rl(a),a!==null){var h=n(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 Wd=a,null}function a2(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(b4()){case mx:return 2;case gx:return 8;case $f:case S4:return 32;case Ox:return 268435456;default:return 32}default:return 32}}var q0=!1,go=null,Oo=null,vo=null,$c=new Map,Bc=new Map,_o=[],Bz="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 l2(a,h){switch(a){case"focusin":case"focusout":go=null;break;case"dragenter":case"dragleave":Oo=null;break;case"mouseover":case"mouseout":vo=null;break;case"pointerover":case"pointerout":$c.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bc.delete(h.pointerId)}}function Dc(a,h,f,p,O,_){return a===null||a.nativeEvent!==_?(a={blockedOn:h,domEventName:f,eventSystemFlags:p,nativeEvent:_,targetContainers:[O]},h!==null&&(h=nl(h),h!==null&&n2(h)),a):(a.eventSystemFlags|=p,h=a.targetContainers,O!==null&&h.indexOf(O)===-1&&h.push(O),a)}function Dz(a,h,f,p,O){switch(h){case"focusin":return go=Dc(go,a,h,f,p,O),!0;case"dragenter":return Oo=Dc(Oo,a,h,f,p,O),!0;case"mouseover":return vo=Dc(vo,a,h,f,p,O),!0;case"pointerover":var _=O.pointerId;return $c.set(_,Dc($c.get(_)||null,a,h,f,p,O)),!0;case"gotpointercapture":return _=O.pointerId,Bc.set(_,Dc(Bc.get(_)||null,a,h,f,p,O)),!0}return!1}function h2(a){var h=rl(a.target);if(h!==null){var f=n(h);if(f!==null){if(h=f.tag,h===13){if(h=o(f),h!==null){a.blockedOn=h,xx(a.priority,function(){o2(f)});return}}else if(h===31){if(h=l(f),h!==null){a.blockedOn=h,xx(a.priority,function(){o2(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 Ud(a){if(a.blockedOn!==null)return!1;for(var h=a.targetContainers;0<h.length;){var f=Z0(a.nativeEvent);if(f===null){f=a.nativeEvent;var p=new f.constructor(f.type,f);Ig=p,f.target.dispatchEvent(p),Ig=null}else return h=nl(f),h!==null&&n2(h),a.blockedOn=f,!1;h.shift()}return!0}function c2(a,h,f){Ud(a)&&f.delete(h)}function zz(){q0=!1,go!==null&&Ud(go)&&(go=null),Oo!==null&&Ud(Oo)&&(Oo=null),vo!==null&&Ud(vo)&&(vo=null),$c.forEach(c2),Bc.forEach(c2)}function Yd(a,h){a.blockedOn===h&&(a.blockedOn=null,q0||(q0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zz)))}var Hd=null;function u2(a){Hd!==a&&(Hd=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hd===a&&(Hd=null);for(var h=0;h<a.length;h+=3){var f=a[h],p=a[h+1],O=a[h+2];if(typeof p!="function"){if(I0(p||f)===null)continue;break}var _=nl(f);_!==null&&(a.splice(h,3),h-=3,ZO(_,{pending:!0,data:O,method:f.method,action:p},p,O))}}))}function jl(a){function h(V){return Yd(V,a)}go!==null&&Yd(go,a),Oo!==null&&Yd(Oo,a),vo!==null&&Yd(vo,a),$c.forEach(h),Bc.forEach(h);for(var f=0;f<_o.length;f++){var p=_o[f];p.blockedOn===a&&(p.blockedOn=null)}for(;0<_o.length&&(f=_o[0],f.blockedOn===null);)h2(f),f.blockedOn===null&&_o.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var O=f[p],_=f[p+1],x=O[rs]||null;if(typeof _=="function")x||u2(f);else if(x){var A=null;if(_&&_.hasAttribute("formAction")){if(O=_,x=_[rs]||null)A=x.formAction;else if(I0(O)!==null)continue}else A=x.action;typeof A=="function"?f[p+1]=A:(f.splice(p,3),p-=3),u2(f)}}}function f2(){function a(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(x){return O=x})},focusReset:"manual",scroll:"manual"})}function h(){O!==null&&(O(),O=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,O=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",h),navigation.addEventListener("navigateerror",h),setTimeout(f,100),function(){p=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",h),navigation.removeEventListener("navigateerror",h),O!==null&&(O(),O=null)}}}function W0(a){this._internalRoot=a}Fd.prototype.render=W0.prototype.render=function(a){var h=this._internalRoot;if(h===null)throw Error(s(409));var f=h.current,p=Ms();s2(f,p,a,h,null,null)},Fd.prototype.unmount=W0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var h=a.containerInfo;s2(a.current,2,null,a,null,null),Ed(),h[sl]=null}};function Fd(a){this._internalRoot=a}Fd.prototype.unstable_scheduleHydration=function(a){if(a){var h=Sx();a={blockedOn:null,target:a,priority:h};for(var f=0;f<_o.length&&h!==0&&h<_o[f].priority;f++);_o.splice(f,0,a),f===0&&h2(a)}};var d2=e.version;if(d2!=="19.2.4")throw Error(s(527,d2,"19.2.4"));j.findDOMNode=function(a){var h=a._reactInternals;if(h===void 0)throw typeof a.render=="function"?Error(s(188)):(a=Object.keys(a).join(","),Error(s(268,a)));return a=u(h),a=a!==null?d(a):null,a=a===null?null:a.stateNode,a};var Nz={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gd.isDisabled&&Gd.supportsFiber)try{Wh=Gd.inject(Nz),ys=Gd}catch{}}return Nc.createRoot=function(a,h){if(!r(a))throw Error(s(299));var f=!1,p="",O=yC,_=bC,x=SC;return h!=null&&(h.unstable_strictMode===!0&&(f=!0),h.identifierPrefix!==void 0&&(p=h.identifierPrefix),h.onUncaughtError!==void 0&&(O=h.onUncaughtError),h.onCaughtError!==void 0&&(_=h.onCaughtError),h.onRecoverableError!==void 0&&(x=h.onRecoverableError)),h=t2(a,1,!1,null,null,f,p,null,O,_,x,f2),a[sl]=h.current,T0(a),new W0(h)},Nc.hydrateRoot=function(a,h,f){if(!r(a))throw Error(s(299));var p=!1,O="",_=yC,x=bC,A=SC,V=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(O=f.identifierPrefix),f.onUncaughtError!==void 0&&(_=f.onUncaughtError),f.onCaughtError!==void 0&&(x=f.onCaughtError),f.onRecoverableError!==void 0&&(A=f.onRecoverableError),f.formState!==void 0&&(V=f.formState)),h=t2(a,1,!0,h,f??null,p,O,V,_,x,A,f2),h.context=i2(null),f=h.current,p=Ms(),p=Bg(p),O=so(p),O.callback=null,ro(f,O,p),f=p,h.current.lanes=f,Yh(h,f),Rr(h),a[sl]=h.current,T0(a),new Fd(h)},Nc.version="19.2.4",Nc}var x2;function Fz(){if(x2)return H0.exports;x2=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(),H0.exports=Hz(),H0.exports}var Gz=Fz();const QP=X.createContext({connected:!1,lastChange:0}),w2=2e3,Kz=3e4,Jz=1.5;function eN({children:t}){const[e,i]=X.useState(!1),[s,r]=X.useState(0),n=X.useRef(null),o=X.useRef(null),l=X.useRef(w2);return X.useEffect(()=>{function c(){const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws`,m=new WebSocket(d);n.current=m,m.onopen=()=>{i(!0),l.current=w2},m.onclose=()=>{i(!1),n.current=null;const g=l.current;l.current=Math.min(g*Jz,Kz),o.current=setTimeout(c,g)},m.onmessage=g=>{try{const v=JSON.parse(g.data);v.type==="file-changes"&&typeof v.timestamp=="number"&&r(v.timestamp)}catch{}},m.onerror=()=>{console.warn("[ws-provider] WebSocket error occurred")}}return c(),()=>{o.current!==null&&(clearTimeout(o.current),o.current=null),n.current&&(n.current.onclose=null,n.current.close(),n.current=null)}},[]),S.jsx(QP.Provider,{value:{connected:e,lastChange:s},children:t})}function pf(){return X.useContext(QP)}function tN(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 iN={activeTab:"plan",expandedCardId:null,inputValues:{}},LP=X.createContext(null);function sN({children:t}){const[e,i]=X.useReducer(tN,iN),s=X.useCallback(l=>i({type:"SET_TAB",tab:l}),[]),r=X.useCallback(l=>i({type:"SET_EXPANDED",cardId:l}),[]),n=X.useCallback((l,c)=>i({type:"SET_INPUT",cardId:l,value:c}),[]),o=X.useCallback(()=>i({type:"RESET"}),[]);return S.jsx(LP.Provider,{value:{...e,setTab:s,setExpanded:r,setInput:n,reset:o},children:t})}function hg(){const t=X.useContext(LP);if(!t)throw new Error("useSimpleMode must be used within SimpleModeProvider");return t}function Fa(){const{lastChange:t}=pf(),[e,i]=X.useState(null),[s,r]=X.useState(null),[n,o]=X.useState(null),[l,c]=X.useState(!0),[u,d]=X.useState(null),m=X.useCallback(async()=>{try{d(null);const[g,v,y]=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(!v.ok&&v.status!==404)throw new Error(`State fetch failed: ${v.status}`);if(!y.ok)throw new Error(`Todos fetch failed: ${y.status}`);const b=g.ok?await g.json():null,w=v.ok?await v.json():null,C=y.ok?await y.json():{pending:[],completed:[]};i(b),r(w),o(C)}catch(g){const v=g instanceof Error?g.message:"Failed to fetch dashboard data";d(v),console.error("[use-dashboard-data]",v)}finally{c(!1)}},[]);return X.useEffect(()=>{m()},[m]),X.useEffect(()=>{t>0&&m()},[t,m]),{roadmap:e,state:s,todos:n,loading:l,error:u}}const Kd="maxsim_dashboard_mode";function rN(){const[t,e]=X.useState(()=>{try{const n=localStorage.getItem(Kd);if(n==="simple"||n==="advanced")return n}catch{}return null}),[i,s]=X.useState(()=>{try{const n=localStorage.getItem(Kd);return n==="simple"||n==="advanced"}catch{return!1}});return X.useEffect(()=>{i||fetch("/api/simple-mode-config").then(n=>n.json()).then(n=>{if(n.default_mode==="simple"||n.default_mode==="advanced"){e(n.default_mode);try{localStorage.setItem(Kd,n.default_mode)}catch{}}}).catch(()=>{}).finally(()=>s(!0))},[i]),{mode:t,setMode:n=>{e(n),i||s(!0);try{localStorage.setItem(Kd,n)}catch{}fetch("/api/simple-mode-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({default_mode:n})}).catch(()=>{})},initialized:i}}const Sb=X.createContext({});function xb(t){const e=X.useRef(null);return e.current===null&&(e.current=t()),e.current}const $P=typeof window<"u",BP=$P?X.useLayoutEffect:X.useEffect,cg=X.createContext(null);function wb(t,e){t.indexOf(e)===-1&&t.push(e)}function mm(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}const tn=(t,e,i)=>i>e?e:i<t?t:i;let Cb=()=>{};const Vn={},DP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function zP(t){return typeof t=="object"&&t!==null}const NP=t=>/^0[^.\s]+$/u.test(t);function jP(t){let e;return()=>(e===void 0&&(e=t()),e)}const ar=t=>t,nN=(t,e)=>i=>e(t(i)),mf=(...t)=>t.reduce(nN),Qu=(t,e,i)=>{const s=e-t;return s===0?1:(i-t)/s};class kb{constructor(){this.subscriptions=[]}add(e){return wb(this.subscriptions,e),()=>mm(this.subscriptions,e)}notify(e,i,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,i,s);else for(let n=0;n<r;n++){const o=this.subscriptions[n];o&&o(e,i,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const br=t=>t*1e3,tr=t=>t/1e3;function XP(t,e){return e?t*(1e3/e):0}const VP=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t,oN=1e-7,aN=12;function lN(t,e,i,s,r){let n,o,l=0;do o=e+(i-e)/2,n=VP(o,s,r)-t,n>0?i=o:e=o;while(Math.abs(n)>oN&&++l<aN);return o}function gf(t,e,i,s){if(t===e&&i===s)return ar;const r=n=>lN(n,0,1,t,i);return n=>n===0||n===1?n:VP(r(n),e,s)}const ZP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,IP=t=>e=>1-t(1-e),qP=gf(.33,1.53,.69,.99),Tb=IP(qP),WP=ZP(Tb),UP=t=>(t*=2)<1?.5*Tb(t):.5*(2-Math.pow(2,-10*(t-1))),Mb=t=>1-Math.sin(Math.acos(t)),YP=IP(Mb),HP=ZP(Mb),hN=gf(.42,0,1,1),cN=gf(0,0,.58,1),FP=gf(.42,0,.58,1),uN=t=>Array.isArray(t)&&typeof t[0]!="number",GP=t=>Array.isArray(t)&&typeof t[0]=="number",fN={linear:ar,easeIn:hN,easeInOut:FP,easeOut:cN,circIn:Mb,circInOut:HP,circOut:YP,backIn:Tb,backInOut:WP,backOut:qP,anticipate:UP},dN=t=>typeof t=="string",C2=t=>{if(GP(t)){Cb(t.length===4);const[e,i,s,r]=t;return gf(e,i,s,r)}else if(dN(t))return fN[t];return t},Jd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pN(t,e){let i=new Set,s=new Set,r=!1,n=!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,m=!1,g=!1)=>{const y=g&&r?i:s;return m&&o.add(d),y.has(d)||y.add(d),d},cancel:d=>{s.delete(d),o.delete(d)},process:d=>{if(l=d,r){n=!0;return}r=!0,[i,s]=[s,i],i.forEach(c),i.clear(),r=!1,n&&(n=!1,u.process(d))}};return u}const mN=40;function KP(t,e){let i=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},n=()=>i=!0,o=Jd.reduce((M,k)=>(M[k]=pN(n),M),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:m,preRender:g,render:v,postRender:y}=o,b=()=>{const M=Vn.useManualTiming?r.timestamp:performance.now();i=!1,Vn.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(M-r.timestamp,mN),1)),r.timestamp=M,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),m.process(r),g.process(r),v.process(r),y.process(r),r.isProcessing=!1,i&&e&&(s=!1,t(b))},w=()=>{i=!0,s=!0,r.isProcessing||t(b)};return{schedule:Jd.reduce((M,k)=>{const P=o[k];return M[k]=(E,z=!1,$=!1)=>(i||w(),P.schedule(E,z,$)),M},{}),cancel:M=>{for(let k=0;k<Jd.length;k++)o[Jd[k]].cancel(M)},state:r,steps:o}}const{schedule:pt,cancel:Vo,state:Pi,steps:J0}=KP(typeof requestAnimationFrame<"u"?requestAnimationFrame:ar,!0);let Xp;function gN(){Xp=void 0}const Ji={now:()=>(Xp===void 0&&Ji.set(Pi.isProcessing||Vn.useManualTiming?Pi.timestamp:performance.now()),Xp),set:t=>{Xp=t,queueMicrotask(gN)}},JP=t=>e=>typeof e=="string"&&e.startsWith(t),eR=JP("--"),ON=JP("var(--"),Ab=t=>ON(t)?vN.test(t.split("/*")[0].trim()):!1,vN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function k2(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Eh={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Lu={...Eh,transform:t=>tn(0,1,t)},ep={...Eh,default:1},_u=t=>Math.round(t*1e5)/1e5,Eb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _N(t){return t==null}const yN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pb=(t,e)=>i=>!!(typeof i=="string"&&yN.test(i)&&i.startsWith(t)||e&&!_N(i)&&Object.prototype.hasOwnProperty.call(i,e)),tR=(t,e,i)=>s=>{if(typeof s!="string")return s;const[r,n,o,l]=s.match(Eb);return{[t]:parseFloat(r),[e]:parseFloat(n),[i]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},bN=t=>tn(0,255,t),ev={...Eh,transform:t=>Math.round(bN(t))},Pa={test:Pb("rgb","red"),parse:tR("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:s=1})=>"rgba("+ev.transform(t)+", "+ev.transform(e)+", "+ev.transform(i)+", "+_u(Lu.transform(s))+")"};function SN(t){let e="",i="",s="",r="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,i+=i,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const s1={test:Pb("#"),parse:SN,transform:Pa.transform},Of=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ao=Of("deg"),Gr=Of("%"),xe=Of("px"),xN=Of("vh"),wN=Of("vw"),T2={...Gr,parse:t=>Gr.parse(t)/100,transform:t=>Gr.transform(t*100)},Fl={test:Pb("hsl","hue"),parse:tR("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:s=1})=>"hsla("+Math.round(t)+", "+Gr.transform(_u(e))+", "+Gr.transform(_u(i))+", "+_u(Lu.transform(s))+")"},qt={test:t=>Pa.test(t)||s1.test(t)||Fl.test(t),parse:t=>Pa.test(t)?Pa.parse(t):Fl.test(t)?Fl.parse(t):s1.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Pa.transform(t):Fl.transform(t),getAnimatableNone:t=>{const e=qt.parse(t);return e.alpha=0,qt.transform(e)}},CN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kN(t){var e,i;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Eb))==null?void 0:e.length)||0)+(((i=t.match(CN))==null?void 0:i.length)||0)>0}const iR="number",sR="color",TN="var",MN="var(",M2="${}",AN=/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 $u(t){const e=t.toString(),i=[],s={color:[],number:[],var:[]},r=[];let n=0;const l=e.replace(AN,c=>(qt.test(c)?(s.color.push(n),r.push(sR),i.push(qt.parse(c))):c.startsWith(MN)?(s.var.push(n),r.push(TN),i.push(c)):(s.number.push(n),r.push(iR),i.push(parseFloat(c))),++n,M2)).split(M2);return{values:i,split:l,indexes:s,types:r}}function rR(t){return $u(t).values}function nR(t){const{split:e,types:i}=$u(t),s=e.length;return r=>{let n="";for(let o=0;o<s;o++)if(n+=e[o],r[o]!==void 0){const l=i[o];l===iR?n+=_u(r[o]):l===sR?n+=qt.transform(r[o]):n+=r[o]}return n}}const EN=t=>typeof t=="number"?0:qt.test(t)?qt.getAnimatableNone(t):t;function PN(t){const e=rR(t);return nR(t)(e.map(EN))}const Sr={test:kN,parse:rR,createTransformer:nR,getAnimatableNone:PN};function tv(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 RN({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,e/=100,i/=100;let r=0,n=0,o=0;if(!e)r=n=o=i;else{const l=i<.5?i*(1+e):i+e-i*e,c=2*i-l;r=tv(c,l,t+1/3),n=tv(c,l,t),o=tv(c,l,t-1/3)}return{red:Math.round(r*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:s}}function gm(t,e){return i=>i>0?e:t}const kt=(t,e,i)=>t+(e-t)*i,iv=(t,e,i)=>{const s=t*t,r=i*(e*e-s)+s;return r<0?0:Math.sqrt(r)},QN=[s1,Pa,Fl],LN=t=>QN.find(e=>e.test(t));function A2(t){const e=LN(t);if(!e)return!1;let i=e.parse(t);return e===Fl&&(i=RN(i)),i}const E2=(t,e)=>{const i=A2(t),s=A2(e);if(!i||!s)return gm(t,e);const r={...i};return n=>(r.red=iv(i.red,s.red,n),r.green=iv(i.green,s.green,n),r.blue=iv(i.blue,s.blue,n),r.alpha=kt(i.alpha,s.alpha,n),Pa.transform(r))},r1=new Set(["none","hidden"]);function $N(t,e){return r1.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}function BN(t,e){return i=>kt(t,e,i)}function Rb(t){return typeof t=="number"?BN:typeof t=="string"?Ab(t)?gm:qt.test(t)?E2:NN:Array.isArray(t)?oR:typeof t=="object"?qt.test(t)?E2:DN:gm}function oR(t,e){const i=[...t],s=i.length,r=t.map((n,o)=>Rb(n)(n,e[o]));return n=>{for(let o=0;o<s;o++)i[o]=r[o](n);return i}}function DN(t,e){const i={...t,...e},s={};for(const r in i)t[r]!==void 0&&e[r]!==void 0&&(s[r]=Rb(t[r])(t[r],e[r]));return r=>{for(const n in s)i[n]=s[n](r);return i}}function zN(t,e){const i=[],s={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const n=e.types[r],o=t.indexes[n][s[n]],l=t.values[o]??0;i[r]=l,s[n]++}return i}const NN=(t,e)=>{const i=Sr.createTransformer(e),s=$u(t),r=$u(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?r1.has(t)&&!r.values.length||r1.has(e)&&!s.values.length?$N(t,e):mf(oR(zN(s,r),r.values),i):gm(t,e)};function aR(t,e,i){return typeof t=="number"&&typeof e=="number"&&typeof i=="number"?kt(t,e,i):Rb(t)(t,e)}const jN=t=>{const e=({timestamp:i})=>t(i);return{start:(i=!0)=>pt.update(e,i),stop:()=>Vo(e),now:()=>Pi.isProcessing?Pi.timestamp:Ji.now()}},lR=(t,e,i=10)=>{let s="";const r=Math.max(Math.round(e/i),2);for(let n=0;n<r;n++)s+=Math.round(t(n/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Om=2e4;function Qb(t){let e=0;const i=50;let s=t.next(e);for(;!s.done&&e<Om;)e+=i,s=t.next(e);return e>=Om?1/0:e}function XN(t,e=100,i){const s=i({...t,keyframes:[0,e]}),r=Math.min(Qb(s),Om);return{type:"keyframes",ease:n=>s.next(r*n).value/e,duration:tr(r)}}const VN=5;function hR(t,e,i){const s=Math.max(e-VN,0);return XP(i-t(s),e-s)}const Et={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},sv=.001;function ZN({duration:t=Et.duration,bounce:e=Et.bounce,velocity:i=Et.velocity,mass:s=Et.mass}){let r,n,o=1-e;o=tn(Et.minDamping,Et.maxDamping,o),t=tn(Et.minDuration,Et.maxDuration,tr(t)),o<1?(r=u=>{const d=u*o,m=d*t,g=d-i,v=n1(u,o),y=Math.exp(-m);return sv-g/v*y},n=u=>{const m=u*o*t,g=m*i+i,v=Math.pow(o,2)*Math.pow(u,2)*t,y=Math.exp(-m),b=n1(Math.pow(u,2),o);return(-r(u)+sv>0?-1:1)*((g-v)*y)/b}):(r=u=>{const d=Math.exp(-u*t),m=(u-i)*t+1;return-sv+d*m},n=u=>{const d=Math.exp(-u*t),m=(i-u)*(t*t);return d*m});const l=5/t,c=qN(r,n,l);if(t=br(t),isNaN(c))return{stiffness:Et.stiffness,damping:Et.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const IN=12;function qN(t,e,i){let s=i;for(let r=1;r<IN;r++)s=s-t(s)/e(s);return s}function n1(t,e){return t*Math.sqrt(1-e*e)}const WN=["duration","bounce"],UN=["stiffness","damping","mass"];function P2(t,e){return e.some(i=>t[i]!==void 0)}function YN(t){let e={velocity:Et.velocity,stiffness:Et.stiffness,damping:Et.damping,mass:Et.mass,isResolvedFromDuration:!1,...t};if(!P2(t,UN)&&P2(t,WN))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(i*1.2),r=s*s,n=2*tn(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Et.mass,stiffness:r,damping:n}}else{const i=ZN({...t,velocity:0});e={...e,...i,mass:Et.mass},e.isResolvedFromDuration=!0}return e}function vm(t=Et.visualDuration,e=Et.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=i;const n=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],l={done:!1,value:n},{stiffness:c,damping:u,mass:d,duration:m,velocity:g,isResolvedFromDuration:v}=YN({...i,velocity:-tr(i.velocity||0)}),y=g||0,b=u/(2*Math.sqrt(c*d)),w=o-n,C=tr(Math.sqrt(c/d)),T=Math.abs(w)<5;s||(s=T?Et.restSpeed.granular:Et.restSpeed.default),r||(r=T?Et.restDelta.granular:Et.restDelta.default);let M;if(b<1){const P=n1(C,b);M=E=>{const z=Math.exp(-b*C*E);return o-z*((y+b*C*w)/P*Math.sin(P*E)+w*Math.cos(P*E))}}else if(b===1)M=P=>o-Math.exp(-C*P)*(w+(y+C*w)*P);else{const P=C*Math.sqrt(b*b-1);M=E=>{const z=Math.exp(-b*C*E),$=Math.min(P*E,300);return o-z*((y+b*C*w)*Math.sinh($)+P*w*Math.cosh($))/P}}const k={calculatedDuration:v&&m||null,next:P=>{const E=M(P);if(v)l.done=P>=m;else{let z=P===0?y:0;b<1&&(z=P===0?br(y):hR(M,P,E));const $=Math.abs(z)<=s,Z=Math.abs(o-E)<=r;l.done=$&&Z}return l.value=l.done?o:E,l},toString:()=>{const P=Math.min(Qb(k),Om),E=lR(z=>k.next(P*z).value,P,30);return P+"ms "+E},toTransition:()=>{}};return k}vm.applyToOptions=t=>{const e=XN(t,100,vm);return t.ease=e.ease,t.duration=br(e.duration),t.type="keyframes",t};function o1({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:n=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const m=t[0],g={done:!1,value:m},v=$=>l!==void 0&&$<l||c!==void 0&&$>c,y=$=>l===void 0?c:c===void 0||Math.abs(l-$)<Math.abs(c-$)?l:c;let b=i*e;const w=m+b,C=o===void 0?w:o(w);C!==w&&(b=C-m);const T=$=>-b*Math.exp(-$/s),M=$=>C+T($),k=$=>{const Z=T($),ie=M($);g.done=Math.abs(Z)<=u,g.value=g.done?C:ie};let P,E;const z=$=>{v(g.value)&&(P=$,E=vm({keyframes:[g.value,y(g.value)],velocity:hR(M,$,g.value),damping:r,stiffness:n,restDelta:u,restSpeed:d}))};return z(0),{calculatedDuration:null,next:$=>{let Z=!1;return!E&&P===void 0&&(Z=!0,k($),z($)),P!==void 0&&$>=P?E.next($-P):(!Z&&k($),g)}}}function HN(t,e,i){const s=[],r=i||Vn.mix||aR,n=t.length-1;for(let o=0;o<n;o++){let l=r(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||ar:e;l=mf(c,l)}s.push(l)}return s}function FN(t,e,{clamp:i=!0,ease:s,mixer:r}={}){const n=t.length;if(Cb(n===e.length),n===1)return()=>e[0];if(n===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[n-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=HN(e,s,r),c=l.length,u=d=>{if(o&&d<t[0])return e[0];let m=0;if(c>1)for(;m<t.length-2&&!(d<t[m+1]);m++);const g=Qu(t[m],t[m+1],d);return l[m](g)};return i?d=>u(tn(t[0],t[n-1],d)):u}function GN(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const r=Qu(0,e,s);t.push(kt(i,1,r))}}function KN(t){const e=[0];return GN(e,t.length-1),e}function JN(t,e){return t.map(i=>i*e)}function e8(t,e){return t.map(()=>e||FP).splice(0,t.length-1)}function yu({duration:t=300,keyframes:e,times:i,ease:s="easeInOut"}){const r=uN(s)?s.map(C2):C2(s),n={done:!1,value:e[0]},o=JN(i&&i.length===e.length?i:KN(e),t),l=FN(o,e,{ease:Array.isArray(r)?r:e8(e,r)});return{calculatedDuration:t,next:c=>(n.value=l(c),n.done=c>=t,n)}}const t8=t=>t!==null;function Lb(t,{repeat:e,repeatType:i="loop"},s,r=1){const n=t.filter(t8),l=r<0||e&&i!=="loop"&&e%2===1?0:n.length-1;return!l||s===void 0?n[l]:s}const i8={decay:o1,inertia:o1,tween:yu,keyframes:yu,spring:vm};function cR(t){typeof t.type=="string"&&(t.type=i8[t.type])}class $b{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 s8=t=>t/100;class Bb extends $b{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:i}=this.options;i&&i.updatedAt!==Ji.now()&&this.tick(Ji.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;cR(e);const{type:i=yu,repeat:s=0,repeatDelay:r=0,repeatType:n,velocity:o=0}=e;let{keyframes:l}=e;const c=i||yu;c!==yu&&typeof l[0]!="number"&&(this.mixKeyframes=mf(s8,aR(l[0],l[1])),l=[0,100]);const u=c({...e,keyframes:l});n==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Qb(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(s+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:s,totalDuration:r,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:d,repeat:m,repeatType:g,repeatDelay:v,type:y,onUpdate:b,finalKeyframe:w}=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 C=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?C<0:C>r;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let M=this.currentTime,k=s;if(m){const $=Math.min(this.currentTime,r)/l;let Z=Math.floor($),ie=$%1;!ie&&$>=1&&(ie=1),ie===1&&Z--,Z=Math.min(Z,m+1),!!(Z%2)&&(g==="reverse"?(ie=1-ie,v&&(ie-=v/l)):g==="mirror"&&(k=o)),M=tn(0,1,ie)*l}const P=T?{done:!1,value:d[0]}:k.next(M);n&&(P.value=n(P.value));let{done:E}=P;!T&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return z&&y!==o1&&(P.value=Lb(d,this.options,w,this.speed)),b&&b(P.value),z&&this.finish(),P}then(e,i){return this.finished.then(e,i)}get duration(){return tr(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+tr(e)}get time(){return tr(this.currentTime)}set time(e){var i;e=br(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(Ji.now());const i=this.playbackSpeed!==e;this.playbackSpeed=e,i&&(this.time=tr(this.currentTime))}play(){var r,n;if(this.isStopped)return;const{driver:e=jN,startTime:i}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(n=(r=this.options).onPlay)==null||n.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=i??s),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(Ji.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 r8(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ra=t=>t*180/Math.PI,a1=t=>{const e=Ra(Math.atan2(t[1],t[0]));return l1(e)},n8={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:a1,rotateZ:a1,skewX:t=>Ra(Math.atan(t[1])),skewY:t=>Ra(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},l1=t=>(t=t%360,t<0&&(t+=360),t),R2=a1,Q2=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),L2=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),o8={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Q2,scaleY:L2,scale:t=>(Q2(t)+L2(t))/2,rotateX:t=>l1(Ra(Math.atan2(t[6],t[5]))),rotateY:t=>l1(Ra(Math.atan2(-t[2],t[0]))),rotateZ:R2,rotate:R2,skewX:t=>Ra(Math.atan(t[4])),skewY:t=>Ra(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function h1(t){return t.includes("scale")?1:0}function c1(t,e){if(!t||t==="none")return h1(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(i)s=o8,r=i;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=n8,r=l}if(!r)return h1(e);const n=s[e],o=r[1].split(",").map(l8);return typeof n=="function"?n(o):o[n]}const a8=(t,e)=>{const{transform:i="none"}=getComputedStyle(t);return c1(i,e)};function l8(t){return parseFloat(t.trim())}const Ph=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Rh=new Set(Ph),$2=t=>t===Eh||t===xe,h8=new Set(["x","y","z"]),c8=Ph.filter(t=>!h8.has(t));function u8(t){const e=[];return c8.forEach(i=>{const s=t.getValue(i);s!==void 0&&(e.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),e}const Do={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")};Do.translateX=Do.x;Do.translateY=Do.y;const Na=new Set;let u1=!1,f1=!1,d1=!1;function uR(){if(f1){const t=Array.from(Na).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),i=new Map;e.forEach(s=>{const r=u8(s);r.length&&(i.set(s,r),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const r=i.get(s);r&&r.forEach(([n,o])=>{var l;(l=s.getValue(n))==null||l.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}f1=!1,u1=!1,Na.forEach(t=>t.complete(d1)),Na.clear()}function fR(){Na.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(f1=!0)})}function f8(){d1=!0,fR(),uR(),d1=!1}class Db{constructor(e,i,s,r,n,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=i,this.name=s,this.motionValue=r,this.element=n,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Na.add(this),u1||(u1=!0,pt.read(fR),pt.resolveKeyframes(uR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:i,element:s,motionValue:r}=this;if(e[0]===null){const n=r==null?void 0:r.get(),o=e[e.length-1];if(n!==void 0)e[0]=n;else if(s&&i){const l=s.readValue(i,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),r&&n===void 0&&r.set(e[0])}r8(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Na.delete(this)}cancel(){this.state==="scheduled"&&(Na.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const d8=t=>t.startsWith("--");function p8(t,e,i){d8(e)?t.style.setProperty(e,i):t.style[e]=i}const m8={};function dR(t,e){const i=jP(t);return()=>m8[e]??i()}const g8=dR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pR=dR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),au=([t,e,i,s])=>`cubic-bezier(${t}, ${e}, ${i}, ${s})`,B2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:au([0,.65,.55,1]),circOut:au([.55,0,1,.45]),backIn:au([.31,.01,.66,-.59]),backOut:au([.33,1.53,.69,.99])};function mR(t,e){if(t)return typeof t=="function"?pR()?lR(t,e):"ease-out":GP(t)?au(t):Array.isArray(t)?t.map(i=>mR(i,e)||B2.easeOut):B2[t]}function O8(t,e,i,{delay:s=0,duration:r=300,repeat:n=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[e]:i};c&&(d.offset=c);const m=mR(l,r);Array.isArray(m)&&(d.easing=m);const g={delay:s,duration:r,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:n+1,direction:o==="reverse"?"alternate":"normal"};return u&&(g.pseudoElement=u),t.animate(d,g)}function gR(t){return typeof t=="function"&&"applyToOptions"in t}function v8({type:t,...e}){return gR(t)&&pR()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class OR extends $b{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:i,name:s,keyframes:r,pseudoElement:n,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!n,this.allowFlatten=o,this.options=e,Cb(typeof e.type!="string");const u=v8(e);this.animation=O8(i,s,r,u,n),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){const d=Lb(r,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):p8(i,s,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,s,r;const e=(i=this.options)==null?void 0:i.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var i,s;const e=((s=(i=this.animation.effect)==null?void 0:i.getComputedTiming)==null?void 0:s.call(i).duration)||0;return tr(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+tr(e)}get time(){return tr(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=br(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 s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&g8()?(this.animation.timeline=e,ar):i(this)}}const vR={anticipate:UP,backInOut:WP,circInOut:HP};function _8(t){return t in vR}function y8(t){typeof t.ease=="string"&&_8(t.ease)&&(t.ease=vR[t.ease])}const rv=10;class b8 extends OR{constructor(e){y8(e),cR(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:i,onUpdate:s,onComplete:r,element:n,...o}=this.options;if(!i)return;if(e!==void 0){i.set(e);return}const l=new Bb({...o,autoplay:!1}),c=Math.max(rv,Ji.now()-this.startTime),u=tn(0,rv,c-rv);i.setWithVelocity(l.sample(Math.max(0,c-u)).value,l.sample(c).value,u),l.stop()}}const D2=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Sr.test(t)||t==="0")&&!t.startsWith("url("));function S8(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 x8(t,e,i,s){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const n=t[t.length-1],o=D2(r,e),l=D2(n,e);return!o||!l?!1:S8(t)||(i==="spring"||gR(i))&&s}function p1(t){t.duration=0,t.type="keyframes"}const w8=new Set(["opacity","clipPath","filter","transform"]),C8=jP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function k8(t){var d;const{motionValue:e,name:i,repeatDelay:s,repeatType:r,damping:n,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 C8()&&i&&w8.has(i)&&(i!=="transform"||!u)&&!c&&!s&&r!=="mirror"&&n!==0&&o!=="inertia"}const T8=40;class M8 extends $b{constructor({autoplay:e=!0,delay:i=0,type:s="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...m}){var y;super(),this.stop=()=>{var b,w;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Ji.now();const g={autoplay:e,delay:i,type:s,repeat:r,repeatDelay:n,repeatType:o,name:c,motionValue:u,element:d,...m},v=(d==null?void 0:d.KeyframeResolver)||Db;this.keyframeResolver=new v(l,(b,w,C)=>this.onKeyframesResolved(b,w,g,!C),c,u,d),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,i,s,r){var w,C;this.keyframeResolver=void 0;const{name:n,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=s;this.resolvedAt=Ji.now(),x8(e,n,o,l)||((Vn.instantAnimations||!c)&&(d==null||d(Lb(e,s,i))),e[0]=e[e.length-1],p1(s),s.repeat=0);const g={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>T8?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...s,keyframes:e},v=!u&&k8(g),y=(C=(w=g.motionValue)==null?void 0:w.owner)==null?void 0:C.current,b=v?new b8({...g,element:y}):new Bb(g);b.finished.then(()=>{this.notifyFinished()}).catch(ar),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(),f8()),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 _R(t,e,i,s=0,r=1){const n=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,l=(o-1)*s;return typeof i=="function"?i(n,o):r===1?n*s:l-n*s}const A8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function E8(t){const e=A8.exec(t);if(!e)return[,];const[,i,s,r]=e;return[`--${i??s}`,r]}function yR(t,e,i=1){const[s,r]=E8(t);if(!s)return;const n=window.getComputedStyle(e).getPropertyValue(s);if(n){const o=n.trim();return DP(o)?parseFloat(o):o}return Ab(r)?yR(r,e,i+1):r}const P8={type:"spring",stiffness:500,damping:25,restSpeed:10},R8=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Q8={type:"keyframes",duration:.8},L8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$8=(t,{keyframes:e})=>e.length>2?Q8:Rh.has(t)?t.startsWith("scale")?R8(e[1]):P8:L8,B8=t=>t!==null;function D8(t,{repeat:e,repeatType:i="loop"},s){const r=t.filter(B8),n=e&&i!=="loop"&&e%2===1?0:r.length-1;return r[n]}function bR(t,e){if(t!=null&&t.inherit&&e){const{inherit:i,...s}=t;return{...e,...s}}return t}function zb(t,e){const i=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return i!==t?bR(i,t):i}function z8({when:t,delay:e,delayChildren:i,staggerChildren:s,staggerDirection:r,repeat:n,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Nb=(t,e,i,s={},r,n)=>o=>{const l=zb(s,t)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-br(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:n?void 0:r};z8(l)||Object.assign(d,$8(t,d)),d.duration&&(d.duration=br(d.duration)),d.repeatDelay&&(d.repeatDelay=br(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let m=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(p1(d),d.delay===0&&(m=!0)),(Vn.instantAnimations||Vn.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(m=!0,p1(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,m&&!n&&e.get()!==void 0){const g=D8(d.keyframes,l);if(g!==void 0){pt.update(()=>{d.onUpdate(g),d.onComplete()});return}}return l.isSync?new Bb(d):new M8(d)};function z2(t){const e=[{},{}];return t==null||t.values.forEach((i,s)=>{e[0][s]=i.get(),e[1][s]=i.getVelocity()}),e}function jb(t,e,i,s){if(typeof e=="function"){const[r,n]=z2(s);e=e(i!==void 0?i:t.custom,r,n)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,n]=z2(s);e=e(i!==void 0?i:t.custom,r,n)}return e}function ah(t,e,i){const s=t.getProps();return jb(s,e,i!==void 0?i:s.custom,t)}const SR=new Set(["width","height","top","left","right","bottom",...Ph]),N2=30,N8=t=>!isNaN(parseFloat(t));class j8{constructor(e,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var n;const r=Ji.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((n=this.events.change)==null||n.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=Ji.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=N8(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 kb);const s=this.events[e].add(i);return e==="change"?()=>{s(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:s}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,s){this.set(i),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}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=Ji.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>N2)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,N2);return XP(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 Oh(t,e){return new j8(t,e)}const m1=t=>Array.isArray(t);function X8(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,Oh(i))}function V8(t){return m1(t)?t[t.length-1]||0:t}function Z8(t,e){const i=ah(t,e);let{transitionEnd:s={},transition:r={},...n}=i||{};n={...n,...s};for(const o in n){const l=V8(n[o]);X8(t,o,l)}}const Ii=t=>!!(t&&t.getVelocity);function I8(t){return!!(Ii(t)&&t.add)}function g1(t,e){const i=t.getValue("willChange");if(I8(i))return i.add(e);if(!i&&Vn.WillChange){const s=new Vn.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Xb(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const q8="framerAppearId",xR="data-"+Xb(q8);function wR(t){return t.props[xR]}function W8({protectedKeys:t,needsAnimating:e},i){const s=t.hasOwnProperty(i)&&e[i]!==!0;return e[i]=!1,s}function CR(t,e,{delay:i=0,transitionOverride:s,type:r}={}){let{transition:n,transitionEnd:o,...l}=e;const c=t.getDefaultTransition();n=n?bR(n,c):c;const u=n==null?void 0:n.reduceMotion;s&&(n=s);const d=[],m=r&&t.animationState&&t.animationState.getState()[r];for(const g in l){const v=t.getValue(g,t.latestValues[g]??null),y=l[g];if(y===void 0||m&&W8(m,g))continue;const b={delay:i,...zb(n||{},g)},w=v.get();if(w!==void 0&&!v.isAnimating&&!Array.isArray(y)&&y===w&&!b.velocity)continue;let C=!1;if(window.MotionHandoffAnimation){const k=wR(t);if(k){const P=window.MotionHandoffAnimation(k,g,pt);P!==null&&(b.startTime=P,C=!0)}}g1(t,g);const T=u??t.shouldReduceMotion;v.start(Nb(g,v,y,T&&SR.has(g)?{type:!1}:b,t,C));const M=v.animation;M&&d.push(M)}if(o){const g=()=>pt.update(()=>{o&&Z8(t,o)});d.length?Promise.all(d).then(g):g()}return d}function O1(t,e,i={}){var c;const s=ah(t,e,i.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(r=i.transitionOverride);const n=s?()=>Promise.all(CR(t,s,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:m,staggerDirection:g}=r;return U8(t,e,u,d,m,g,i)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,d]=l==="beforeChildren"?[n,o]:[o,n];return u().then(()=>d())}else return Promise.all([n(),o(i.delay)])}function U8(t,e,i=0,s=0,r=0,n=1,o){const l=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),l.push(O1(c,e,{...o,delay:i+(typeof s=="function"?0:s)+_R(t.variantChildren,c,s,r,n)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function Y8(t,e,i={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const r=e.map(n=>O1(t,n,i));s=Promise.all(r)}else if(typeof e=="string")s=O1(t,e,i);else{const r=typeof e=="function"?ah(t,e,i.custom):e;s=Promise.all(CR(t,r,i))}return s.then(()=>{t.notify("AnimationComplete",e)})}const H8={test:t=>t==="auto",parse:t=>t},kR=t=>e=>e.test(t),TR=[Eh,xe,Gr,Ao,wN,xN,H8],j2=t=>TR.find(kR(t));function F8(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||NP(t):!0}const G8=new Set(["brightness","contrast","saturate","opacity"]);function K8(t){const[e,i]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=i.match(Eb)||[];if(!s)return t;const r=i.replace(s,"");let n=G8.has(e)?1:0;return s!==i&&(n*=100),e+"("+n+r+")"}const J8=/\b([a-z-]*)\(.*?\)/gu,v1={...Sr,getAnimatableNone:t=>{const e=t.match(J8);return e?e.map(K8).join(" "):t}},_1={...Sr,getAnimatableNone:t=>{const e=Sr.parse(t);return Sr.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},X2={...Eh,transform:Math.round},e7={rotate:Ao,rotateX:Ao,rotateY:Ao,rotateZ:Ao,scale:ep,scaleX:ep,scaleY:ep,scaleZ:ep,skew:Ao,skewX:Ao,skewY:Ao,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:Lu,originX:T2,originY:T2,originZ:xe},Vb={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,inset:xe,insetBlock:xe,insetBlockStart:xe,insetBlockEnd:xe,insetInline:xe,insetInlineStart:xe,insetInlineEnd:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,paddingBlock:xe,paddingBlockStart:xe,paddingBlockEnd:xe,paddingInline:xe,paddingInlineStart:xe,paddingInlineEnd:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,marginBlock:xe,marginBlockStart:xe,marginBlockEnd:xe,marginInline:xe,marginInlineStart:xe,marginInlineEnd:xe,fontSize:xe,backgroundPositionX:xe,backgroundPositionY:xe,...e7,zIndex:X2,fillOpacity:Lu,strokeOpacity:Lu,numOctaves:X2},t7={...Vb,color:qt,backgroundColor:qt,outlineColor:qt,fill:qt,stroke:qt,borderColor:qt,borderTopColor:qt,borderRightColor:qt,borderBottomColor:qt,borderLeftColor:qt,filter:v1,WebkitFilter:v1,mask:_1,WebkitMask:_1},MR=t=>t7[t],i7=new Set([v1,_1]);function AR(t,e){let i=MR(t);return i7.has(i)||(i=Sr),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const s7=new Set(["auto","none","0"]);function r7(t,e,i){let s=0,r;for(;s<t.length&&!r;){const n=t[s];typeof n=="string"&&!s7.has(n)&&$u(n).values.length&&(r=t[s]),s++}if(r&&i)for(const n of e)t[n]=AR(i,r)}class n7 extends Db{constructor(e,i,s,r,n){super(e,i,s,r,n,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:i,name:s}=this;if(!i||!i.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let m=e[d];if(typeof m=="string"&&(m=m.trim(),Ab(m))){const g=yR(m,i.current);g!==void 0&&(e[d]=g),d===e.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!SR.has(s)||e.length!==2)return;const[r,n]=e,o=j2(r),l=j2(n),c=k2(r),u=k2(n);if(c!==u&&Do[s]){this.needsMeasurement=!0;return}if(o!==l)if($2(o)&&$2(l))for(let d=0;d<e.length;d++){const m=e[d];typeof m=="string"&&(e[d]=parseFloat(m))}else Do[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:i}=this,s=[];for(let r=0;r<e.length;r++)(e[r]===null||F8(e[r]))&&s.push(r);s.length&&r7(e,s,i)}measureInitialState(){const{element:e,unresolvedKeyframes:i,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Do[s](e.measureViewportBox(),window.getComputedStyle(e.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&e.getValue(s,r).jump(r,!1)}measureEndState(){var l;const{element:e,name:i,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const r=e.getValue(i);r&&r.jump(this.measuredOrigin,!1);const n=s.length-1,o=s[n];s[n]=Do[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 o7=new Set(["opacity","clipPath","filter","transform"]);function ER(t,e,i){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const r=(i==null?void 0:i[t])??s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(s=>s!=null)}const PR=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function y1(t){return zP(t)&&"offsetHeight"in t}const{schedule:Zb}=KP(queueMicrotask,!1),vr={x:!1,y:!1};function RR(){return vr.x||vr.y}function a7(t){return t==="x"||t==="y"?vr[t]?null:(vr[t]=!0,()=>{vr[t]=!1}):vr.x||vr.y?null:(vr.x=vr.y=!0,()=>{vr.x=vr.y=!1})}function QR(t,e){const i=ER(t),s=new AbortController,r={passive:!0,...e,signal:s.signal};return[i,r,()=>s.abort()]}function l7(t){return!(t.pointerType==="touch"||RR())}function h7(t,e,i={}){const[s,r,n]=QR(t,i);return s.forEach(o=>{let l=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",y)},m=w=>{u&&(u(w),u=void 0),d()},g=w=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),c&&(c=!1,m(w))},v=()=>{l=!0,window.addEventListener("pointerup",g,r),window.addEventListener("pointercancel",g,r)},y=w=>{if(w.pointerType!=="touch"){if(l){c=!0;return}m(w)}},b=w=>{if(!l7(w))return;c=!1;const C=e(o,w);typeof C=="function"&&(u=C,o.addEventListener("pointerleave",y,r))};o.addEventListener("pointerenter",b,r),o.addEventListener("pointerdown",v,r)}),n}const LR=(t,e)=>e?t===e?!0:LR(t,e.parentElement):!1,Ib=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,c7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function u7(t){return c7.has(t.tagName)||t.isContentEditable===!0}const f7=new Set(["INPUT","SELECT","TEXTAREA"]);function d7(t){return f7.has(t.tagName)||t.isContentEditable===!0}const Vp=new WeakSet;function V2(t){return e=>{e.key==="Enter"&&t(e)}}function nv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const p7=(t,e)=>{const i=t.currentTarget;if(!i)return;const s=V2(()=>{if(Vp.has(i))return;nv(i,"down");const r=V2(()=>{nv(i,"up")}),n=()=>nv(i,"cancel");i.addEventListener("keyup",r,e),i.addEventListener("blur",n,e)});i.addEventListener("keydown",s,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),e)};function Z2(t){return Ib(t)&&!RR()}const I2=new WeakSet;function m7(t,e,i={}){const[s,r,n]=QR(t,i),o=l=>{const c=l.currentTarget;if(!Z2(l)||I2.has(l))return;Vp.add(c),i.stopPropagation&&I2.add(l);const u=e(c,l),d=(v,y)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",g),Vp.has(c)&&Vp.delete(c),Z2(v)&&typeof u=="function"&&u(v,{success:y})},m=v=>{d(v,c===window||c===document||i.useGlobalTarget||LR(c,v.target))},g=v=>{d(v,!1)};window.addEventListener("pointerup",m,r),window.addEventListener("pointercancel",g,r)};return s.forEach(l=>{(i.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),y1(l)&&(l.addEventListener("focus",u=>p7(u,r)),!u7(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),n}function qb(t){return zP(t)&&"ownerSVGElement"in t}const Zp=new WeakMap;let Eo;const $R=(t,e,i)=>(s,r)=>r&&r[0]?r[0][t+"Size"]:qb(s)&&"getBBox"in s?s.getBBox()[e]:s[i],g7=$R("inline","width","offsetWidth"),O7=$R("block","height","offsetHeight");function v7({target:t,borderBoxSize:e}){var i;(i=Zp.get(t))==null||i.forEach(s=>{s(t,{get width(){return g7(t,e)},get height(){return O7(t,e)}})})}function _7(t){t.forEach(v7)}function y7(){typeof ResizeObserver>"u"||(Eo=new ResizeObserver(_7))}function b7(t,e){Eo||y7();const i=ER(t);return i.forEach(s=>{let r=Zp.get(s);r||(r=new Set,Zp.set(s,r)),r.add(e),Eo==null||Eo.observe(s)}),()=>{i.forEach(s=>{const r=Zp.get(s);r==null||r.delete(e),r!=null&&r.size||Eo==null||Eo.unobserve(s)})}}const Ip=new Set;let Gl;function S7(){Gl=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ip.forEach(e=>e(t))},window.addEventListener("resize",Gl)}function x7(t){return Ip.add(t),Gl||S7(),()=>{Ip.delete(t),!Ip.size&&typeof Gl=="function"&&(window.removeEventListener("resize",Gl),Gl=void 0)}}function q2(t,e){return typeof t=="function"?x7(t):b7(t,e)}function w7(t){return qb(t)&&t.tagName==="svg"}const C7=[...TR,qt,Sr],k7=t=>C7.find(kR(t)),W2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kl=()=>({x:W2(),y:W2()}),U2=()=>({min:0,max:0}),ii=()=>({x:U2(),y:U2()}),T7=new WeakMap;function ug(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Bu(t){return typeof t=="string"||Array.isArray(t)}const Wb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ub=["initial",...Wb];function fg(t){return ug(t.animate)||Ub.some(e=>Bu(t[e]))}function BR(t){return!!(fg(t)||t.variants)}function M7(t,e,i){for(const s in e){const r=e[s],n=i[s];if(Ii(r))t.addValue(s,r);else if(Ii(n))t.addValue(s,Oh(r,{owner:t}));else if(n!==r)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=t.getStaticValue(s);t.addValue(s,Oh(o!==void 0?o:r,{owner:t}))}}for(const s in i)e[s]===void 0&&t.removeValue(s);return e}const b1={current:null},DR={current:!1},A7=typeof window<"u";function E7(){if(DR.current=!0,!!A7)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 Y2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let _m={};function zR(t){_m=t}function P7(){return _m}class R7{scrapeMotionValuesFromProps(e,i,s){return{}}constructor({parent:e,props:i,presenceContext:s,reducedMotionConfig:r,skipAnimations:n,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=Db,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 v=Ji.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,pt.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=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=n,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=fg(i),this.isVariantNode=BR(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:m,...g}=this.scrapeMotionValuesFromProps(i,{},this);for(const v in g){const y=g[v];u[v]!==void 0&&Ii(y)&&y.set(u[v])}}mount(e){var i,s;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,T7.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,n)=>this.bindToMotionValue(n,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(DR.current||E7(),this.shouldReduceMotion=b1.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Vo(this.notifyUpdate),Vo(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 s=this.features[i];s&&(s.unmount(),s.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&&o7.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:u,duration:d}=i.accelerate,m=new OR({element:this.current,name:e,keyframes:l,times:c,ease:u,duration:br(d)}),g=o(m);this.valueSubscriptions.set(e,()=>{g(),m.cancel()});return}const s=Rh.has(e);s&&this.onBindTransform&&this.onBindTransform();const r=i.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&pt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let n;typeof window<"u"&&window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,i)),this.valueSubscriptions.set(e,()=>{r(),n&&n(),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 _m){const i=_m[e];if(!i)continue;const{isEnabled:s,Feature:r}=i;if(!this.features[e]&&r&&s(this.props)&&(this.features[e]=new r(this)),this.features[e]){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ii()}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 s=0;s<Y2.length;s++){const r=Y2[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n="on"+r,o=e[n];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=M7(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 s=this.values.get(e);i!==s&&(s&&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 s=this.values.get(e);return s===void 0&&i!==void 0&&(s=Oh(i===null?void 0:i,{owner:this}),this.addValue(e,s)),s}readValue(e,i){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(DP(s)||NP(s))?s=parseFloat(s):!k7(s)&&Sr.test(i)&&(s=AR(e,i)),this.setBaseTarget(e,Ii(s)?s.get():s)),Ii(s)?s.get():s}setBaseTarget(e,i){this.baseTarget[e]=i}getBaseTarget(e){var n;const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const o=jb(this.props,i,(n=this.presenceContext)==null?void 0:n.custom);o&&(s=o[e])}if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Ii(r)?r:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,i){return this.events[e]||(this.events[e]=new kb),this.events[e].add(i)}notify(e,...i){this.events[e]&&this.events[e].notify(...i)}scheduleRenderMicrotask(){Zb.render(this.render)}}class NR extends R7{constructor(){super(...arguments),this.KeyframeResolver=n7}sortInstanceNodePosition(e,i){return e.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(e,i){const s=e.style;return s?s[i]:void 0}removeValueFromRenderState(e,{vars:i,style:s}){delete i[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ii(e)&&(this.childSubscription=e.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Fo{constructor(e){this.isMounted=!1,this.node=e}update(){}}function jR({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function Q7({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function L7(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}function ov(t){return t===void 0||t===1}function S1({scale:t,scaleX:e,scaleY:i}){return!ov(t)||!ov(e)||!ov(i)}function wa(t){return S1(t)||XR(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function XR(t){return H2(t.x)||H2(t.y)}function H2(t){return t&&t!=="0%"}function ym(t,e,i){const s=t-i,r=e*s;return i+r}function F2(t,e,i,s,r){return r!==void 0&&(t=ym(t,r,s)),ym(t,i,s)+e}function x1(t,e=0,i=1,s,r){t.min=F2(t.min,e,i,s,r),t.max=F2(t.max,e,i,s,r)}function VR(t,{x:e,y:i}){x1(t.x,e.translate,e.scale,e.originPoint),x1(t.y,i.translate,i.scale,i.originPoint)}const G2=.999999999999,K2=1.0000000000001;function $7(t,e,i,s=!1){const r=i.length;if(!r)return;e.x=e.y=1;let n,o;for(let l=0;l<r;l++){n=i[l],o=n.projectionDelta;const{visualElement:c}=n.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&n.options.layoutScroll&&n.scroll&&n!==n.root&&eh(t,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,VR(t,o)),s&&wa(n.latestValues)&&eh(t,n.latestValues))}e.x<K2&&e.x>G2&&(e.x=1),e.y<K2&&e.y>G2&&(e.y=1)}function Jl(t,e){t.min=t.min+e,t.max=t.max+e}function J2(t,e,i,s,r=.5){const n=kt(t.min,t.max,r);x1(t,e,i,n,s)}function eh(t,e){J2(t.x,e.x,e.scaleX,e.scale,e.originX),J2(t.y,e.y,e.scaleY,e.scale,e.originY)}function ZR(t,e){return jR(L7(t.getBoundingClientRect(),e))}function B7(t,e,i){const s=ZR(t,i),{scroll:r}=e;return r&&(Jl(s.x,r.offset.x),Jl(s.y,r.offset.y)),s}const D7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},z7=Ph.length;function N7(t,e,i){let s="",r=!0;for(let n=0;n<z7;n++){const o=Ph[n],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=PR(l,Vb[o]);if(!c){r=!1;const d=D7[o]||o;s+=`${d}(${u}) `}i&&(e[o]=u)}}return s=s.trim(),i?s=i(e,r?"":s):r&&(s="none"),s}function Yb(t,e,i){const{style:s,vars:r,transformOrigin:n}=t;let o=!1,l=!1;for(const c in e){const u=e[c];if(Rh.has(c)){o=!0;continue}else if(eR(c)){r[c]=u;continue}else{const d=PR(u,Vb[c]);c.startsWith("origin")?(l=!0,n[c]=d):s[c]=d}}if(e.transform||(o||i?s.transform=N7(e,t.transform,i):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=n;s.transformOrigin=`${c} ${u} ${d}`}}function IR(t,{style:e,vars:i},s,r){const n=t.style;let o;for(o in e)n[o]=e[o];r==null||r.applyProjectionStyles(n,s);for(o in i)n.setProperty(o,i[o])}function e5(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const jc={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(xe.test(t))t=parseFloat(t);else return t;const i=e5(t,e.target.x),s=e5(t,e.target.y);return`${i}% ${s}%`}},j7={correct:(t,{treeScale:e,projectionDelta:i})=>{const s=t,r=Sr.parse(t);if(r.length>5)return s;const n=Sr.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=kt(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),n(r)}},w1={borderRadius:{...jc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:jc,borderTopRightRadius:jc,borderBottomLeftRadius:jc,borderBottomRightRadius:jc,boxShadow:j7};function qR(t,{layout:e,layoutId:i}){return Rh.has(t)||t.startsWith("origin")||(e||i!==void 0)&&(!!w1[t]||t==="opacity")}function Hb(t,e,i){var o;const s=t.style,r=e==null?void 0:e.style,n={};if(!s)return n;for(const l in s)(Ii(s[l])||r&&Ii(r[l])||qR(l,t)||((o=i==null?void 0:i.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(n[l]=s[l]);return n}function X7(t){return window.getComputedStyle(t)}class V7 extends NR{constructor(){super(...arguments),this.type="html",this.renderInstance=IR}readValueFromInstance(e,i){var s;if(Rh.has(i))return(s=this.projection)!=null&&s.isProjecting?h1(i):a8(e,i);{const r=X7(e),n=(eR(i)?r.getPropertyValue(i):r[i])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:i}){return ZR(e,i)}build(e,i,s){Yb(e,i,s.transformTemplate)}scrapeMotionValuesFromProps(e,i,s){return Hb(e,i,s)}}const Z7={offset:"stroke-dashoffset",array:"stroke-dasharray"},I7={offset:"strokeDashoffset",array:"strokeDasharray"};function q7(t,e,i=1,s=0,r=!0){t.pathLength=1;const n=r?Z7:I7;t[n.offset]=`${-s}`,t[n.array]=`${e} ${i}`}const W7=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function WR(t,{attrX:e,attrY:i,attrScale:s,pathLength:r,pathSpacing:n=1,pathOffset:o=0,...l},c,u,d){if(Yb(t,l,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:m,style:g}=t;m.transform&&(g.transform=m.transform,delete m.transform),(g.transform||m.transformOrigin)&&(g.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),g.transform&&(g.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete m.transformBox);for(const v of W7)m[v]!==void 0&&(g[v]=m[v],delete m[v]);e!==void 0&&(m.x=e),i!==void 0&&(m.y=i),s!==void 0&&(m.scale=s),r!==void 0&&q7(m,r,n,o,!1)}const UR=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"]),YR=t=>typeof t=="string"&&t.toLowerCase()==="svg";function U7(t,e,i,s){IR(t,e,void 0,s);for(const r in e.attrs)t.setAttribute(UR.has(r)?r:Xb(r),e.attrs[r])}function HR(t,e,i){const s=Hb(t,e,i);for(const r in t)if(Ii(t[r])||Ii(e[r])){const n=Ph.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[n]=t[r]}return s}class Y7 extends NR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ii}getBaseTargetFromProps(e,i){return e[i]}readValueFromInstance(e,i){if(Rh.has(i)){const s=MR(i);return s&&s.default||0}return i=UR.has(i)?i:Xb(i),e.getAttribute(i)}scrapeMotionValuesFromProps(e,i,s){return HR(e,i,s)}build(e,i,s){WR(e,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,i,s,r){U7(e,i,s,r)}mount(e){this.isSVGTag=YR(e.tagName),super.mount(e)}}const H7=Ub.length;function FR(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?FR(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const e={};for(let i=0;i<H7;i++){const s=Ub[i],r=t.props[s];(Bu(r)||r===!1)&&(e[s]=r)}return e}function GR(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let s=0;s<i;s++)if(e[s]!==t[s])return!1;return!0}const F7=[...Wb].reverse(),G7=Wb.length;function K7(t){return e=>Promise.all(e.map(({animation:i,options:s})=>Y8(t,i,s)))}function J7(t){let e=K7(t),i=t5(),s=!0;const r=c=>(u,d)=>{var g;const m=ah(t,d,c==="exit"?(g=t.presenceContext)==null?void 0:g.custom:void 0);if(m){const{transition:v,transitionEnd:y,...b}=m;u={...u,...b,...y}}return u};function n(c){e=c(t)}function o(c){const{props:u}=t,d=FR(t.parent)||{},m=[],g=new Set;let v={},y=1/0;for(let w=0;w<G7;w++){const C=F7[w],T=i[C],M=u[C]!==void 0?u[C]:d[C],k=Bu(M),P=C===c?T.isActive:null;P===!1&&(y=w);let E=M===d[C]&&M!==u[C]&&k;if(E&&s&&t.manuallyAnimateOnMount&&(E=!1),T.protectedKeys={...v},!T.isActive&&P===null||!M&&!T.prevProp||ug(M)||typeof M=="boolean")continue;if(C==="exit"&&T.isActive&&P!==!0){T.prevResolvedValues&&(v={...v,...T.prevResolvedValues});continue}const z=ej(T.prevProp,M);let $=z||C===c&&T.isActive&&!E&&k||w>y&&k,Z=!1;const ie=Array.isArray(M)?M:[M];let F=ie.reduce(r(C),{});P===!1&&(F={});const{prevResolvedValues:R={}}=T,Q={...R,...F},D=j=>{$=!0,g.has(j)&&(Z=!0,g.delete(j)),T.needsAnimating[j]=!0;const U=t.getValue(j);U&&(U.liveStyle=!1)};for(const j in Q){const U=F[j],Y=R[j];if(v.hasOwnProperty(j))continue;let W=!1;m1(U)&&m1(Y)?W=!GR(U,Y):W=U!==Y,W?U!=null?D(j):g.add(j):U!==void 0&&g.has(j)?D(j):T.protectedKeys[j]=!0}T.prevProp=M,T.prevResolvedValues=F,T.isActive&&(v={...v,...F}),s&&t.blockInitialAnimation&&($=!1);const I=E&&z;$&&(!I||Z)&&m.push(...ie.map(j=>{const U={type:C};if(typeof j=="string"&&s&&!I&&t.manuallyAnimateOnMount&&t.parent){const{parent:Y}=t,W=ah(Y,j);if(Y.enteringChildren&&W){const{delayChildren:N}=W.transition||{};U.delay=_R(Y.enteringChildren,t,N)}}return{animation:j,options:U}}))}if(g.size){const w={};if(typeof u.initial!="boolean"){const C=ah(t,Array.isArray(u.initial)?u.initial[0]:u.initial);C&&C.transition&&(w.transition=C.transition)}g.forEach(C=>{const T=t.getBaseTarget(C),M=t.getValue(C);M&&(M.liveStyle=!0),w[C]=T??null}),m.push({animation:w})}let b=!!m.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,b?e(m):Promise.resolve()}function l(c,u){var m;if(i[c].isActive===u)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(g=>{var v;return(v=g.animationState)==null?void 0:v.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:n,getState:()=>i,reset:()=>{i=t5()}}}function ej(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!GR(e,t):!1}function Oa(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function t5(){return{animate:Oa(!0),whileInView:Oa(),whileHover:Oa(),whileTap:Oa(),whileDrag:Oa(),whileFocus:Oa(),exit:Oa()}}function i5(t,e){t.min=e.min,t.max=e.max}function mr(t,e){i5(t.x,e.x),i5(t.y,e.y)}function s5(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const KR=1e-4,tj=1-KR,ij=1+KR,JR=.01,sj=0-JR,rj=0+JR;function es(t){return t.max-t.min}function nj(t,e,i){return Math.abs(t-e)<=i}function r5(t,e,i,s=.5){t.origin=s,t.originPoint=kt(e.min,e.max,t.origin),t.scale=es(i)/es(e),t.translate=kt(i.min,i.max,t.origin)-t.originPoint,(t.scale>=tj&&t.scale<=ij||isNaN(t.scale))&&(t.scale=1),(t.translate>=sj&&t.translate<=rj||isNaN(t.translate))&&(t.translate=0)}function bu(t,e,i,s){r5(t.x,e.x,i.x,s?s.originX:void 0),r5(t.y,e.y,i.y,s?s.originY:void 0)}function n5(t,e,i){t.min=i.min+e.min,t.max=t.min+es(e)}function oj(t,e,i){n5(t.x,e.x,i.x),n5(t.y,e.y,i.y)}function o5(t,e,i){t.min=e.min-i.min,t.max=t.min+es(e)}function bm(t,e,i){o5(t.x,e.x,i.x),o5(t.y,e.y,i.y)}function a5(t,e,i,s,r){return t-=e,t=ym(t,1/i,s),r!==void 0&&(t=ym(t,1/r,s)),t}function aj(t,e=0,i=1,s=.5,r,n=t,o=t){if(Gr.test(e)&&(e=parseFloat(e),e=kt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=kt(n.min,n.max,s);t===n&&(l-=e),t.min=a5(t.min,e,i,l,r),t.max=a5(t.max,e,i,l,r)}function l5(t,e,[i,s,r],n,o){aj(t,e[i],e[s],e[r],e.scale,n,o)}const lj=["x","scaleX","originX"],hj=["y","scaleY","originY"];function h5(t,e,i,s){l5(t.x,e,lj,i?i.x:void 0,s?s.x:void 0),l5(t.y,e,hj,i?i.y:void 0,s?s.y:void 0)}function c5(t){return t.translate===0&&t.scale===1}function eQ(t){return c5(t.x)&&c5(t.y)}function u5(t,e){return t.min===e.min&&t.max===e.max}function cj(t,e){return u5(t.x,e.x)&&u5(t.y,e.y)}function f5(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function tQ(t,e){return f5(t.x,e.x)&&f5(t.y,e.y)}function d5(t){return es(t.x)/es(t.y)}function p5(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Vr(t){return[t("x"),t("y")]}function uj(t,e,i){let s="";const r=t.x.translate/e.x,n=t.y.translate/e.y,o=(i==null?void 0:i.z)||0;if((r||n||o)&&(s=`translate3d(${r}px, ${n}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:u,rotate:d,rotateX:m,rotateY:g,skewX:v,skewY:y}=i;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),m&&(s+=`rotateX(${m}deg) `),g&&(s+=`rotateY(${g}deg) `),v&&(s+=`skewX(${v}deg) `),y&&(s+=`skewY(${y}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const iQ=["TopLeft","TopRight","BottomLeft","BottomRight"],fj=iQ.length,m5=t=>typeof t=="string"?parseFloat(t):t,g5=t=>typeof t=="number"||xe.test(t);function dj(t,e,i,s,r,n){r?(t.opacity=kt(0,i.opacity??1,pj(s)),t.opacityExit=kt(e.opacity??1,0,mj(s))):n&&(t.opacity=kt(e.opacity??1,i.opacity??1,s));for(let o=0;o<fj;o++){const l=`border${iQ[o]}Radius`;let c=O5(e,l),u=O5(i,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||g5(c)===g5(u)?(t[l]=Math.max(kt(m5(c),m5(u),s),0),(Gr.test(u)||Gr.test(c))&&(t[l]+="%")):t[l]=u}(e.rotate||i.rotate)&&(t.rotate=kt(e.rotate||0,i.rotate||0,s))}function O5(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const pj=sQ(0,.5,YP),mj=sQ(.5,.95,ar);function sQ(t,e,i){return s=>s<t?0:s>e?1:i(Qu(t,e,s))}function gj(t,e,i){const s=Ii(t)?t:Oh(t);return s.start(Nb("",s,e,i)),s.animation}function Du(t,e,i,s={passive:!0}){return t.addEventListener(e,i,s),()=>t.removeEventListener(e,i)}const Oj=(t,e)=>t.depth-e.depth;class vj{constructor(){this.children=[],this.isDirty=!1}add(e){wb(this.children,e),this.isDirty=!0}remove(e){mm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Oj),this.isDirty=!1,this.children.forEach(e)}}function _j(t,e){const i=Ji.now(),s=({timestamp:r})=>{const n=r-i;n>=e&&(Vo(s),t(n-e))};return pt.setup(s,!0),()=>Vo(s)}function qp(t){return Ii(t)?t.get():t}class yj{constructor(){this.members=[]}add(e){wb(this.members,e);for(let i=this.members.length-1;i>=0;i--){const s=this.members[i];if(s===e||s===this.lead||s===this.prevLead)continue;const r=s.instance;r&&r.isConnected===!1&&s.isPresent!==!1&&!s.snapshot&&mm(this.members,s)}e.scheduleRender()}remove(e){if(mm(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 s;for(let r=i;r>=0;r--){const n=this.members[r],o=n.instance;if(n.isPresent!==!1&&(!o||o.isConnected!==!1)){s=n;break}}return s?(this.promote(s),!0):!1}promote(e,i){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();const r=s.options.layoutDependency,n=e.options.layoutDependency;if(!(r!==void 0&&n!==void 0&&r===n)){const c=s.instance;c&&c.isConnected===!1&&!s.snapshot||(e.resumeFrom=s,i&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:l}=e.options;l===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:i,resumingFrom:s}=e;i.onExitComplete&&i.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Wp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},av=["","X","Y","Z"],bj=1e3;let Sj=0;function lv(t,e,i,s){const{latestValues:r}=e;r[t]&&(i[t]=r[t],e.setStaticValue(t,0),s&&(s[t]=0))}function rQ(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=wR(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",pt,!(r||n))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&rQ(s)}function nQ({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(o={},l=e==null?void 0:e()){this.id=Sj++,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(Cj),this.nodes.forEach(Aj),this.nodes.forEach(Ej),this.nodes.forEach(kj)},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 vj)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kb),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=qb(o)&&!w7(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,m=0;const g=()=>this.root.updateBlockedByResize=!1;pt.read(()=>{m=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==m&&(m=v,this.root.updateBlockedByResize=!0,d&&d(),d=_j(g,250),Wp.hasAnimatedSinceResize&&(Wp.hasAnimatedSinceResize=!1,this.nodes.forEach(y5)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:m,hasRelativeLayoutChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||$j,{onLayoutAnimationStart:b,onLayoutAnimationComplete:w}=u.getProps(),C=!this.targetLayout||!tQ(this.targetLayout,v),T=!m&&g;if(this.options.layoutRoot||this.resumeFrom||T||m&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...zb(y,"layout"),onPlay:b,onComplete:w};(u.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(d,T)}else m||y5(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}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(),Vo(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(Pj),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&&rQ(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const m=this.path[d];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.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(v5);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(_5);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Mj),this.nodes.forEach(xj),this.nodes.forEach(wj)):this.nodes.forEach(_5),this.clearAllSnapshots();const l=Ji.now();Pi.delta=tn(0,1e3/60,l-Pi.timestamp),Pi.timestamp=l,Pi.isProcessing=!0,J0.update.process(Pi),J0.preRender.process(Pi),J0.render.process(Pi),Pi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tj),this.sharedNodes.forEach(Rj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!es(this.snapshot.measuredBox.x)&&!es(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=ii(),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=s(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&&!eQ(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||wa(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)),Bj(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return ii();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Dj))){const{scroll:d}=this.root;d&&(Jl(l.x,d.offset.x),Jl(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=ii();if(mr(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:m,options:g}=d;d!==this.root&&m&&g.layoutScroll&&(m.wasRoot&&mr(l,o),Jl(l.x,m.offset.x),Jl(l.y,m.offset.y))}return l}applyTransform(o,l=!1){const c=ii();mr(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&&eh(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),wa(d.latestValues)&&eh(c,d.latestValues)}return wa(this.latestValues)&&eh(c,this.latestValues),c}removeTransform(o){const l=ii();mr(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!wa(u.latestValues))continue;S1(u.latestValues)&&u.updateSnapshot();const d=ii(),m=u.measurePageBox();mr(d,m),h5(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return wa(this.latestValues)&&h5(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!==Pi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;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||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:m}=this.options;if(!this.layout||!(d||m))return;this.resolvedRelativeTargetAt=Pi.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=ii(),this.targetWithTransforms=ii()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mr(this.target,this.layout.layoutBox),VR(this.target,this.targetDelta)):mr(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||S1(this.parent.latestValues)||XR(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=ii(),this.relativeTargetOrigin=ii(),bm(this.relativeTargetOrigin,l,c),mr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Pi.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;mr(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,g=this.treeScale.y;$7(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=ii());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(s5(this.prevProjectionDelta.x,this.projectionDelta.x),s5(this.prevProjectionDelta.y,this.projectionDelta.y)),bu(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==g||!p5(this.projectionDelta.x,this.prevProjectionDelta.x)||!p5(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}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=Kl(),this.projectionDelta=Kl(),this.projectionDeltaWithTransform=Kl()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},m=Kl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const g=ii(),v=c?c.source:void 0,y=this.layout?this.layout.source:void 0,b=v!==y,w=this.getStack(),C=!w||w.members.length<=1,T=!!(b&&!C&&this.options.crossfade===!0&&!this.path.some(Lj));this.animationProgress=0;let M;this.mixTargetDelta=k=>{const P=k/1e3;b5(m.x,o.x,P),b5(m.y,o.y,P),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bm(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Qj(this.relativeTarget,this.relativeTargetOrigin,g,P),M&&cj(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=ii()),mr(M,this.relativeTarget)),b&&(this.animationValues=d,dj(d,u,this.latestValues,P,T,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},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&&(Vo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{Wp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Oh(0)),this.motionValue.jump(0,!1),this.currentAnimation=gj(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(bj),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&&oQ(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ii();const m=es(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+m;const g=es(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+g}mr(l,c),eh(l,d),bu(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new yj),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&&lv("z",o,u,this.animationValues);for(let d=0;d<av.length;d++)lv(`rotate${av[d]}`,o,u,this.animationValues),lv(`skew${av[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=qp(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=qp(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!wa(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let m=uj(this.projectionDeltaWithTransform,this.treeScale,d);c&&(m=c(d,m)),o.transform=m;const{x:g,y:v}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${v.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 y in w1){if(d[y]===void 0)continue;const{correct:b,applyTo:w,isCSSVariable:C}=w1[y],T=m==="none"?d[y]:b(d[y],u);if(w){const M=w.length;for(let k=0;k<M;k++)o[w[k]]=T}else C?this.options.visualElement.renderState.vars[y]=T:o[y]=T}this.options.layoutId&&(o.pointerEvents=u===this?qp(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(v5),this.root.sharedNodes.clear()}}}function xj(t){t.updateLayout()}function wj(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:s,measuredBox:r}=t.layout,{animationType:n}=t.options,o=e.source!==t.layout.source;n==="size"?Vr(m=>{const g=o?e.measuredBox[m]:e.layoutBox[m],v=es(g);g.min=s[m].min,g.max=g.min+v}):oQ(n,e.layoutBox,s)&&Vr(m=>{const g=o?e.measuredBox[m]:e.layoutBox[m],v=es(s[m]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[m].max=t.relativeTarget[m].min+v)});const l=Kl();bu(l,s,e.layoutBox);const c=Kl();o?bu(c,t.applyTransform(r,!0),e.measuredBox):bu(c,s,e.layoutBox);const u=!eQ(l);let d=!1;if(!t.resumeFrom){const m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:v}=m;if(g&&v){const y=ii();bm(y,e.layoutBox,g.layoutBox);const b=ii();bm(b,s,v.layoutBox),tQ(y,b)||(d=!0),m.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=m)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Cj(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 kj(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Tj(t){t.clearSnapshot()}function v5(t){t.clearMeasurements()}function _5(t){t.isLayoutDirty=!1}function Mj(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function y5(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Aj(t){t.resolveTargetDelta()}function Ej(t){t.calcProjection()}function Pj(t){t.resetSkewAndRotation()}function Rj(t){t.removeLeadSnapshot()}function b5(t,e,i){t.translate=kt(e.translate,0,i),t.scale=kt(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function S5(t,e,i,s){t.min=kt(e.min,i.min,s),t.max=kt(e.max,i.max,s)}function Qj(t,e,i,s){S5(t.x,e.x,i.x,s),S5(t.y,e.y,i.y,s)}function Lj(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $j={duration:.45,ease:[.4,0,.1,1]},x5=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),w5=x5("applewebkit/")&&!x5("chrome/")?Math.round:ar;function C5(t){t.min=w5(t.min),t.max=w5(t.max)}function Bj(t){C5(t.x),C5(t.y)}function oQ(t,e,i){return t==="position"||t==="preserve-aspect"&&!nj(d5(e),d5(i),.2)}function Dj(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const zj=nQ({attachResizeListener:(t,e)=>Du(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}),hv={current:void 0},aQ=nQ({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!hv.current){const t=new zj({});t.mount(window),t.setOptions({layoutScroll:!0}),hv.current=t}return hv.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Fb=X.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function k5(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Nj(...t){return e=>{let i=!1;const s=t.map(r=>{const n=k5(r,e);return!i&&typeof n=="function"&&(i=!0),n});if(i)return()=>{for(let r=0;r<s.length;r++){const n=s[r];typeof n=="function"?n():k5(t[r],null)}}}}function jj(...t){return X.useCallback(Nj(...t),t)}class Xj extends X.Component{getSnapshotBeforeUpdate(e){const i=this.props.childRef.current;if(i&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=i.offsetParent,r=y1(s)&&s.offsetWidth||0,n=y1(s)&&s.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=n-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Vj({children:t,isPresent:e,anchorX:i,anchorY:s,root:r,pop:n}){var g;const o=X.useId(),l=X.useRef(null),c=X.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=X.useContext(Fb),d=((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref),m=jj(l,d);return X.useInsertionEffect(()=>{const{width:v,height:y,top:b,left:w,right:C,bottom:T}=c.current;if(e||n===!1||!l.current||!v||!y)return;const M=i==="left"?`left: ${w}`:`right: ${C}`,k=s==="bottom"?`bottom: ${T}`:`top: ${b}`;l.current.dataset.motionPopId=o;const P=document.createElement("style");u&&(P.nonce=u);const E=r??document.head;return E.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
50
|
-
[data-motion-pop-id="${o}"] {
|
|
51
|
-
position: absolute !important;
|
|
52
|
-
width: ${v}px !important;
|
|
53
|
-
height: ${y}px !important;
|
|
54
|
-
${M}px !important;
|
|
55
|
-
${k}px !important;
|
|
56
|
-
}
|
|
57
|
-
`),()=>{E.contains(P)&&E.removeChild(P)}},[e]),S.jsx(Xj,{isPresent:e,childRef:l,sizeRef:c,pop:n,children:n===!1?t:X.cloneElement(t,{ref:m})})}const Zj=({children:t,initial:e,isPresent:i,onExitComplete:s,custom:r,presenceAffectsLayout:n,mode:o,anchorX:l,anchorY:c,root:u})=>{const d=xb(Ij),m=X.useId();let g=!0,v=X.useMemo(()=>(g=!1,{id:m,initial:e,isPresent:i,custom:r,onExitComplete:y=>{d.set(y,!0);for(const b of d.values())if(!b)return;s&&s()},register:y=>(d.set(y,!1),()=>d.delete(y))}),[i,d,s]);return n&&g&&(v={...v}),X.useMemo(()=>{d.forEach((y,b)=>d.set(b,!1))},[i]),X.useEffect(()=>{!i&&!d.size&&s&&s()},[i]),t=S.jsx(Vj,{pop:o==="popLayout",isPresent:i,anchorX:l,anchorY:c,root:u,children:t}),S.jsx(cg.Provider,{value:v,children:t})};function Ij(){return new Map}function lQ(t=!0){const e=X.useContext(cg);if(e===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:r}=e,n=X.useId();X.useEffect(()=>{if(t)return r(n)},[t]);const o=X.useCallback(()=>t&&s&&s(n),[n,s,t]);return!i&&s?[!1,o]:[!0]}const tp=t=>t.key||"";function T5(t){const e=[];return X.Children.forEach(t,i=>{X.isValidElement(i)&&e.push(i)}),e}const hQ=({children:t,custom:e,initial:i=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:n="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[d,m]=lQ(o),g=X.useMemo(()=>T5(t),[t]),v=o&&!d?[]:g.map(tp),y=X.useRef(!0),b=X.useRef(g),w=xb(()=>new Map),C=X.useRef(new Set),[T,M]=X.useState(g),[k,P]=X.useState(g);BP(()=>{y.current=!1,b.current=g;for(let $=0;$<k.length;$++){const Z=tp(k[$]);v.includes(Z)?(w.delete(Z),C.current.delete(Z)):w.get(Z)!==!0&&w.set(Z,!1)}},[k,v.length,v.join("-")]);const E=[];if(g!==T){let $=[...g];for(let Z=0;Z<k.length;Z++){const ie=k[Z],F=tp(ie);v.includes(F)||($.splice(Z,0,ie),E.push(ie))}return n==="wait"&&E.length&&($=E),P(T5($)),M(g),null}const{forceRender:z}=X.useContext(Sb);return S.jsx(S.Fragment,{children:k.map($=>{const Z=tp($),ie=o&&!d?!1:g===k||v.includes(Z),F=()=>{if(C.current.has(Z))return;if(C.current.add(Z),w.has(Z))w.set(Z,!0);else return;let R=!0;w.forEach(Q=>{Q||(R=!1)}),R&&(z==null||z(),P(b.current),o&&(m==null||m()),s&&s())};return S.jsx(Zj,{isPresent:ie,initial:!y.current||i?void 0:!1,custom:e,presenceAffectsLayout:r,mode:n,root:u,onExitComplete:ie?void 0:F,anchorX:l,anchorY:c,children:$},Z)})})},cQ=X.createContext({strict:!1}),M5={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 A5=!1;function qj(){if(A5)return;const t={};for(const e in M5)t[e]={isEnabled:i=>M5[e].some(s=>!!i[s])};zR(t),A5=!0}function uQ(){return qj(),P7()}function Wj(t){const e=uQ();for(const i in t)e[i]={...e[i],...t[i]};zR(e)}const Uj=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 Sm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Uj.has(t)}let fQ=t=>!Sm(t);function Yj(t){typeof t=="function"&&(fQ=e=>e.startsWith("on")?!Sm(e):t(e))}try{Yj(require("@emotion/is-prop-valid").default)}catch{}function Hj(t,e,i){const s={};for(const r in t)r==="values"&&typeof t.values=="object"||(fQ(r)||i===!0&&Sm(r)||!e&&!Sm(r)||t.draggable&&r.startsWith("onDrag"))&&(s[r]=t[r]);return s}const dg=X.createContext({});function Fj(t,e){if(fg(t)){const{initial:i,animate:s}=t;return{initial:i===!1||Bu(i)?i:void 0,animate:Bu(s)?s:void 0}}return t.inherit!==!1?e:{}}function Gj(t){const{initial:e,animate:i}=Fj(t,X.useContext(dg));return X.useMemo(()=>({initial:e,animate:i}),[E5(e),E5(i)])}function E5(t){return Array.isArray(t)?t.join(" "):t}const Gb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dQ(t,e,i){for(const s in e)!Ii(e[s])&&!qR(s,i)&&(t[s]=e[s])}function Kj({transformTemplate:t},e){return X.useMemo(()=>{const i=Gb();return Yb(i,e,t),Object.assign({},i.vars,i.style)},[e])}function Jj(t,e){const i=t.style||{},s={};return dQ(s,i,t),Object.assign(s,Kj(t,e)),s}function eX(t,e){const i={},s=Jj(t,e);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,i}const pQ=()=>({...Gb(),attrs:{}});function tX(t,e,i,s){const r=X.useMemo(()=>{const n=pQ();return WR(n,e,YR(s),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const n={};dQ(n,t.style,t),r.style={...n,...r.style}}return r}const iX=["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 Kb(t){return typeof t!="string"||t.includes("-")?!1:!!(iX.indexOf(t)>-1||/[A-Z]/u.test(t))}function sX(t,e,i,{latestValues:s},r,n=!1,o){const c=(o??Kb(t)?tX:eX)(e,s,r,t),u=Hj(e,typeof t=="string",n),d=t!==X.Fragment?{...u,...c,ref:i}:{},{children:m}=e,g=X.useMemo(()=>Ii(m)?m.get():m,[m]);return X.createElement(t,{...d,children:g})}function rX({scrapeMotionValuesFromProps:t,createRenderState:e},i,s,r){return{latestValues:nX(i,s,r,t),renderState:e()}}function nX(t,e,i,s){const r={},n=s(t,{});for(const g in n)r[g]=qp(n[g]);let{initial:o,animate:l}=t;const c=fg(t),u=BR(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 m=d?l:o;if(m&&typeof m!="boolean"&&!ug(m)){const g=Array.isArray(m)?m:[m];for(let v=0;v<g.length;v++){const y=jb(t,g[v]);if(y){const{transitionEnd:b,transition:w,...C}=y;for(const T in C){let M=C[T];if(Array.isArray(M)){const k=d?M.length-1:0;M=M[k]}M!==null&&(r[T]=M)}for(const T in b)r[T]=b[T]}}}return r}const mQ=t=>(e,i)=>{const s=X.useContext(dg),r=X.useContext(cg),n=()=>rX(t,e,s,r);return i?n():xb(n)},oX=mQ({scrapeMotionValuesFromProps:Hb,createRenderState:Gb}),aX=mQ({scrapeMotionValuesFromProps:HR,createRenderState:pQ}),lX=Symbol.for("motionComponentSymbol");function hX(t,e,i){const s=X.useRef(i);X.useInsertionEffect(()=>{s.current=i});const r=X.useRef(null);return X.useCallback(n=>{var l;n&&((l=t.onMount)==null||l.call(t,n)),e&&(n?e.mount(n):e.unmount());const o=s.current;if(typeof o=="function")if(n){const c=o(n);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(n);else o&&(o.current=n)},[e])}const gQ=X.createContext({});function Wl(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function cX(t,e,i,s,r,n){var M,k;const{visualElement:o}=X.useContext(dg),l=X.useContext(cQ),c=X.useContext(cg),u=X.useContext(Fb),d=u.reducedMotion,m=u.skipAnimations,g=X.useRef(null),v=X.useRef(!1);s=s||l.renderer,!g.current&&s&&(g.current=s(t,{visualState:e,parent:o,props:i,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:m,isSVG:n}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const y=g.current,b=X.useContext(gQ);y&&!y.projection&&r&&(y.type==="html"||y.type==="svg")&&uX(g.current,i,r,b);const w=X.useRef(!1);X.useInsertionEffect(()=>{y&&w.current&&y.update(i,c)});const C=i[xR],T=X.useRef(!!C&&!((M=window.MotionHandoffIsComplete)!=null&&M.call(window,C))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,C)));return BP(()=>{v.current=!0,y&&(w.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),T.current&&y.animationState&&y.animationState.animateChanges())}),X.useEffect(()=>{y&&(!T.current&&y.animationState&&y.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,C)}),T.current=!1),y.enteringChildren=void 0)}),y}function uX(t,e,i,s){const{layoutId:r,layout:n,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:OQ(t.parent)),t.projection.setOptions({layoutId:r,layout:n,alwaysMeasureLayout:!!o||l&&Wl(l),visualElement:t,animationType:typeof n=="string"?n:"both",initialPromotionConfig:s,crossfade:d,layoutScroll:c,layoutRoot:u})}function OQ(t){if(t)return t.options.allowProjection!==!1?t.projection:OQ(t.parent)}function cv(t,{forwardMotionProps:e=!1,type:i}={},s,r){s&&Wj(s);const n=i?i==="svg":Kb(t),o=n?aX:oX;function l(u,d){let m;const g={...X.useContext(Fb),...u,layoutId:fX(u)},{isStatic:v}=g,y=Gj(u),b=o(u,v);if(!v&&$P){dX();const w=pX(g);m=w.MeasureLayout,y.visualElement=cX(t,b,g,r,w.ProjectionNode,n)}return S.jsxs(dg.Provider,{value:y,children:[m&&y.visualElement?S.jsx(m,{visualElement:y.visualElement,...g}):null,sX(t,u,hX(b,y.visualElement,d),b,v,e,n)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=X.forwardRef(l);return c[lX]=t,c}function fX({layoutId:t}){const e=X.useContext(Sb).id;return e&&t!==void 0?e+"-"+t:t}function dX(t,e){X.useContext(cQ).strict}function pX(t){const e=uQ(),{drag:i,layout:s}=e;if(!i&&!s)return{};const r={...i,...s};return{MeasureLayout:i!=null&&i.isEnabled(t)||s!=null&&s.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function mX(t,e){if(typeof Proxy>"u")return cv;const i=new Map,s=(n,o)=>cv(n,o,t,e),r=(n,o)=>s(n,o);return new Proxy(r,{get:(n,o)=>o==="create"?s:(i.has(o)||i.set(o,cv(o,void 0,t,e)),i.get(o))})}const gX=(t,e)=>e.isSVG??Kb(t)?new Y7(e):new V7(e,{allowProjection:t!==X.Fragment});class OX extends Fo{constructor(e){super(e),e.animationState||(e.animationState=J7(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ug(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 vX=0;class _X extends Fo{constructor(){super(...arguments),this.id=vX++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)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 yX={animation:{Feature:OX},exit:{Feature:_X}};function vf(t){return{point:{x:t.pageX,y:t.pageY}}}const bX=t=>e=>Ib(e)&&t(e,vf(e));function Su(t,e,i,s){return Du(t,e,bX(i),s)}const vQ=({current:t})=>t?t.ownerDocument.defaultView:null,P5=(t,e)=>Math.abs(t-e);function SX(t,e){const i=P5(t.x,e.x),s=P5(t.y,e.y);return Math.sqrt(i**2+s**2)}const R5=new Set(["auto","scroll"]);class _Q{constructor(e,i,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:n=!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=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=fv(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=SX(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!b)return;const{point:w}=v,{timestamp:C}=Pi;this.history.push({...w,timestamp:C});const{onStart:T,onMove:M}=this.handlers;y||(T&&T(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,v)},this.handlePointerMove=(v,y)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=uv(y,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(v,y)=>{this.end();const{onEnd:b,onSessionEnd:w,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=fv(v.type==="pointercancel"?this.lastMoveEventInfo:uv(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(v,T),w&&w(v,T)},!Ib(e))return;this.dragSnapToOrigin=n,this.handlers=i,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=r||window;const c=vf(e),u=uv(c,this.transformPagePoint),{point:d}=u,{timestamp:m}=Pi;this.history=[{...d,timestamp:m}];const{onSessionStart:g}=i;g&&g(e,fv(u,this.history)),this.removeListeners=mf(Su(this.contextWindow,"pointermove",this.handlePointerMove),Su(this.contextWindow,"pointerup",this.handlePointerUp),Su(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(e){let i=e.parentElement;for(;i;){const s=getComputedStyle(i);(R5.has(s.overflowX)||R5.has(s.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 s=e===window,r=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},n={x:r.x-i.x,y:r.y-i.y};n.x===0&&n.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=n.x,this.lastMoveEventInfo.point.y+=n.y):this.history.length>0&&(this.history[0].x-=n.x,this.history[0].y-=n.y),this.scrollPositions.set(e,r),pt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vo(this.updatePoint)}}function uv(t,e){return e?{point:e(t.point)}:t}function Q5(t,e){return{x:t.x-e.x,y:t.y-e.y}}function fv({point:t},e){return{point:t,delta:Q5(t,yQ(e)),offset:Q5(t,xX(e)),velocity:wX(e,.1)}}function xX(t){return t[0]}function yQ(t){return t[t.length-1]}function wX(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null;const r=yQ(t);for(;i>=0&&(s=t[i],!(r.timestamp-s.timestamp>br(e)));)i--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&r.timestamp-s.timestamp>br(e)*2&&(s=t[1]);const n=tr(r.timestamp-s.timestamp);if(n===0)return{x:0,y:0};const o={x:(r.x-s.x)/n,y:(r.y-s.y)/n};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function CX(t,{min:e,max:i},s){return e!==void 0&&t<e?t=s?kt(e,t,s.min):Math.max(t,e):i!==void 0&&t>i&&(t=s?kt(i,t,s.max):Math.min(t,i)),t}function L5(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 kX(t,{top:e,left:i,bottom:s,right:r}){return{x:L5(t.x,i,r),y:L5(t.y,e,s)}}function $5(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,s]=[s,i]),{min:i,max:s}}function TX(t,e){return{x:$5(t.x,e.x),y:$5(t.y,e.y)}}function MX(t,e){let i=.5;const s=es(t),r=es(e);return r>s?i=Qu(e.min,e.max-s,t.min):s>r&&(i=Qu(t.min,t.max-r,e.min)),tn(0,1,i)}function AX(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 C1=.35;function EX(t=C1){return t===!1?t=0:t===!0&&(t=C1),{x:B5(t,"left","right"),y:B5(t,"top","bottom")}}function B5(t,e,i){return{min:D5(t,e),max:D5(t,i)}}function D5(t,e){return typeof t=="number"?t:t[e]||0}const PX=new WeakMap;class RX{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=ii(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:i=!1,distanceThreshold:s}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const n=m=>{i&&this.snapToCursor(vf(m).point),this.stopAnimation()},o=(m,g)=>{const{drag:v,dragPropagation:y,onDragStart:b}=this.getProps();if(v&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=a7(v),!this.openDragLock))return;this.latestPointerEvent=m,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),Vr(C=>{let T=this.getAxisMotionValue(C).get()||0;if(Gr.test(T)){const{projection:M}=this.visualElement;if(M&&M.layout){const k=M.layout.layoutBox[C];k&&(T=es(k)*(parseFloat(T)/100))}}this.originPoint[C]=T}),b&&pt.update(()=>b(m,g),!1,!0),g1(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},l=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:y,onDirectionLock:b,onDrag:w}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:C}=g;if(y&&this.currentDirection===null){this.currentDirection=LX(C),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",g.point,C),this.updateAxis("y",g.point,C),this.visualElement.render(),w&&pt.update(()=>w(m,g),!1,!0)},c=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g,this.stop(m,g),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new _Q(e,{onSessionStart:n,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:s,contextWindow:vQ(this.visualElement),element:this.visualElement.current})}stop(e,i){const s=e||this.latestPointerEvent,r=i||this.latestPanInfo,n=this.isDragging;if(this.cancel(),!n||!r||!s)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&pt.postRender(()=>l(s,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:i}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&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,s){const{drag:r}=this.getProps();if(!s||!ip(e,r,this.currentDirection))return;const n=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=CX(o,this.constraints[e],this.elastic[e])),n.set(o)}resolveConstraints(){var n;const{dragConstraints:e,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(n=this.visualElement.projection)==null?void 0:n.layout,r=this.constraints;e&&Wl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=kX(s.layoutBox,e):this.constraints=!1,this.elastic=EX(i),r!==this.constraints&&!Wl(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&Vr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=AX(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!Wl(e))return!1;const s=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const n=B7(s,r.root,this.visualElement.getTransformPagePoint());let o=TX(r.layout.layoutBox,n);if(i){const l=i(Q7(o));this.hasMutatedConstraints=!!l,l&&(o=jR(l))}return o}startAnimation(e){const{drag:i,dragMomentum:s,dragElastic:r,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Vr(d=>{if(!ip(d,i,this.currentDirection))return;let m=c&&c[d]||{};o&&(m={min:0,max:0});const g=r?200:1e6,v=r?40:1e7,y={type:"inertia",velocity:s?e[d]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...n,...m};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(l)}startAxisValueAnimation(e,i){const s=this.getAxisMotionValue(e);return g1(this.visualElement,e),s.start(Nb(e,s,0,i,this.visualElement,!1))}stopAnimation(){Vr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const i=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),r=s[i];return r||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){Vr(i=>{const{drag:s}=this.getProps();if(!ip(i,s,this.currentDirection))return;const{projection:r}=this.visualElement,n=this.getAxisMotionValue(i);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[i],c=n.get()||0;n.set(e[i]-kt(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:i}=this.getProps(),{projection:s}=this.visualElement;if(!Wl(i)||!s||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Vr(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=MX({min:c,max:c},this.constraints[o])}});const{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Vr(o=>{if(!ip(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(kt(c,u,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;PX.set(this.visualElement,this);const e=this.visualElement.current,i=Su(e,"pointerdown",u=>{const{drag:d,dragListener:m=!0}=this.getProps(),g=u.target,v=g!==e&&d7(g);d&&m&&!v&&this.start(u)});let s;const r=()=>{const{dragConstraints:u}=this.getProps();Wl(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=QX(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:n}=this.visualElement,o=n.addEventListener("measure",r);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),pt.read(r);const l=Du(window,"resize",()=>this.scalePositionWithinConstraints()),c=n.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Vr(m=>{const g=this.getAxisMotionValue(m);g&&(this.originPoint[m]+=u[m].translate,g.set(g.get()+u[m].translate))}),this.visualElement.render())}));return()=>{l(),i(),o(),c&&c(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:n=!1,dragElastic:o=C1,dragMomentum:l=!0}=e;return{...e,drag:i,dragDirectionLock:s,dragPropagation:r,dragConstraints:n,dragElastic:o,dragMomentum:l}}}function z5(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function QX(t,e,i){const s=q2(t,z5(i)),r=q2(e,z5(i));return()=>{s(),r()}}function ip(t,e,i){return(e===!0||e===t)&&(i===null||i===t)}function LX(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}class $X extends Fo{constructor(e){super(e),this.removeGroupControls=ar,this.removeListeners=ar,this.controls=new RX(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ar}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 dv=t=>(e,i)=>{t&&pt.update(()=>t(e,i),!1,!0)};class BX extends Fo{constructor(){super(...arguments),this.removePointerDownListener=ar}onPointerDown(e){this.session=new _Q(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vQ(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:i,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:dv(e),onStart:dv(i),onMove:dv(s),onEnd:(n,o)=>{delete this.session,r&&pt.postRender(()=>r(n,o))}}}mount(){this.removePointerDownListener=Su(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 pv=!1;class DX extends X.Component{componentDidMount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:s,layoutId:r}=this.props,{projection:n}=e;n&&(i.group&&i.group.add(n),s&&s.register&&r&&s.register(n),pv&&n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:i,visualElement:s,drag:r,isPresent:n}=this.props,{projection:o}=s;return o&&(o.isPresent=n,e.layoutDependency!==i&&o.setOptions({...o.options,layoutDependency:i}),pv=!0,r||e.layoutDependency!==i||i===void 0||e.isPresent!==n?o.willUpdate():this.safeToRemove(),e.isPresent!==n&&(n?o.promote():o.relegate()||pt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Zb.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:s}=this.props,{projection:r}=e;pv=!0,r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function bQ(t){const[e,i]=lQ(),s=X.useContext(Sb);return S.jsx(DX,{...t,layoutGroup:s,switchLayoutGroup:X.useContext(gQ),isPresent:e,safeToRemove:i})}const zX={pan:{Feature:BX},drag:{Feature:$X,ProjectionNode:aQ,MeasureLayout:bQ}};function N5(t,e,i){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,n=s[r];n&&pt.postRender(()=>n(e,vf(e)))}class NX extends Fo{mount(){const{current:e}=this.node;e&&(this.unmount=h7(e,(i,s)=>(N5(this.node,s,"Start"),r=>N5(this.node,r,"End"))))}unmount(){}}class jX extends Fo{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=mf(Du(this.node.current,"focus",()=>this.onFocus()),Du(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function j5(t,e,i){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),n=s[r];n&&pt.postRender(()=>n(e,vf(e)))}class XX extends Fo{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:i,propagate:s}=this.node.props;this.unmount=m7(e,(r,n)=>(j5(this.node,n,"Start"),(o,{success:l})=>j5(this.node,o,l?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const k1=new WeakMap,mv=new WeakMap,VX=t=>{const e=k1.get(t.target);e&&e(t)},ZX=t=>{t.forEach(VX)};function IX({root:t,...e}){const i=t||document;mv.has(i)||mv.set(i,{});const s=mv.get(i),r=JSON.stringify(e);return s[r]||(s[r]=new IntersectionObserver(ZX,{root:t,...e})),s[r]}function qX(t,e,i){const s=IX(e);return k1.set(t,i),s.observe(t),()=>{k1.delete(t),s.unobserve(t)}}const WX={some:0,all:1};class UX extends Fo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:i,margin:s,amount:r="some",once:n}=e,o={root:i?i.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:WX[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:m}=this.node.getProps(),g=u?d:m;g&&g(c)};return qX(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(YX(e,i))&&this.startObserver()}unmount(){}}function YX({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}const HX={inView:{Feature:UX},tap:{Feature:XX},focus:{Feature:jX},hover:{Feature:NX}},FX={layout:{ProjectionNode:aQ,MeasureLayout:bQ}},GX={...yX,...HX,...zX,...FX},_f=mX(GX,gX);function KX({roadmap:t,state:e,todos:i}){var m;const{connected:s}=pf(),r=(t==null?void 0:t.progress_percent)??0,n=(t==null?void 0:t.current_phase)??(e==null?void 0:e.currentPhase)??"--",o=((m=t==null?void 0:t.phases.find(g=>g.number===t.current_phase))==null?void 0:m.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 ${s?"bg-success":"bg-danger"}`,title:s?"Connected":"Disconnected"})]})]}),S.jsx("div",{className:"h-1 w-full bg-muted mb-5",children:S.jsx(_f.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:n}),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 JX(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function eV(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function tV({phaseName:t,phaseNumber:e,completedPlans:i,totalPlans:s,status:r,roadmapComplete:n,isCurrent:o,onClick:l,onToggleComplete:c}){const u=s>0?Math.round(i/s*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:n,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:n?"Mark incomplete":"Mark complete"}):S.jsx("span",{className:`inline-block h-1.5 w-1.5 shrink-0 ${eV(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,"/",s]})]}),S.jsx("div",{className:"h-px w-full bg-muted/50",children:S.jsx(_f.div,{className:`h-full ${JX(r)}`,initial:{width:0},animate:{width:`${u}%`},transition:{duration:.5,ease:"easeOut"}})})]})}function iV({phases:t,currentPhase:e,onPhaseClick:i,onToggleComplete:s}){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(tV,{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:s},r.number))})]})}function SQ(t){var e,i,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=SQ(t[e]))&&(s&&(s+=" "),s+=i)}else for(i in t)t[i]&&(s&&(s+=" "),s+=i);return s}function sV(){for(var t,e,i=0,s="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=SQ(t))&&(s&&(s+=" "),s+=e);return s}const rV=(t,e)=>{const i=new Array(t.length+e.length);for(let s=0;s<t.length;s++)i[s]=t[s];for(let s=0;s<e.length;s++)i[t.length+s]=e[s];return i},nV=(t,e)=>({classGroupId:t,validator:e}),xQ=(t=new Map,e=null,i)=>({nextPart:t,validators:e,classGroupId:i}),xm="-",X5=[],oV="arbitrary..",aV=t=>{const e=hV(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return lV(o);const l=o.split(xm),c=l[0]===""&&l.length>1?1:0;return wQ(l,c,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=s[o],u=i[o];return c?u?rV(u,c):c:u||X5}return i[o]||X5}}},wQ=(t,e,i)=>{if(t.length-e===0)return i.classGroupId;const r=t[e],n=i.nextPart.get(r);if(n){const u=wQ(t,e+1,n);if(u)return u}const o=i.validators;if(o===null)return;const l=e===0?t.join(xm):t.slice(e).join(xm),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(l))return d.classGroupId}},lV=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),i=e.indexOf(":"),s=e.slice(0,i);return s?oV+s:void 0})(),hV=t=>{const{theme:e,classGroups:i}=t;return cV(i,e)},cV=(t,e)=>{const i=xQ();for(const s in t){const r=t[s];Jb(r,i,s,e)}return i},Jb=(t,e,i,s)=>{const r=t.length;for(let n=0;n<r;n++){const o=t[n];uV(o,e,i,s)}},uV=(t,e,i,s)=>{if(typeof t=="string"){fV(t,e,i);return}if(typeof t=="function"){dV(t,e,i,s);return}pV(t,e,i,s)},fV=(t,e,i)=>{const s=t===""?e:CQ(e,t);s.classGroupId=i},dV=(t,e,i,s)=>{if(mV(t)){Jb(t(s),e,i,s);return}e.validators===null&&(e.validators=[]),e.validators.push(nV(i,t))},pV=(t,e,i,s)=>{const r=Object.entries(t),n=r.length;for(let o=0;o<n;o++){const[l,c]=r[o];Jb(c,CQ(e,l),i,s)}},CQ=(t,e)=>{let i=t;const s=e.split(xm),r=s.length;for(let n=0;n<r;n++){const o=s[n];let l=i.nextPart.get(o);l||(l=xQ(),i.nextPart.set(o,l)),i=l}return i},mV=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,gV=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,i=Object.create(null),s=Object.create(null);const r=(n,o)=>{i[n]=o,e++,e>t&&(e=0,s=i,i=Object.create(null))};return{get(n){let o=i[n];if(o!==void 0)return o;if((o=s[n])!==void 0)return r(n,o),o},set(n,o){n in i?i[n]=o:r(n,o)}}},T1="!",V5=":",OV=[],Z5=(t,e,i,s,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:i,maybePostfixModifierPosition:s,isExternal:r}),vV=t=>{const{prefix:e,experimentalParseClassName:i}=t;let s=r=>{const n=[];let o=0,l=0,c=0,u;const d=r.length;for(let b=0;b<d;b++){const w=r[b];if(o===0&&l===0){if(w===V5){n.push(r.slice(c,b)),c=b+1;continue}if(w==="/"){u=b;continue}}w==="["?o++:w==="]"?o--:w==="("?l++:w===")"&&l--}const m=n.length===0?r:r.slice(c);let g=m,v=!1;m.endsWith(T1)?(g=m.slice(0,-1),v=!0):m.startsWith(T1)&&(g=m.slice(1),v=!0);const y=u&&u>c?u-c:void 0;return Z5(n,v,g,y)};if(e){const r=e+V5,n=s;s=o=>o.startsWith(r)?n(o.slice(r.length)):Z5(OV,!1,o,void 0,!0)}if(i){const r=s;s=n=>i({className:n,parseClassName:r})}return s},_V=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((i,s)=>{e.set(i,1e6+s)}),i=>{const s=[];let r=[];for(let n=0;n<i.length;n++){const o=i[n],l=o[0]==="[",c=e.has(o);l||c?(r.length>0&&(r.sort(),s.push(...r),r=[]),s.push(o)):r.push(o)}return r.length>0&&(r.sort(),s.push(...r)),s}},yV=t=>({cache:gV(t.cacheSize),parseClassName:vV(t),sortModifiers:_V(t),...aV(t)}),bV=/\s+/,SV=(t,e)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:r,sortModifiers:n}=e,o=[],l=t.trim().split(bV);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:m,modifiers:g,hasImportantModifier:v,baseClassName:y,maybePostfixModifierPosition:b}=i(d);if(m){c=d+(c.length>0?" "+c:c);continue}let w=!!b,C=s(w?y.substring(0,b):y);if(!C){if(!w){c=d+(c.length>0?" "+c:c);continue}if(C=s(y),!C){c=d+(c.length>0?" "+c:c);continue}w=!1}const T=g.length===0?"":g.length===1?g[0]:n(g).join(":"),M=v?T+T1:T,k=M+C;if(o.indexOf(k)>-1)continue;o.push(k);const P=r(C,w);for(let E=0;E<P.length;++E){const z=P[E];o.push(M+z)}c=d+(c.length>0?" "+c:c)}return c},xV=(...t)=>{let e=0,i,s,r="";for(;e<t.length;)(i=t[e++])&&(s=kQ(i))&&(r&&(r+=" "),r+=s);return r},kQ=t=>{if(typeof t=="string")return t;let e,i="";for(let s=0;s<t.length;s++)t[s]&&(e=kQ(t[s]))&&(i&&(i+=" "),i+=e);return i},wV=(t,...e)=>{let i,s,r,n;const o=c=>{const u=e.reduce((d,m)=>m(d),t());return i=yV(u),s=i.cache.get,r=i.cache.set,n=l,l(c)},l=c=>{const u=s(c);if(u)return u;const d=SV(c,i);return r(c,d),d};return n=o,(...c)=>n(xV(...c))},CV=[],Jt=t=>{const e=i=>i[t]||CV;return e.isThemeGetter=!0,e},TQ=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,MQ=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kV=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MV=/\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$/,AV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bo=t=>kV.test(t),Ne=t=>!!t&&!Number.isNaN(Number(t)),So=t=>!!t&&Number.isInteger(Number(t)),gv=t=>t.endsWith("%")&&Ne(t.slice(0,-1)),Tn=t=>TV.test(t),AQ=()=>!0,RV=t=>MV.test(t)&&!AV.test(t),eS=()=>!1,QV=t=>EV.test(t),LV=t=>PV.test(t),$V=t=>!Se(t)&&!we(t),BV=t=>Go(t,RQ,eS),Se=t=>TQ.test(t),va=t=>Go(t,QQ,RV),I5=t=>Go(t,IV,Ne),DV=t=>Go(t,$Q,AQ),zV=t=>Go(t,LQ,eS),q5=t=>Go(t,EQ,eS),NV=t=>Go(t,PQ,LV),sp=t=>Go(t,BQ,QV),we=t=>MQ.test(t),Xc=t=>Ga(t,QQ),jV=t=>Ga(t,LQ),W5=t=>Ga(t,EQ),XV=t=>Ga(t,RQ),VV=t=>Ga(t,PQ),rp=t=>Ga(t,BQ,!0),ZV=t=>Ga(t,$Q,!0),Go=(t,e,i)=>{const s=TQ.exec(t);return s?s[1]?e(s[1]):i(s[2]):!1},Ga=(t,e,i=!1)=>{const s=MQ.exec(t);return s?s[1]?e(s[1]):i:!1},EQ=t=>t==="position"||t==="percentage",PQ=t=>t==="image"||t==="url",RQ=t=>t==="length"||t==="size"||t==="bg-size",QQ=t=>t==="length",IV=t=>t==="number",LQ=t=>t==="family-name",$Q=t=>t==="number"||t==="weight",BQ=t=>t==="shadow",qV=()=>{const t=Jt("color"),e=Jt("font"),i=Jt("text"),s=Jt("font-weight"),r=Jt("tracking"),n=Jt("leading"),o=Jt("breakpoint"),l=Jt("container"),c=Jt("spacing"),u=Jt("radius"),d=Jt("shadow"),m=Jt("inset-shadow"),g=Jt("text-shadow"),v=Jt("drop-shadow"),y=Jt("blur"),b=Jt("perspective"),w=Jt("aspect"),C=Jt("ease"),T=Jt("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...k(),we,Se],E=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],$=()=>[we,Se,c],Z=()=>[bo,"full","auto",...$()],ie=()=>[So,"none","subgrid",we,Se],F=()=>["auto",{span:["full",So,we,Se]},So,we,Se],R=()=>[So,"auto",we,Se],Q=()=>["auto","min","max","fr",we,Se],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],I=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...$()],j=()=>[bo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],U=()=>[bo,"screen","full","dvw","lvw","svw","min","max","fit",...$()],Y=()=>[bo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...$()],W=()=>[t,we,Se],N=()=>[...k(),W5,q5,{position:[we,Se]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],se=()=>["auto","cover","contain",XV,BV,{size:[we,Se]}],ce=()=>[gv,Xc,va],he=()=>["","none","full",u,we,Se],de=()=>["",Ne,Xc,va],ge=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Ne,gv,W5,q5],mt=()=>["","none",y,we,Se],Ft=()=>["none",Ne,we,Se],Gt=()=>["none",Ne,we,Se],oi=()=>[Ne,we,Se],Pe=()=>[bo,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Tn],breakpoint:[Tn],color:[AQ],container:[Tn],"drop-shadow":[Tn],ease:["in","out","in-out"],font:[$V],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Tn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Tn],shadow:[Tn],spacing:["px",Ne],text:[Tn],"text-shadow":[Tn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bo,Se,we,w]}],container:["container"],columns:[{columns:[Ne,Se,we,l]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:P()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],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:[So,"auto",we,Se]}],basis:[{basis:[bo,"full","auto",l,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,bo,"auto","initial","none",Se]}],grow:[{grow:["",Ne,we,Se]}],shrink:[{shrink:["",Ne,we,Se]}],order:[{order:[So,"first","last","none",we,Se]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:F()}],"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":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...I(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...I(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pbs:[{pbs:$()}],pbe:[{pbe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[l,"screen",...j()]}],"min-w":[{"min-w":[l,"screen","none",...j()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",i,Xc,va]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,ZV,DV]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gv,Se]}],"font-family":[{font:[jV,zV,e]}],"font-features":[{"font-features":[Se]}],"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,we,Se]}],"line-clamp":[{"line-clamp":[Ne,"none",we,I5]}],leading:[{leading:[n,...$()]}],"list-image":[{"list-image":["none",we,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",we,va]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Ne,"auto",we,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,Se]}],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",we,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},So,we,Se],radial:["",we,Se],conic:[So,we,Se]},VV,NV]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],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:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,we,Se]}],"outline-w":[{outline:["",Ne,Xc,va]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",d,rp,sp]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",m,rp,sp]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Ne,va]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",g,rp,sp]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Ne,we,Se]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"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":[Ne]}],"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":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"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":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"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":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"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":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"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":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"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":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"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":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[we,Se]}],"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":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"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":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,Se]}],filter:[{filter:["","none",we,Se]}],blur:[{blur:mt()}],brightness:[{brightness:[Ne,we,Se]}],contrast:[{contrast:[Ne,we,Se]}],"drop-shadow":[{"drop-shadow":["","none",v,rp,sp]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Ne,we,Se]}],"hue-rotate":[{"hue-rotate":[Ne,we,Se]}],invert:[{invert:["",Ne,we,Se]}],saturate:[{saturate:[Ne,we,Se]}],sepia:[{sepia:["",Ne,we,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",we,Se]}],"backdrop-blur":[{"backdrop-blur":mt()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,we,Se]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,we,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,we,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,we,Se]}],"backdrop-invert":[{"backdrop-invert":["",Ne,we,Se]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,we,Se]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,we,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,we,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",we,Se]}],ease:[{ease:["linear","initial",C,we,Se]}],delay:[{delay:[Ne,we,Se]}],animate:[{animate:["none",T,we,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,we,Se]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ft()}],"rotate-x":[{"rotate-x":Ft()}],"rotate-y":[{"rotate-y":Ft()}],"rotate-z":[{"rotate-z":Ft()}],scale:[{scale:Gt()}],"scale-x":[{"scale-x":Gt()}],"scale-y":[{"scale-y":Gt()}],"scale-z":[{"scale-z":Gt()}],"scale-3d":["scale-3d"],skew:[{skew:oi()}],"skew-x":[{"skew-x":oi()}],"skew-y":[{"skew-y":oi()}],transform:[{transform:[we,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"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",we,Se]}],"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":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mbs":[{"scroll-mbs":$()}],"scroll-mbe":[{"scroll-mbe":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pbs":[{"scroll-pbs":$()}],"scroll-pbe":[{"scroll-pbe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",we,Se]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Ne,Xc,va,I5]}],stroke:[{stroke:["none",...W()]}],"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"]}},WV=wV(qV);function He(...t){return WV(sV(t))}function UV(t){const[e,i]=X.useState(null),[s,r]=X.useState(!1),[n,o]=X.useState(null),{lastChange:l}=pf(),c=X.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 m=await u.json().catch(()=>({}));throw new Error(m.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 X.useEffect(()=>{c()},[c]),X.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:s,error:n,refetch:c}}function YV({tasks:t,planPath:e,planContent:i,onContentChange:s}){const r=X.useCallback(async n=>{const o=t[n];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 m=l.slice(d.index),g=m.match(/<done>([\s\S]*?)<\/done>/);if(g){const v=g[1],y=d.index+m.indexOf(g[0]),b=y+g[0].length,w=/^\s*\[x\]/i.test(v);let C;w?C=v.replace(/^\s*\[x\]\s*/i,""):C=`[x] ${v.trim()}`,l=l.slice(0,y)+`<done>${C}</done>`+l.slice(b)}}if(l!==i){s(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(m){console.error("[task-list] Failed to write checkbox change:",m)}}},[t,e,i,s]);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((n,o)=>S.jsxs("div",{className:He("flex items-start gap-2 py-1 px-2 rounded-md transition-colors","hover:bg-muted/50",n.completed&&"opacity-60"),children:[S.jsx("button",{type:"button",onClick:()=>r(o),className:He("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",n.completed?"bg-success border-success text-background":"border-muted-foreground hover:border-accent"),"aria-label":`Toggle ${n.name}`,children:n.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:He("text-sm font-sans",n.completed&&"line-through text-muted-foreground"),children:n.name}),S.jsx("span",{className:He("text-xs px-1.5 py-0.5 rounded-sm font-mono",n.type.startsWith("checkpoint")?"bg-warning/20 text-warning":"bg-muted text-muted-foreground"),children:n.type})]}),n.files.length>0&&S.jsx("div",{className:"mt-0.5",children:n.files.map((l,c)=>S.jsx("span",{className:"text-xs font-mono text-muted-foreground mr-2",children:l},c))})]})]},o))})}function HV({plan:t,onEdit:e}){const[i,s]=X.useState(t.content),r=t.frontmatter,n=r.plan??"?",o=r.wave,l=r.autonomous,c=r.depends_on??[],u=r.files_modified??[];let d="";const m=t.content.match(/<objective>([\s\S]*?)<\/objective>/);if(m){const y=m[1].trim().split(`
|
|
58
|
-
`)[0];d=y.length>120?y.slice(0,117)+"...":y}const g=X.useCallback(v=>{s(v)},[]);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(n).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:He("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(YV,{tasks:t.tasks,planPath:t.path,planContent:i,onContentChange:g})]})]})}function M1(){return M1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)({}).hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},M1.apply(null,arguments)}function FV(t,e){if(t==null)return{};var i={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.indexOf(s)!==-1)continue;i[s]=t[s]}return i}let A1=[],DQ=[];(()=>{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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,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?DQ:A1).push(i=i+t[e])})();function GV(t){if(t<768)return!1;for(let e=0,i=A1.length;;){let s=e+i>>1;if(t<A1[s])i=s;else if(t>=DQ[s])e=s+1;else return!0;if(e==i)return!1}}function U5(t){return t>=127462&&t<=127487}const Y5=8205;function KV(t,e,i=!0,s=!0){return(i?zQ:JV)(t,e,s)}function zQ(t,e,i){if(e==t.length)return e;e&&NQ(t.charCodeAt(e))&&jQ(t.charCodeAt(e-1))&&e--;let s=Ov(t,e);for(e+=H5(s);e<t.length;){let r=Ov(t,e);if(s==Y5||r==Y5||i&&GV(r))e+=H5(r),s=r;else if(U5(r)){let n=0,o=e-2;for(;o>=0&&U5(Ov(t,o));)n++,o-=2;if(n%2==0)break;e+=2}else break}return e}function JV(t,e,i){for(;e>0;){let s=zQ(t,e-2,i);if(s<e)return s;e--}return 0}function Ov(t,e){let i=t.charCodeAt(e);if(!jQ(i)||e+1==t.length)return i;let s=t.charCodeAt(e+1);return NQ(s)?(i-55296<<10)+(s-56320)+65536:i}function NQ(t){return t>=56320&&t<57344}function jQ(t){return t>=55296&&t<56320}function H5(t){return t<65536?1:2}let Je=class XQ{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,s){[e,i]=vh(this,e,i);let r=[];return this.decompose(0,e,r,2),s.length&&s.decompose(0,s.length,r,3),this.decompose(i,this.length,r,1),Zr.from(r,this.length-(i-e)+s.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=vh(this,e,i);let s=[];return this.decompose(e,i,s,0),Zr.from(s,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),s=this.length-this.scanIdentical(e,-1),r=new xu(this),n=new xu(e);for(let o=i,l=i;;){if(r.next(o),n.next(o),o=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(l+=r.value.length,r.done||l>=s)return!0}}iter(e=1){return new xu(this,e)}iterRange(e,i=this.length){return new VQ(this,e,i)}iterLines(e,i){let s;if(e==null)s=this.iter();else{i==null&&(i=this.lines+1);let r=this.line(e).from;s=this.iterRange(r,Math.max(r,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new ZQ(s)}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]?XQ.empty:e.length<=32?new zt(e):Zr.from(zt.split(e,[]))}};class zt extends Je{constructor(e,i=eZ(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,s,r){for(let n=0;;n++){let o=this.text[n],l=r+o.length;if((i?s:l)>=e)return new tZ(r,l,s,o);r=l+1,s++}}decompose(e,i,s,r){let n=e<=0&&i>=this.length?this:new zt(F5(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(r&1){let o=s.pop(),l=Up(n.text,o.text.slice(),0,n.length);if(l.length<=32)s.push(new zt(l,o.length+n.length));else{let c=l.length>>1;s.push(new zt(l.slice(0,c)),new zt(l.slice(c)))}}else s.push(n)}replace(e,i,s){if(!(s instanceof zt))return super.replace(e,i,s);[e,i]=vh(this,e,i);let r=Up(this.text,Up(s.text,F5(this.text,0,e)),i),n=this.length+s.length-(i-e);return r.length<=32?new zt(r,n):Zr.from(zt.split(r,[]),n)}sliceString(e,i=this.length,s=`
|
|
59
|
-
`){[e,i]=vh(this,e,i);let r="";for(let n=0,o=0;n<=i&&o<this.text.length;o++){let l=this.text[o],c=n+l.length;n>e&&o&&(r+=s),e<c&&i>n&&(r+=l.slice(Math.max(0,e-n),i-n)),n=c+1}return r}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let s=[],r=-1;for(let n of e)s.push(n),r+=n.length+1,s.length==32&&(i.push(new zt(s,r)),s=[],r=-1);return r>-1&&i.push(new zt(s,r)),i}}class Zr extends Je{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let s of e)this.lines+=s.lines}lineInner(e,i,s,r){for(let n=0;;n++){let o=this.children[n],l=r+o.length,c=s+o.lines-1;if((i?c:l)>=e)return o.lineInner(e,i,s,r);r=l+1,s=c+1}}decompose(e,i,s,r){for(let n=0,o=0;o<=i&&n<this.children.length;n++){let l=this.children[n],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?s.push(l):l.decompose(e-o,i-o,s,u)}o=c+1}}replace(e,i,s){if([e,i]=vh(this,e,i),s.lines<this.lines)for(let r=0,n=0;r<this.children.length;r++){let o=this.children[r],l=n+o.length;if(e>=n&&i<=l){let c=o.replace(e-n,i-n,s),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 Zr(d,this.length-(i-e)+s.length)}return super.replace(n,l,c)}n=l+1}return super.replace(e,i,s)}sliceString(e,i=this.length,s=`
|
|
60
|
-
`){[e,i]=vh(this,e,i);let r="";for(let n=0,o=0;n<this.children.length&&o<=i;n++){let l=this.children[n],c=o+l.length;o>e&&n&&(r+=s),e<c&&i>o&&(r+=l.sliceString(e-o,i-o,s)),o=c+1}return r}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof Zr))return 0;let s=0,[r,n,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,n+=i){if(r==o||n==l)return s;let c=this.children[r],u=e.children[n];if(c!=u)return s+c.scanIdentical(u,i);s+=c.length+1}}static from(e,i=e.reduce((s,r)=>s+r.length+1,-1)){let s=0;for(let v of e)s+=v.lines;if(s<32){let v=[];for(let y of e)y.flatten(v);return new zt(v,i)}let r=Math.max(32,s>>5),n=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function m(v){let y;if(v.lines>n&&v instanceof Zr)for(let b of v.children)m(b);else v.lines>o&&(c>o||!c)?(g(),l.push(v)):v instanceof zt&&c&&(y=d[d.length-1])instanceof zt&&v.lines+y.lines<=32?(c+=v.lines,u+=v.length+1,d[d.length-1]=new zt(y.text.concat(v.text),y.length+1+v.length)):(c+v.lines>r&&g(),c+=v.lines,u+=v.length+1,d.push(v))}function g(){c!=0&&(l.push(d.length==1?d[0]:Zr.from(d,u)),u=-1,c=d.length=0)}for(let v of e)m(v);return g(),l.length==1?l[0]:new Zr(l,i)}}Je.empty=new zt([""],0);function eZ(t){let e=-1;for(let i of t)e+=i.length+1;return e}function Up(t,e,i=0,s=1e9){for(let r=0,n=0,o=!0;n<t.length&&r<=s;n++){let l=t[n],c=r+l.length;c>=i&&(c>s&&(l=l.slice(0,s-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 F5(t,e,i){return Up(t,[""],e,i)}class xu{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 zt?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let s=this.nodes.length-1,r=this.nodes[s],n=this.offsets[s],o=n>>1,l=r instanceof zt?r.text.length:r.children.length;if(o==(i>0?l:0)){if(s==0)return this.done=!0,this.value="",this;i>0&&this.offsets[s-1]++,this.nodes.pop(),this.offsets.pop()}else if((n&1)==(i>0?0:1)){if(this.offsets[s]+=i,e==0)return this.lineBreak=!0,this.value=`
|
|
61
|
-
`,this;e--}else if(r instanceof zt){let c=r.text[o+(i<0?-1:0)];if(this.offsets[s]+=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[s]+=i):(i<0&&this.offsets[s]--,this.nodes.push(c),this.offsets.push(i>0?1:(c instanceof zt?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 VQ{constructor(e,i,s){this.value="",this.done=!1,this.cursor=new xu(e,i>s?-1:1),this.pos=i>s?e.length:0,this.from=Math.min(i,s),this.to=Math.max(i,s)}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 s=i<0?this.pos-this.from:this.to-this.pos;e>s&&(e=s),s-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*i,this.value=r.length<=s?r:i<0?r.slice(r.length-s):r.slice(0,s),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 ZQ{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:s,value:r}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):s?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Je.prototype[Symbol.iterator]=function(){return this.iter()},xu.prototype[Symbol.iterator]=VQ.prototype[Symbol.iterator]=ZQ.prototype[Symbol.iterator]=function(){return this});let tZ=class{constructor(e,i,s,r){this.from=e,this.to=i,this.number=s,this.text=r}get length(){return this.to-this.from}};function vh(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function bi(t,e,i=!0,s=!0){return KV(t,e,i,s)}function iZ(t){return t>=56320&&t<57344}function sZ(t){return t>=55296&&t<56320}function ps(t,e){let i=t.charCodeAt(e);if(!sZ(i)||e+1==t.length)return i;let s=t.charCodeAt(e+1);return iZ(s)?(i-55296<<10)+(s-56320)+65536:i}function tS(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ir(t){return t<65536?1:2}const E1=/\r\n?|\n/;var Bi=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Bi||(Bi={}));class Kr{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 s=this.sections[i+1];e+=s<0?this.sections[i]:s}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,s=0,r=0;i<this.sections.length;){let n=this.sections[i++],o=this.sections[i++];o<0?(e(s,r,n),r+=n):r+=o,s+=n}}iterChangedRanges(e,i=!1){P1(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let s=this.sections[i++],r=this.sections[i++];r<0?e.push(s,r):e.push(r,s)}return new Kr(e)}composeDesc(e){return this.empty?e:e.empty?this:IQ(this,e)}mapDesc(e,i=!1){return e.empty?this:R1(this,e,i)}mapPos(e,i=-1,s=Bi.Simple){let r=0,n=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 n+(e-r);n+=l}else{if(s!=Bi.Simple&&u>=e&&(s==Bi.TrackDel&&r<e&&u>e||s==Bi.TrackBefore&&r<e||s==Bi.TrackAfter&&u>e))return null;if(u>e||u==e&&i<0&&!l)return e==r||i<0?n:n+c;n+=c}r=u}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return n}touchesRange(e,i=e){for(let s=0,r=0;s<this.sections.length&&r<=i;){let n=this.sections[s++],o=this.sections[s++],l=r+n;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 s=this.sections[i++],r=this.sections[i++];e+=(e?" ":"")+s+(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 Kr(e)}static create(e){return new Kr(e)}}class si extends Kr{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 P1(this,(i,s,r,n,o)=>e=e.replace(r,r+(s-i),o),!1),e}mapDesc(e,i=!1){return R1(this,e,i,!0)}invert(e){let i=this.sections.slice(),s=[];for(let r=0,n=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(;s.length<c;)s.push(Je.empty);s.push(o?e.slice(n,n+o):Je.empty)}n+=o}return new si(i,s)}compose(e){return this.empty?e:e.empty?this:IQ(this,e,!0)}map(e,i=!1){return e.empty?this:R1(this,e,i,!0)}iterChanges(e,i=!1){P1(this,e,i)}get desc(){return Kr.create(this.sections)}filter(e){let i=[],s=[],r=[],n=new zu(this);e:for(let o=0,l=0;;){let c=o==e.length?1e9:e[o++];for(;l<c||l==c&&n.len==0;){if(n.done)break e;let d=Math.min(n.len,c-l);Xi(r,d,-1);let m=n.ins==-1?-1:n.off==0?n.ins:0;Xi(i,d,m),m>0&&zo(s,i,n.text),n.forward(d),l+=d}let u=e[o++];for(;l<u;){if(n.done)break e;let d=Math.min(n.len,u-l);Xi(i,d,-1),Xi(r,d,n.ins==-1?-1:n.off==0?n.ins:0),n.forward(d),l+=d}}return{changes:new si(i,s),filtered:Kr.create(r)}}toJSON(){let e=[];for(let i=0;i<this.sections.length;i+=2){let s=this.sections[i],r=this.sections[i+1];r<0?e.push(s):r==0?e.push([s]):e.push([s].concat(this.inserted[i>>1].toJSON()))}return e}static of(e,i,s){let r=[],n=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;o<i&&Xi(r,i-o,-1);let m=new si(r,n);l=l?l.compose(m.map(l)):m,r=[],n=[],o=0}function u(d){if(Array.isArray(d))for(let m of d)u(m);else if(d instanceof si){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:m,to:g=m,insert:v}=d;if(m>g||m<0||g>i)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${i})`);let y=v?typeof v=="string"?Je.of(v.split(s||E1)):v:Je.empty,b=y.length;if(m==g&&b==0)return;m<o&&c(),m>o&&Xi(r,m-o,-1),Xi(r,g-m,b),zo(n,r,y),o=g}}return u(e),c(!l),l}static empty(e){return new si(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let i=[],s=[];for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="number")i.push(n,-1);else{if(!Array.isArray(n)||typeof n[0]!="number"||n.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(n.length==1)i.push(n[0],0);else{for(;s.length<r;)s.push(Je.empty);s[r]=Je.of(n.slice(1)),i.push(n[0],s[r].length)}}}return new si(i,s)}static createSet(e,i){return new si(e,i)}}function Xi(t,e,i,s=!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:s?(t[r]+=e,t[r+1]+=i):t.push(e,i)}function zo(t,e,i){if(i.length==0)return;let s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<s;)t.push(Je.empty);t.push(i)}}function P1(t,e,i){let s=t.inserted;for(let r=0,n=0,o=0;o<t.sections.length;){let l=t.sections[o++],c=t.sections[o++];if(c<0)r+=l,n+=l;else{let u=r,d=n,m=Je.empty;for(;u+=l,d+=c,c&&s&&(m=m.append(s[o-2>>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],c=t.sections[o++];e(r,u,n,d,m),r=u,n=d}}}function R1(t,e,i,s=!1){let r=[],n=s?[]:null,o=new zu(t),l=new zu(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);Xi(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(Xi(r,l.ins,-1);u;){let d=Math.min(o.len,u);o.ins>=0&&c<o.i&&o.len<=d&&(Xi(r,0,o.ins),n&&zo(n,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 m=Math.min(d,l.len);u+=m,d-=m,l.forward(m)}else if(l.ins==0&&l.len<d)d-=l.len,l.next();else break;Xi(r,u,c<o.i?o.ins:0),n&&c<o.i&&zo(n,r,o.text),c=o.i,o.forward(o.len-d)}else{if(o.done&&l.done)return n?si.createSet(r,n):Kr.create(r);throw new Error("Mismatched change set lengths")}}}function IQ(t,e,i=!1){let s=[],r=i?[]:null,n=new zu(t),o=new zu(e);for(let l=!1;;){if(n.done&&o.done)return r?si.createSet(s,r):Kr.create(s);if(n.ins==0)Xi(s,n.len,0,l),n.next();else if(o.len==0&&!o.done)Xi(s,0,o.ins,l),r&&zo(r,s,o.text),o.next();else{if(n.done||o.done)throw new Error("Mismatched change set lengths");{let c=Math.min(n.len2,o.len),u=s.length;if(n.ins==-1){let d=o.ins==-1?-1:o.off?0:o.ins;Xi(s,c,d,l),r&&d&&zo(r,s,o.text)}else o.ins==-1?(Xi(s,n.off?0:n.len,c,l),r&&zo(r,s,n.textBit(c))):(Xi(s,n.off?0:n.len,o.off?0:o.ins,l),r&&!o.off&&zo(r,s,o.text));l=(n.ins>c||o.ins>=0&&o.len>c)&&(l||s.length>u),n.forward2(c),o.forward(c)}}}}class zu{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?Je.empty:e[i]}textBit(e){let{inserted:i}=this.set,s=this.i-2>>1;return s>=i.length&&!e?Je.empty:i[s].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 Qa{constructor(e,i,s){this.from=e,this.to=i,this.flags=s}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 s,r;return this.empty?s=r=e.mapPos(this.from,i):(s=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),s==this.from&&r==this.to?this:new Qa(s,r,this.flags)}extend(e,i=e){if(e<=this.anchor&&i>=this.anchor)return ne.range(e,i);let s=Math.abs(e-this.anchor)>Math.abs(i-this.anchor)?e:i;return ne.range(this.anchor,s)}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 ne.range(e.anchor,e.head)}static create(e,i,s){return new Qa(e,i,s)}}class ne{constructor(e,i){this.ranges=e,this.mainIndex=i}map(e,i=-1){return e.empty?this:ne.create(this.ranges.map(s=>s.map(e,i)),this.mainIndex)}eq(e,i=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let s=0;s<this.ranges.length;s++)if(!this.ranges[s].eq(e.ranges[s],i))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ne([this.main],0)}addRange(e,i=!0){return ne.create([e].concat(this.ranges),i?0:this.mainIndex+1)}replaceRange(e,i=this.mainIndex){let s=this.ranges.slice();return s[i]=e,ne.create(s,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 ne(e.ranges.map(i=>Qa.fromJSON(i)),e.main)}static single(e,i=e){return new ne([ne.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 s=0,r=0;r<e.length;r++){let n=e[r];if(n.empty?n.from<=s:n.from<s)return ne.normalized(e.slice(),i);s=n.to}return new ne(e,i)}static cursor(e,i=0,s,r){return Qa.create(e,e,(i==0?0:i<0?8:16)|(s==null?7:Math.min(6,s))|(r??16777215)<<6)}static range(e,i,s,r){let n=(s??16777215)<<6|(r==null?7:Math.min(6,r));return i<e?Qa.create(i,e,48|n):Qa.create(e,i,(i>e?8:0)|n)}static normalized(e,i=0){let s=e[i];e.sort((r,n)=>r.from-n.from),i=e.indexOf(s);for(let r=1;r<e.length;r++){let n=e[r],o=e[r-1];if(n.empty?n.from<=o.to:n.from<o.to){let l=o.from,c=Math.max(n.to,o.to);r<=i&&i--,e.splice(--r,2,n.anchor>n.head?ne.range(c,l):ne.range(l,c))}}return new ne(e,i)}}function qQ(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let iS=0;class ve{constructor(e,i,s,r,n){this.combine=e,this.compareInput=i,this.compare=s,this.isStatic=r,this.id=iS++,this.default=e([]),this.extensions=typeof n=="function"?n(this):n}get reader(){return this}static define(e={}){return new ve(e.combine||(i=>i),e.compareInput||((i,s)=>i===s),e.compare||(e.combine?(i,s)=>i===s:sS),!!e.static,e.enables)}of(e){return new Yp([],this,0,e)}compute(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Yp(e,this,1,i)}computeN(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Yp(e,this,2,i)}from(e,i){return i||(i=s=>s),this.compute([e],s=>i(s.field(e)))}}function sS(t,e){return t==e||t.length==e.length&&t.every((i,s)=>i===e[s])}class Yp{constructor(e,i,s,r){this.dependencies=e,this.facet=i,this.type=s,this.value=r,this.id=iS++}dynamicSlot(e){var i;let s=this.value,r=this.facet.compareInput,n=this.id,o=e[n]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let m of this.dependencies)m=="doc"?c=!0:m=="selection"?u=!0:(((i=e[m.id])!==null&&i!==void 0?i:1)&1)==0&&d.push(e[m.id]);return{create(m){return m.values[o]=s(m),1},update(m,g){if(c&&g.docChanged||u&&(g.docChanged||g.selection)||Q1(m,d)){let v=s(m);if(l?!G5(v,m.values[o],r):!r(v,m.values[o]))return m.values[o]=v,1}return 0},reconfigure:(m,g)=>{let v,y=g.config.address[n];if(y!=null){let b=Cm(g,y);if(this.dependencies.every(w=>w instanceof ve?g.facet(w)===m.facet(w):w instanceof Si?g.field(w,!1)==m.field(w,!1):!0)||(l?G5(v=s(m),b,r):r(v=s(m),b)))return m.values[o]=b,0}else v=s(m);return m.values[o]=v,1}}}}function G5(t,e,i){if(t.length!=e.length)return!1;for(let s=0;s<t.length;s++)if(!i(t[s],e[s]))return!1;return!0}function Q1(t,e){let i=!1;for(let s of e)wu(t,s)&1&&(i=!0);return i}function rZ(t,e,i){let s=i.map(c=>t[c.id]),r=i.map(c=>c.type),n=s.filter(c=>!(c&1)),o=t[e.id]>>1;function l(c){let u=[];for(let d=0;d<s.length;d++){let m=Cm(c,s[d]);if(r[d]==2)for(let g of m)u.push(g);else u.push(m)}return e.combine(u)}return{create(c){for(let u of s)wu(c,u);return c.values[o]=l(c),1},update(c,u){if(!Q1(c,n))return 0;let d=l(c);return e.compare(d,c.values[o])?0:(c.values[o]=d,1)},reconfigure(c,u){let d=Q1(c,s),m=u.config.facets[e.id],g=u.facet(e);if(m&&!d&&sS(i,m))return c.values[o]=g,0;let v=l(c);return e.compare(v,g)?(c.values[o]=g,0):(c.values[o]=v,1)}}}const np=ve.define({static:!0});class Si{constructor(e,i,s,r,n){this.id=e,this.createF=i,this.updateF=s,this.compareF=r,this.spec=n,this.provides=void 0}static define(e){let i=new Si(iS++,e.create,e.update,e.compare||((s,r)=>s===r),e);return e.provide&&(i.provides=e.provide(i)),i}create(e){let i=e.facet(np).find(s=>s.field==this);return((i==null?void 0:i.create)||this.createF)(e)}slot(e){let i=e[this.id]>>1;return{create:s=>(s.values[i]=this.create(s),1),update:(s,r)=>{let n=s.values[i],o=this.updateF(n,r);return this.compareF(n,o)?0:(s.values[i]=o,1)},reconfigure:(s,r)=>{let n=s.facet(np),o=r.facet(np),l;return(l=n.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(s.values[i]=l.create(s),1):r.config.address[this.id]!=null?(s.values[i]=r.field(this),0):(s.values[i]=this.create(s),1)}}}init(e){return[this,np.of({field:this,create:e})]}get extension(){return this}}const Ma={lowest:4,low:3,default:2,high:1,highest:0};function Vc(t){return e=>new WQ(e,t)}const Wn={highest:Vc(Ma.highest),high:Vc(Ma.high),default:Vc(Ma.default),low:Vc(Ma.low),lowest:Vc(Ma.lowest)};class WQ{constructor(e,i){this.inner=e,this.prec=i}}class pg{of(e){return new L1(this,e)}reconfigure(e){return pg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class L1{constructor(e,i){this.compartment=e,this.inner=i}}class wm{constructor(e,i,s,r,n,o){for(this.base=e,this.compartments=i,this.dynamicSlots=s,this.address=r,this.staticValues=n,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<s.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,s){let r=[],n=Object.create(null),o=new Map;for(let g of nZ(e,i,o))g instanceof Si?r.push(g):(n[g.facet.id]||(n[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(v=>g.slot(v));let d=s==null?void 0:s.config.facets;for(let g in n){let v=n[g],y=v[0].facet,b=d&&d[g]||[];if(v.every(w=>w.type==0))if(l[y.id]=c.length<<1|1,sS(b,v))c.push(s.facet(y));else{let w=y.combine(v.map(C=>C.value));c.push(s&&y.compare(w,s.facet(y))?s.facet(y):w)}else{for(let w of v)w.type==0?(l[w.id]=c.length<<1|1,c.push(w.value)):(l[w.id]=u.length<<1,u.push(C=>w.dynamicSlot(C)));l[y.id]=u.length<<1,u.push(w=>rZ(w,y,v))}}let m=u.map(g=>g(l));return new wm(e,o,m,l,c,n)}}function nZ(t,e,i){let s=[[],[],[],[],[]],r=new Map;function n(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=s[c].indexOf(o);u>-1&&s[c].splice(u,1),o instanceof L1&&i.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)n(u,l);else if(o instanceof L1){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),n(u,l)}else if(o instanceof WQ)n(o.inner,o.prec);else if(o instanceof Si)s[l].push(o),o.provides&&n(o.provides,l);else if(o instanceof Yp)s[l].push(o),o.facet.extensions&&n(o.facet.extensions,Ma.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.`);n(u,l)}}return n(t,Ma.default),s.reduce((o,l)=>o.concat(l))}function wu(t,e){if(e&1)return 2;let i=e>>1,s=t.status[i];if(s==4)throw new Error("Cyclic dependency between fields and/or facets");if(s&2)return s;t.status[i]=4;let r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r}function Cm(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const UQ=ve.define(),$1=ve.define({combine:t=>t.some(e=>e),static:!0}),YQ=ve.define({combine:t=>t.length?t[0]:void 0,static:!0}),HQ=ve.define(),FQ=ve.define(),GQ=ve.define(),KQ=ve.define({combine:t=>t.length?t[0]:!1});class nn{constructor(e,i){this.type=e,this.value=i}static define(){return new oZ}}class oZ{of(e){return new nn(this,e)}}class aZ{constructor(e){this.map=e}of(e){return new Qe(this,e)}}class Qe{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 Qe(this.type,i)}is(e){return this.type==e}static define(e={}){return new aZ(e.map||(i=>i))}static mapEffects(e,i){if(!e.length)return e;let s=[];for(let r of e){let n=r.map(i);n&&s.push(n)}return s}}Qe.reconfigure=Qe.define();Qe.appendConfig=Qe.define();class Yt{constructor(e,i,s,r,n,o){this.startState=e,this.changes=i,this.selection=s,this.effects=r,this.annotations=n,this.scrollIntoView=o,this._doc=null,this._state=null,s&&qQ(s,i.newLength),n.some(l=>l.type==Yt.time)||(this.annotations=n.concat(Yt.time.of(Date.now())))}static create(e,i,s,r,n,o){return new Yt(e,i,s,r,n,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(Yt.userEvent);return!!(i&&(i==e||i.length>e.length&&i.slice(0,e.length)==e&&i[e.length]=="."))}}Yt.time=nn.define();Yt.userEvent=nn.define();Yt.addToHistory=nn.define();Yt.remote=nn.define();function lZ(t,e){let i=[];for(let s=0,r=0;;){let n,o;if(s<t.length&&(r==e.length||e[r]>=t[s]))n=t[s++],o=t[s++];else if(r<e.length)n=e[r++],o=e[r++];else return i;!i.length||i[i.length-1]<n?i.push(n,o):i[i.length-1]<o&&(i[i.length-1]=o)}}function JQ(t,e,i){var s;let r,n,o;return i?(r=e.changes,n=si.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),n=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(n):(s=t.selection)===null||s===void 0?void 0:s.map(r),effects:Qe.mapEffects(t.effects,r).concat(Qe.mapEffects(e.effects,n)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function B1(t,e,i){let s=e.selection,r=lh(e.annotations);return e.userEvent&&(r=r.concat(Yt.userEvent.of(e.userEvent))),{changes:e.changes instanceof si?e.changes:si.of(e.changes||[],i,t.facet(YQ)),selection:s&&(s instanceof ne?s:ne.single(s.anchor,s.head)),effects:lh(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function eL(t,e,i){let s=B1(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(i=!1);for(let n=1;n<e.length;n++){e[n].filter===!1&&(i=!1);let o=!!e[n].sequential;s=JQ(s,B1(t,e[n],o?s.changes.newLength:t.doc.length),o)}let r=Yt.create(t,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return cZ(i?hZ(r):r)}function hZ(t){let e=t.startState,i=!0;for(let r of e.facet(HQ)){let n=r(t);if(n===!1){i=!1;break}Array.isArray(n)&&(i=i===!0?n:lZ(i,n))}if(i!==!0){let r,n;if(i===!1)n=t.changes.invertedDesc,r=si.empty(e.doc.length);else{let o=t.changes.filter(i);r=o.changes,n=o.filtered.mapDesc(o.changes).invertedDesc}t=Yt.create(e,r,t.selection&&t.selection.map(n),Qe.mapEffects(t.effects,n),t.annotations,t.scrollIntoView)}let s=e.facet(FQ);for(let r=s.length-1;r>=0;r--){let n=s[r](t);n instanceof Yt?t=n:Array.isArray(n)&&n.length==1&&n[0]instanceof Yt?t=n[0]:t=eL(e,lh(n),!1)}return t}function cZ(t){let e=t.startState,i=e.facet(GQ),s=t;for(let r=i.length-1;r>=0;r--){let n=i[r](t);n&&Object.keys(n).length&&(s=JQ(s,B1(e,n,t.changes.newLength),!0))}return s==t?t:Yt.create(e,t.changes,t.selection,s.effects,s.annotations,s.scrollIntoView)}const uZ=[];function lh(t){return t==null?uZ:Array.isArray(t)?t:[t]}var St=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(St||(St={}));const fZ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let D1;try{D1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function dZ(t){if(D1)return D1.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>""&&(i.toUpperCase()!=i.toLowerCase()||fZ.test(i)))return!0}return!1}function pZ(t){return e=>{if(!/\S/.test(e))return St.Space;if(dZ(e))return St.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return St.Word;return St.Other}}class We{constructor(e,i,s,r,n,o){this.config=e,this.doc=i,this.selection=s,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=n,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)wu(this,l<<1);this.computeSlot=null}field(e,i=!0){let s=this.config.address[e.id];if(s==null){if(i)throw new RangeError("Field is not present in this state");return}return wu(this,s),Cm(this,s)}update(...e){return eL(this,e,!0)}applyTransaction(e){let i=this.config,{base:s,compartments:r}=i;for(let l of e.effects)l.is(pg.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(Qe.reconfigure)?(i=null,s=l.value):l.is(Qe.appendConfig)&&(i=null,s=lh(s).concat(l.value));let n;i?n=e.startState.values.slice():(i=wm.resolve(s,r,this),n=new We(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=e.startState.facet($1)?e.newSelection:e.newSelection.asSingle();new We(i,e.newDoc,o,n,(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:ne.cursor(i.from+e.length)}))}changeByRange(e){let i=this.selection,s=e(i.ranges[0]),r=this.changes(s.changes),n=[s.range],o=lh(s.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++)n[g]=n[g].map(d);let m=r.mapDesc(u,!0);n.push(c.range.map(m)),r=r.compose(d),o=Qe.mapEffects(o,d).concat(Qe.mapEffects(lh(c.effects),m))}return{changes:r,selection:ne.create(n,i.mainIndex),effects:o}}changes(e=[]){return e instanceof si?e:si.of(e,this.doc.length,this.facet(We.lineSeparator))}toText(e){return Je.of(e.split(this.facet(We.lineSeparator)||E1))}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:(wu(this,i),Cm(this,i))}toJSON(e){let i={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let s in e){let r=e[s];r instanceof Si&&this.config.address[r.id]!=null&&(i[s]=r.spec.toJSON(this.field(e[s]),this))}return i}static fromJSON(e,i={},s){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(s){for(let n in s)if(Object.prototype.hasOwnProperty.call(e,n)){let o=s[n],l=e[n];r.push(o.init(c=>o.spec.fromJSON(l,c)))}}return We.create({doc:e.doc,selection:ne.fromJSON(e.selection),extensions:i.extensions?r.concat([i.extensions]):r})}static create(e={}){let i=wm.resolve(e.extensions||[],new Map),s=e.doc instanceof Je?e.doc:Je.of((e.doc||"").split(i.staticFacet(We.lineSeparator)||E1)),r=e.selection?e.selection instanceof ne?e.selection:ne.single(e.selection.anchor,e.selection.head):ne.single(0);return qQ(r,s.length),i.staticFacet($1)||(r=r.asSingle()),new We(i,s,r,i.dynamicSlots.map(()=>null),(n,o)=>o.create(n),null)}get tabSize(){return this.facet(We.tabSize)}get lineBreak(){return this.facet(We.lineSeparator)||`
|
|
62
|
-
`}get readOnly(){return this.facet(KQ)}phrase(e,...i){for(let s of this.facet(We.phrases))if(Object.prototype.hasOwnProperty.call(s,e)){e=s[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(s,r)=>{if(r=="$")return"$";let n=+(r||1);return!n||n>i.length?s:i[n-1]})),e}languageDataAt(e,i,s=-1){let r=[];for(let n of this.facet(UQ))for(let o of n(this,i,s))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let i=this.languageDataAt("wordChars",e);return pZ(i.length?i[0]:"")}wordAt(e){let{text:i,from:s,length:r}=this.doc.lineAt(e),n=this.charCategorizer(e),o=e-s,l=e-s;for(;o>0;){let c=bi(i,o,!1);if(n(i.slice(c,o))!=St.Word)break;o=c}for(;l<r;){let c=bi(i,l);if(n(i.slice(l,c))!=St.Word)break;l=c}return o==l?null:ne.range(o+s,l+s)}}We.allowMultipleSelections=$1;We.tabSize=ve.define({combine:t=>t.length?t[0]:4});We.lineSeparator=YQ;We.readOnly=KQ;We.phrases=ve.define({compare(t,e){let i=Object.keys(t),s=Object.keys(e);return i.length==s.length&&i.every(r=>t[r]==e[r])}});We.languageData=UQ;We.changeFilter=HQ;We.transactionFilter=FQ;We.transactionExtender=GQ;pg.reconfigure=Qe.define();function on(t,e,i={}){let s={};for(let r of t)for(let n of Object.keys(r)){let o=r[n],l=s[n];if(l===void 0)s[n]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(i,n))s[n]=i[n](l,o);else throw new Error("Config merge conflict for field "+n)}for(let r in e)s[r]===void 0&&(s[r]=e[r]);return s}class Zo{eq(e){return this==e}range(e,i=e){return z1.create(e,i,this)}}Zo.prototype.startSide=Zo.prototype.endSide=0;Zo.prototype.point=!1;Zo.prototype.mapMode=Bi.TrackDel;function rS(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let z1=class tL{constructor(e,i,s){this.from=e,this.to=i,this.value=s}static create(e,i,s){return new tL(e,i,s)}};function N1(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class nS{constructor(e,i,s,r){this.from=e,this.to=i,this.value=s,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,i,s,r=0){let n=s?this.to:this.from;for(let o=r,l=n.length;;){if(o==l)return o;let c=o+l>>1,u=n[c]-e||(s?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,s,r){for(let n=this.findIndex(i,-1e9,!0),o=this.findIndex(s,1e9,!1,n);n<o;n++)if(r(this.from[n]+e,this.to[n]+e,this.value[n])===!1)return!1}map(e,i){let s=[],r=[],n=[],o=-1,l=-1;for(let c=0;c<this.value.length;c++){let u=this.value[c],d=this.from[c]+e,m=this.to[c]+e,g,v;if(d==m){let y=i.mapPos(d,u.startSide,u.mapMode);if(y==null||(g=v=y,u.startSide!=u.endSide&&(v=i.mapPos(d,u.endSide),v<g)))continue}else if(g=i.mapPos(d,u.startSide),v=i.mapPos(m,u.endSide),g>v||g==v&&u.startSide>0&&u.endSide<=0)continue;(v-g||u.endSide-u.startSide)<0||(o<0&&(o=g),u.point&&(l=Math.max(l,v-g)),s.push(u),r.push(g-o),n.push(v-o))}return{mapped:s.length?new nS(r,n,s,l):null,pos:o}}}class Ze{constructor(e,i,s,r){this.chunkPos=e,this.chunk=i,this.nextLayer=s,this.maxPoint=r}static create(e,i,s,r){return new Ze(e,i,s,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:s=!1,filterFrom:r=0,filterTo:n=this.length}=e,o=e.filter;if(i.length==0&&!o)return this;if(s&&(i=i.slice().sort(N1)),this.isEmpty)return i.length?Ze.of(i):this;let l=new iL(this,null,-1).goto(0),c=0,u=[],d=new Zn;for(;l.value||c<i.length;)if(c<i.length&&(l.from-i[c].from||l.startSide-i[c].value.startSide)>=0){let m=i[c++];d.addInner(m.from,m.to,m.value)||u.push(m)}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)||n<this.chunkPos[l.chunkIndex])&&d.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||n<l.from||o(l.from,l.to,l.value))&&(d.addInner(l.from,l.to,l.value)||u.push(z1.create(l.from,l.to,l.value))),l.next());return d.finishInner(this.nextLayer.isEmpty&&!u.length?Ze.empty:this.nextLayer.update({add:u,filter:o,filterFrom:r,filterTo:n}))}map(e){if(e.empty||this.isEmpty)return this;let i=[],s=[],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),s.push(e.mapPos(l));else if(u===!0){let{mapped:d,pos:m}=c.map(l,e);d&&(r=Math.max(r,d.maxPoint),i.push(d),s.push(m))}}let n=this.nextLayer.map(e);return i.length==0?n:new Ze(s,i,n||Ze.empty,r)}between(e,i,s){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let n=this.chunkPos[r],o=this.chunk[r];if(i>=n&&e<=n+o.length&&o.between(n,e-n,i-n,s)===!1)return}this.nextLayer.between(e,i,s)}}iter(e=0){return Nu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return Nu.from(e).goto(i)}static compare(e,i,s,r,n=-1){let o=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=n),l=i.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=n),c=K5(o,l,s),u=new Zc(o,c,n),d=new Zc(l,c,n);s.iterGaps((m,g,v)=>J5(u,m,d,g,v,r)),s.empty&&s.length==0&&J5(u,0,d,0,0,r)}static eq(e,i,s=0,r){r==null&&(r=999999999);let n=e.filter(d=>!d.isEmpty&&i.indexOf(d)<0),o=i.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(n.length!=o.length)return!1;if(!n.length)return!0;let l=K5(n,o),c=new Zc(n,l,0).goto(s),u=new Zc(o,l,0).goto(s);for(;;){if(c.to!=u.to||!j1(c.active,u.active)||c.point&&(!u.point||!rS(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(e,i,s,r,n=-1){let o=new Zc(e,null,n).goto(i),l=i,c=o.openStart;for(;;){let u=Math.min(o.to,s);if(o.point){let d=o.activeForPoint(o.to),m=o.pointFrom<i?d.length+1:o.point.startSide<0?d.length:Math.min(d.length,c);r.point(l,u,o.point,d,m,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>s)return c+(o.point&&o.to>s?1:0);l=o.to,o.next()}}static of(e,i=!1){let s=new Zn;for(let r of e instanceof z1?[e]:i?mZ(e):e)s.add(r.from,r.to,r.value);return s.finish()}static join(e){if(!e.length)return Ze.empty;let i=e[e.length-1];for(let s=e.length-2;s>=0;s--)for(let r=e[s];r!=Ze.empty;r=r.nextLayer)i=new Ze(r.chunkPos,r.chunk,i,Math.max(r.maxPoint,i.maxPoint));return i}}Ze.empty=new Ze([],[],null,-1);function mZ(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let s=t[i];if(N1(e,s)>0)return t.slice().sort(N1);e=s}return t}Ze.empty.nextLayer=Ze.empty;class Zn{finishChunk(e){this.chunks.push(new nS(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,s){this.addInner(e,i,s)||(this.nextLayer||(this.nextLayer=new Zn)).add(e,i,s)}addInner(e,i,s){let r=e-this.lastTo||s.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||s.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=s,this.lastFrom=e,this.lastTo=i,this.value.push(s),s.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 s=i.value.length-1;return this.last=i.value[s],this.lastFrom=i.from[s]+e,this.lastTo=i.to[s]+e,!0}finish(){return this.finishInner(Ze.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let i=Ze.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,i}}function K5(t,e,i){let s=new Map;for(let n of t)for(let o=0;o<n.chunk.length;o++)n.chunk[o].maxPoint<=0&&s.set(n.chunk[o],n.chunkPos[o]);let r=new Set;for(let n of e)for(let o=0;o<n.chunk.length;o++){let l=s.get(n.chunk[o]);l!=null&&(i?i.mapPos(l):l)==n.chunkPos[o]&&!(i!=null&&i.touchesRange(l,l+n.chunk[o].length))&&r.add(n.chunk[o])}return r}class iL{constructor(e,i,s,r=0){this.layer=e,this.skip=i,this.minPoint=s,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,s){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++,s=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],i,!0);(!s||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],s=e+i.from[this.rangeIndex];if(this.from=s,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 Nu{constructor(e){this.heap=e}static from(e,i=null,s=-1){let r=[];for(let n=0;n<e.length;n++)for(let o=e[n];!o.isEmpty;o=o.nextLayer)o.maxPoint>=s&&r.push(new iL(o,i,s,n));return r.length==1?r[0]:new Nu(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,i=-1e9){for(let s of this.heap)s.goto(e,i);for(let s=this.heap.length>>1;s>=0;s--)vv(this.heap,s);return this.next(),this}forward(e,i){for(let s of this.heap)s.forward(e,i);for(let s=this.heap.length>>1;s>=0;s--)vv(this.heap,s);(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(),vv(this.heap,0)}}}function vv(t,e){for(let i=t[e];;){let s=(e<<1)+1;if(s>=t.length)break;let r=t[s];if(s+1<t.length&&r.compare(t[s+1])>=0&&(r=t[s+1],s++),i.compare(r)<0)break;t[s]=i,t[e]=r,e=s}}class Zc{constructor(e,i,s){this.minPoint=s,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=Nu.from(e,i,s)}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){op(this.active,e),op(this.activeTo,e),op(this.activeRank,e),this.minActive=eT(this.active,this.activeTo)}addActive(e){let i=0,{value:s,to:r,rank:n}=this.cursor;for(;i<this.activeRank.length&&(n-this.activeRank[i]||r-this.activeTo[i])>0;)i++;ap(this.active,i,s),ap(this.activeTo,i,r),ap(this.activeRank,i,n),e&&ap(e,i,this.cursor.from),this.minActive=eT(this.active,this.activeTo)}next(){let e=this.to,i=this.point;this.point=null;let s=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),s&&op(s,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let n=this.cursor.value;if(!n.point)this.addActive(s),this.cursor.next();else if(i&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=n,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=n.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(s){this.openStart=0;for(let r=s.length-1;r>=0&&s[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let i=[];for(let s=this.active.length-1;s>=0&&!(this.activeRank[s]<this.pointRank);s--)(this.activeTo[s]>e||this.activeTo[s]==e&&this.active[s].endSide>=this.point.endSide)&&i.push(this.active[s]);return i.reverse()}openEnd(e){let i=0;for(let s=this.activeTo.length-1;s>=0&&this.activeTo[s]>e;s--)i++;return i}}function J5(t,e,i,s,r,n){t.goto(e),i.goto(s);let o=s+r,l=s,c=s-e,u=!!n.boundChange;for(let d=!1;;){let m=t.to+c-i.to,g=m||t.endSide-i.endSide,v=g<0?t.to+c:i.to,y=Math.min(v,o);if(t.point||i.point?(t.point&&i.point&&rS(t.point,i.point)&&j1(t.activeForPoint(t.to),i.activeForPoint(i.to))||n.comparePoint(l,y,t.point,i.point),d=!1):(d&&n.boundChange(l),y>l&&!j1(t.active,i.active)&&n.compareRange(l,y,t.active,i.active),u&&y<o&&(m||t.openEnd(v)!=i.openEnd(v))&&(d=!0)),v>o)break;l=v,g<=0&&t.next(),g>=0&&i.next()}}function j1(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!rS(t[i],e[i]))return!1;return!0}function op(t,e){for(let i=e,s=t.length-1;i<s;i++)t[i]=t[i+1];t.pop()}function ap(t,e,i){for(let s=t.length-1;s>=e;s--)t[s+1]=t[s];t[e]=i}function eT(t,e){let i=-1,s=1e9;for(let r=0;r<e.length;r++)(e[r]-s||t[r].endSide-t[i].endSide)<0&&(i=r,s=e[r]);return i}function xr(t,e,i=t.length){let s=0;for(let r=0;r<i&&r<t.length;)t.charCodeAt(r)==9?(s+=e-s%e,r++):(s++,r=bi(t,r));return s}function X1(t,e,i,s){for(let r=0,n=0;;){if(n>=e)return r;if(r==t.length)break;n+=t.charCodeAt(r)==9?i-n%i:1,r=bi(t,r)}return s===!0?-1:t.length}const V1="ͼ",tT=typeof Symbol>"u"?"__"+V1:Symbol.for(V1),Z1=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),iT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Io{constructor(e,i){this.rules=[];let{finish:s}=i||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function n(o,l,c,u){let d=[],m=/^@(\w+)\b/.exec(o[0]),g=m&&m[1]=="keyframes";if(m&&l==null)return c.push(o[0]+";");for(let v in l){let y=l[v];if(/&/.test(v))n(v.split(/,\s*/).map(b=>o.map(w=>b.replace(/&/,w))).reduce((b,w)=>b.concat(w)),y,c);else if(y&&typeof y=="object"){if(!m)throw new RangeError("The value of a property ("+v+") should be a primitive value.");n(r(v),y,d,g)}else y!=null&&d.push(v.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+y+";")}(d.length||g)&&c.push((s&&!m&&!u?o.map(s):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)n(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
63
|
-
`)}static newName(){let e=iT[tT]||1;return iT[tT]=e+1,V1+e.toString(36)}static mount(e,i,s){let r=e[Z1],n=s&&s.nonce;r?n&&r.setNonce(n):r=new gZ(e,n),r.mount(Array.isArray(i)?i:[i],e)}}let sT=new Map;class gZ{constructor(e,i){let s=e.ownerDocument||e,r=s.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let n=sT.get(s);if(n)return e[Z1]=n;this.sheet=new r.CSSStyleSheet,sT.set(s,this)}else this.styleTag=s.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[Z1]=this}mount(e,i){let s=this.sheet,r=0,n=0;for(let o=0;o<e.length;o++){let l=e[o],c=this.modules.indexOf(l);if(c<n&&c>-1&&(this.modules.splice(c,1),n--,c=-1),c==-1){if(this.modules.splice(n++,0,l),s)for(let u=0;u<l.rules.length;u++)s.insertRule(l.rules[u],r++)}else{for(;n<c;)r+=this.modules[n++].rules.length;r+=l.rules.length,n++}}if(s)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 qo={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:"'"},ju={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OZ=typeof navigator<"u"&&/Mac/.test(navigator.platform),vZ=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $i=0;$i<10;$i++)qo[48+$i]=qo[96+$i]=String($i);for(var $i=1;$i<=24;$i++)qo[$i+111]="F"+$i;for(var $i=65;$i<=90;$i++)qo[$i]=String.fromCharCode($i+32),ju[$i]=String.fromCharCode($i);for(var _v in qo)ju.hasOwnProperty(_v)||(ju[_v]=qo[_v]);function _Z(t){var e=OZ&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||vZ&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?ju:qo)[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 lt(){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 s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];typeof r=="string"?t.setAttribute(s,r):r!=null&&(t[s]=r)}e++}for(;e<arguments.length;e++)sL(t,arguments[e]);return t}function sL(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++)sL(t,e[i]);else throw new RangeError("Unsupported child node: "+e)}let Gi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},I1=typeof document<"u"?document:{documentElement:{style:{}}};const q1=/Edge\/(\d+)/.exec(Gi.userAgent),rL=/MSIE \d/.test(Gi.userAgent),W1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gi.userAgent),mg=!!(rL||W1||q1),rT=!mg&&/gecko\/(\d+)/i.test(Gi.userAgent),yv=!mg&&/Chrome\/(\d+)/.exec(Gi.userAgent),yZ="webkitFontSmoothing"in I1.documentElement.style,U1=!mg&&/Apple Computer/.test(Gi.vendor),nT=U1&&(/Mobile\/\w+/.test(Gi.userAgent)||Gi.maxTouchPoints>2);var _e={mac:nT||/Mac/.test(Gi.platform),windows:/Win/.test(Gi.platform),linux:/Linux|X11/.test(Gi.platform),ie:mg,ie_version:rL?I1.documentMode||6:W1?+W1[1]:q1?+q1[1]:0,gecko:rT,gecko_version:rT?+(/Firefox\/(\d+)/.exec(Gi.userAgent)||[0,0])[1]:0,chrome:!!yv,chrome_version:yv?+yv[1]:0,ios:nT,android:/Android\b/.test(Gi.userAgent),webkit_version:yZ?+(/\bAppleWebKit\/(\d+)/.exec(Gi.userAgent)||[0,0])[1]:0,safari:U1,safari_version:U1?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Gi.userAgent)||[0,0])[1]:0,tabSize:I1.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function oS(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 km=Object.create(null);function aS(t,e,i){if(t==e)return!0;t||(t=km),e||(e=km);let s=Object.keys(t),r=Object.keys(e);if(s.length-0!=r.length-0)return!1;for(let n of s)if(n!=i&&(r.indexOf(n)==-1||t[n]!==e[n]))return!1;return!0}function bZ(t,e){for(let i=t.attributes.length-1;i>=0;i--){let s=t.attributes[i].name;e[s]==null&&t.removeAttribute(s)}for(let i in e){let s=e[i];i=="style"?t.style.cssText=s:t.getAttribute(i)!=s&&t.setAttribute(i,s)}}function oT(t,e,i){let s=!1;if(e)for(let r in e)i&&r in i||(s=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(i)for(let r in i)e&&e[r]==i[r]||(s=!0,r=="style"?t.style.cssText=i[r]:t.setAttribute(r,i[r]));return s}function SZ(t){let e=Object.create(null);for(let i=0;i<t.attributes.length;i++){let s=t.attributes[i];e[s.name]=s.value}return e}class kr{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,s){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var zi=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(zi||(zi={}));class Te extends Zo{constructor(e,i,s,r){super(),this.startSide=e,this.endSide=i,this.widget=s,this.spec=r}get heightRelevant(){return!1}static mark(e){return new yf(e)}static widget(e){let i=Math.max(-1e4,Math.min(1e4,e.side||0)),s=!!e.block;return i+=s&&!e.inlineOrder?i>0?3e8:-4e8:i>0?1e8:-1e8,new Ia(e,i,i,s,e.widget||null,!1)}static replace(e){let i=!!e.block,s,r;if(e.isBlockGap)s=-5e8,r=4e8;else{let{start:n,end:o}=nL(e,i);s=(n?i?-3e8:-1:5e8)-1,r=(o?i?2e8:1:-6e8)+1}return new Ia(e,s,r,i,e.widget||null,!0)}static line(e){return new bf(e)}static set(e,i=!1){return Ze.of(e,i)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Te.none=Ze.empty;class yf extends Te{constructor(e){let{start:i,end:s}=nL(e);super(i?-1:5e8,s?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?oS(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||km}eq(e){return this==e||e instanceof yf&&this.tagName==e.tagName&&aS(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)}}yf.prototype.point=!1;class bf extends Te{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof bf&&this.spec.class==e.spec.class&&aS(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)}}bf.prototype.mapMode=Bi.TrackBefore;bf.prototype.point=!0;class Ia extends Te{constructor(e,i,s,r,n,o){super(i,s,n,e),this.block=r,this.isReplace=o,this.mapMode=r?i<=0?Bi.TrackBefore:Bi.TrackAfter:Bi.TrackDel}get type(){return this.startSide!=this.endSide?zi.WidgetRange:this.startSide<=0?zi.WidgetBefore:zi.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Ia&&xZ(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)}}Ia.prototype.point=!0;function nL(t,e=!1){let{inclusiveStart:i,inclusiveEnd:s}=t;return i==null&&(i=t.inclusive),s==null&&(s=t.inclusive),{start:i??e,end:s??e}}function xZ(t,e){return t==e||!!(t&&e&&t.compare(e))}function hh(t,e,i,s=0){let r=i.length-1;r>=0&&i[r]+s>=t?i[r]=Math.max(i[r],e):i.push(t,e)}class Xu extends Zo{constructor(e,i){super(),this.tagName=e,this.attributes=i}eq(e){return e==this||e instanceof Xu&&this.tagName==e.tagName&&aS(this.attributes,e.attributes)}static create(e){return new Xu(e.tagName,e.attributes||km)}static set(e,i=!1){return Ze.of(e,i)}}Xu.prototype.startSide=Xu.prototype.endSide=-1;function Vu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Y1(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Cu(t,e){if(!e.anchorNode)return!1;try{return Y1(t,e.anchorNode)}catch{return!1}}function ku(t){return t.nodeType==3?Iu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Tu(t,e,i,s){return i?aT(t,e,i,s,-1)||aT(t,e,i,s,1):!1}function Wo(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Tm(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function aT(t,e,i,s,r){for(;;){if(t==i&&e==s)return!0;if(e==(r<0?0:In(t))){if(t.nodeName=="DIV")return!1;let n=t.parentNode;if(!n||n.nodeType!=1)return!1;e=Wo(t)+(r<0?0:1),t=n}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?In(t):0}else return!1}}function In(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zu(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function wZ(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 oL(t,e){let i=e.width/t.offsetWidth,s=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-t.offsetHeight)<1)&&(s=1),{scaleX:i,scaleY:s}}function CZ(t,e,i,s,r,n,o,l){let c=t.ownerDocument,u=c.defaultView||window;for(let d=t,m=!1;d&&!m;)if(d.nodeType==1){let g,v=d==c.body,y=1,b=1;if(v)g=wZ(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(m=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let T=d.getBoundingClientRect();({scaleX:y,scaleY:b}=oL(d,T)),g={left:T.left,right:T.left+d.clientWidth*y,top:T.top,bottom:T.top+d.clientHeight*b}}let w=0,C=0;if(r=="nearest")e.top<g.top?(C=e.top-(g.top+o),i>0&&e.bottom>g.bottom+C&&(C=e.bottom-g.bottom+o)):e.bottom>g.bottom&&(C=e.bottom-g.bottom+o,i<0&&e.top-C<g.top&&(C=e.top-(g.top+o)));else{let T=e.bottom-e.top,M=g.bottom-g.top;C=(r=="center"&&T<=M?e.top+T/2-M/2:r=="start"||r=="center"&&i<0?e.top-o:e.bottom-M+o)-g.top}if(s=="nearest"?e.left<g.left?(w=e.left-(g.left+n),i>0&&e.right>g.right+w&&(w=e.right-g.right+n)):e.right>g.right&&(w=e.right-g.right+n,i<0&&e.left<g.left+w&&(w=e.left-(g.left+n))):w=(s=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:s=="start"==l?e.left-n:e.right-(g.right-g.left)+n)-g.left,w||C)if(v)u.scrollBy(w,C);else{let T=0,M=0;if(C){let k=d.scrollTop;d.scrollTop+=C/b,M=(d.scrollTop-k)*b}if(w){let k=d.scrollLeft;d.scrollLeft+=w/y,T=(d.scrollLeft-k)*y}e={left:e.left-T,top:e.top-M,right:e.right-T,bottom:e.bottom-M},T&&Math.abs(T-w)<1&&(s="nearest"),M&&Math.abs(M-C)<1&&(r="nearest")}if(v)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 kZ(t){let e=t.ownerDocument,i,s;for(let r=t.parentNode;r&&!(r==e.body||i&&s);)if(r.nodeType==1)!s&&r.scrollHeight>r.clientHeight&&(s=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:s}}class TZ{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:s}=e;this.set(i,Math.min(e.anchorOffset,i?In(i):0),s,Math.min(e.focusOffset,s?In(s):0))}set(e,i,s,r){this.anchorNode=e,this.anchorOffset=i,this.focusNode=s,this.focusOffset=r}}let Ca=null;_e.safari&&_e.safari_version>=26&&(Ca=!1);function aL(t){if(t.setActive)return t.setActive();if(Ca)return t.focus(Ca);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(Ca==null?{get preventScroll(){return Ca={preventScroll:!0},!0}}:void 0),!Ca){Ca=!1;for(let i=0;i<e.length;){let s=e[i++],r=e[i++],n=e[i++];s.scrollTop!=r&&(s.scrollTop=r),s.scrollLeft!=n&&(s.scrollLeft=n)}}}let lT;function Iu(t,e,i=e){let s=lT||(lT=document.createRange());return s.setEnd(t,i),s.setStart(t,e),s}function ch(t,e,i,s){let r={key:e,code:e,keyCode:i,which:i,cancelable:!0};s&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=s);let n=new KeyboardEvent("keydown",r);n.synthetic=!0,t.dispatchEvent(n);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),n.defaultPrevented||o.defaultPrevented}function MZ(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function AZ(t,e){let i=e.focusNode,s=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=s)return!1;for(s=Math.min(s,In(i));;)if(s){if(i.nodeType!=1)return!1;let r=i.childNodes[s-1];r.contentEditable=="false"?s--:(i=r,s=In(i))}else{if(i==t)return!0;s=Wo(i),i=i.parentNode}}function lL(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function hL(t,e){for(let i=t,s=e;;){if(i.nodeType==3&&s>0)return{node:i,offset:s};if(i.nodeType==1&&s>0){if(i.contentEditable=="false")return null;i=i.childNodes[s-1],s=In(i)}else if(i.parentNode&&!Tm(i))s=Wo(i),i=i.parentNode;else return null}}function cL(t,e){for(let i=t,s=e;;){if(i.nodeType==3&&s<i.nodeValue.length)return{node:i,offset:s};if(i.nodeType==1&&s<i.childNodes.length){if(i.contentEditable=="false")return null;i=i.childNodes[s],s=0}else if(i.parentNode&&!Tm(i))s=Wo(i)+1,i=i.parentNode;else return null}}class yr{constructor(e,i,s=!0){this.node=e,this.offset=i,this.precise=s}static before(e,i){return new yr(e.parentNode,Wo(e),i)}static after(e,i){return new yr(e.parentNode,Wo(e)+1,i)}}var ut=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(ut||(ut={}));const qa=ut.LTR,lS=ut.RTL;function uL(t){let e=[];for(let i=0;i<t.length;i++)e.push(1<<+t[i]);return e}const EZ=uL("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),PZ=uL("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),H1=Object.create(null),Qr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),i=t.charCodeAt(1);H1[e]=i,H1[i]=-e}function fL(t){return t<=247?EZ[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?PZ[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const RZ=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Wr{get dir(){return this.level%2?lS:qa}constructor(e,i,s){this.from=e,this.to=i,this.level=s}side(e,i){return this.dir==i==e?this.to:this.from}forward(e,i){return e==(this.dir==i)}static find(e,i,s,r){let n=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=i&&l.to>=i){if(l.level==s)return o;(n<0||(r!=0?r<0?l.from<i:l.to>i:e[n].level>l.level))&&(n=o)}}if(n<0)throw new RangeError("Index out of range");return n}}function dL(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let s=t[i],r=e[i];if(s.from!=r.from||s.to!=r.to||s.direction!=r.direction||!dL(s.inner,r.inner))return!1}return!0}const ct=[];function QZ(t,e,i,s,r){for(let n=0;n<=s.length;n++){let o=n?s[n-1].to:e,l=n<s.length?s[n].from:i,c=n?256:r;for(let u=o,d=c,m=c;u<l;u++){let g=fL(t.charCodeAt(u));g==512?g=d:g==8&&m==4&&(g=16),ct[u]=g==4?2:g,g&7&&(m=g),d=g}for(let u=o,d=c,m=c;u<l;u++){let g=ct[u];if(g==128)u<l-1&&d==ct[u+1]&&d&24?g=ct[u]=d:ct[u]=256;else if(g==64){let v=u+1;for(;v<l&&ct[v]==64;)v++;let y=u&&d==8||v<i&&ct[v]==8?m==1?1:8:256;for(let b=u;b<v;b++)ct[b]=y;u=v-1}else g==8&&m==1&&(ct[u]=1);d=g,g&7&&(m=g)}}}function LZ(t,e,i,s,r){let n=r==1?2:1;for(let o=0,l=0,c=0;o<=s.length;o++){let u=o?s[o-1].to:e,d=o<s.length?s[o].from:i;for(let m=u,g,v,y;m<d;m++)if(v=H1[g=t.charCodeAt(m)])if(v<0){for(let b=l-3;b>=0;b-=3)if(Qr[b+1]==-v){let w=Qr[b+2],C=w&2?r:w&4?w&1?n:r:0;C&&(ct[m]=ct[Qr[b]]=C),l=b;break}}else{if(Qr.length==189)break;Qr[l++]=m,Qr[l++]=g,Qr[l++]=c}else if((y=ct[m])==2||y==1){let b=y==r;c=b?0:1;for(let w=l-3;w>=0;w-=3){let C=Qr[w+2];if(C&2)break;if(b)Qr[w+2]|=2;else{if(C&4)break;Qr[w+2]|=4}}}}}function $Z(t,e,i,s){for(let r=0,n=s;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=ct[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(ct[d]==256)d++;else break;let m=n==1,g=(d<e?ct[d]:s)==1,v=m==g?m?1:2:s;for(let y=d,b=r,w=b?i[b-1].to:t;y>c;)y==w&&(y=i[--b].from,w=b?i[b-1].to:t),ct[--y]=v;c=d}else n=u,c++}}}function F1(t,e,i,s,r,n,o){let l=s%2?2:1;if(s%2==r%2)for(let c=e,u=0;c<i;){let d=!0,m=!1;if(u==n.length||c<n[u].from){let b=ct[c];b!=l&&(d=!1,m=b==16)}let g=!d&&l==1?[]:null,v=d?s:s+1,y=c;e:for(;;)if(u<n.length&&y==n[u].from){if(m)break e;let b=n[u];if(!d)for(let w=b.to,C=u+1;;){if(w==i)break e;if(C<n.length&&n[C].from==w)w=n[C++].to;else{if(ct[w]==l)break e;break}}if(u++,g)g.push(b);else{b.from>c&&o.push(new Wr(c,b.from,v));let w=b.direction==qa!=!(v%2);G1(t,w?s+1:s,r,b.inner,b.from,b.to,o),c=b.to}y=b.to}else{if(y==i||(d?ct[y]!=l:ct[y]==l))break;y++}g?F1(t,c,y,s+1,r,g,o):c<y&&o.push(new Wr(c,y,v)),c=y}else for(let c=i,u=n.length;c>e;){let d=!0,m=!1;if(!u||c>n[u-1].to){let b=ct[c-1];b!=l&&(d=!1,m=b==16)}let g=!d&&l==1?[]:null,v=d?s:s+1,y=c;e:for(;;)if(u&&y==n[u-1].to){if(m)break e;let b=n[--u];if(!d)for(let w=b.from,C=u;;){if(w==e)break e;if(C&&n[C-1].to==w)w=n[--C].from;else{if(ct[w-1]==l)break e;break}}if(g)g.push(b);else{b.to<c&&o.push(new Wr(b.to,c,v));let w=b.direction==qa!=!(v%2);G1(t,w?s+1:s,r,b.inner,b.from,b.to,o),c=b.from}y=b.from}else{if(y==e||(d?ct[y-1]!=l:ct[y-1]==l))break;y--}g?F1(t,y,c,s+1,r,g,o):y<c&&o.push(new Wr(y,c,v)),c=y}}function G1(t,e,i,s,r,n,o){let l=e%2?2:1;QZ(t,r,n,s,l),LZ(t,r,n,s,l),$Z(r,n,s,l),F1(t,r,n,e,i,s,o)}function BZ(t,e,i){if(!t)return[new Wr(0,0,e==lS?1:0)];if(e==qa&&!i.length&&!RZ.test(t))return pL(t.length);if(i.length)for(;t.length>ct.length;)ct[ct.length]=256;let s=[],r=e==qa?0:1;return G1(t,r,r,i,0,t.length,s),s}function pL(t){return[new Wr(0,t,0)]}let mL="";function DZ(t,e,i,s,r){var n;let o=s.head-t.from,l=Wr.find(e,o,(n=s.bidiLevel)!==null&&n!==void 0?n:-1,s.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=bi(t.text,o,c.forward(r,i));(d<c.from||d>c.to)&&(d=u),mL=t.text.slice(Math.min(o,d),Math.max(o,d));let m=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return m&&d==u&&m.level+(r?0:1)<c.level?ne.cursor(m.side(!r,i)+t.from,m.forward(r,i)?1:-1,m.level):ne.cursor(d+t.from,c.forward(r,i)?-1:1,c.level)}function zZ(t,e,i){for(let s=e;s<i;s++){let r=fL(t.charCodeAt(s));if(r==1)return qa;if(r==2||r==4)return lS}return qa}const gL=ve.define(),OL=ve.define(),vL=ve.define(),_L=ve.define(),K1=ve.define(),yL=ve.define(),bL=ve.define(),hS=ve.define(),cS=ve.define(),SL=ve.define({combine:t=>t.some(e=>e)}),xL=ve.define({combine:t=>t.some(e=>e)}),wL=ve.define();class uh{constructor(e,i="nearest",s="nearest",r=5,n=5,o=!1){this.range=e,this.y=i,this.x=s,this.yMargin=r,this.xMargin=n,this.isSnapshot=o}map(e){return e.empty?this:new uh(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 uh(ne.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const lp=Qe.define({map:(t,e)=>t.map(e)}),CL=Qe.define();function Os(t,e,i){let s=t.facet(_L);s.length?s[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const Dn=ve.define({combine:t=>t.length?t[0]:!0});let NZ=0;const th=ve.define({combine(t){return t.filter((e,i)=>{for(let s=0;s<i;s++)if(t[s].plugin==e.plugin)return!1;return!0})}});class Nt{constructor(e,i,s,r,n){this.id=e,this.create=i,this.domEventHandlers=s,this.domEventObservers=r,this.baseExtensions=n(this),this.extension=this.baseExtensions.concat(th.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(th.of({plugin:this,arg:e}))}static define(e,i){const{eventHandlers:s,eventObservers:r,provide:n,decorations:o}=i||{};return new Nt(NZ++,e,s,r,l=>{let c=[];return o&&c.push(gg.of(u=>{let d=u.plugin(l);return d?o(d):Te.none})),n&&c.push(n(l)),c})}static fromClass(e,i){return Nt.define((s,r)=>new e(s,r),i)}}class bv{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(s){if(Os(i.state,s,"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){Os(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(s){Os(e.state,s,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const kL=ve.define(),uS=ve.define(),gg=ve.define(),TL=ve.define(),fS=ve.define(),Sf=ve.define(),ML=ve.define();function hT(t,e){let i=t.state.facet(ML);if(!i.length)return i;let s=i.map(n=>n instanceof Function?n(t):n),r=[];return Ze.spans(s,e.from,e.to,{point(){},span(n,o,l,c){let u=n-e.from,d=o-e.from,m=r;for(let g=l.length-1;g>=0;g--,c--){let v=l[g].spec.bidiIsolate,y;if(v==null&&(v=zZ(e.text,u,d)),c>0&&m.length&&(y=m[m.length-1]).to==u&&y.direction==v)y.to=d,m=y.inner;else{let b={from:u,to:d,direction:v,inner:[]};m.push(b),m=b.inner}}}}),r}const AL=ve.define();function dS(t){let e=0,i=0,s=0,r=0;for(let n of t.state.facet(AL)){let o=n(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(i=Math.max(i,o.right)),o.top!=null&&(s=Math.max(s,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:i,top:s,bottom:r}}const lu=ve.define();class ir{constructor(e,i,s,r){this.fromA=e,this.toA=i,this.fromB=s,this.toB=r}join(e){return new ir(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,s=this;for(;i>0;i--){let r=e[i-1];if(!(r.fromA>s.toA)){if(r.toA<s.fromA)break;s=s.join(r),e.splice(i-1,1)}}return e.splice(i,0,s),e}static extendWithRanges(e,i){if(i.length==0)return e;let s=[];for(let r=0,n=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,c=n<i.length?i[n]:1e9,u=Math.min(l,c);if(u==1e9)break;let d=u+o,m=u,g=d;for(;;)if(n<i.length&&i[n]<=m){let v=i[n+1];n+=2,m=Math.max(m,v);for(let y=r;y<e.length&&e[y].fromB<=m;y++)o=e[y].toA-e[y].toB;g=Math.max(g,v+o)}else if(r<e.length&&e[r].fromB<=m){let v=e[r++];m=Math.max(m,v.toB),g=Math.max(g,v.toA),o=v.toA-v.toB}else break;s.push(new ir(d,g,u,m))}return s}}class Mm{constructor(e,i,s){this.view=e,this.state=i,this.transactions=s,this.flags=0,this.startState=e.state,this.changes=si.empty(this.startState.doc.length);for(let n of s)this.changes=this.changes.compose(n.changes);let r=[];this.changes.iterChangedRanges((n,o,l,c)=>r.push(new ir(n,o,l,c))),this.changedRanges=r}static create(e,i,s){return new Mm(e,i,s)}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 jZ=[];class Ht{constructor(e,i,s=0){this.dom=e,this.length=i,this.flags=s,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return jZ}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&&bZ(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 s=i;for(let r of this.children){if(r==e)return s;s+=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 s=Wo(this.dom),r=this.length?e>0:i>0;return new yr(this.parent.dom,s+(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 vg)return e;return null}static get(e){return e.cmTile}}class Og extends Ht{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,s=null,r,n=(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=s?s.nextSibling:i.firstChild,n&&r!=l.dom&&(n.written=!0),l.dom.parentNode==i)for(;r&&r!=l.dom;)r=cT(r);else i.insertBefore(l.dom,r);s=l.dom}for(r=s?s.nextSibling:i.firstChild,n&&r&&(n.written=!0);r;)r=cT(r);this.length=o}}function cT(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class vg extends Og{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=Ht.get(e);if(i&&this.owns(i))return i;e=e.parentNode}}blockTiles(e){for(let i=[],s=this,r=0,n=0;;)if(r==s.children.length){if(!i.length)return;s=s.parent,s.breakAfter&&n++,r=i.pop()}else{let o=s.children[r++];if(o instanceof jn)i.push(r),s=o,r=0;else{let l=n+o.length,c=e(o,n);if(c!==void 0)return c;n=l+o.breakAfter}}}resolveBlock(e,i){let s,r=-1,n,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&&(s=void 0)}(c<e||e==u&&(i<-1?l.length:l.covers(1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,r=e-c),(u>e||e==c&&(i>1?l.length:l.covers(-1)))&&(!n||!l.isWidget()&&n.isWidget())&&(n=l,o=e-c)}}),!s&&!n)throw new Error("No tile at position "+e);return s&&i<0||!n?{tile:s,offset:r}:{tile:n,offset:o}}}class jn extends Og{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 s=new jn(i||document.createElement(e.tagName),e);return i||(s.flags|=4),s}}class _h extends Og{constructor(e,i){super(e),this.attrs=i}isLine(){return!0}static start(e,i,s){let r=new _h(i||document.createElement("div"),e);return(!i||!s)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,i,s){let r=null,n=-1,o=null,l=-1;function c(d,m){for(let g=0,v=0;g<d.children.length&&v<=m;g++){let y=d.children[g],b=v+y.length;b>=m&&(y.isComposite()?c(y,m-v):(!o||o.isHidden&&(i>0||s&&VZ(o,y)))&&(b>m||y.flags&32)?(o=y,l=m-v):(v<m||y.flags&16&&!y.isHidden)&&(r=y,n=m-v)),v=b}}c(this,e);let u=(i<0?r:o)||r||o;return u?{tile:u,offset:u==r?n:l}:null}coordsIn(e,i){let s=this.resolveInline(e,i,!0);return s?s.tile.coordsIn(Math.max(0,s.offset),i):XZ(this)}domIn(e,i){let s=this.resolveInline(e,i);if(s){let{tile:r,offset:n}=s;if(this.dom.contains(r.dom))return r.isText()?new yr(r.dom,Math.min(r.dom.nodeValue.length,n)):r.domPosFor(n,r.flags&16?1:r.flags&32?-1:i);let o=s.tile.parent,l=!1;for(let c of o.children){if(l)return new yr(c.dom,0);c==s.tile&&(l=!0)}}return new yr(this.dom,0)}}function XZ(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=ku(e);return i[i.length-1]||null}function VZ(t,e){let i=t.coordsIn(0,1),s=e.coordsIn(0,1);return i&&s&&s.top<i.bottom}class gs extends Og{constructor(e,i){super(e),this.mark=i}get domAttrs(){return this.mark.attrs}static of(e,i){let s=new gs(i||document.createElement(e.tagName),e);return i||(s.flags|=4),s}}class La extends Ht{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 s=this.dom.nodeValue.length;e>s&&(e=s);let r=e,n=e,o=0;e==0&&i<0||e==s&&i>=0?_e.chrome||_e.gecko||(e?(r--,o=1):n<s&&(n++,o=-1)):i<0?r--:n<s&&n++;let l=Iu(this.dom,r,n).getClientRects();if(!l.length)return null;let c=l[(o?o<0:i>=0)?0:l.length-1];return _e.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(l,u=>u.width)||c),o?Zu(c,o<0):c||null}static of(e,i){let s=new La(i||document.createTextNode(e),e);return i||(s.flags|=2),s}}class Wa extends Ht{constructor(e,i,s,r){super(e,i,r),this.widget=s}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,s){let r=this.widget.coordsAt(this.dom,e,i);if(r)return r;if(s)return Zu(this.dom.getBoundingClientRect(),this.length?e==0:i<=0);{let n=this.dom.getClientRects(),o=null;if(!n.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let c=l?n.length-1:0;o=n[c],!(e>0?c==0:c==n.length-1||o.top<o.bottom);c+=l?-1:1);return Zu(o,!l)}}get overrideDOMText(){if(!this.length)return Je.empty;let{root:e}=this;if(!e)return Je.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,s,r,n){return n||(n=e.toDOM(i),e.editable||(n.contentEditable="false")),new Wa(n,s,e,r)}}class Am extends Ht{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 Je.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class ZZ{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,i,s){let{tile:r,index:n,beforeBreak:o,parents:l}=this;for(;e||i>0;)if(r.isComposite())if(o){if(!e)break;s&&s.break(),e--,o=!1}else if(n==r.children.length){if(!e&&!l.length)break;s&&s.leave(r),o=!!r.breakAfter,{tile:r,index:n}=l.pop(),n++}else{let c=r.children[n],u=c.breakAfter;(i>0?c.length<=e:c.length<e)&&(!s||s.skip(c,0,c.length)!==!1||!c.isComposite)?(o=!!u,n++,e-=c.length):(l.push({tile:r,index:n}),r=c,n=0,s&&c.isComposite()&&s.enter(c))}else if(n==r.length)o=!!r.breakAfter,{tile:r,index:n}=l.pop(),n++;else if(e){let c=Math.min(e,r.length-n);s&&s.skip(r,n,n+c),e-=c,n+=c}else break;return this.tile=r,this.index=n,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class IZ{constructor(e,i,s,r){this.from=e,this.to=i,this.wrapper=s,this.rank=r}}class qZ{constructor(e,i,s){this.cache=e,this.root=i,this.blockWrappers=s,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,i,s,r){var n;this.flushBuffer();let o=this.ensureMarks(i,s),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 La(l.dom,l.text+e);c.parent=o}else o.append(r||La.of(e,(n=this.cache.find(La))===null||n===void 0?void 0:n.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,i){let s=this.curLine;s.dom!=i.line.dom&&(s.setDOM(this.cache.reused.has(i.line)?Sv(i.line.dom):i.line.dom),this.cache.reused.set(i.line,2));let r=s;for(let l=i.marks.length-1;l>=0;l--){let c=i.marks[l],u=r.lastChild;if(u instanceof gs&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(Sv(c.dom)),r=u;else{if(this.cache.reused.get(c)){let m=Ht.get(c.dom);m&&m.setDOM(Sv(c.dom))}let d=gs.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let n=Ht.get(e.text);n&&this.cache.reused.set(n,2);let o=new La(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,i,s){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let n=this.ensureMarks(i,s);!r&&!(e.flags&16)&&n.append(this.getBuffer(1)),n.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,i,s){this.flushBuffer(),this.ensureMarks(i,s).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 s;e||(e=EL);let r=_h.start(e,i||((s=this.cache.find(_h))===null||s===void 0?void 0:s.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 s;let r=this.curLine;for(let n=e.length-1;n>=0;n--){let o=e[n],l;if(i>0&&(l=r.lastChild)&&l instanceof gs&&l.mark.eq(o))r=l,i--;else{let c=gs.of(o,(s=this.cache.find(gs,u=>u.mark.eq(o)))===null||s===void 0?void 0:s.dom);r.append(c),r=c,i=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!uT(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(_e.ios&&uT(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(xv,0,32)||new Wa(xv.toDOM(),0,xv,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 IZ(e.from,e.to,e.value,e.rank),s=this.wrappers.length;for(;s>0&&(this.wrappers[s-1].rank-i.rank||this.wrappers[s-1].to-i.to)<0;)s--;this.wrappers.splice(s,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let i=this.root;for(let s of this.wrappers){let r=i.lastChild;if(s.from<this.pos&&r instanceof jn&&r.wrapper.eq(s.wrapper))i=r;else{let n=jn.of(s.wrapper,(e=this.cache.find(jn,o=>o.wrapper.eq(s.wrapper)))===null||e===void 0?void 0:e.dom);i.append(n),i=n}}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),s=this.cache.find(Am,void 0,1);return s&&(s.flags=i),s||new Am(i)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class WZ{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:n,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 n?null:r.slice(0,l)}let i=Math.min(this.text.length,this.textOff+e),s=this.text.slice(this.textOff,i);return this.textOff=i,s}}const Em=[Wa,_h,La,gs,Am,jn,vg];for(let t=0;t<Em.length;t++)Em[t].bucket=t;class UZ{constructor(e){this.view=e,this.buckets=Em.map(()=>[]),this.index=Em.map(()=>0),this.reused=new Map}add(e){let i=e.constructor.bucket,s=this.buckets[i];s.length<6?s.push(e):s[this.index[i]=(this.index[i]+1)%6]=e}find(e,i,s=2){let r=e.bucket,n=this.buckets[r],o=this.index[r];for(let l=n.length-1;l>=0;l--){let c=(l+o)%n.length,u=n[c];if((!i||i(u))&&!this.reused.has(u))return n.splice(c,1),c<o&&this.index[r]--,this.reused.set(u,s),u}return null}findWidget(e,i,s){let r=this.buckets[0];if(r.length)for(let n=0,o=0;;n++){if(n==r.length){if(o)return null;o=1,n=0}let l=r[n];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(n,1),n<this.index[0]&&this.index[0]--,l.widget==e&&l.length==i&&(l.flags&497)==s?(this.reused.set(l,1),l):(this.reused.set(l,2),new Wa(l.dom,i,e,l.flags&-498|s))}}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 YZ{constructor(e,i,s,r,n){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=n,this.openWidget=!1,this.openMarks=0,this.cache=new UZ(e),this.text=new WZ(e.state.doc),this.builder=new qZ(this.cache,new vg(e,e.contentDOM),Ze.iter(s)),this.cache.reused.set(i,2),this.old=new ZZ(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 s=i&&this.getCompositionContext(i.text);for(let r=0,n=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,n+=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(n,i.range.fromB),this.cache.clear(),this.builder.addComposition(i,s),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(n,l.toB)),n=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,i,s){let r=GZ(this.old),n=this.openMarks;this.old.advance(e,s?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?Wa.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,n),n=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&c==o.length?this.builder.addText(o.text,r,n,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,c),r,n)),n=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Am)this.cache.add(o);else if(o instanceof gs)this.builder.ensureLine(null),this.builder.addMark(o,r,n),this.cache.reused.set(o,1),n=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 gs&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=n=0):o instanceof gs&&(r.shift(),n=Math.min(n,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,i){let s=null,r=this.builder,n=0,o=Ze.spans(this.decorations,e,i,{point:(l,c,u,d,m,g)=>{if(u instanceof Ia){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(n=d.length,m>d.length)r.continueWidget(c-l);else{let v=u.widget||(u.block?yh.block:yh.inline),y=HZ(u),b=this.cache.findWidget(v,c-l,y)||Wa.of(v,this.view,c-l,y);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(s),r.addBlockWidget(b)):(r.ensureLine(s),r.addInlineWidget(b,d,m))}s=null}else s=FZ(s,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let m=l;m<c;){let g=this.text.next(Math.min(512,c-m));g==null?(r.addLineStartIfNotCovered(s),r.addBreak(),m++):(r.ensureLine(s),r.addText(g,u,m==l?d:u.length),m+=g.length),s=null}}});r.addLineStartIfNotCovered(s),this.openWidget=o>n,this.openMarks=o}forward(e,i,s=1){i-e<=10?this.old.advance(i-e,s,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(i-e-10,-1),this.old.advance(5,s,this.reuseWalker))}getCompositionContext(e){let i=[],s=null;for(let r=e.parentNode;;r=r.parentNode){let n=Ht.get(r);if(r==this.view.contentDOM)break;n instanceof gs?i.push(n):n!=null&&n.isLine()?s=n:n instanceof jn||(r.nodeName=="DIV"&&!s&&r!=this.view.contentDOM?s=new _h(r,EL):s||i.push(gs.of(new yf({tagName:r.nodeName.toLowerCase(),attributes:SZ(r)}),r)))}return{line:s,marks:i}}}function uT(t,e){let i=s=>{for(let r of s.children)if((e?r.isText():r.length)||i(r))return!0;return!1};return i(t)}function HZ(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 EL={class:"cm-line"};function FZ(t,e){let i=e.spec.attributes,s=e.spec.class;return!i&&!s||(t||(t={class:"cm-line"}),i&&oS(i,t),s&&(t.class+=" "+s)),t}function GZ(t){let e=[];for(let i=t.parents.length;i>1;i--){let s=i==t.parents.length?t.tile:t.parents[i].tile;s instanceof gs&&e.push(s.mark)}return e}function Sv(t){let e=Ht.get(t);return e&&e.setDOM(t.cloneNode()),t}class yh extends kr{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}}yh.inline=new yh("span");yh.block=new yh("div");const xv=new class extends kr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class fT{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Te.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 vg(e,e.contentDOM),this.updateInner([new ir(0,0,0,e.state.doc.length)],null)}update(e){var i;let s=e.changedRanges;this.minWidth>0&&s.length&&(s.every(({fromA:d,toA:m})=>m<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:!o9(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let n=r>-1?JZ(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:m}=this.hasComposition;s=new ir(d,m,e.changes.mapPos(d,-1),e.changes.mapPos(m,1)).addToSet(s.slice())}this.hasComposition=n?{from:n.range.fromB,to:n.range.toB}:null,(_e.ie||_e.chrome)&&!n&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=i9(o,this.decorations,e.changes);c.length&&(s=ir.extendWithRanges(s,c));let u=r9(l,this.blockWrappers,e.changes);return u.length&&(s=ir.extendWithRanges(s,u)),n&&!s.some(d=>d.fromA<=n.range.fromA&&d.toA>=n.range.toA)&&(s=n.range.addToSet(s.slice())),this.tile.flags&2&&s.length==0?!1:(this.updateInner(s,n),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,i){this.view.viewState.mustMeasureContent=!0;let{observer:s}=this.view;s.ignore(()=>{if(i||e.length){let o=this.tile,l=new YZ(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=l.run(e,i),J1(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 n=_e.chrome||_e.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(n),n&&(n.written||s.selectionRange.focusNode!=n.node||!this.tile.dom.contains(n.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 n of this.tile.children)n.isWidget()&&n.widget instanceof wv&&r.push(n.dom);s.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let i of e.transactions)for(let s of i.effects)s.is(CL)&&(this.editContextFormatting=s.value)}updateSelection(e=!1,i=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:s}=this.tile,r=this.view.root.activeElement,n=r==s,o=!n&&!(this.view.state.facet(Dn)||s.tabIndex>-1)&&Cu(s,this.view.observer.selectionRange)&&!(r&&s.contains(r));if(!(n||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)),_e.gecko&&c.empty&&!this.hasComposition&&KZ(u)){let g=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(g,u.node.childNodes[u.offset]||null)),u=d=new yr(g,0),l=!0}let m=this.view.observer.selectionRange;(l||!m.focusNode||(!Tu(u.node,u.offset,m.anchorNode,m.anchorOffset)||!Tu(d.node,d.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,c))&&(this.view.observer.ignore(()=>{_e.android&&_e.chrome&&s.contains(m.focusNode)&&n9(m.focusNode,s)&&(s.blur(),s.focus({preventScroll:!0}));let g=Vu(this.view.root);if(g)if(c.empty){if(_e.gecko){let v=e9(u.node,u.offset);if(v&&v!=3){let y=(v==1?hL:cL)(u.node,u.offset);y&&(u=new yr(y.node,y.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 v=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),v.setEnd(d.node,d.offset),v.setStart(u.node,u.offset),g.removeAllRanges(),g.addRange(v)}o&&this.view.root.activeElement==s&&(s.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new yr(m.anchorNode,m.anchorOffset),this.impreciseHead=d.precise?null:new yr(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,i){return this.hasComposition&&i.empty&&Tu(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,s=Vu(e.root),{anchorNode:r,anchorOffset:n}=e.observer.selectionRange;if(!s||!i.empty||!i.assoc||!s.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);s.collapse(d.node,d.offset),s.modify("move",i.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=i.from&&s.collapse(r,n)}posFromDOM(e,i){let s=this.tile.nearest(e);if(!s)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=s.posAtStart;if(s.isComposite()){let n;if(e==s.dom)n=s.dom.childNodes[i];else{let o=In(e)==0?0:i==0?-1:1;for(;;){let l=e.parentNode;if(l==s.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?n=e:n=e.nextSibling}if(n==s.dom.firstChild)return r;for(;n&&!Ht.get(n);)n=n.nextSibling;if(!n)return r+s.length;for(let o=0,l=r;;o++){let c=s.children[o];if(c.dom==n)return l;l+=c.length+c.breakAfter}}else return s.isText()?e==s.dom?r+i:r+(i?s.length:0):r}domAtPos(e,i){let{tile:s,offset:r}=this.tile.resolveBlock(e,i);return s.isWidget()?s.domPosFor(e,i):s.domIn(r,i)}inlineDOMNearPos(e,i){let s,r=-1,n=!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&&(n=!0)}else{let m=d+u.length;if(d<=e&&(s=u,r=e-d,n=m<e),m>=e&&!o&&(o=u,l=e-d,c=d>e),d>e&&o)return!0}}),!s&&!o?this.domAtPos(e,i):(n&&o?s=null:c&&s&&(o=null),s&&i<0||!o?s.domIn(r,i):o.domIn(l,i))}coordsAt(e,i){let{tile:s,offset:r}=this.tile.resolveBlock(e,i);return s.isWidget()?s.widget instanceof wv?null:s.coordsInWidget(r,i,!0):s.coordsIn(r,i)}lineAt(e,i){let{tile:s}=this.tile.resolveBlock(e,i);return s.isLine()?s:null}coordsForChar(e){let{tile:i,offset:s}=this.tile.resolveBlock(e,1);if(!i.isLine())return null;function r(n,o){if(n.isComposite())for(let l of n.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(n.isText()&&o<n.length){let l=bi(n.text,o);if(l==o)return null;let c=Iu(n.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,s)}measureVisibleLineHeights(e){let i=[],{from:s,to:r}=e,n=this.view.contentDOM.clientWidth,o=n>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==ut.LTR,u=0,d=(m,g,v)=>{for(let y=0;y<m.children.length&&!(g>r);y++){let b=m.children[y],w=g+b.length,C=b.dom.getBoundingClientRect(),{height:T}=C;if(v&&!y&&(u+=C.top-v.top),b instanceof jn)w>s&&d(b,g,C);else if(g>=s&&(u>0&&i.push(-u),i.push(T+u),u=0,o)){let M=b.dom.lastChild,k=M?ku(M):[];if(k.length){let P=k[k.length-1],E=c?P.right-C.left:C.right-P.left;E>l&&(l=E,this.minWidth=n,this.minWidthFrom=g,this.minWidthTo=w)}}v&&y==m.children.length-1&&(u+=v.bottom-C.bottom),g=w+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"?ut.RTL:ut.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=ku(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"),s,r,n;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=ku(i.firstChild)[0];s=i.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,n=o&&o.height?o.height:s,i.remove()}),{lineHeight:s,charWidth:r,textHeight:n}}computeBlockGapDeco(){let e=[],i=this.view.viewState;for(let s=0,r=0;;r++){let n=r==i.viewports.length?null:i.viewports[r],o=n?n.from-1:this.view.state.doc.length;if(o>s){let l=(i.lineBlockAt(o).bottom-i.lineBlockAt(s).top)/this.view.scaleY;e.push(Te.replace({widget:new wv(l),block:!0,inclusive:!0,isBlockGap:!0}).range(s,o))}if(!n)break;s=n.to+1}return Te.set(e)}updateDeco(){let e=1,i=this.view.state.facet(gg).map(n=>(this.dynamicDecorationMap[e++]=typeof n=="function")?n(this.view):n),s=!1,r=this.view.state.facet(fS).map((n,o)=>{let l=typeof n=="function";return l&&(s=!0),l?n(this.view):n});for(r.length&&(this.dynamicDecorationMap[e++]=s,i.push(Ze.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(TL).map(n=>typeof n=="function"?n(this.view):n)}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(wL))try{if(u(this.view,e.range,e))return!0}catch(d){Os(this.view.state,d,"scroll handler")}let{range:i}=e,s=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1),r;if(!s)return;!i.empty&&(r=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(s={left:Math.min(s.left,r.left),top:Math.min(s.top,r.top),right:Math.max(s.right,r.right),bottom:Math.max(s.bottom,r.bottom)});let n=dS(this.view),o={left:s.left-n.left,top:s.top-n.top,right:s.right+n.right,bottom:s.bottom+n.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(CZ(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==ut.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(s.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||s.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=s=>s.isWidget()||s.children.some(i);return i(this.tile.resolveBlock(e,1).tile)}destroy(){J1(this.tile)}}function J1(t,e){let i=e==null?void 0:e.get(t);if(i!=1){i==null&&t.destroy();for(let s of t.children)J1(s,e)}}function KZ(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 PL(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let s=hL(i.focusNode,i.focusOffset),r=cL(i.focusNode,i.focusOffset),n=s||r;if(r&&s&&r.node!=s.node){let l=Ht.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)n=r;else if(t.docView.lastCompositionAfterCursor){let c=Ht.get(s.node);!c||c.isText()&&c.text!=s.node.nodeValue||(n=r)}}if(t.docView.lastCompositionAfterCursor=n!=s,!n)return null;let o=e-n.offset;return{from:o,to:o+n.node.nodeValue.length,node:n.node}}function JZ(t,e,i){let s=PL(t,i);if(!s)return null;let{node:r,from:n,to:o}=s,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(s.from,s.to)!=l)return null;let c=e.invertedDesc;return{range:new ir(c.mapPos(n),c.mapPos(o),n,o),text:r}}function e9(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 t9=class{constructor(){this.changes=[]}compareRange(e,i){hh(e,i,this.changes)}comparePoint(e,i){hh(e,i,this.changes)}boundChange(e){hh(e,e,this.changes)}};function i9(t,e,i){let s=new t9;return Ze.compare(t,e,i,s),s.changes}class s9{constructor(){this.changes=[]}compareRange(e,i){hh(e,i,this.changes)}comparePoint(){}boundChange(e){hh(e,e,this.changes)}}function r9(t,e,i){let s=new s9;return Ze.compare(t,e,i,s),s.changes}function n9(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 o9(t,e){let i=!1;return e&&t.iterChangedRanges((s,r)=>{s<e.to&&r>e.from&&(i=!0)}),i}class wv extends kr{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 a9(t,e,i=1){let s=t.charCategorizer(e),r=t.doc.lineAt(e),n=e-r.from;if(r.length==0)return ne.cursor(e);n==0?i=1:n==r.length&&(i=-1);let o=n,l=n;i<0?o=bi(r.text,n,!1):l=bi(r.text,n);let c=s(r.text.slice(o,l));for(;o>0;){let u=bi(r.text,o,!1);if(s(r.text.slice(u,o))!=c)break;o=u}for(;l<r.length;){let u=bi(r.text,l);if(s(r.text.slice(l,u))!=c)break;l=u}return ne.range(o+r.from,l+r.from)}function l9(t,e,i,s,r){let n=Math.round((s-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);n+=c*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+X1(o,n,t.state.tabSize)}function ey(t,e,i){let s=t.lineBlockAt(e);if(Array.isArray(s.type)){let r;for(let n of s.type){if(n.from>e)break;if(!(n.to<e)){if(n.from<e&&n.to>e)return n;(!r||n.type==zi.Text&&(r.type!=n.type||(i<0?n.from<e:n.to>e)))&&(r=n)}}return r||s}return s}function h9(t,e,i,s){let r=ey(t,e.head,e.assoc||-1),n=!s||r.type!=zi.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(n){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),c=t.posAtCoords({x:i==(l==ut.LTR)?o.right-1:o.left+1,y:(n.top+n.bottom)/2});if(c!=null)return ne.cursor(c,i?-1:1)}return ne.cursor(i?r.to:r.from,i?-1:1)}function dT(t,e,i,s){let r=t.state.doc.lineAt(e.head),n=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,c=null;;){let u=DZ(r,n,o,l,i),d=mL;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)),n=t.bidiSpans(r),u=t.visualLineSide(r,!i)}if(c){if(!c(d))return l}else{if(!s)return u;c=s(d)}l=u}}function c9(t,e,i){let s=t.state.charCategorizer(e),r=s(i);return n=>{let o=s(n);return r==St.Space&&(r=o),r==o}}function u9(t,e,i,s){let r=e.head,n=i?1:-1;if(r==(i?t.state.doc.length:0))return ne.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=n<0?u.top:u.bottom;else{let y=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,t.defaultCharacterWidth*(r-y.from))),l=(n<0?y.top:y.bottom)+d}let m=c.left+o,g=s??t.viewState.heightOracle.textHeight>>1,v=ty(t,{x:m,y:l+g*n},!1,n);return ne.cursor(v.pos,v.assoc,void 0,o)}function Mu(t,e,i){for(;;){let s=0;for(let r of t)r.between(e-1,e+1,(n,o,l)=>{if(e>n&&e<o){let c=s||i||(e-n<o-e?-1:1);e=c<0?n:o,s=c}});if(!s)return e}}function RL(t,e){let i=null;for(let s=0;s<e.ranges.length;s++){let r=e.ranges[s],n=null;if(r.empty){let o=Mu(t,r.from,0);o!=r.from&&(n=ne.cursor(o,-1))}else{let o=Mu(t,r.from,-1),l=Mu(t,r.to,1);(o!=r.from||l!=r.to)&&(n=ne.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}n&&(i||(i=e.ranges.slice()),i[s]=n)}return i?ne.create(i,e.mainIndex):e}function Cv(t,e,i){let s=Mu(t.state.facet(Sf).map(r=>r(t)),i.from,e.head>i.from?-1:1);return s==i.from?i:ne.cursor(s,s<i.from?1:-1)}class qr{constructor(e,i){this.pos=e,this.assoc=i}}function ty(t,e,i,s){let r=t.contentDOM.getBoundingClientRect(),n=r.top+t.viewState.paddingTop,{x:o,y:l}=e,c=l-n,u;for(;;){if(c<0)return new qr(0,1);if(c>t.viewState.docHeight)return new qr(t.state.doc.length,-1);if(u=t.elementAtHeight(c),s==null)break;if(u.type==zi.Text){if(s<0?u.to<t.viewport.from:u.from>t.viewport.to)break;let g=t.docView.coordsAt(s<0?u.from:u.to,s>0?-1:1);if(g&&(s<0?g.top<=c+n:g.bottom>=c+n))break}let m=t.viewState.heightOracle.textHeight/2;c=s>0?u.bottom+m:u.top-m}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(i)return null;if(u.type==zi.Text){let m=l9(t,r,u,o,l);return new qr(m,m==u.from?1:-1)}}if(u.type!=zi.Text)return c<(u.top+u.bottom)/2?new qr(u.from,1):new qr(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 f9(t,o,l,t.textDirectionAt(u.from)).scanTile(d,u.from)}class f9{constructor(e,i,s,r){this.view=e,this.x=i,this.y=s,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:s,spans:r}=this.bidiSpansAt(e);return r[Wr.find(r,e-s.from,-1,i)].level==this.baseDir}dirAt(e,i){let{line:s,spans:r}=this.bidiSpansAt(e);return r[Wr.find(r,e-s.from,-1,i)].dir}bidiIn(e,i){let{spans:s,line:r}=this.bidiSpansAt(e);return s.length>1||s.length&&(s[0].level!=this.baseDir||s[0].to+r.from<i)}scan(e,i){let s=0,r=e.length-1,n=new Set,o=this.bidiIn(e[0],e[r]),l,c,u=-1,d=1e9,m;e:for(;s<r;){let v=r-s,y=s+r>>1;t:if(n.has(y)){let w=s+Math.floor(Math.random()*v);for(let C=0;C<v;C++){if(!n.has(w)){y=w;break t}w++,w==r&&(w=s)}break e}n.add(y);let b=i(y);if(b)for(let w=0;w<b.length;w++){let C=b[w],T=0;if(C.bottom<this.y)(!l||l.bottom<C.bottom)&&(l=C),T=1;else if(C.top>this.y)(!c||c.top>C.top)&&(c=C),T=-1;else{let M=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,k=Math.abs(M);k<d&&(u=y,d=k,m=C),M&&(T=M<0==(this.baseDir==ut.LTR)?-1:1)}T==-1&&(!o||this.baseDirAt(e[y],1))?r=y:T==1&&(!o||this.baseDirAt(e[y+1],-1))&&(s=y+1)}}if(!m){let v=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(v.top+v.bottom)/2,this.scan(e,i)}let g=(o?this.dirAt(e[u],1):this.baseDir)==ut.LTR;return{i:u,after:this.x>(m.left+m.right)/2==g}}scanText(e,i){let s=[];for(let n=0;n<e.length;n=bi(e.text,n))s.push(i+n);s.push(i+e.length);let r=this.scan(s,n=>{let o=s[n]-i,l=s[n+1]-i;return Iu(e.dom,o,l).getClientRects()});return r.after?new qr(s[r.i+1],-1):new qr(s[r.i],1)}scanTile(e,i){if(!e.length)return new qr(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 s=[i];for(let l=0,c=i;l<e.children.length;l++)s.push(c+=e.children[l].length);let r=this.scan(s,l=>{let c=e.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:Iu(c.dom,0,c.length)).getClientRects()}),n=e.children[r.i],o=s[r.i];return n.isText()?this.scanText(n,o):n.isComposite()?this.scanTile(n,o):r.after?new qr(s[r.i+1],-1):new qr(o,1)}}const hu="";class d9{constructor(e,i){this.points=e,this.view=i,this.text="",this.lineSeparator=i.state.facet(We.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=hu}readRange(e,i){if(!e)return this;let s=e.parentNode;for(let r=e;;){this.findPointBefore(s,r);let n=this.text.length;this.readNode(r);let o=Ht.get(r),l=r.nextSibling;if(l==i){o!=null&&o.breakAfter&&!l&&s!=this.view.contentDOM&&this.lineBreak();break}let c=Ht.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:Tm(r))||Tm(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>n)&&!m9(l,i)&&this.lineBreak(),r=l}return this.findPointBefore(s,i),this}readTextNode(e){let i=e.nodeValue;for(let s of this.points)s.node==e&&(s.pos=this.text.length+Math.min(s.offset,i.length));for(let s=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let n=-1,o=1,l;if(this.lineSeparator?(n=i.indexOf(this.lineSeparator,s),o=this.lineSeparator.length):(l=r.exec(i))&&(n=l.index,o=l[0].length),this.append(i.slice(s,n<0?i.length:n)),n<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);s=n+o}}readNode(e){let i=Ht.get(e),s=i&&i.overrideDOMText;if(s!=null){this.findPointInside(e,s.length);for(let r=s.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 s of this.points)s.node==e&&e.childNodes[s.offset]==i&&(s.pos=this.text.length)}findPointInside(e,i){for(let s of this.points)(e.nodeType==3?s.node==e:e.contains(s.node))&&(s.pos=this.text.length+(p9(e,s.node,s.offset)?i:0))}}function p9(t,e,i){for(;;){if(!e||i<In(e))return!1;if(e==t)return!0;i=Wo(e)+1,e=e.parentNode}}function m9(t,e){let i;for(;!(t==e||!t);t=t.nextSibling){let s=Ht.get(t);if(!(s!=null&&s.isWidget()))return!1;s&&(i||(i=[])).push(s)}if(i)for(let s of i){let r=s.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class pT{constructor(e,i){this.node=e,this.offset=i,this.pos=-1}}class g9{constructor(e,i,s,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=i>-1;let{impreciseHead:n,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=QL(e.docView.tile,i,s,0))){let l=n||o?[]:v9(e),c=new d9(l,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=_9(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=n&&n.node==l.focusNode&&n.offset==l.focusOffset||!Y1(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||!Y1(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((_e.ios||_e.chrome)&&e.state.selection.main.empty&&c!=u&&(d.from>0||d.to<e.state.doc.length)){let m=Math.min(c,u),g=Math.max(c,u),v=d.from-m,y=d.to-g;(v==0||v==1||m==0)&&(y==0||y==-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(ne.range(u,c)):this.newSel=ne.single(u,c)}}}function QL(t,e,i,s){if(t.isComposite()){let r=-1,n=-1,o=-1,l=-1;for(let c=0,u=s,d=s;c<t.children.length;c++){let m=t.children[c],g=u+m.length;if(u<e&&g>i)return QL(m,e,i,u);if(g>=e&&r==-1&&(r=c,n=u),u>i&&m.dom.parentNode==t.dom){o=c,l=d;break}d=g,u=g+m.breakAfter}return{from:n,to:l<0?s+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:s,to:s+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function LL(t,e){let i,{newSel:s}=e,r=t.state.selection.main,n=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;(n===8||_e.android&&e.text.length<l-o)&&(c=r.to,u="end");let d=$L(t.state.doc.sliceString(o,l,hu),e.text,c-o,u);d&&(_e.chrome&&n==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==hu+hu&&d.toB--,i={from:o+d.from,to:o+d.toA,insert:Je.of(e.text.slice(d.from,d.toB).split(hu))})}else s&&(!t.hasFocus&&t.state.facet(Dn)||Pm(s,r))&&(s=null);if(!i&&!s)return!1;if(!i&&e.typeOver&&!r.empty&&s&&s.main.empty?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(_e.mac||_e.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(s&&i.insert.length==2&&(s=ne.single(s.main.anchor-1,s.main.head-1)),i={from:i.from,to:i.to,insert:Je.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)}:_e.chrome&&i&&i.from==i.to&&i.from==r.head&&i.insert.toString()==`
|
|
66
|
-
`&&t.lineWrapping&&(s&&(s=ne.single(s.main.anchor-1,s.main.head-1)),i={from:r.from,to:r.to,insert:Je.of([" "])}),i)return pS(t,i,s,n);if(s&&!Pm(s,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"&&(s=RL(t.state.facet(Sf).map(c=>c(t)),s))),t.dispatch({selection:s,scrollIntoView:o,userEvent:l}),!0}else return!1}function pS(t,e,i,s=-1){if(_e.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(_e.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&&ch(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||s==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ch(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ch(t.contentDOM,"Delete",46)))return!0;let n=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=O9(t,e,i));return t.state.facet(yL).some(c=>c(t,e.from,e.to,n,l))||t.dispatch(l()),!0}function O9(t,e,i){let s,r=t.state,n=r.selection.main,o=-1;if(e.from==e.to&&e.from<n.from||e.from>n.to){let c=e.from<n.from?-1:1,u=c<0?n.from:n.to,d=Mu(r.facet(Sf).map(m=>m(t)),u,c);e.from==d&&(o=d)}if(o>-1)s={changes:e,selection:ne.cursor(e.from+e.insert.length,-1)};else if(e.from>=n.from&&e.to<=n.to&&e.to-e.from>=(n.to-n.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=n.from<e.from?r.sliceDoc(n.from,e.from):"",u=n.to>e.to?r.sliceDoc(e.to,n.to):"";s=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<=n.to+10&&e.to>=n.to-10){let d=t.state.sliceDoc(e.from,e.to),m,g=i&&PL(t,i.main.head);if(g){let y=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-y}}else m=t.state.doc.lineAt(n.head);let v=n.to-e.to;s=r.changeByRange(y=>{if(y.from==n.from&&y.to==n.to)return{changes:c,range:u||y.map(c)};let b=y.to-v,w=b-d.length;if(t.state.sliceDoc(w,b)!=d||b>=m.from&&w<=m.to)return{range:y};let C=r.changes({from:w,to:b,insert:e.insert}),T=y.to-n.to;return{changes:C,range:u?ne.range(Math.max(0,u.anchor+T),Math.max(0,u.head+T)):y.map(C)}})}else s={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(s,{userEvent:l,scrollIntoView:!0})}function $L(t,e,i,s){let r=Math.min(t.length,e.length),n=0;for(;n<r&&t.charCodeAt(n)==e.charCodeAt(n);)n++;if(n==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(s=="end"){let c=Math.max(0,n-Math.min(o,l));i-=o+c-n}if(o<n&&t.length<e.length){let c=i<=n&&i>=o?n-i:0;n-=c,l=n+(l-o),o=n}else if(l<n){let c=i<=n&&i>=l?n-i:0;n-=c,o=n+(o-l),l=n}return{from:n,toA:o,toB:l}}function v9(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:n}=t.observer.selectionRange;return i&&(e.push(new pT(i,s)),(r!=i||n!=s)&&e.push(new pT(r,n))),e}function _9(t,e){if(t.length==0)return null;let i=t[0].pos,s=t.length==2?t[1].pos:i;return i>-1&&s>-1?ne.single(i+e,s+e):null}function Pm(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class y9{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,_e.safari&&e.contentDOM.addEventListener("input",()=>null),_e.gecko&&$9(e.contentDOM.ownerDocument)}handleEvent(e){!M9(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 s=this.handlers[e];if(s){for(let r of s.observers)r(this.view,i);for(let r of s.handlers){if(i.defaultPrevented)break;if(r(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=b9(e),s=this.handlers,r=this.view.contentDOM;for(let n in i)if(n!="scroll"){let o=!i[n].handlers.length,l=s[n];l&&o!=!l.handlers.length&&(r.removeEventListener(n,this.handleEvent),l=null),l||r.addEventListener(n,this.handleEvent,{passive:o})}for(let n in s)n!="scroll"&&!i[n]&&r.removeEventListener(n,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&&DL.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),_e.android&&_e.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let i;return _e.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((i=BL.find(s=>s.keyCode==e.keyCode))&&!e.ctrlKey||S9.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,ch(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:_e.safari&&!_e.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 mT(t,e){return(i,s)=>{try{return e.call(t,s,i)}catch(r){Os(i.state,r)}}}function b9(t){let e=Object.create(null);function i(s){return e[s]||(e[s]={observers:[],handlers:[]})}for(let s of t){let r=s.spec,n=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(n)for(let l in n){let c=n[l];c&&i(l).handlers.push(mT(s.value,c))}if(o)for(let l in o){let c=o[l];c&&i(l).observers.push(mT(s.value,c))}}for(let s in wr)i(s).handlers.push(wr[s]);for(let s in hr)i(s).observers.push(hr[s]);return e}const BL=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],S9="dthko",DL=[16,17,18,20,91,92,224,225],hp=6;function cp(t){return Math.max(0,t)*.7+8}function x9(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class w9{constructor(e,i,s,r){this.view=e,this.startEvent=i,this.style=s,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=i,this.scrollParents=kZ(e.contentDOM),this.atoms=e.state.facet(Sf).map(o=>o(e));let n=e.contentDOM.ownerDocument;n.addEventListener("mousemove",this.move=this.move.bind(this)),n.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=i.shiftKey,this.multiple=e.state.facet(We.allowMultipleSelections)&&C9(e,i),this.dragging=T9(e,i)&&jL(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&&x9(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=0,n=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:n,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=dS(this.view);e.clientX-c.left<=r+hp?i=-cp(r-e.clientX):e.clientX+c.right>=o-hp&&(i=cp(e.clientX-o)),e.clientY-c.top<=n+hp?s=-cp(n-e.clientY):e.clientY+c.bottom>=l-hp&&(s=cp(e.clientY-l)),this.setScrollSpeed(i,s)}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,s=RL(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!s.eq(i.state.selection,this.dragging===!1))&&this.view.dispatch({selection:s,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 C9(t,e){let i=t.state.facet(gL);return i.length?i[0](e):_e.mac?e.metaKey:e.ctrlKey}function k9(t,e){let i=t.state.facet(OL);return i.length?i[0](e):_e.mac?!e.altKey:!e.ctrlKey}function T9(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let s=Vu(t.root);if(!s||s.rangeCount==0)return!0;let r=s.getRangeAt(0).getClientRects();for(let n=0;n<r.length;n++){let o=r[n];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function M9(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,s;i!=t.contentDOM;i=i.parentNode)if(!i||i.nodeType==11||(s=Ht.get(i))&&s.isWidget()&&!s.isHidden&&s.widget.ignoreEvent(e))return!1;return!0}const wr=Object.create(null),hr=Object.create(null),zL=_e.ie&&_e.ie_version<15||_e.ios&&_e.webkit_version<604;function A9(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(),NL(t,i.value)},50)}function _g(t,e,i){for(let s of t.facet(e))i=s(i,t);return i}function NL(t,e){e=_g(t.state,hS,e);let{state:i}=t,s,r=1,n=i.toText(e),o=n.lines==i.selection.ranges.length;if(iy!=null&&i.selection.ranges.every(c=>c.empty)&&iy==n.toString()){let c=-1;s=i.changeByRange(u=>{let d=i.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let m=i.toText((o?n.line(r++).text:e)+i.lineBreak);return{changes:{from:d.from,insert:m},range:ne.cursor(u.from+m.length)}})}else o?s=i.changeByRange(c=>{let u=n.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:ne.cursor(c.from+u.length)}}):s=i.replaceSelection(n);t.dispatch(s,{userEvent:"input.paste",scrollIntoView:!0})}hr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};wr.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);hr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};hr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};wr.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let s of t.state.facet(vL))if(i=s(t,e),i)break;if(!i&&e.button==0&&(i=P9(t,e)),i){let s=!t.hasFocus;t.inputState.startMouseSelection(new w9(t,e,i,s)),s&&t.observer.ignore(()=>{aL(t.contentDOM);let n=t.root.activeElement;n&&!n.contains(t.contentDOM)&&n.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function gT(t,e,i,s){if(s==1)return ne.cursor(e,i);if(s==2)return a9(t.state,e,i);{let r=t.docView.lineAt(e,i),n=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:n.from,l=r?r.posAtEnd:n.to;return l<t.state.doc.length&&l==n.to&&l++,ne.range(o,l)}}const E9=_e.ie&&_e.ie_version<=11;let OT=null,vT=0,_T=0;function jL(t){if(!E9)return t.detail;let e=OT,i=_T;return OT=t,_T=Date.now(),vT=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(vT+1)%3:1}function P9(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),s=jL(e),r=t.state.selection;return{update(n){n.docChanged&&(i.pos=n.changes.mapPos(i.pos),r=r.map(n.changes))},get(n,o,l){let c=t.posAndSideAtCoords({x:n.clientX,y:n.clientY},!1),u,d=gT(t,c.pos,c.assoc,s);if(i.pos!=c.pos&&!o){let m=gT(t,i.pos,i.assoc,s),g=Math.min(m.from,d.from),v=Math.max(m.to,d.to);d=g<d.from?ne.range(g,v):ne.range(v,g)}return o?r.replaceRange(r.main.extend(d.from,d.to)):l&&s==1&&r.ranges.length>1&&(u=R9(r,c.pos))?u:l?r.addRange(d):ne.create([d])}}}function R9(t,e){for(let i=0;i<t.ranges.length;i++){let{from:s,to:r}=t.ranges[i];if(s<=e&&r>=e)return ne.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}wr.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 n=r.posAtStart,o=n+r.length;(n>=i.to||o<=i.from)&&(i=ne.range(n,o))}}let{inputState:s}=t;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",_g(t.state,cS,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1};wr.dragend=t=>(t.inputState.draggedContent=null,!1);function yT(t,e,i,s){if(i=_g(t.state,hS,i),!i)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:n}=t.inputState,o=s&&n&&k9(t,e)?{from:n.from,to:n.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}wr.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let s=Array(i.length),r=0,n=()=>{++r==i.length&&yT(t,e,s.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<i.length;o++){let l=new FileReader;l.onerror=n,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(s[o]=l.result),n()},l.readAsText(i[o])}return!0}else{let s=e.dataTransfer.getData("Text");if(s)return yT(t,e,s,!0),!0}return!1};wr.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=zL?null:e.clipboardData;return i?(NL(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(A9(t),!1)};function Q9(t,e){let i=t.dom.parentNode;if(!i)return;let s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(()=>{s.remove(),t.focus()},50)}function L9(t){let e=[],i=[],s=!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:n}of t.selection.ranges){let o=t.doc.lineAt(n);o.number>r&&(e.push(o.text),i.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}s=!0}return{text:_g(t,cS,e.join(t.lineBreak)),ranges:i,linewise:s}}let iy=null;wr.copy=wr.cut=(t,e)=>{if(!Cu(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:s,linewise:r}=L9(t.state);if(!i&&!r)return!1;iy=r?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let n=zL?null:e.clipboardData;return n?(n.clearData(),n.setData("text/plain",i),!0):(Q9(t,i),!1)};const XL=nn.define();function VL(t,e){let i=[];for(let s of t.facet(bL)){let r=s(t,e);r&&i.push(r)}return i.length?t.update({effects:i,annotations:XL.of(!0)}):null}function ZL(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=VL(t.state,e);i?t.dispatch(i):t.update([])}},10)}hr.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),ZL(t)};hr.blur=t=>{t.observer.clearSelectionRange(),ZL(t)};hr.compositionstart=hr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};hr.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,_e.chrome&&_e.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};hr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};wr.beforeinput=(t,e)=>{var i,s;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let n=(i=e.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"),o=e.getTargetRanges();if(n&&o.length){let l=o[0],c=t.posAtDOM(l.startContainer,l.startOffset),u=t.posAtDOM(l.endContainer,l.endOffset);return pS(t,{from:c,to:u,insert:t.state.toText(n)},null),!0}}let r;if(_e.chrome&&_e.android&&(r=BL.find(n=>n.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let n=((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>n+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return _e.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),_e.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>hr.compositionend(t,e),20),!1};const bT=new Set;function $9(t){bT.has(t)||(bT.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const ST=["pre-wrap","normal","pre-line","break-spaces"];let bh=!1;function xT(){bh=!1}class B9{constructor(e){this.lineWrapping=e,this.doc=Je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,i){let s=this.doc.lineAt(i).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(s+=Math.max(0,Math.ceil((i-e-s*this.lineLength*.5)/this.lineLength))),this.lineHeight*s}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 ST.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let i=!1;for(let s=0;s<e.length;s++){let r=e[s];r<0?s++:this.heightSamples[Math.floor(r*10)]||(i=!0,this.heightSamples[Math.floor(r*10)]=!0)}return i}refresh(e,i,s,r,n,o){let l=ST.indexOf(e)>-1,c=Math.abs(i-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(s-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=i,this.charWidth=s,this.textHeight=r,this.lineLength=n,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 D9{constructor(e,i){this.from=e,this.heights=i,this.index=0}get more(){return this.index<this.heights.length}}class _r{constructor(e,i,s,r,n){this.from=e,this.length=i,this.top=s,this.height=r,this._content=n}get type(){return typeof this._content=="number"?zi.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 Ia?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 _r(this.from,this.length+e.length,this.top,this.height+e.height,i)}}var dt=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(dt||(dt={}));const Hp=.001;class ts{constructor(e,i,s=2){this.length=e,this.height=i,this.flags=s}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)>Hp&&(bh=!0),this.height=e)}replace(e,i,s){return ts.of(s)}decomposeLeft(e,i){i.push(this)}decomposeRight(e,i){i.push(this)}applyChanges(e,i,s,r){let n=this,o=s.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:m}=r[l],g=n.lineAt(c,dt.ByPosNoHeight,s.setDoc(i),0,0),v=g.to>=u?g:n.lineAt(u,dt.ByPosNoHeight,s,0,0);for(m+=v.to-u,u=v.to;l>0&&g.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,c<g.from&&(g=n.lineAt(c,dt.ByPosNoHeight,s,0,0));d+=g.from-c,c=g.from;let y=mS.build(s.setDoc(o),e,d,m);n=Rm(n,n.replace(c,u,y))}return n.updateHeight(s,0)}static empty(){return new Ls(0,0,0)}static of(e){if(e.length==1)return e[0];let i=0,s=e.length,r=0,n=0;for(;;)if(i==s)if(r>n*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),s+=1+l.break,r-=l.size}else if(n>r*2){let l=e[s];l.break?e.splice(s,1,l.left,null,l.right):e.splice(s,1,l.left,l.right),s+=2+l.break,n-=l.size}else break;else if(r<n){let l=e[i++];l&&(r+=l.size)}else{let l=e[--s];l&&(n+=l.size)}let o=0;return e[i-1]==null?(o=1,i--):e[i]==null&&(o=1,s++),new N9(ts.of(e.slice(0,i)),o,ts.of(e.slice(s)))}}function Rm(t,e){return t==e?t:(t.constructor!=e.constructor&&(bh=!0),e)}ts.prototype.size=1;const z9=Te.replace({});class IL extends ts{constructor(e,i,s){super(e,i),this.deco=s,this.spaceAbove=0}mainBlock(e,i){return new _r(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,i,s,r){return this.spaceAbove&&e<s+this.spaceAbove?new _r(r,0,s,this.spaceAbove,z9):this.mainBlock(s,r)}lineAt(e,i,s,r,n){let o=this.mainBlock(r,n);return this.spaceAbove?this.blockAt(0,s,r,n).join(o):o}forEachLine(e,i,s,r,n,o){e<=n+this.length&&i>=n&&o(this.lineAt(0,dt.ByPos,s,r,n))}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,s=!1,r){return r&&r.from<=i&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ls extends IL{constructor(e,i,s){super(e,i,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=s}mainBlock(e,i){return new _r(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,i,s){let r=s[0];return s.length==1&&(r instanceof Ls||r instanceof Ri&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ri?r=new Ls(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ts.of(s)}updateHeight(e,i=0,s=!1,r){return r&&r.from<=i&&r.more?this.setMeasuredHeight(r):(s||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 Ri extends ts{constructor(e){super(e,0)}heightMetrics(e,i){let s=e.doc.lineAt(i).number,r=e.doc.lineAt(i+this.length).number,n=r-s+1,o,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*n);o=c/n,this.length>n+1&&(l=(this.height-c)/(this.length-n-1))}else o=this.height/n;return{firstLine:s,lastLine:r,perLine:o,perChar:l}}blockAt(e,i,s,r){let{firstLine:n,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-s)/this.height))*this.length)),d=i.doc.lineAt(u),m=l+d.length*c,g=Math.max(s,e-m/2);return new _r(d.from,d.length,g,m,0)}else{let u=Math.max(0,Math.min(o-n,Math.floor((e-s)/l))),{from:d,length:m}=i.doc.line(n+u);return new _r(d,m,s+l*u,l,0)}}lineAt(e,i,s,r,n){if(i==dt.ByHeight)return this.blockAt(e,s,r,n);if(i==dt.ByPosNoHeight){let{from:v,to:y}=s.doc.lineAt(e);return new _r(v,y-v,0,0,0)}let{firstLine:o,perLine:l,perChar:c}=this.heightMetrics(s,n),u=s.doc.lineAt(e),d=l+u.length*c,m=u.number-o,g=r+l*m+c*(u.from-n-m);return new _r(u.from,u.length,Math.max(r,Math.min(g,r+this.height-d)),d,0)}forEachLine(e,i,s,r,n,o){e=Math.max(e,n),i=Math.min(i,n+this.length);let{firstLine:l,perLine:c,perChar:u}=this.heightMetrics(s,n);for(let d=e,m=r;d<=i;){let g=s.doc.lineAt(d);if(d==e){let y=g.number-l;m+=c*y+u*(e-n-y)}let v=c+u*g.length;o(new _r(g.from,g.length,m,v,0)),m+=v,d=g.to+1}}replace(e,i,s){let r=this.length-i;if(r>0){let n=s[s.length-1];n instanceof Ri?s[s.length-1]=new Ri(n.length+r):s.push(null,new Ri(r-1))}if(e>0){let n=s[0];n instanceof Ri?s[0]=new Ri(e+n.length):s.unshift(new Ri(e-1),null)}return ts.of(s)}decomposeLeft(e,i){i.push(new Ri(e-1),null)}decomposeRight(e,i){i.push(null,new Ri(this.length-e-1))}updateHeight(e,i=0,s=!1,r){let n=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 Ri(r.from-i-1).updateHeight(e,i));l<=n&&r.more;){let d=e.doc.lineAt(l).length;o.length&&o.push(null);let m=r.heights[r.index++],g=0;m<0&&(g=-m,m=r.heights[r.index++]),c==-1?c=m:Math.abs(m-c)>=Hp&&(c=-2);let v=new Ls(d,m,g);v.outdated=!1,o.push(v),l+=d+1}l<=n&&o.push(null,new Ri(n-l).updateHeight(e,l));let u=ts.of(o);return(c<0||Math.abs(u.height-this.height)>=Hp||Math.abs(c-this.heightMetrics(e,i).perLine)>=Hp)&&(bh=!0),Rm(this,u)}else(s||this.outdated)&&(this.setHeight(e.heightForGap(i,i+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class N9 extends ts{constructor(e,i,s){super(e.length+i+s.length,e.height+s.height,i|(e.outdated||s.outdated?2:0)),this.left=e,this.right=s,this.size=e.size+s.size}get break(){return this.flags&1}blockAt(e,i,s,r){let n=s+this.left.height;return e<n?this.left.blockAt(e,i,s,r):this.right.blockAt(e,i,n,r+this.left.length+this.break)}lineAt(e,i,s,r,n){let o=r+this.left.height,l=n+this.left.length+this.break,c=i==dt.ByHeight?e<o:e<l,u=c?this.left.lineAt(e,i,s,r,n):this.right.lineAt(e,i,s,o,l);if(this.break||(c?u.to<l:u.from>l))return u;let d=i==dt.ByPosNoHeight?dt.ByPosNoHeight:dt.ByPos;return c?u.join(this.right.lineAt(l,d,s,o,l)):this.left.lineAt(l,d,s,r,n).join(u)}forEachLine(e,i,s,r,n,o){let l=r+this.left.height,c=n+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,i,s,r,n,o),i>=c&&this.right.forEachLine(e,i,s,l,c,o);else{let u=this.lineAt(c,dt.ByPos,s,r,n);e<u.from&&this.left.forEachLine(e,u.from-1,s,r,n,o),u.to>=e&&u.from<=i&&o(u),i>u.to&&this.right.forEachLine(u.to+1,i,s,l,c,o)}}replace(e,i,s){let r=this.left.length+this.break;if(i<r)return this.balanced(this.left.replace(e,i,s),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,i-r,s));let n=[];e>0&&this.decomposeLeft(e,n);let o=n.length;for(let l of s)n.push(l);if(e>0&&wT(n,o-1),i<this.length){let l=n.length;this.decomposeRight(i,n),wT(n,l)}return ts.of(n)}decomposeLeft(e,i){let s=this.left.length;if(e<=s)return this.left.decomposeLeft(e,i);i.push(this.left),this.break&&(s++,e>=s&&i.push(null)),e>s&&this.right.decomposeLeft(e-s,i)}decomposeRight(e,i){let s=this.left.length,r=s+this.break;if(e>=r)return this.right.decomposeRight(e-r,i);e<s&&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?ts.of(this.break?[e,null,i]:[e,i]):(this.left=Rm(this.left,e),this.right=Rm(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,s=!1,r){let{left:n,right:o}=this,l=i+n.length+this.break,c=null;return r&&r.from<=i+n.length&&r.more?c=n=n.updateHeight(e,i,s,r):n.updateHeight(e,i,s),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(e,l,s,r):o.updateHeight(e,l,s),c?this.balanced(n,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function wT(t,e){let i,s;t[e]==null&&(i=t[e-1])instanceof Ri&&(s=t[e+1])instanceof Ri&&t.splice(e-1,3,new Ri(i.length+1+s.length))}const j9=5;class mS{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 s=Math.min(i,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Ls?r.length+=s-this.pos:(s>this.pos||!this.isCovered)&&this.nodes.push(new Ls(s-this.pos,-1,0)),this.writtenTo=s,i>s&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=i}point(e,i,s){if(e<i||s.heightRelevant){let r=s.widget?s.widget.estimatedHeight:0,n=s.widget?s.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=i-e;s.block?this.addBlock(new IL(o,r,s)):(o||n||r>=j9)&&this.addLineDeco(r,n,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 Ls(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,i){let s=new Ri(i-e);return this.oracle.doc.lineAt(e).to==i&&(s.flags|=4),s}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ls)return e;let i=new Ls(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,s){let r=this.ensureLine();r.length+=s,r.collapsed+=s,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=i,this.writtenTo=this.pos=this.pos+s}finish(e){let i=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(i instanceof Ls)&&!this.isCovered?this.nodes.push(new Ls(0,-1,0)):(this.writtenTo<this.pos||i==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let s=e;for(let r of this.nodes)r instanceof Ls&&r.updateHeight(this.oracle,s),s+=r?r.length:1;return this.nodes}static build(e,i,s,r){let n=new mS(s,e);return Ze.spans(i,s,r,n,0),n.finish(s)}}function X9(t,e,i){let s=new V9;return Ze.compare(t,e,i,s,0),s.changes}class V9{constructor(){this.changes=[]}compareRange(){}comparePoint(e,i,s,r){(e<i||s&&s.heightRelevant||r&&r.heightRelevant)&&hh(e,i,this.changes,5)}}function Z9(t,e){let i=t.getBoundingClientRect(),s=t.ownerDocument,r=s.defaultView||window,n=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!=s.body;)if(u.nodeType==1){let d=u,m=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&m.overflow!="visible"){let g=d.getBoundingClientRect();n=Math.max(n,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=m.position=="absolute"||m.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:n-i.left,right:Math.max(n,o)-i.left,top:l-(i.top+e),bottom:Math.max(l,c)-(i.top+e)}}function I9(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 q9(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class kv{constructor(e,i,s,r){this.from=e,this.to=i,this.size=s,this.displaySize=r}static same(e,i){if(e.length!=i.length)return!1;for(let s=0;s<e.length;s++){let r=e[s],n=i[s];if(r.from!=n.from||r.to!=n.to||r.size!=n.size)return!1}return!0}draw(e,i){return Te.replace({widget:new W9(this.displaySize*(i?e.scaleY:e.scaleX),i)}).range(this.from,this.to)}}class W9 extends kr{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 CT{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=kT,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ut.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=e.facet(uS).some(s=>typeof s!="function"&&s.class=="cm-lineWrapping");this.heightOracle=new B9(i),this.stateDeco=TT(e),this.heightMap=ts.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle.setDoc(e.doc),[new ir(0,0,0,e.doc.length)]);for(let s=0;s<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());s++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Te.set(this.lineGaps.map(s=>s.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:i}=this.state.selection;for(let s=0;s<=1;s++){let r=s?i.head:i.anchor;if(!e.some(({from:n,to:o})=>r>=n&&r<=o)){let{from:n,to:o}=this.lineBlockAt(r);e.push(new up(n,o))}}return this.viewports=e.sort((s,r)=>s.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?kT:new gS(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(cu(e,this.scaler))})}update(e,i=null){this.state=e.state;let s=this.stateDeco;this.stateDeco=TT(this.state);let r=e.changedRanges,n=ir.extendWithRanges(r,X9(s,this.stateDeco,e?e.changes:si.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);xT(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),n),(this.heightMap.height!=o||bh)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=n.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(xL)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let i=e.contentDOM,s=window.getComputedStyle(i),r=this.heightOracle,n=s.whiteSpace;this.defaultTextDirection=s.direction=="rtl"?ut.RTL:ut.LTR;let o=this.heightOracle.mustRefreshForWrapping(n)||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:k,scaleY:P}=oL(i,l);(k>.005&&Math.abs(this.scaleX-k)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=k,this.scaleY=P,u|=16,o=c=!0)}let m=(parseInt(s.paddingTop)||0)*this.scaleY,g=(parseInt(s.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let v=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=v&&(this.scrollAnchorHeight=-1,this.scrollTop=v),this.scrolledToBottom=lL(e.scrollDOM);let y=(this.printing?q9:Z9)(i,this.paddingTop),b=y.top-this.pixelViewport.top,w=y.bottom-this.pixelViewport.bottom;this.pixelViewport=y;let C=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(C!=this.inView&&(this.inView=C,C&&(c=!0)),!this.inView&&!this.scrollTarget&&!I9(e.dom))return 0;let T=l.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),c){let k=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(T-this.contentDOMWidth)>r.charWidth){let{lineHeight:P,charWidth:E,textHeight:z}=e.docView.measureTextSize();o=P>0&&r.refresh(n,P,E,z,Math.max(5,T/E),k),o&&(e.docView.minWidth=0,u|=16)}b>0&&w>0?d=Math.max(b,w):b<0&&w<0&&(d=Math.min(b,w)),xT();for(let P of this.viewports){let E=P.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?ts.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle,[new ir(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new D9(P.from,E))}bh&&(u|=2)}let M=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||M)&&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 s=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,n=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new up(r.lineAt(o-s*1e3,dt.ByHeight,n,0,0).from,r.lineAt(l+(1-s)*1e3,dt.ByHeight,n,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),m=r.lineAt(u,dt.ByPos,n,0,0),g;i.y=="center"?g=(m.top+m.bottom)/2-d/2:i.y=="start"||i.y=="nearest"&&u<c.from?g=m.top:g=m.bottom-d,c=new up(r.lineAt(g-1e3/2,dt.ByHeight,n,0,0).from,r.lineAt(g+d+1e3/2,dt.ByHeight,n,0,0).to)}}return c}mapViewport(e,i){let s=i.mapPos(e.from,-1),r=i.mapPos(e.to,1);return new up(this.heightMap.lineAt(s,dt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,dt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:i},s=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,dt.ByPos,this.heightOracle,0,0),{bottom:n}=this.heightMap.lineAt(i,dt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-s,250)))&&(i==this.state.doc.length||n>=l+Math.max(10,Math.min(s,250)))&&r>o-2*1e3&&n<l+2*1e3}mapLineGaps(e,i){if(!e.length||i.empty)return e;let s=[];for(let r of e)i.touchesRange(r.from,r.to)||s.push(new kv(i.mapPos(r.from),i.mapPos(r.to),r.size,r.displaySize));return s}ensureLineGaps(e,i){let s=this.heightOracle.lineWrapping,r=s?1e4:2e3,n=r>>1,o=r<<1;if(this.defaultTextDirection!=ut.LTR&&!s)return[];let l=[],c=(d,m,g,v)=>{if(m-d<n)return;let y=this.state.selection.main,b=[y.from];y.empty||b.push(y.to);for(let C of b)if(C>d&&C<m){c(d,C-10,g,v),c(C+10,m,g,v);return}let w=Y9(e,C=>C.from>=g.from&&C.to<=g.to&&Math.abs(C.from-d)<n&&Math.abs(C.to-m)<n&&!b.some(T=>C.from<T&&C.to>T));if(!w){if(m<g.to&&i&&s&&i.visibleRanges.some(M=>M.from<=m&&M.to>=m)){let M=i.moveToLineBoundary(ne.cursor(m),!1,!0).head;M>d&&(m=M)}let C=this.gapSize(g,d,m,v),T=s||C<2e6?C:2e6;w=new kv(d,m,C,T)}l.push(w)},u=d=>{if(d.length<o||d.type!=zi.Text)return;let m=U9(d.from,d.to,this.stateDeco);if(m.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,v,y;if(s){let b=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,C;if(g!=null){let T=dp(m,g),M=((this.visibleBottom-this.visibleTop)/2+b)/d.height;w=T-M,C=T+M}else w=(this.visibleTop-d.top-b)/d.height,C=(this.visibleBottom-d.top+b)/d.height;v=fp(m,w),y=fp(m,C)}else{let b=m.total*this.heightOracle.charWidth,w=r*this.heightOracle.charWidth,C=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+C<this.pixelViewport.left&&(C=E.size-E.displaySize);let T=this.pixelViewport.left+C,M=this.pixelViewport.right+C,k,P;if(g!=null){let E=dp(m,g),z=((M-T)/2+w)/b;k=E-z,P=E+z}else k=(T-w)/b,P=(M+w)/b;v=fp(m,k),y=fp(m,P)}v>d.from&&c(d.from,v,d,m),y<d.to&&c(y,d.to,d,m)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(u):u(d);return l}gapSize(e,i,s,r){let n=dp(r,s)-dp(r,i);return this.heightOracle.lineWrapping?e.height*n:r.total*this.heightOracle.charWidth*n}updateLineGaps(e){kv.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Te.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 s=[];Ze.spans(i,this.viewport.from,this.viewport.to,{span(n,o){s.push({from:n,to:o})},point(){}},20);let r=0;if(s.length!=this.visibleRanges.length)r=12;else for(let n=0;n<s.length&&!(r&8);n++){let o=this.visibleRanges[n],l=s[n];(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=s,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(i=>i.from<=e&&i.to>=e)||cu(this.heightMap.lineAt(e,dt.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)||cu(this.heightMap.lineAt(this.scaler.fromDOM(e),dt.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 cu(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 up{constructor(e,i){this.from=e,this.to=i}}function U9(t,e,i){let s=[],r=t,n=0;return Ze.spans(i,t,e,{span(){},point(o,l){o>r&&(s.push({from:r,to:o}),n+=o-r),r=l}},20),r<e&&(s.push({from:r,to:e}),n+=e-r),{total:n,ranges:s}}function fp({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let s=Math.floor(t*i);for(let r=0;;r++){let{from:n,to:o}=e[r],l=o-n;if(s<=l)return n+s;s-=l}}function dp(t,e){let i=0;for(let{from:s,to:r}of t.ranges){if(e<=r){i+=e-s;break}i+=r-s}return i/t.total}function Y9(t,e){for(let i of t)if(e(i))return i}const kT={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function TT(t){let e=t.facet(gg).filter(s=>typeof s!="function"),i=t.facet(fS).filter(s=>typeof s!="function");return i.length&&e.push(Ze.join(i)),e}class gS{constructor(e,i,s){let r=0,n=0,o=0;this.viewports=s.map(({from:l,to:c})=>{let u=i.lineAt(l,dt.ByPos,e,0,0).top,d=i.lineAt(c,dt.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-n)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),n=l.bottom}toDOM(e){for(let i=0,s=0,r=0;;i++){let n=i<this.viewports.length?this.viewports[i]:null;if(!n||e<n.top)return r+(e-s)*this.scale;if(e<=n.bottom)return n.domTop+(e-n.top);s=n.bottom,r=n.domBottom}}fromDOM(e){for(let i=0,s=0,r=0;;i++){let n=i<this.viewports.length?this.viewports[i]:null;if(!n||e<n.domTop)return s+(e-r)/this.scale;if(e<=n.domBottom)return n.top+(e-n.domTop);s=n.bottom,r=n.domBottom}}eq(e){return e instanceof gS?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((i,s)=>i.from==e.viewports[s].from&&i.to==e.viewports[s].to):!1}}function cu(t,e){if(e.scale==1)return t;let i=e.toDOM(t.top),s=e.toDOM(t.bottom);return new _r(t.from,t.length,i,s-i,Array.isArray(t._content)?t._content.map(r=>cu(r,e)):t._content)}const pp=ve.define({combine:t=>t.join(" ")}),sy=ve.define({combine:t=>t.indexOf(!0)>-1}),ry=Io.newName(),qL=Io.newName(),WL=Io.newName(),UL={"&light":"."+qL,"&dark":"."+WL};function ny(t,e,i){return new Io(e,{finish(s){return/&/.test(s)?s.replace(/&\w*/,r=>{if(r=="&")return t;if(!i||!i[r])throw new RangeError(`Unsupported selector: ${r}`);return i[r]}):t+" "+s}})}const H9=ny("."+ry,{"&":{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"}},UL),F9={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Tv=_e.ie&&_e.ie_version<=11;class G9{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new TZ,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 s of i)this.queue.push(s);(_e.ie&&_e.ie_version<=11||_e.ios&&e.composing)&&i.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&_e.android&&e.constructor.EDIT_CONTEXT!==!1&&!(_e.chrome&&_e.chrome_version<126)&&(this.editContext=new J9(e),e.state.facet(Dn)&&(e.contentDOM.editContext=this.editContext.editContext)),Tv&&(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,s)=>i!=e[s]))){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:s}=this,r=this.selectionRange;if(s.state.facet(Dn)?s.root.activeElement!=this.dom:!Cu(this.dom,r))return;let n=r.anchorNode&&s.docView.tile.nearest(r.anchorNode);if(n&&n.isWidget()&&n.widget.ignoreEvent(e)){i||(this.selectionChanged=!1);return}(_e.ie&&_e.ie_version<=11||_e.android&&_e.chrome)&&!s.state.selection.main.empty&&r.focusNode&&Tu(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,i=Vu(e.root);if(!i)return!1;let s=_e.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&K9(this.view,i)||i;if(!s||this.selectionRange.eq(s))return!1;let r=Cu(this.dom,s);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&AZ(this.dom,s)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(s),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 s=this.dom;s;)if(s.nodeType==1)!i&&e<this.scrollTargets.length&&this.scrollTargets[e]==s?e++:i||(i=this.scrollTargets.slice(0,e)),i&&i.push(s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;if(e<this.scrollTargets.length&&!i&&(i=this.scrollTargets.slice(0,e)),i){for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);for(let s of this.scrollTargets=i)s.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,F9),Tv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Tv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,i){var s;if(!this.delayedAndroidKey){let r=()=>{let n=this.delayedAndroidKey;n&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=n.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&n.force&&ch(this.dom,n.key,n.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:i,force:this.lastChange<Date.now()-50||!!(!((s=this.delayedAndroidKey)===null||s===void 0)&&s.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,s=-1,r=!1;for(let n of e){let o=this.readMutation(n);o&&(o.typeOver&&(r=!0),i==-1?{from:i,to:s}=o:(i=Math.min(o.from,i),s=Math.max(o.to,s)))}return{from:i,to:s,typeOver:r}}readChange(){let{from:e,to:i,typeOver:s}=this.processRecords(),r=this.selectionChanged&&Cu(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 n=new g9(this.view,e,i,s);return this.view.docView.domChanged={newSel:n.newSel?n.newSel.main:null},n}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 s=this.view.state,r=LL(this.view,i);return this.view.state==s&&(i.domChanged||i.newSel&&!Pm(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 s=MT(i,e.previousSibling||e.target.previousSibling,-1),r=MT(i,e.nextSibling||e.target.nextSibling,1);return{from:s?i.posAfter(s):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(Dn)!=e.state.facet(Dn)&&(e.view.contentDOM.editContext=e.state.facet(Dn)?this.editContext.editContext:null))}destroy(){var e,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(i=this.gapIntersection)===null||i===void 0||i.disconnect(),(s=this.resizeScroll)===null||s===void 0||s.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 MT(t,e,i){for(;e;){let s=Ht.get(e);if(s&&s.parent==t)return s;let r=e.parentNode;e=r!=t.dom?r:i>0?e.nextSibling:e.previousSibling}return null}function AT(t,e){let i=e.startContainer,s=e.startOffset,r=e.endContainer,n=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Tu(o.node,o.offset,r,n)&&([i,s,r,n]=[r,n,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:n}}function K9(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return AT(t,r)}let i=null;function s(r){r.preventDefault(),r.stopImmediatePropagation(),i=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",s,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",s,!0),i?AT(t,i):null}class J9{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=s=>{let r=e.state.selection.main,{anchor:n,head:o}=r,l=this.toEditorPos(s.updateRangeStart),c=this.toEditorPos(s.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:s.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>s.text.length;l==this.from&&n<this.from?l=n:c==this.to&&n>this.to&&(c=n);let d=$L(e.state.sliceDoc(l,c),s.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let g=ne.single(this.toEditorPos(s.selectionStart),this.toEditorPos(s.selectionEnd));Pm(g,r)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:d.from+l,to:d.toA+l,insert:Je.of(s.text.slice(d.from,d.toB).split(`
|
|
67
|
-
`))};if((_e.mac||_e.android)&&m.from==o-1&&/^\. ?$/.test(s.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:l,to:c,insert:Je.of([s.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);pS(e,m,ne.single(this.toEditorPos(s.selectionStart,g),this.toEditorPos(s.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,s.updateRangeStart-1),Math.min(i.text.length,s.updateRangeStart+1)))&&this.handlers.compositionend(s)},this.handlers.characterboundsupdate=s=>{let r=[],n=null;for(let o=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);o<l;o++){let c=e.coordsForChar(o);n=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||n||new DOMRect,r.push(n)}i.updateCharacterBounds(s.rangeStart,r)},this.handlers.textformatupdate=s=>{let r=[];for(let n of s.getTextFormats()){let o=n.underlineStyle,l=n.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(n.rangeStart),u=this.toEditorPos(n.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(Te.mark({attributes:{style:d}}).range(c,u))}}}e.dispatch({effects:CL.of(Te.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:s}=this.composing;this.composing=null,s&&this.reset(e.state)}};for(let s in this.handlers)i.addEventListener(s,this.handlers[s]);this.measureReq={read:s=>{this.editContext.updateControlBounds(s.contentDOM.getBoundingClientRect());let r=Vu(s.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,s=!1,r=this.pendingContextChange;return e.changes.iterChanges((n,o,l,c,u)=>{if(s)return;let d=u.length-(o-n);if(r&&o>=r.to)if(r.from==n&&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(n+=i,o+=i,o<=this.from)this.from+=d,this.to+=d;else if(n<this.to){if(n<this.from||o>this.to||this.to-this.from+u.length>3e4){s=!0;return}this.editContext.updateText(this.toContextPos(n),this.toContextPos(o),u.toString()),this.to+=d}i+=d}),r&&!s&&this.revertPending(e.state),!s}update(e){let i=this.pendingContextChange,s=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(s.from,s.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,s=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),r=this.toContextPos(i.head);(this.editContext.selectionStart!=s||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(s,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 s=this.composing;return s&&s.drifted?s.editorBase+(e-s.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 pe{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:s}=e;this.dispatchTransactions=e.dispatchTransactions||s&&(r=>r.forEach(n=>s(n,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||MZ(e.parent)||document,this.viewState=new CT(e.state||We.create(e)),e.scrollTo&&e.scrollTo.is(lp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(th).map(r=>new bv(r));for(let r of this.plugins)r.update(this);this.observer=new G9(this),this.inputState=new y9(this),this.inputState.ensureHandlers(this.plugins),this.docView=new fT(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 Yt?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,s=!1,r,n=this.state;for(let g of e){if(g.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=g.state}if(this.destroyed){this.viewState.state=n;return}let o=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(XL))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=VL(n,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(n.doc)||!this.state.selection.eq(n.selection))&&(d=null)):this.observer.clear(),n.facet(We.phrases)!=this.state.facet(We.phrases))return this.setState(n);r=Mm.create(this,n,e),r.flags|=l;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:v}=g.state.selection;m=new uh(v.empty?v:ne.cursor(v.head,v.head>v.anchor?-1:1))}for(let v of g.effects)v.is(lp)&&(m=v.value.clip(this.state))}this.viewState.update(r,m),this.bidiCache=Qm.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),i=this.docView.update(r),this.state.facet(lu)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(pp)!=r.state.facet(pp)&&(this.viewState.mustMeasureContent=!0),(i||s||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!r.empty)for(let g of this.state.facet(K1))try{g(r)}catch(v){Os(this.state,v,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!LL(this,d)&&u.force&&ch(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 s of this.plugins)s.destroy(this);this.viewState=new CT(e),this.plugins=e.facet(th).map(s=>new bv(s)),this.pluginMap.clear();for(let s of this.plugins)s.update(this);this.docView.destroy(),this.docView=new fT(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(th),s=e.state.facet(th);if(i!=s){let r=[];for(let n of s){let o=i.indexOf(n);if(o<0)r.push(new bv(n));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let n of this.plugins)n.mustUpdate!=e&&n.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!=s&&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(s){Os(this.state,s,"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,s=this.scrollDOM,r=s.scrollTop*this.scaleY,{scrollAnchorPos:n,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(lL(s))n=-1,o=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(r);n=v.from,o=v.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(v=>{try{return v.read(this)}catch(y){return Os(this.state,y),ET}}),m=Mm.create(this,this.state,[]),g=!1;m.flags|=c,i?i.flags|=c:i=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let v=0;v<u.length;v++)if(d[v]!=ET)try{let y=u[v];y.write&&y.write(d[v],this)}catch(y){Os(this.state,y)}if(g&&this.docView.updateSelection(!0),!m.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 y=(n<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(n).top)-o;if(y>1||y<-1){r=r+y,s.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(K1))l(i)}get themeClasses(){return ry+" "+(this.state.facet(sy)?WL:qL)+" "+this.state.facet(pp)}updateAttrs(){let e=PT(this,kL,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),i={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Dn)?"true":"false",class:"cm-content",style:`${_e.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(i["aria-readonly"]="true"),PT(this,uS,i);let s=this.observer.ignore(()=>{let r=oT(this.contentDOM,this.contentAttrs,i),n=oT(this.dom,this.editorAttrs,e);return r||n});return this.editorAttrs=e,this.contentAttrs=i,s}showAnnouncements(e){let i=!0;for(let s of e)for(let r of s.effects)if(r.is(pe.announce)){i&&(this.announceDOM.textContent=""),i=!1;let n=this.announceDOM.appendChild(document.createElement("div"));n.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(lu);let e=this.state.facet(pe.cspNonce);Io.mount(this.root,this.styleModules.concat(H9).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(s=>s.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,s){return Cv(this,e,dT(this,e,i,s))}moveByGroup(e,i){return Cv(this,e,dT(this,e,i,s=>c9(this,e.head,s)))}visualLineSide(e,i){let s=this.bidiSpans(e),r=this.textDirectionAt(e.from),n=s[i?s.length-1:0];return ne.cursor(n.side(i,r)+e.from,n.forward(!i,r)?1:-1)}moveToLineBoundary(e,i,s=!0){return h9(this,e,i,s)}moveVertically(e,i,s){return Cv(this,e,u9(this,e,i,s))}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 s=ty(this,e,i);return s&&s.pos}posAndSideAtCoords(e,i=!0){return this.readMeasured(),ty(this,e,i)}coordsAtPos(e,i=1){this.readMeasured();let s=this.docView.coordsAt(e,i);if(!s||s.left==s.right)return s;let r=this.state.doc.lineAt(e),n=this.bidiSpans(r),o=n[Wr.find(n,e-r.from,-1,i)];return Zu(s,o.dir==ut.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(SL)||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>eI)return pL(e.length);let i=this.textDirectionAt(e.from),s;for(let n of this.bidiCache)if(n.from==e.from&&n.dir==i&&(n.fresh||dL(n.isolates,s=hT(this,e))))return n.order;s||(s=hT(this,e));let r=BZ(e.text,i,s);return this.bidiCache.push(new Qm(e.from,e.to,i,s,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||_e.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{aL(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 lp.of(new uh(typeof e=="number"?ne.cursor(e):e,i.y,i.x,i.yMargin,i.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:i}=this.scrollDOM,s=this.viewState.scrollAnchorAt(e);return lp.of(new uh(ne.cursor(s.from),"start","start",s.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 Nt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Nt.define(()=>({}),{eventObservers:e})}static theme(e,i){let s=Io.newName(),r=[pp.of(s),lu.of(ny(`.${s}`,e))];return i&&i.dark&&r.push(sy.of(!0)),r}static baseTheme(e){return Wn.lowest(lu.of(ny("."+ry,e,UL)))}static findFromDOM(e){var i;let s=e.querySelector(".cm-content"),r=s&&Ht.get(s)||Ht.get(e);return((i=r==null?void 0:r.root)===null||i===void 0?void 0:i.view)||null}}pe.styleModule=lu;pe.inputHandler=yL;pe.clipboardInputFilter=hS;pe.clipboardOutputFilter=cS;pe.scrollHandler=wL;pe.focusChangeEffect=bL;pe.perLineTextDirection=SL;pe.exceptionSink=_L;pe.updateListener=K1;pe.editable=Dn;pe.mouseSelectionStyle=vL;pe.dragMovesSelection=OL;pe.clickAddsSelectionRange=gL;pe.decorations=gg;pe.blockWrappers=TL;pe.outerDecorations=fS;pe.atomicRanges=Sf;pe.bidiIsolatedRanges=ML;pe.scrollMargins=AL;pe.darkTheme=sy;pe.cspNonce=ve.define({combine:t=>t.length?t[0]:""});pe.contentAttributes=uS;pe.editorAttributes=kL;pe.lineWrapping=pe.contentAttributes.of({class:"cm-lineWrapping"});pe.announce=Qe.define();const eI=4096,ET={};class Qm{constructor(e,i,s,r,n,o){this.from=e,this.to=i,this.dir=s,this.isolates=r,this.fresh=n,this.order=o}static update(e,i){if(i.empty&&!e.some(n=>n.fresh))return e;let s=[],r=e.length?e[e.length-1].dir:ut.LTR;for(let n=Math.max(0,e.length-10);n<e.length;n++){let o=e[n];o.dir==r&&!i.touchesRange(o.from,o.to)&&s.push(new Qm(i.mapPos(o.from,1),i.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return s}}function PT(t,e,i){for(let s=t.state.facet(e),r=s.length-1;r>=0;r--){let n=s[r],o=typeof n=="function"?n(t):n;o&&oS(o,i)}return i}const tI=_e.mac?"mac":_e.windows?"win":_e.linux?"linux":"key";function iI(t,e){const i=t.split(/-(?!$)/);let s=i[i.length-1];s=="Space"&&(s=" ");let r,n,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))n=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))e=="mac"?l=!0:n=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(s="Alt-"+s),n&&(s="Ctrl-"+s),l&&(s="Meta-"+s),o&&(s="Shift-"+s),s}function mp(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 sI=Wn.default(pe.domEventHandlers({keydown(t,e){return HL(YL(e.state),t,e,"editor")}})),Ka=ve.define({enables:sI}),RT=new WeakMap;function YL(t){let e=t.facet(Ka),i=RT.get(e);return i||RT.set(e,i=oI(e.reduce((s,r)=>s.concat(r),[]))),i}function rI(t,e,i){return HL(YL(t.state),e,t,i)}let Bo=null;const nI=4e3;function oI(t,e=tI){let i=Object.create(null),s=Object.create(null),r=(o,l)=>{let c=s[o];if(c==null)s[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")},n=(o,l,c,u,d)=>{var m,g;let v=i[o]||(i[o]=Object.create(null)),y=l.split(/ (?!$)/).map(C=>iI(C,e));for(let C=1;C<y.length;C++){let T=y.slice(0,C).join(" ");r(T,!0),v[T]||(v[T]={preventDefault:!0,stopPropagation:!1,run:[M=>{let k=Bo={view:M,prefix:T,scope:o};return setTimeout(()=>{Bo==k&&(Bo=null)},nI),!0}]})}let b=y.join(" ");r(b,!1);let w=v[b]||(v[b]={preventDefault:!1,stopPropagation:!1,run:((g=(m=v._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});c&&w.run.push(c),u&&(w.preventDefault=!0),d&&(w.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:m}=o;for(let g in d)d[g].run.push(v=>m(v,oy))}let c=o[e]||o.key;if(c)for(let u of l)n(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&n(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return i}let oy=null;function HL(t,e,i,s){oy=e;let r=_Z(e),n=ps(r,0),o=Ir(n)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;Bo&&Bo.view==i&&Bo.scope==s&&(l=Bo.prefix+" ",DL.indexOf(e.keyCode)<0&&(u=!0,Bo=null));let m=new Set,g=w=>{if(w){for(let C of w.run)if(!m.has(C)&&(m.add(C),C(i)))return w.stopPropagation&&(d=!0),!0;w.preventDefault&&(w.stopPropagation&&(d=!0),u=!0)}return!1},v=t[s],y,b;return v&&(g(v[l+mp(r,e,!o)])?c=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(_e.windows&&e.ctrlKey&&e.altKey)&&!(_e.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=qo[e.keyCode])&&y!=r?(g(v[l+mp(y,e,!0)])||e.shiftKey&&(b=ju[e.keyCode])!=r&&b!=y&&g(v[l+mp(b,e,!1)]))&&(c=!0):o&&e.shiftKey&&g(v[l+mp(r,e,!0)])&&(c=!0),!c&&g(v._any)&&(c=!0)),u&&(c=!0),c&&d&&e.stopPropagation(),oy=null,c}class xf{constructor(e,i,s,r,n){this.className=e,this.left=i,this.top=s,this.width=r,this.height=n}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,s){if(s.empty){let r=e.coordsAtPos(s.head,s.assoc||1);if(!r)return[];let n=FL(e);return[new xf(i,r.left-n.left,r.top-n.top,null,r.bottom-r.top)]}else return aI(e,i,s)}}function FL(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==ut.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function QT(t,e,i,s){let r=t.coordsAtPos(e,i*2);if(!r)return s;let n=t.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=t.posAtCoords({x:n.left+1,y:o}),c=t.posAtCoords({x:n.right-1,y:o});return l==null||c==null?s:{from:Math.max(s.from,Math.min(l,c)),to:Math.min(s.to,Math.max(l,c))}}function aI(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let s=Math.max(i.from,t.viewport.from),r=Math.min(i.to,t.viewport.to),n=t.textDirection==ut.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),c=FL(t),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),m=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=l.right-(d?parseInt(d.paddingRight):0),v=ey(t,s,1),y=ey(t,r,-1),b=v.type==zi.Text?v:null,w=y.type==zi.Text?y:null;if(b&&(t.lineWrapping||v.widgetLineBreaks)&&(b=QT(t,s,1,b)),w&&(t.lineWrapping||y.widgetLineBreaks)&&(w=QT(t,r,-1,w)),b&&w&&b.from==w.from&&b.to==w.to)return T(M(i.from,i.to,b));{let P=b?M(i.from,null,b):k(v,!1),E=w?M(null,i.to,w):k(y,!0),z=[];return(b||v).to<(w||y).from-(b&&w?1:0)||v.widgetLineBreaks>1&&P.bottom+t.defaultLineHeight/2<E.top?z.push(C(m,P.bottom,g,E.top)):P.bottom<E.top&&t.elementAtHeight((P.bottom+E.top)/2).type==zi.Text&&(P.bottom=E.top=(P.bottom+E.top)/2),T(P).concat(z).concat(T(E))}function C(P,E,z,$){return new xf(e,P-c.left,E-c.top,Math.max(0,z-P),$-E)}function T({top:P,bottom:E,horizontal:z}){let $=[];for(let Z=0;Z<z.length;Z+=2)$.push(C(z[Z],P,z[Z+1],E));return $}function M(P,E,z){let $=1e9,Z=-1e9,ie=[];function F(D,I,L,j,U){let Y=t.coordsAtPos(D,D==z.to?-2:2),W=t.coordsAtPos(L,L==z.from?2:-2);!Y||!W||($=Math.min(Y.top,W.top,$),Z=Math.max(Y.bottom,W.bottom,Z),U==ut.LTR?ie.push(n&&I?m:Y.left,n&&j?g:W.right):ie.push(!n&&j?m:W.left,!n&&I?g:Y.right))}let R=P??z.from,Q=E??z.to;for(let D of t.visibleRanges)if(D.to>R&&D.from<Q)for(let I=Math.max(D.from,R),L=Math.min(D.to,Q);;){let j=t.state.doc.lineAt(I);for(let U of t.bidiSpans(j)){let Y=U.from+j.from,W=U.to+j.from;if(Y>=L)break;W>I&&F(Math.max(Y,I),P==null&&Y<=R,Math.min(W,L),E==null&&W>=Q,U.dir)}if(I=j.to+1,I>=L)break}return ie.length==0&&F(R,P==null,Q,E==null,t.textDirection),{top:$,bottom:Z,horizontal:ie}}function k(P,E){let z=l.top+(E?P.top:P.bottom);return{top:z,bottom:z,horizontal:[]}}}function lI(t,e){return t.constructor==e.constructor&&t.eq(e)}class hI{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(Fp)!=e.state.facet(Fp)&&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,s=e.facet(Fp);for(;i<s.length&&s[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,s)=>!lI(i,this.drawn[s]))){let i=this.dom.firstChild,s=0;for(let r of e)r.update&&i&&r.constructor&&this.drawn[s].constructor&&r.update(i,this.drawn[s])?(i=i.nextSibling,s++):this.dom.insertBefore(r.draw(),i);for(;i;){let r=i.nextSibling;i.remove(),i=r}this.drawn=e,_e.safari&&_e.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 Fp=ve.define();function GL(t){return[Nt.define(e=>new hI(e,t)),Fp.of(t)]}const qu=ve.define({combine(t){return on(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,i)=>Math.min(e,i),drawRangeCursor:(e,i)=>e||i})}});function cI(t={}){return[qu.of(t),uI,fI,dI,xL.of(!0)]}function KL(t){return t.startState.facet(qu)!=t.state.facet(qu)}const uI=GL({above:!0,markers(t){let{state:e}=t,i=e.facet(qu),s=[];for(let r of e.selection.ranges){let n=r==e.selection.main;if(r.empty||i.drawRangeCursor){let o=n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:ne.cursor(r.head,r.head>r.anchor?-1:1);for(let c of xf.forRange(t,o,l))s.push(c)}}return s},update(t,e){t.transactions.some(s=>s.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let i=KL(t);return i&<(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){LT(e.state,t)},class:"cm-cursorLayer"});function LT(t,e){e.style.animationDuration=t.facet(qu).cursorBlinkRate+"ms"}const fI=GL({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:xf.forRange(t,"cm-selectionBackground",e)).reduce((e,i)=>e.concat(i))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||KL(t)},class:"cm-selectionLayer"}),dI=Wn.highest(pe.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"}}}})),JL=Qe.define({map(t,e){return t==null?null:e.mapPos(t)}}),uu=Si.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((i,s)=>s.is(JL)?s.value:i,t)}}),pI=Nt.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(uu);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(uu)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(uu),i=e!=null&&t.coordsAtPos(e);if(!i)return null;let s=t.scrollDOM.getBoundingClientRect();return{left:i.left-s.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-s.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(uu)!=t&&this.view.dispatch({effects:JL.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 mI(){return[uu,pI]}function $T(t,e,i,s,r){e.lastIndex=0;for(let n=t.iterRange(i,s),o=i,l;!n.next().done;o+=n.value.length)if(!n.lineBreak)for(;l=e.exec(n.value);)r(o+l.index,l)}function gI(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 s=[];for(let{from:r,to:n}of i)r=Math.max(t.state.doc.lineAt(r).from,r-e),n=Math.min(t.state.doc.lineAt(n).to,n+e),s.length&&s[s.length-1].to>=r?s[s.length-1].to=n:s.push({from:r,to:n});return s}class OI{constructor(e){const{regexp:i,decoration:s,decorate:r,boundary:n,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 s=="function")this.addMatch=(l,c,u,d)=>{let m=s(l,c,u);m&&d(u,u+l[0].length,m)};else if(s)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,s);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=n,this.maxLength=o}createDeco(e){let i=new Zn,s=i.add.bind(i);for(let{from:r,to:n}of gI(e,this.maxLength))$T(e.state.doc,this.regexp,r,n,(o,l)=>this.addMatch(l,e,o,s));return i.finish()}updateDeco(e,i){let s=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((n,o,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(s=Math.min(l,s),r=Math.max(c,r))}),e.viewportMoved||r-s>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,i.map(e.changes),s,r):i}updateRange(e,i,s,r){for(let n of e.visibleRanges){let o=Math.max(n.from,s),l=Math.min(n.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(n.from,c.from),m=Math.min(n.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])){m=l;break}}let g=[],v,y=(b,w,C)=>g.push(C.range(b,w));if(c==u)for(this.regexp.lastIndex=d-c.from;(v=this.regexp.exec(c.text))&&v.index<m-c.from;)this.addMatch(v,e,v.index+c.from,y);else $T(e.state.doc,this.regexp,d,m,(b,w)=>this.addMatch(w,e,b,y));i=i.update({filterFrom:d,filterTo:m,filter:(b,w)=>b<d||w>m,add:g})}}return i}}const ay=/x/.unicode!=null?"gu":"g",vI=new RegExp(`[\0-\b
|
|
68
|
-
--\u2028\u2029\uFEFF-]`,ay),_I={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 Mv=null;function yI(){var t;if(Mv==null&&typeof document<"u"&&document.body){let e=document.body.style;Mv=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Mv||!1}const Gp=ve.define({combine(t){let e=on(t,{render:null,specialChars:vI,addSpecialChars:null});return(e.replaceTabs=!yI())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,ay)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,ay)),e}});function bI(t={}){return[Gp.of(t),SI()]}let BT=null;function SI(){return BT||(BT=Nt.fromClass(class{constructor(t){this.view=t,this.decorations=Te.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Gp)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new OI({regexp:t.specialChars,decoration:(e,i,s)=>{let{doc:r}=i.state,n=ps(e[0],0);if(n==9){let o=r.lineAt(s),l=i.state.tabSize,c=xr(o.text,l,s-o.from);return Te.replace({widget:new kI((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[n]||(this.decorationCache[n]=Te.replace({widget:new CI(t,n)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Gp);t.startState.facet(Gp)!=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 xI="•";function wI(t){return t>=32?xI:t==10?"":String.fromCharCode(9216+t)}class CI extends kr{constructor(e,i){super(),this.options=e,this.code=i}eq(e){return e.code==this.code}toDOM(e){let i=wI(this.code),s=e.state.phrase("Control character")+" "+(_I[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,s,i);if(r)return r;let n=document.createElement("span");return n.textContent=i,n.title=s,n.setAttribute("aria-label",s),n.className="cm-specialChar",n}ignoreEvent(){return!1}}class kI extends kr{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 TI(){return AI}const MI=Te.line({class:"cm-activeLine"}),AI=Nt.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 s of t.state.selection.ranges){let r=t.lineBlockAt(s.head);r.from>e&&(i.push(MI.range(r.from)),e=r.from)}return Te.set(i)}},{decorations:t=>t.decorations});class EI extends kr{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?ku(e.firstChild):[];if(!i.length)return null;let s=window.getComputedStyle(e.parentNode),r=Zu(i[0],s.direction!="rtl"),n=parseInt(s.lineHeight);return r.bottom-r.top>n*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+n}:r}ignoreEvent(){return!1}}function PI(t){let e=Nt.fromClass(class{constructor(i){this.view=i,this.placeholder=t?Te.set([Te.widget({widget:new EI(t),side:1}).range(0)]):Te.none}get decorations(){return this.view.state.doc.length?Te.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,pe.contentAttributes.of({"aria-placeholder":t})]:e}const ly=2e3;function RI(t,e,i){let s=Math.min(e.line,i.line),r=Math.max(e.line,i.line),n=[];if(e.off>ly||i.off>ly||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let c=s;c<=r;c++){let u=t.doc.line(c);u.length<=l&&n.push(ne.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=s;c<=r;c++){let u=t.doc.line(c),d=X1(u.text,o,t.tabSize,!0);if(d<0)n.push(ne.cursor(u.to));else{let m=X1(u.text,l,t.tabSize);n.push(ne.range(u.from+d,u.from+m))}}}return n}function QI(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function DT(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),s=t.state.doc.lineAt(i),r=i-s.from,n=r>ly?-1:r==s.length?QI(t,e.clientX):xr(s.text,t.state.tabSize,i-s.from);return{line:s.number,col:n,off:r}}function LI(t,e){let i=DT(t,e),s=t.state.selection;return i?{update(r){if(r.docChanged){let n=r.changes.mapPos(r.startState.doc.line(i.line).from),o=r.state.doc.lineAt(n);i={line:o.number,col:i.col,off:Math.min(i.off,o.length)},s=s.map(r.changes)}},get(r,n,o){let l=DT(t,r);if(!l)return s;let c=RI(t.state,i,l);return c.length?o?ne.create(c.concat(s.ranges)):ne.create(c):s}}:null}function $I(t){let e=(i=>i.altKey&&i.button==0);return pe.mouseSelectionStyle.of((i,s)=>e(s)?LI(i,s):null)}const BI={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},DI={style:"cursor: crosshair"};function zI(t={}){let[e,i]=BI[t.key||"Alt"],s=Nt.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[s,pe.contentAttributes.of(r=>{var n;return!((n=r.plugin(s))===null||n===void 0)&&n.isDown?DI:null})]}const gp="-10000px";class e3{constructor(e,i,s,r){this.facet=i,this.createTooltipView=s,this.removeTooltipView=r,this.input=e.state.facet(i),this.tooltips=this.input.filter(o=>o);let n=null;this.tooltipViews=this.tooltips.map(o=>n=s(o,n))}update(e,i){var s;let r=e.state.facet(this.facet),n=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<n.length;c++){let u=n[c],d=-1;if(u){for(let m=0;m<this.tooltips.length;m++){let g=this.tooltips[m];g&&g.create==u.create&&(d=m)}if(d<0)o[c]=this.createTooltipView(u,c?o[c-1]:null),l&&(l[c]=!!u.above);else{let m=o[c]=this.tooltipViews[d];l&&(l[c]=i[d]),m.update&&m.update(e)}}}for(let c of this.tooltipViews)o.indexOf(c)<0&&(this.removeTooltipView(c),(s=c.destroy)===null||s===void 0||s.call(c));return i&&(l.forEach((c,u)=>i[u]=c),i.length=l.length),this.input=r,this.tooltips=n,this.tooltipViews=o,!0}}function NI(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Av=ve.define({combine:t=>{var e,i,s;return{position:_e.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:((s=t.find(r=>r.tooltipSpace))===null||s===void 0?void 0:s.tooltipSpace)||NI}}}),zT=new WeakMap,OS=Nt.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(Av);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 e3(t,vS,(i,s)=>this.createTooltip(i,s),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,s=t.state.facet(Av);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;i=!0}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.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),s=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=gp,i.dom.style.left="0px",this.container.insertBefore(i.dom,s),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 s of this.manager.tooltipViews)s.dom.remove(),(t=s.destroy)===null||t===void 0||t.call(s);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:n}=this.manager.tooltipViews[0];if(_e.safari){let o=n.getBoundingClientRect();i=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else i=!!n.offsetParent&&n.offsetParent!=this.container.ownerDocument.body}if(i||this.position=="absolute")if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(t=n.width/this.parent.offsetWidth,e=n.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let s=this.view.scrollDOM.getBoundingClientRect(),r=dS(this.view);return{visible:{left:s.left+r.left,top:s.top+r.top,right:s.right-r.right,bottom:s.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((n,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(n.pos):this.view.coordsAtPos(n.pos)}),size:this.manager.tooltipViews.map(({dom:n})=>n.getBoundingClientRect()),space:this.view.state.facet(Av).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:s,scaleX:r,scaleY:n}=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,m=t.pos[l],g=t.size[l];if(!m||c.clip!==!1&&(m.bottom<=Math.max(i.top,s.top)||m.top>=Math.min(i.bottom,s.bottom)||m.right<Math.max(i.left,s.left)-.1||m.left>Math.min(i.right,s.right)+.1)){d.style.top=gp;continue}let v=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,y=v?7:0,b=g.right-g.left,w=(e=zT.get(u))!==null&&e!==void 0?e:g.bottom-g.top,C=u.offset||XI,T=this.view.textDirection==ut.LTR,M=g.width>s.right-s.left?T?s.left:s.right-g.width:T?Math.max(s.left,Math.min(m.left-(v?14:0)+C.x,s.right-b)):Math.min(Math.max(s.left,m.left-b+(v?14:0)-C.x),s.right-b),k=this.above[l];!c.strictSide&&(k?m.top-w-y-C.y<s.top:m.bottom+w+y+C.y>s.bottom)&&k==s.bottom-m.bottom>m.top-s.top&&(k=this.above[l]=!k);let P=(k?m.top-s.top:s.bottom-m.bottom)-y;if(P<w&&u.resize!==!1){if(P<this.view.defaultLineHeight){d.style.top=gp;continue}zT.set(u,w),d.style.height=(w=P)/n+"px"}else d.style.height&&(d.style.height="");let E=k?m.top-w-y-C.y:m.bottom+y+C.y,z=M+b;if(u.overlap!==!0)for(let $ of o)$.left<z&&$.right>M&&$.top<E+w&&$.bottom>E&&(E=k?$.top-w-2-y:$.bottom+y+2);if(this.position=="absolute"?(d.style.top=(E-t.parent.top)/n+"px",NT(d,(M-t.parent.left)/r)):(d.style.top=E/n+"px",NT(d,M/r)),v){let $=m.left+(T?C.x:-C.x)-(M+14-7);v.style.left=$/r+"px"}u.overlap!==!0&&o.push({left:M,top:E,right:z,bottom:E+w}),d.classList.toggle("cm-tooltip-above",k),d.classList.toggle("cm-tooltip-below",!k),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=gp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function NT(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const jI=pe.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"}}}),XI={x:0,y:0},vS=ve.define({enables:[OS,jI]}),Lm=ve.define({combine:t=>t.reduce((e,i)=>e.concat(i),[])});class yg{static create(e){return new yg(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new e3(e,Lm,(i,s)=>this.createHostedView(i,s),i=>i.dom.remove())}createHostedView(e,i){let s=e.create(this.view);return s.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(s.dom,i?i.dom.nextSibling:this.dom.firstChild),this.mounted&&s.mount&&s.mount(this.view),s}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 s of this.manager.tooltipViews){let r=s[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 VI=vS.compute([Lm],t=>{let e=t.facet(Lm);return e.length===0?null:{pos:Math.min(...e.map(i=>i.pos)),end:Math.max(...e.map(i=>{var s;return(s=i.end)!==null&&s!==void 0?s:i.pos})),create:yg.create,above:e[0].above,arrow:e.some(i=>i.arrow)}});class ZI{constructor(e,i,s,r,n){this.view=e,this.source=i,this.field=s,this.setHover=r,this.hoverTime=n,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,s=e.docView.tile.nearest(i.target);if(!s)return;let r,n=1;if(s.isWidget())r=s.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==ut.RTL?-1:1;n=i.x<l.left?-u:u}let o=this.source(e,r,n);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=>Os(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(OS),i=e?e.manager.tooltips.findIndex(s=>s.create==yg.create):-1;return i>-1?e.manager.tooltipViews[i]:null}mousemove(e){var i,s;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:n}=this;if(r.length&&n&&!II(n.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(s=(i=r[0])===null||i===void 0?void 0:i.end)!==null&&s!==void 0?s:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!qI(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:s}=this;s&&s.dom.contains(e.relatedTarget)?this.watchTooltipLeave(s.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let i=s=>{e.removeEventListener("mouseleave",i),this.active.length&&!this.view.dom.contains(s.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 Op=4;function II(t,e){let{left:i,right:s,top:r,bottom:n}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),n=Math.max(l.bottom,n)}return e.clientX>=i-Op&&e.clientX<=s+Op&&e.clientY>=r-Op&&e.clientY<=n+Op}function qI(t,e,i,s,r,n){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>s||o.right<s||o.top>r||Math.min(o.bottom,l)<r)return!1;let c=t.posAtCoords({x:s,y:r},!1);return c>=e&&c<=i}function WI(t,e={}){let i=Qe.define(),s=Si.define({create(){return[]},update(r,n){if(r.length&&(e.hideOnChange&&(n.docChanged||n.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(n,o))),n.docChanged)){let o=[];for(let l of r){let c=n.changes.mapPos(l.pos,-1,Bi.TrackDel);if(c!=null){let u=Object.assign(Object.create(null),l);u.pos=c,u.end!=null&&(u.end=n.changes.mapPos(u.end)),o.push(u)}}r=o}for(let o of n.effects)o.is(i)&&(r=o.value),o.is(UI)&&(r=[]);return r},provide:r=>Lm.from(r)});return{active:s,extension:[s,Nt.define(r=>new ZI(r,t,s,i,e.hoverTime||300)),VI]}}function t3(t,e){let i=t.plugin(OS);if(!i)return null;let s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s]}const UI=Qe.define(),jT=ve.define({combine(t){let e,i;for(let s of t)e=e||s.topContainer,i=i||s.bottomContainer;return{topContainer:e,bottomContainer:i}}});function _S(t,e){let i=t.plugin(i3),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null}const i3=Nt.fromClass(class{constructor(t){this.input=t.state.facet(Wu),this.specs=this.input.filter(i=>i),this.panels=this.specs.map(i=>i(t));let e=t.state.facet(jT);this.top=new vp(t,!0,e.topContainer),this.bottom=new vp(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(jT);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new vp(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new vp(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(Wu);if(i!=this.input){let s=i.filter(c=>c),r=[],n=[],o=[],l=[];for(let c of s){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?n:o).push(d)}this.specs=s,this.panels=r,this.top.sync(n),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let s of this.panels)s.update&&s.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>pe.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class vp{constructor(e,i,s){this.view=e,this.top=i,this.container=s,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=XT(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=XT(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 XT(t){let e=t.nextSibling;return t.remove(),e}const Wu=ve.define({enables:i3});function YI(t,e){let i,s=new Promise(o=>i=o),r=o=>HI(o,e,i);t.state.field(Ev,!1)?t.dispatch({effects:s3.of(r)}):t.dispatch({effects:Qe.appendConfig.of(Ev.init(()=>[r]))});let n=r3.of(r);return{close:n,result:s.then(o=>((t.win.queueMicrotask||(c=>t.win.setTimeout(c,10)))(()=>{t.state.field(Ev).indexOf(r)>-1&&t.dispatch({effects:n})}),o))}}const Ev=Si.define({create(){return[]},update(t,e){for(let i of e.effects)i.is(s3)?t=[i.value].concat(t):i.is(r3)&&(t=t.filter(s=>s!=i.value));return t},provide:t=>Wu.computeN([t],e=>e.field(t))}),s3=Qe.define(),r3=Qe.define();function HI(t,e,i){let s=e.content?e.content(t,()=>o(null)):null;if(!s){if(s=lt("form"),e.input){let l=lt("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),s.appendChild(lt("label",(e.label||"")+": ",l))}else s.appendChild(document.createTextNode(e.label||""));s.appendChild(document.createTextNode(" ")),s.appendChild(lt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=s.nodeName=="FORM"?[s]:s.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 n=lt("div",s,lt("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(n.className=e.class),n.classList.add("cm-dialog");function o(l){n.contains(n.ownerDocument.activeElement)&&t.focus(),i(l)}return{dom:n,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=s.querySelector(e.focus):l=s.querySelector("input")||s.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class qn extends Zo{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}qn.prototype.elementClass="";qn.prototype.toDOM=void 0;qn.prototype.mapMode=Bi.TrackBefore;qn.prototype.startSide=qn.prototype.endSide=-1;qn.prototype.point=!0;const Kp=ve.define(),FI=ve.define(),GI={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ze.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Au=ve.define();function KI(t){return[n3(),Au.of({...GI,...t})]}const VT=ve.define({combine:t=>t.some(e=>e)});function n3(t){return[JI]}const JI=Nt.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(Au).map(e=>new IT(t,e)),this.fixed=!t.state.facet(VT);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,s=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(s<(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(VT)!=!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=Ze.iter(this.view.state.facet(Kp),this.view.viewport.from),s=[],r=this.gutters.map(n=>new eq(n,this.view.viewport,-this.view.documentPadding.top));for(let n of this.view.viewportLineBlocks)if(s.length&&(s=[]),Array.isArray(n.type)){let o=!0;for(let l of n.type)if(l.type==zi.Text&&o){hy(i,s,l.from);for(let c of r)c.line(this.view,l,s);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(n.type==zi.Text){hy(i,s,n.from);for(let o of r)o.line(this.view,n,s)}else if(n.widget)for(let o of r)o.widget(this.view,n);for(let n of r)n.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Au),i=t.state.facet(Au),s=t.docChanged||t.heightChanged||t.viewportChanged||!Ze.eq(t.startState.facet(Kp),t.state.facet(Kp),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let r of this.gutters)r.update(t)&&(s=!0);else{s=!0;let r=[];for(let n of i){let o=e.indexOf(n);o<0?r.push(new IT(this.view,n)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let n of this.gutters)n.dom.remove(),r.indexOf(n)<0&&n.destroy();for(let n of r)n.config.side=="after"?this.getDOMAfter().appendChild(n.dom):this.dom.appendChild(n.dom);this.gutters=r}return s}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>pe.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||i.gutters.length==0||!i.fixed)return null;let s=i.dom.offsetWidth*e.scaleX,r=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==ut.LTR?{left:s,right:r}:{right:s,left:r}})});function ZT(t){return Array.isArray(t)?t:[t]}function hy(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class eq{constructor(e,i,s){this.gutter=e,this.height=s,this.i=0,this.cursor=Ze.iter(e.markers,i.from)}addElement(e,i,s){let{gutter:r}=this,n=(i.top-this.height)/e.scaleY,o=i.height/e.scaleY;if(this.i==r.elements.length){let l=new o3(e,o,n,s);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,n,s);this.height=i.bottom,this.i++}line(e,i,s){let r=[];hy(this.cursor,r,i.from),s.length&&(r=r.concat(s));let n=this.gutter.config.lineMarker(e,i,r);n&&r.unshift(n);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,i,r)}widget(e,i){let s=this.gutter.config.widgetMarker(e,i.widget,i),r=s?[s]:null;for(let n of e.state.facet(FI)){let o=n(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 IT{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 s in i.domEventHandlers)this.dom.addEventListener(s,r=>{let n=r.target,o;if(n!=this.dom&&this.dom.contains(n)){for(;n.parentNode!=this.dom;)n=n.parentNode;let c=n.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);i.domEventHandlers[s](e,l,r)&&r.preventDefault()});this.markers=ZT(i.markers(e)),i.initialSpacer&&(this.spacer=new o3(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=ZT(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 s=e.view.viewport;return!Ze.eq(this.markers,i,s.from,s.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class o3{constructor(e,i,s,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,i,s,r)}update(e,i,s,r){this.height!=i&&(this.height=i,this.dom.style.height=i+"px"),this.above!=s&&(this.dom.style.marginTop=(this.above=s)?s+"px":""),tq(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,i){let s="cm-gutterElement",r=this.dom.firstChild;for(let n=0,o=0;;){let l=o,c=n<i.length?i[n++]:null,u=!1;if(c){let d=c.elementClass;d&&(s+=" "+d);for(let m=o;m<this.markers.length;m++)if(this.markers[m].compare(c)){l=m,u=!0;break}}else l=this.markers.length;for(;o<l;){let d=this.markers[o++];if(d.toDOM){d.destroy(r);let m=r.nextSibling;r.remove(),r=m}}if(!c)break;c.toDOM&&(u?r=r.nextSibling:this.dom.insertBefore(c.toDOM(e),r)),u&&o++}this.dom.className=s,this.markers=i}destroy(){this.setMarkers(null,[])}}function tq(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 iq=ve.define(),sq=ve.define(),ih=ve.define({combine(t){return on(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,i){let s=Object.assign({},e);for(let r in i){let n=s[r],o=i[r];s[r]=n?(l,c,u)=>n(l,c,u)||o(l,c,u):o}return s}})}});class Pv extends qn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Rv(t,e){return t.state.facet(ih).formatNumber(e,t.state)}const rq=Au.compute([ih],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(iq)},lineMarker(e,i,s){return s.some(r=>r.toDOM)?null:new Pv(Rv(e,e.state.doc.lineAt(i.from).number))},widgetMarker:(e,i,s)=>{for(let r of e.state.facet(sq)){let n=r(e,i,s);if(n)return n}return null},lineMarkerChange:e=>e.startState.facet(ih)!=e.state.facet(ih),initialSpacer(e){return new Pv(Rv(e,qT(e.state.doc.lines)))},updateSpacer(e,i){let s=Rv(i.view,qT(i.view.state.doc.lines));return s==e.number?e:new Pv(s)},domEventHandlers:t.facet(ih).domEventHandlers,side:"before"}));function nq(t={}){return[ih.of(t),n3(),rq]}function qT(t){let e=9;for(;e<t;)e=e*10+9;return e}const oq=new class extends qn{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},aq=Kp.compute(["selection"],t=>{let e=[],i=-1;for(let s of t.selection.ranges){let r=t.doc.lineAt(s.head).from;r>i&&(i=r,e.push(oq.range(r)))}return Ze.of(e)});function lq(){return aq}const a3=1024;let hq=0;class sr{constructor(e,i){this.from=e,this.to=i}}class Le{constructor(e={}){this.id=hq++,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=ri.match(e)),i=>{let s=e(i);return s===void 0?null:[this,s]}}}Le.closedBy=new Le({deserialize:t=>t.split(" ")});Le.openedBy=new Le({deserialize:t=>t.split(" ")});Le.group=new Le({deserialize:t=>t.split(" ")});Le.isolate=new Le({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Le.contextHash=new Le({perNode:!0});Le.lookAhead=new Le({perNode:!0});Le.mounted=new Le({perNode:!0});class fh{constructor(e,i,s,r=!1){this.tree=e,this.overlay=i,this.parser=s,this.bracketed=r}static get(e){return e&&e.props&&e.props[Le.mounted.id]}}const cq=Object.create(null);class ri{constructor(e,i,s,r=0){this.name=e,this.props=i,this.id=s,this.flags=r}static define(e){let i=e.props&&e.props.length?Object.create(null):cq,s=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ri(e.name||"",i,e.id,s);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[n[0].id]=n[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(Le.group);return i?i.indexOf(e)>-1:!1}return this.id==e}static match(e){let i=Object.create(null);for(let s in e)for(let r of s.split(" "))i[r]=e[s];return s=>{for(let r=s.prop(Le.group),n=-1;n<(r?r.length:0);n++){let o=i[n<0?s.name:r[n]];if(o)return o}}}}ri.none=new ri("",Object.create(null),0,8);class wf{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 s of this.types){let r=null;for(let n of e){let o=n(s);if(o){r||(r=Object.assign({},s.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 ri(s.name,r,s.id,s.flags):s)}return new wf(i)}}const _p=new WeakMap,WT=new WeakMap;var tt;(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"})(tt||(tt={}));class et{constructor(e,i,s,r,n){if(this.type=e,this.children=i,this.positions=s,this.length=r,this.props=null,n&&n.length){this.props=Object.create(null);for(let[o,l]of n)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=fh.get(this);if(e&&!e.overlay)return e.tree.toString();let i="";for(let s of this.children){let r=s.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 $m(this.topNode,e)}cursorAt(e,i=0,s=0){let r=_p.get(this)||this.topNode,n=new $m(r);return n.moveTo(e,i),_p.set(this,n._tree),n}get topNode(){return new qi(this,0,0,null)}resolve(e,i=0){let s=Uu(_p.get(this)||this.topNode,e,i,!1);return _p.set(this,s),s}resolveInner(e,i=0){let s=Uu(WT.get(this)||this.topNode,e,i,!0);return WT.set(this,s),s}resolveStack(e,i=0){return dq(this,e,i)}iterate(e){let{enter:i,leave:s,from:r=0,to:n=this.length}=e,o=e.mode||0,l=(o&tt.IncludeAnonymous)>0;for(let c=this.cursor(o|tt.IncludeAnonymous);;){let u=!1;if(c.from<=n&&c.to>=r&&(!l&&c.type.isAnonymous||i(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&s&&(l||!c.type.isAnonymous)&&s(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:SS(ri.none,this.children,this.positions,0,this.children.length,0,this.length,(i,s,r)=>new et(this.type,i,s,r,this.propValues),e.makeTree||((i,s,r)=>new et(ri.none,i,s,r)))}static build(e){return pq(e)}}et.empty=new et(ri.none,[],[],0);class yS{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 yS(this.buffer,this.index)}}class Uo{constructor(e,i,s){this.buffer=e,this.length=i,this.set=s}get type(){return ri.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],s=this.buffer[e+3],r=this.set.types[i],n=r.name;if(/\W/.test(n)&&!r.isError&&(n=JSON.stringify(n)),e+=4,s==e)return n;let o=[];for(;e<s;)o.push(this.childString(e)),e=this.buffer[e+3];return n+"("+o.join(",")+")"}findChild(e,i,s,r,n){let{buffer:o}=this,l=-1;for(let c=e;c!=i&&!(l3(n,r,o[c+1],o[c+2])&&(l=c,s>0));c=o[c+3]);return l}slice(e,i,s){let r=this.buffer,n=new Uint16Array(i-e),o=0;for(let l=e,c=0;l<i;){n[c++]=r[l++],n[c++]=r[l++]-s;let u=n[c++]=r[l++]-s;n[c++]=r[l++]-e,o=Math.max(o,u)}return new Uo(n,o,this.set)}}function l3(t,e,i,s){switch(t){case-2:return i<e;case-1:return s>=e&&i<e;case 0:return i<e&&s>e;case 1:return i<=e&&s>e;case 2:return s>e;case 4:return!0}}function Uu(t,e,i,s){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=!s&&t instanceof qi&&t.index<0?null:t.parent;if(!o)return t;t=o}let n=s?0:tt.IgnoreOverlays;if(s)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof qi&&o.index<0&&((r=l.enter(e,i,n))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,i,n);if(!o)return t;t=o}}class h3{cursor(e=0){return new $m(this,e)}getChild(e,i=null,s=null){let r=UT(this,e,i,s);return r.length?r[0]:null}getChildren(e,i=null,s=null){return UT(this,e,i,s)}resolve(e,i=0){return Uu(this,e,i,!1)}resolveInner(e,i=0){return Uu(this,e,i,!0)}matchContext(e){return cy(this.parent,e)}enterUnfinishedNodesBefore(e){let i=this.childBefore(e),s=this;for(;i;){let r=i.lastChild;if(!r||r.to!=i.to)break;r.type.isError&&r.from==r.to?(s=i,i=r.prevSibling):i=r}return s}get node(){return this}get next(){return this.parent}}class qi extends h3{constructor(e,i,s,r){super(),this._tree=e,this.from=i,this.index=s,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,s,r,n=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],m=c[e]+o.from,g;if(!(!(n&tt.EnterBracketed&&d instanceof et&&(g=fh.get(d))&&!g.overlay&&g.bracketed&&s>=m&&s<=m+d.length)&&!l3(r,s,m,m+d.length))){if(d instanceof Uo){if(n&tt.ExcludeBuffers)continue;let v=d.findChild(0,d.buffer.length,i,s-m,r);if(v>-1)return new Ur(new uq(o,d,e,m),null,v)}else if(n&tt.IncludeAnonymous||!d.type.isAnonymous||bS(d)){let v;if(!(n&tt.IgnoreMounts)&&(v=fh.get(d))&&!v.overlay)return new qi(v.tree,m,e,o);let y=new qi(d,m,e,o);return n&tt.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(i<0?d.children.length-1:0,i,s,r,n)}}}if(n&tt.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,s=0){let r;if(!(s&tt.IgnoreOverlays)&&(r=fh.get(this._tree))&&r.overlay){let n=e-this.from,o=s&tt.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((i>0||o?l<=n:l<n)&&(i<0||o?c>=n:c>n))return new qi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,i,s)}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 UT(t,e,i,s){let r=t.cursor(),n=[];if(!r.firstChild())return n;if(i!=null){for(let o=!1;!o;)if(o=r.type.is(i),!r.nextSibling())return n}for(;;){if(s!=null&&r.type.is(s))return n;if(r.type.is(e)&&n.push(r.node),!r.nextSibling())return s==null?n:[]}}function cy(t,e,i=e.length-1){for(let s=t;i>=0;s=s.parent){if(!s)return!1;if(!s.type.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}class uq{constructor(e,i,s,r){this.parent=e,this.buffer=i,this.index=s,this.start=r}}class Ur extends h3{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,s){super(),this.context=e,this._parent=i,this.index=s,this.type=e.buffer.set.types[e.buffer.buffer[s]]}child(e,i,s){let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.context.start,s);return n<0?null:new Ur(this.context,this,n)}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,s=0){if(s&tt.ExcludeBuffers)return null;let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],i>0?1:-1,e-this.context.start,i);return n<0?null:new Ur(this.context,this,n)}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 Ur(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 Ur(this.context,this._parent,e.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],i=[],{buffer:s}=this.context,r=this.index+4,n=s.buffer[this.index+3];if(n>r){let o=s.buffer[this.index+1];e.push(s.slice(r,n,o)),i.push(0)}return new et(this.type,e,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function c3(t){if(!t.length)return null;let e=0,i=t[0];for(let n=1;n<t.length;n++){let o=t[n];(o.from>i.from||o.to<i.to)&&(i=o,e=n)}let s=i instanceof qi&&i.index<0?null:i.parent,r=t.slice();return s?r[e]=s:r.splice(e,1),new fq(r,i)}class fq{constructor(e,i){this.heads=e,this.node=i}get next(){return c3(this.heads)}}function dq(t,e,i){let s=t.resolveInner(e,i),r=null;for(let n=s instanceof qi?s:s.context.parent;n;n=n.parent)if(n.index<0){let o=n.parent;(r||(r=[s])).push(o.resolve(e,i)),n=o}else{let o=fh.get(n.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new qi(o.tree,o.overlay[0].from+n.from,-1,n);(r||(r=[s])).push(Uu(l,e,i,!1))}}return r?c3(r):s}class $m{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&~tt.EnterBracketed,e instanceof qi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let s=e._parent;s;s=s._parent)this.stack.unshift(s.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:s,buffer:r}=this.buffer;return this.type=i||r.set.types[r.buffer[e]],this.from=s+r.buffer[e+1],this.to=s+r.buffer[e+2],!0}yield(e){return e?e instanceof qi?(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,s){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,i,s,this.mode));let{buffer:r}=this.buffer,n=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.buffer.start,s);return n<0?!1:(this.stack.push(this.index),this.yieldBuf(n))}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,s=this.mode){return this.buffer?s&tt.ExcludeBuffers?!1:this.enterChild(1,e,i):this.yield(this._tree.enter(e,i,s))}parent(){if(!this.buffer)return this.yieldNode(this.mode&tt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&tt.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,s=this.stack.length-1;if(e<0){let r=s<0?0:this.stack[s]+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<(s<0?i.buffer.length:i.buffer[this.stack[s]+3]))return this.yieldBuf(r)}return s<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,s,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let n=0;n<this.index;n++)if(r.buffer.buffer[n+3]<this.index)return!1;({index:i,parent:s}=r)}else({index:i,_parent:s}=this._tree);for(;s;{index:i,_parent:s}=s)if(i>-1)for(let n=i+e,o=e<0?-1:s._tree.children.length;n!=o;n+=e){let l=s._tree.children[n];if(this.mode&tt.IncludeAnonymous||l instanceof Uo||!l.type.isAnonymous||bS(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,s=0;if(e&&e.context==this.buffer)e:for(let r=this.index,n=this.stack.length;n>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;i=o,s=n+1;break e}r=this.stack[--n]}for(let r=s;r<this.stack.length;r++)i=new Ur(this.buffer,i,this.stack[r]);return this.bufferNode=new Ur(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,i){for(let s=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){s++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&i&&i(this),r=this.type.isAnonymous,!s)return;if(this.nextSibling())break;this.parent(),s--,r=!0}}}matchContext(e){if(!this.buffer)return cy(this.node.parent,e);let{buffer:i}=this.buffer,{types:s}=i.set;for(let r=e.length-1,n=this.stack.length-1;r>=0;n--){if(n<0)return cy(this._tree,e,r);let o=s[i.buffer[this.stack[n]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function bS(t){return t.children.some(e=>e instanceof Uo||!e.type.isAnonymous||bS(e))}function pq(t){var e;let{buffer:i,nodeSet:s,maxBufferLength:r=a3,reused:n=[],minRepeatType:o=s.types.length}=t,l=Array.isArray(i)?new yS(i,i.length):i,c=s.types,u=0,d=0;function m(P,E,z,$,Z,ie){let{id:F,start:R,end:Q,size:D}=l,I=d,L=u;if(D<0)if(l.next(),D==-1){let N=n[F];z.push(N),$.push(R-P);return}else if(D==-3){u=F;return}else if(D==-4){d=F;return}else throw new RangeError(`Unrecognized record size: ${D}`);let j=c[F],U,Y,W=R-P;if(Q-R<=r&&(Y=w(l.pos-E,Z))){let N=new Uint16Array(Y.size-Y.skip),G=l.pos-Y.size,se=N.length;for(;l.pos>G;)se=C(Y.start,N,se);U=new Uo(N,Q-Y.start,s),W=Y.start-P}else{let N=l.pos-D;l.next();let G=[],se=[],ce=F>=o?F:-1,he=0,de=Q;for(;l.pos>N;)ce>=0&&l.id==ce&&l.size>=0?(l.end<=de-r&&(y(G,se,R,he,l.end,de,ce,I,L),he=G.length,de=l.end),l.next()):ie>2500?g(R,N,G,se):m(R,N,G,se,ce,ie+1);if(ce>=0&&he>0&&he<G.length&&y(G,se,R,he,R,de,ce,I,L),G.reverse(),se.reverse(),ce>-1&&he>0){let ge=v(j,L);U=SS(j,G,se,0,G.length,0,Q-R,ge,ge)}else U=b(j,G,se,Q-R,I-Q,L)}z.push(U),$.push(W)}function g(P,E,z,$){let Z=[],ie=0,F=-1;for(;l.pos>E;){let{id:R,start:Q,end:D,size:I}=l;if(I>4)l.next();else{if(F>-1&&Q<F)break;F<0&&(F=D-r),Z.push(R,Q,D),ie++,l.next()}}if(ie){let R=new Uint16Array(ie*4),Q=Z[Z.length-2];for(let D=Z.length-3,I=0;D>=0;D-=3)R[I++]=Z[D],R[I++]=Z[D+1]-Q,R[I++]=Z[D+2]-Q,R[I++]=I;z.push(new Uo(R,Z[2]-Q,s)),$.push(Q-P)}}function v(P,E){return(z,$,Z)=>{let ie=0,F=z.length-1,R,Q;if(F>=0&&(R=z[F])instanceof et){if(!F&&R.type==P&&R.length==Z)return R;(Q=R.prop(Le.lookAhead))&&(ie=$[F]+R.length+Q)}return b(P,z,$,Z,ie,E)}}function y(P,E,z,$,Z,ie,F,R,Q){let D=[],I=[];for(;P.length>$;)D.push(P.pop()),I.push(E.pop()+z-Z);P.push(b(s.types[F],D,I,ie-Z,R-ie,Q)),E.push(Z-z)}function b(P,E,z,$,Z,ie,F){if(ie){let R=[Le.contextHash,ie];F=F?[R].concat(F):[R]}if(Z>25){let R=[Le.lookAhead,Z];F=F?[R].concat(F):[R]}return new et(P,E,z,$,F)}function w(P,E){let z=l.fork(),$=0,Z=0,ie=0,F=z.end-r,R={size:0,start:0,skip:0};e:for(let Q=z.pos-P;z.pos>Q;){let D=z.size;if(z.id==E&&D>=0){R.size=$,R.start=Z,R.skip=ie,ie+=4,$+=4,z.next();continue}let I=z.pos-D;if(D<0||I<Q||z.start<F)break;let L=z.id>=o?4:0,j=z.start;for(z.next();z.pos>I;){if(z.size<0)if(z.size==-3||z.size==-4)L+=4;else break e;else z.id>=o&&(L+=4);z.next()}Z=j,$+=D,ie+=L}return(E<0||$==P)&&(R.size=$,R.start=Z,R.skip=ie),R.size>4?R:void 0}function C(P,E,z){let{id:$,start:Z,end:ie,size:F}=l;if(l.next(),F>=0&&$<o){let R=z;if(F>4){let Q=l.pos-(F-4);for(;l.pos>Q;)z=C(P,E,z)}E[--z]=R,E[--z]=ie-P,E[--z]=Z-P,E[--z]=$}else F==-3?u=$:F==-4&&(d=$);return z}let T=[],M=[];for(;l.pos>0;)m(t.start||0,t.bufferStart||0,T,M,-1,0);let k=(e=t.length)!==null&&e!==void 0?e:T.length?M[0]+T[0].length:0;return new et(c[t.topID],T.reverse(),M.reverse(),k)}const YT=new WeakMap;function Jp(t,e){if(!t.isAnonymous||e instanceof Uo||e.type!=t)return 1;let i=YT.get(e);if(i==null){i=1;for(let s of e.children){if(s.type!=t||!(s instanceof et)){i=1;break}i+=Jp(t,s)}YT.set(e,i)}return i}function SS(t,e,i,s,r,n,o,l,c){let u=0;for(let y=s;y<r;y++)u+=Jp(t,e[y]);let d=Math.ceil(u*1.5/8),m=[],g=[];function v(y,b,w,C,T){for(let M=w;M<C;){let k=M,P=b[M],E=Jp(t,y[M]);for(M++;M<C;M++){let z=Jp(t,y[M]);if(E+z>=d)break;E+=z}if(M==k+1){if(E>d){let z=y[k];v(z.children,z.positions,0,z.children.length,b[k]+T);continue}m.push(y[k])}else{let z=b[M-1]+y[M-1].length-P;m.push(SS(t,y,b,k,M,P,z,null,c))}g.push(P+T-n)}}return v(e,i,s,r,0),(l||c)(m,g,o)}class u3{constructor(){this.map=new WeakMap}setBuffer(e,i,s){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(i,s)}getBuffer(e,i){let s=this.map.get(e);return s&&s.get(i)}set(e,i){e instanceof Ur?this.setBuffer(e.context.buffer,e.index,i):e instanceof qi&&this.map.set(e.tree,i)}get(e){return e instanceof Ur?this.getBuffer(e.context.buffer,e.index):e instanceof qi?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 Xn{constructor(e,i,s,r,n=!1,o=!1){this.from=e,this.to=i,this.tree=s,this.offset=r,this.open=(n?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,i=[],s=!1){let r=[new Xn(0,e.length,e,0,!1,s)];for(let n of i)n.to>e.length&&r.push(n);return r}static applyChanges(e,i,s=128){if(!i.length)return e;let r=[],n=1,o=e.length?e[0]:null;for(let l=0,c=0,u=0;;l++){let d=l<i.length?i[l]:null,m=d?d.fromA:1e9;if(m-c>=s)for(;o&&o.from<m;){let g=o;if(c>=g.from||m<=g.to||u){let v=Math.max(g.from,c)-u,y=Math.min(g.to,m)-u;g=v>=y?null:new Xn(v,y,g.tree,g.offset+u,l>0,!!d)}if(g&&r.push(g),o.to>m)break;o=n<e.length?e[n++]:null}if(!d)break;c=d.toA,u=d.toA-d.toB}return r}}class xS{startParse(e,i,s){return typeof e=="string"&&(e=new mq(e)),s=s?s.length?s.map(r=>new sr(r.from,r.to)):[new sr(0,0)]:[new sr(0,e.length)],this.createParse(e,i||[],s)}parse(e,i,s){let r=this.startParse(e,i,s);for(;;){let n=r.advance();if(n)return n}}}class mq{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 f3(t){return(e,i,s,r)=>new Oq(e,t,i,s,r)}class HT{constructor(e,i,s,r,n,o){this.parser=e,this.parse=i,this.overlay=s,this.bracketed=r,this.target=n,this.from=o}}function FT(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class gq{constructor(e,i,s,r,n,o,l,c){this.parser=e,this.predicate=i,this.mounts=s,this.index=r,this.start=n,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const uy=new Le({perNode:!0});class Oq{constructor(e,i,s,r,n){this.nest=i,this.input=s,this.fragments=r,this.ranges=n,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let s=this.baseParse.advance();if(!s)return null;if(this.baseParse=null,this.baseTree=s,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let s=this.baseTree;return this.stoppedAt!=null&&(s=new et(s.type,s.children,s.positions,s.length,s.propValues.concat([[uy,this.stoppedAt]]))),s}let e=this.inner[this.innerDone],i=e.parse.advance();if(i){this.innerDone++;let s=Object.assign(Object.create(null),e.target.props);s[Le.mounted.id]=new fh(i,e.overlay,e.parser,e.bracketed),e.target.props=s}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 yq(this.fragments),i=null,s=null,r=new $m(new qi(this.baseTree,this.ranges[0].from,0,null),tt.IncludeAnonymous|tt.IgnoreMounts);e:for(let n,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 m=d.from+u.pos,g=d.to+u.pos;m>=r.from&&g<=r.to&&!i.ranges.some(v=>v.from<g&&v.to>m)&&i.ranges.push({from:m,to:g})}}l=!1}else if(s&&(o=vq(s.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(n=this.nest(r,this.input))&&(r.from<r.to||!n.overlay)){r.tree||(_q(r),i&&i.depth++,s&&s.depth++);let u=e.findMounts(r.from,n.parser);if(typeof n.overlay=="function")i=new gq(n.parser,n.overlay,u,this.inner.length,r.from,!!n.bracketed,r.tree,i);else{let d=JT(this.ranges,n.overlay||(r.from<r.to?[new sr(r.from,r.to)]:[]));d.length&&FT(d),(d.length||!n.overlay)&&this.inner.push(new HT(n.parser,d.length?n.parser.startParse(this.input,eM(u,d),d):n.parser.startParse(""),n.overlay?n.overlay.map(m=>new sr(m.from-r.from,m.to-r.from)):null,!!n.bracketed,r.tree,d.length?d[0].from:r.from)),n.overlay?d.length&&(s={ranges:d,depth:0,prev:s}):l=!1}}else if(i&&(c=i.predicate(r))&&(c===!0&&(c=new sr(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++,s&&s.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(i&&!--i.depth){let u=JT(this.ranges,i.ranges);u.length&&(FT(u),this.inner.splice(i.index,0,new HT(i.parser,i.parser.startParse(this.input,eM(i.mounts,u),u),i.ranges.map(d=>new sr(d.from-i.start,d.to-i.start)),i.bracketed,i.target,u[0].from))),i=i.prev}s&&!--s.depth&&(s=s.prev)}}}}function vq(t,e,i){for(let s of t){if(s.from>=i)break;if(s.to>e)return s.from<=e&&s.to>=i?2:1}return 0}function GT(t,e,i,s,r,n){if(e<i){let o=t.buffer[e+1];s.push(t.slice(e,i,o)),r.push(o-n)}}function _q(t){let{node:e}=t,i=[],s=e.context.buffer;do i.push(t.index),t.parent();while(!t.tree);let r=t.tree,n=r.children.indexOf(s),o=r.children[n],l=o.buffer,c=[n];function u(d,m,g,v,y,b){let w=i[b],C=[],T=[];GT(o,d,w,C,T,v);let M=l[w+1],k=l[w+2];c.push(C.length);let P=b?u(w+4,l[w+3],o.set.types[l[w]],M,k-M,b-1):e.toTree();return C.push(P),T.push(M-v),GT(o,l[w+3],m,C,T,v),new et(g,C,T,y)}r.children[n]=u(0,l.length,ri.none,0,o.length,i.length-1);for(let d of c){let m=t.tree.children[d],g=t.tree.positions[d];t.yield(new qi(m,g+t.from,d,t._tree))}}class KT{constructor(e,i){this.offset=i,this.done=!1,this.cursor=e.cursor(tt.IncludeAnonymous|tt.IgnoreMounts)}moveTo(e){let{cursor:i}=this,s=e-this.offset;for(;!this.done&&i.from<s;)i.to>=e&&i.enter(s,1,tt.IgnoreOverlays|tt.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 et)i=i.children[0];else break}return!1}}let yq=class{constructor(e){var i;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let s=this.curFrag=e[0];this.curTo=(i=s.tree.prop(uy))!==null&&i!==void 0?i:s.to,this.inner=new KT(s.tree,-s.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(uy))!==null&&e!==void 0?e:i.to,this.inner=new KT(i.tree,-i.offset)}}findMounts(e,i){var s;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let n=this.inner.cursor.node;n;n=n.parent){let o=(s=n.tree)===null||s===void 0?void 0:s.prop(Le.mounted);if(o&&o.parser==i)for(let l=this.fragI;l<this.fragments.length;l++){let c=this.fragments[l];if(c.from>=n.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:n.from-c.offset,mount:o})}}}return r}};function JT(t,e){let i=null,s=e;for(let r=1,n=0;r<t.length;r++){let o=t[r-1].to,l=t[r].from;for(;n<s.length;n++){let c=s[n];if(c.from>=l)break;c.to<=o||(i||(s=i=e.slice()),c.from<o?(i[n]=new sr(c.from,o),c.to>l&&i.splice(n+1,0,new sr(l,c.to))):c.to>l?i[n--]=new sr(l,c.to):i.splice(n--,1))}}return s}function bq(t,e,i,s){let r=0,n=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==t.length?1e9:o?t[r].to:t[r].from,m=n==e.length?1e9:l?e[n].to:e[n].from;if(o!=l){let g=Math.max(c,i),v=Math.min(d,m,s);g<v&&u.push(new sr(g,v))}if(c=Math.min(d,m),c==1e9)break;d==c&&(o?(o=!1,r++):o=!0),m==c&&(l?(l=!1,n++):l=!0)}return u}function eM(t,e){let i=[];for(let{pos:s,mount:r,frag:n}of t){let o=s+(r.overlay?r.overlay[0].from:0),l=o+r.tree.length,c=Math.max(n.from,o),u=Math.min(n.to,l);if(r.overlay){let d=r.overlay.map(g=>new sr(g.from+s,g.to+s)),m=bq(e,d,c,u);for(let g=0,v=c;;g++){let y=g==m.length,b=y?u:m[g].from;if(b>v&&i.push(new Xn(v,b,r.tree,-o,n.from>=v||n.openStart,n.to<=b||n.openEnd)),y)break;v=m[g].to}}else i.push(new Xn(c,u,r.tree,-o,n.from>=o||n.openStart,n.to<=l||n.openEnd))}return i}let Sq=0;class Bs{constructor(e,i,s,r){this.name=e,this.set=i,this.base=s,this.modified=r,this.id=Sq++}toString(){let{name:e}=this;for(let i of this.modified)i.name&&(e=`${i.name}(${e})`);return e}static define(e,i){let s=typeof e=="string"?e:"?";if(e instanceof Bs&&(i=e),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let r=new Bs(s,[],null,[]);if(r.set.push(r),i)for(let n of i.set)r.set.push(n);return r}static defineModifier(e){let i=new Bm(e);return s=>s.modified.indexOf(i)>-1?s:Bm.get(s.base||s,s.modified.concat(i).sort((r,n)=>r.id-n.id))}}let xq=0;class Bm{constructor(e){this.name=e,this.instances=[],this.id=xq++}static get(e,i){if(!i.length)return e;let s=i[0].instances.find(l=>l.base==e&&wq(i,l.modified));if(s)return s;let r=[],n=new Bs(e.name,r,e,i);for(let l of i)l.instances.push(n);let o=Cq(i);for(let l of e.set)if(!l.modified.length)for(let c of o)r.push(Bm.get(l,c));return n}}function wq(t,e){return t.length==e.length&&t.every((i,s)=>i==e[s])}function Cq(t){let e=[[]];for(let i=0;i<t.length;i++)for(let s=0,r=e.length;s<r;s++)e.push(e[s].concat(t[i]));return e.sort((i,s)=>s.length-i.length)}function Qh(t){let e=Object.create(null);for(let i in t){let s=t[i];Array.isArray(s)||(s=[s]);for(let r of i.split(" "))if(r){let n=[],o=2,l=r;for(let m=0;;){if(l=="..."&&m>0&&m+3==r.length){o=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+r);if(n.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==r.length)break;let v=r[m++];if(m==r.length&&v=="!"){o=0;break}if(v!="/")throw new RangeError("Invalid path: "+r);l=r.slice(m)}let c=n.length-1,u=n[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new Yu(s,o,c>0?n.slice(0,c):null);e[u]=d.sort(e[u])}}return d3.add(e)}const d3=new Le({combine(t,e){let i,s,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 n=new Yu(r.tags,r.mode,r.context);i?i.next=n:s=n,i=n}return s}});class Yu{constructor(e,i,s,r){this.tags=e,this.mode=i,this.context=s,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}}Yu.empty=new Yu([],2,null);function p3(t,e){let i=Object.create(null);for(let n of t)if(!Array.isArray(n.tag))i[n.tag.id]=n.class;else for(let o of n.tag)i[o.id]=n.class;let{scope:s,all:r=null}=e||{};return{style:n=>{let o=r;for(let l of n)for(let c of l.set){let u=i[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:s}}function kq(t,e){let i=null;for(let s of t){let r=s.style(e);r&&(i=i?i+" "+r:r)}return i}function Tq(t,e,i,s=0,r=t.length){let n=new Mq(s,Array.isArray(e)?e:[e],i);n.highlightRange(t.cursor(),s,r,"",n.highlighters),n.flush(r)}class Mq{constructor(e,i,s){this.at=e,this.highlighters=i,this.span=s,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,s,r,n){let{type:o,from:l,to:c}=e;if(l>=s||c<=i)return;o.isTop&&(n=this.highlighters.filter(v=>!v.scope||v.scope(o)));let u=r,d=Aq(e)||Yu.empty,m=kq(n,d.tags);if(m&&(u&&(u+=" "),u+=m,d.mode==1&&(r+=(r?" ":"")+m)),this.startSpan(Math.max(i,l),u),d.opaque)return;let g=e.tree&&e.tree.prop(Le.mounted);if(g&&g.overlay){let v=e.node.enter(g.overlay[0].from+l,1),y=this.highlighters.filter(w=>!w.scope||w.scope(g.tree.type)),b=e.firstChild();for(let w=0,C=l;;w++){let T=w<g.overlay.length?g.overlay[w]:null,M=T?T.from+l:c,k=Math.max(i,C),P=Math.min(s,M);if(k<P&&b)for(;e.from<P&&(this.highlightRange(e,k,P,r,n),this.startSpan(Math.min(P,e.to),u),!(e.to>=M||!e.nextSibling())););if(!T||M>s)break;C=T.to+l,C>i&&(this.highlightRange(v.cursor(),Math.max(i,T.from+l),Math.min(s,C),"",y),this.startSpan(Math.min(s,C),u))}b&&e.parent()}else if(e.firstChild()){g&&(r="");do if(!(e.to<=i)){if(e.from>=s)break;this.highlightRange(e,i,s,r,n),this.startSpan(Math.min(s,e.to),u)}while(e.nextSibling());e.parent()}}}function Aq(t){let e=t.type.prop(d3);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const me=Bs.define,yp=me(),Qo=me(),tM=me(Qo),iM=me(Qo),Lo=me(),bp=me(Lo),Qv=me(Lo),jr=me(),_a=me(jr),Lr=me(),$r=me(),fy=me(),Ic=me(fy),Sp=me(),B={comment:yp,lineComment:me(yp),blockComment:me(yp),docComment:me(yp),name:Qo,variableName:me(Qo),typeName:tM,tagName:me(tM),propertyName:iM,attributeName:me(iM),className:me(Qo),labelName:me(Qo),namespace:me(Qo),macroName:me(Qo),literal:Lo,string:bp,docString:me(bp),character:me(bp),attributeValue:me(bp),number:Qv,integer:me(Qv),float:me(Qv),bool:me(Lo),regexp:me(Lo),escape:me(Lo),color:me(Lo),url:me(Lo),keyword:Lr,self:me(Lr),null:me(Lr),atom:me(Lr),unit:me(Lr),modifier:me(Lr),operatorKeyword:me(Lr),controlKeyword:me(Lr),definitionKeyword:me(Lr),moduleKeyword:me(Lr),operator:$r,derefOperator:me($r),arithmeticOperator:me($r),logicOperator:me($r),bitwiseOperator:me($r),compareOperator:me($r),updateOperator:me($r),definitionOperator:me($r),typeOperator:me($r),controlOperator:me($r),punctuation:fy,separator:me(fy),bracket:Ic,angleBracket:me(Ic),squareBracket:me(Ic),paren:me(Ic),brace:me(Ic),content:jr,heading:_a,heading1:me(_a),heading2:me(_a),heading3:me(_a),heading4:me(_a),heading5:me(_a),heading6:me(_a),contentSeparator:me(jr),list:me(jr),quote:me(jr),emphasis:me(jr),strong:me(jr),link:me(jr),monospace:me(jr),strikethrough:me(jr),inserted:me(),deleted:me(),changed:me(),invalid:me(),meta:Sp,documentMeta:me(Sp),annotation:me(Sp),processingInstruction:me(Sp),definition:Bs.defineModifier("definition"),constant:Bs.defineModifier("constant"),function:Bs.defineModifier("function"),standard:Bs.defineModifier("standard"),local:Bs.defineModifier("local"),special:Bs.defineModifier("special")};for(let t in B){let e=B[t];e instanceof Bs&&(e.name=t)}p3([{tag:B.link,class:"tok-link"},{tag:B.heading,class:"tok-heading"},{tag:B.emphasis,class:"tok-emphasis"},{tag:B.strong,class:"tok-strong"},{tag:B.keyword,class:"tok-keyword"},{tag:B.atom,class:"tok-atom"},{tag:B.bool,class:"tok-bool"},{tag:B.url,class:"tok-url"},{tag:B.labelName,class:"tok-labelName"},{tag:B.inserted,class:"tok-inserted"},{tag:B.deleted,class:"tok-deleted"},{tag:B.literal,class:"tok-literal"},{tag:B.string,class:"tok-string"},{tag:B.number,class:"tok-number"},{tag:[B.regexp,B.escape,B.special(B.string)],class:"tok-string2"},{tag:B.variableName,class:"tok-variableName"},{tag:B.local(B.variableName),class:"tok-variableName tok-local"},{tag:B.definition(B.variableName),class:"tok-variableName tok-definition"},{tag:B.special(B.variableName),class:"tok-variableName2"},{tag:B.definition(B.propertyName),class:"tok-propertyName tok-definition"},{tag:B.typeName,class:"tok-typeName"},{tag:B.namespace,class:"tok-namespace"},{tag:B.className,class:"tok-className"},{tag:B.macroName,class:"tok-macroName"},{tag:B.propertyName,class:"tok-propertyName"},{tag:B.operator,class:"tok-operator"},{tag:B.comment,class:"tok-comment"},{tag:B.meta,class:"tok-meta"},{tag:B.invalid,class:"tok-invalid"},{tag:B.punctuation,class:"tok-punctuation"}]);var Lv;const $a=new Le;function wS(t){return ve.define({combine:t?e=>e.concat(t):void 0})}const CS=new Le;class rr{constructor(e,i,s=[],r=""){this.data=e,this.name=r,We.prototype.hasOwnProperty("tree")||Object.defineProperty(We.prototype,"tree",{get(){return ft(this)}}),this.parser=i,this.extension=[Yo.of(this),We.languageData.of((n,o,l)=>{let c=sM(n,o,l),u=c.type.prop($a);if(!u)return[];let d=n.facet(u),m=c.type.prop(CS);if(m){let g=c.resolve(o-c.from,l);for(let v of m)if(v.test(g,n)){let y=n.facet(v.facet);return v.type=="replace"?y:y.concat(d)}}return d})].concat(s)}isActiveAt(e,i,s=-1){return sM(e,i,s).type.prop($a)==this.data}findRegions(e){let i=e.facet(Yo);if((i==null?void 0:i.data)==this.data)return[{from:0,to:e.doc.length}];if(!i||!i.allowsNesting)return[];let s=[],r=(n,o)=>{if(n.prop($a)==this.data){s.push({from:o,to:o+n.length});return}let l=n.prop(Le.mounted);if(l){if(l.tree.prop($a)==this.data){if(l.overlay)for(let c of l.overlay)s.push({from:c.from+o,to:c.to+o});else s.push({from:o,to:o+n.length});return}else if(l.overlay){let c=s.length;if(r(l.tree,l.overlay[0].from+o),s.length>c)return}}for(let c=0;c<n.children.length;c++){let u=n.children[c];u instanceof et&&r(u,n.positions[c]+o)}};return r(ft(e),0),s}get allowsNesting(){return!0}}rr.setState=Qe.define();function sM(t,e,i){let s=t.facet(Yo),r=ft(t).topNode;if(!s||s.allowsNesting)for(let n=r;n;n=n.enter(e,i,tt.ExcludeBuffers|tt.EnterBracketed))n.type.isTop&&(r=n);return r}class Sh extends rr{constructor(e,i,s){super(e,i,[],s),this.parser=i}static define(e){let i=wS(e.languageData);return new Sh(i,e.parser.configure({props:[$a.add(s=>s.isTop?i:void 0)]}),e.name)}configure(e,i){return new Sh(this.data,this.parser.configure(e),i||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ft(t){let e=t.field(rr.state,!1);return e?e.tree:et.empty}class Eq{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 s=this.cursorPos-this.string.length;return e<s||i>=this.cursorPos?this.doc.sliceString(e,i):this.string.slice(e-s,i-s)}}let qc=null;class Hu{constructor(e,i,s=[],r,n,o,l,c){this.parser=e,this.state=i,this.fragments=s,this.tree=r,this.treeLen=n,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,i,s){return new Hu(e,i,[],et.empty,0,s,[],null)}startParse(){return this.parser.startParse(new Eq(this.state.doc),this.fragments)}work(e,i){return i!=null&&i>=this.state.doc.length&&(i=void 0),this.tree!=et.empty&&this.isDone(i??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var s;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(Xn.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(s=this.parse.stoppedAt)!==null&&s!==void 0?s: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(Xn.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let i=qc;qc=this;try{return e()}finally{qc=i}}withoutTempSkipped(e){for(let i;i=this.tempSkipped.pop();)e=rM(e,i.from,i.to);return e}changes(e,i){let{fragments:s,tree:r,treeLen:n,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((u,d,m,g)=>c.push({fromA:u,toA:d,fromB:m,toB:g})),s=Xn.applyChanges(s,c),r=et.empty,n=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),m=e.mapPos(u.to,-1);d<m&&l.push({from:d,to:m})}}}return new Hu(this.parser,i,s,r,n,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 s=0;s<this.skipped.length;s++){let{from:r,to:n}=this.skipped[s];r<e.to&&n>e.from&&(this.fragments=rM(this.fragments,r,n),this.skipped.splice(s--,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 xS{createParse(i,s,r){let n=r[0].from,o=r[r.length-1].to;return{parsedPos:n,advance(){let c=qc;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 et(ri.none,[],[],o-n)},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 qc}}function rM(t,e,i){return Xn.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class xh{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),s=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),i.viewport.to);return i.work(20,s)||i.takeTree(),new xh(i)}static init(e){let i=Math.min(3e3,e.doc.length),s=Hu.create(e.facet(Yo).parser,e,{from:0,to:i});return s.work(20,i)||s.takeTree(),new xh(s)}}rr.state=Si.define({create:xh.init,update(t,e){for(let i of e.effects)if(i.is(rr.setState))return i.value;return e.startState.facet(Yo)!=e.state.facet(Yo)?xh.init(e.state):t.apply(e)}});let m3=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(m3=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const $v=typeof navigator<"u"&&(!((Lv=navigator.scheduling)===null||Lv===void 0)&&Lv.isInputPending)?()=>navigator.scheduling.isInputPending():null,Pq=Nt.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(rr.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(rr.state);(i.tree!=i.context.tree||!i.context.isDone(e.doc.length))&&(this.working=m3(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:s,viewport:{to:r}}=this.view,n=s.field(rr.state);if(n.tree==n.context.tree&&n.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!$v?Math.max(25,e.timeRemaining()-5):1e9),l=n.context.treeLen<r&&s.doc.length>r+1e3,c=n.context.work(()=>$v&&$v()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-i,(c||this.chunkBudget<=0)&&(n.context.takeTree(),this.view.dispatch({effects:rr.setState.of(new xh(n.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(n.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(i=>Os(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()}}}),Yo=ve.define({combine(t){return t.length?t[0]:null},enables:t=>[rr.state,Pq,pe.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class Fu{constructor(e,i=[]){this.language=e,this.support=i,this.extension=[e,i]}}class Dm{constructor(e,i,s,r,n,o=void 0){this.name=e,this.alias=i,this.extensions=s,this.filename=r,this.loadFunc=n,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:s}=e;if(!i){if(!s)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");i=()=>Promise.resolve(s)}return new Dm(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,i,s)}static matchFilename(e,i){for(let r of e)if(r.filename&&r.filename.test(i))return r;let s=/\.([^.]+)$/.exec(i);if(s){for(let r of e)if(r.extensions.indexOf(s[1])>-1)return r}return null}static matchLanguageName(e,i,s=!0){i=i.toLowerCase();for(let r of e)if(r.alias.some(n=>n==i))return r;if(s)for(let r of e)for(let n of r.alias){let o=i.indexOf(n);if(o>-1&&(n.length>2||!/\w/.test(i[o-1])&&!/\w/.test(i[o+n.length])))return r}return null}}const Rq=ve.define(),Lh=ve.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 zm(t){let e=t.facet(Lh);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Gu(t,e){let i="",s=t.tabSize,r=t.facet(Lh)[0];if(r==" "){for(;e>=s;)i+=" ",e-=s;r=" "}for(let n=0;n<e;n++)i+=r;return i}function kS(t,e){t instanceof We&&(t=new bg(t));for(let s of t.state.facet(Rq)){let r=s(t,e);if(r!==void 0)return r}let i=ft(t.state);return i.length>=e?Qq(t,i,e):null}class bg{constructor(e,i={}){this.state=e,this.options=i,this.unit=zm(e)}lineAt(e,i=1){let s=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:n}=this.options;return r!=null&&r>=s.from&&r<=s.to?n&&r==e?{text:"",from:e}:(i<0?r<e:r<=e)?{text:s.text.slice(r-s.from),from:r}:{text:s.text.slice(0,r-s.from),from:s.from}:s}textAfterPos(e,i=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:s,from:r}=this.lineAt(e,i);return s.slice(e-r,Math.min(s.length,e+100-r))}column(e,i=1){let{text:s,from:r}=this.lineAt(e,i),n=this.countColumn(s,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(n+=o-this.countColumn(s,s.search(/\S|$/))),n}countColumn(e,i=e.length){return xr(e,this.state.tabSize,i)}lineIndent(e,i=1){let{text:s,from:r}=this.lineAt(e,i),n=this.options.overrideIndentation;if(n){let o=n(r);if(o>-1)return o}return this.countColumn(s,s.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Cf=new Le;function Qq(t,e,i){let s=e.resolveStack(i),r=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=s.node){let n=[];for(let o=r;o&&!(o.from<s.node.from||o.to>s.node.to||o.from==s.node.from&&o.type==s.node.type);o=o.parent)n.push(o);for(let o=n.length-1;o>=0;o--)s={node:n[o],next:s}}return g3(s,t,i)}function g3(t,e,i){for(let s=t;s;s=s.next){let r=$q(s.node);if(r)return r(TS.create(e,i,s))}return 0}function Lq(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function $q(t){let e=t.type.prop(Cf);if(e)return e;let i=t.firstChild,s;if(i&&(s=i.type.prop(Le.closedBy))){let r=t.lastChild,n=r&&s.indexOf(r.name)>-1;return o=>O3(o,!0,1,void 0,n&&!Lq(o)?r.from:void 0)}return t.parent==null?Bq:null}function Bq(){return 0}class TS extends bg{constructor(e,i,s){super(e.state,e.options),this.base=e,this.pos=i,this.context=s}get node(){return this.context.node}static create(e,i,s){return new TS(e,i,s)}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 s=e.resolve(i.from);for(;s.parent&&s.parent.from==s.from;)s=s.parent;if(Dq(s,e))break;i=this.state.doc.lineAt(s.from)}return this.lineIndent(i.from)}continue(){return g3(this.context.next,this.base,this.pos)}}function Dq(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function zq(t){let e=t.node,i=e.childAfter(e.from),s=e.lastChild;if(!i)return null;let r=t.options.simulateBreak,n=t.state.doc.lineAt(i.from),o=r==null||r<=n.from?n.to:Math.min(n.to,r);for(let l=i.to;;){let c=e.childAfter(l);if(!c||c==s)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(n.text.slice(i.to-n.from))[0].length;return{from:i.from,to:i.to+u}}l=c.to}}function Nq({closing:t,align:e=!0,units:i=1}){return s=>O3(s,e,i,t)}function O3(t,e,i,s,r){let n=t.textAfter,o=n.match(/^\s*/)[0].length,l=s&&n.slice(o,o+s.length)==s||r==t.pos+o,c=e?zq(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*i)}const jq=t=>t.baseIndent;function em({except:t,units:e=1}={}){return i=>{let s=t&&t.test(i.textAfter);return i.baseIndent+(s?0:e*i.unit)}}const Xq=200;function Vq(){return We.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:s}=t.newSelection.main,r=i.lineAt(s);if(s>r.from+Xq)return t;let n=i.sliceString(r.from,s);if(!e.some(u=>u.test(n)))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 m=kS(o,d.from);if(m==null)continue;let g=/^\s*/.exec(d.text)[0],v=Gu(o,m);g!=v&&c.push({from:d.from,to:d.from+g.length,insert:v})}return c.length?[t,{changes:c,sequential:!0}]:t})}const v3=ve.define(),$h=new Le;function _3(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 Zq(t,e,i){let s=ft(t);if(s.length<i)return null;let r=s.resolveStack(i,1),n=null;for(let o=r;o;o=o.next){let l=o.node;if(l.to<=i||l.from>i)continue;if(n&&l.from<e)break;let c=l.type.prop($h);if(c&&(l.to<s.length-50||s.length==t.doc.length||!Iq(l))){let u=c(l,t);u&&u.from<=i&&u.from>=e&&u.to>i&&(n=u)}}return n}function Iq(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Nm(t,e,i){for(let s of t.facet(v3)){let r=s(t,e,i);if(r)return r}return Zq(t,e,i)}function y3(t,e){let i=e.mapPos(t.from,1),s=e.mapPos(t.to,-1);return i>=s?void 0:{from:i,to:s}}const Sg=Qe.define({map:y3}),kf=Qe.define({map:y3});function b3(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(s=>s.from<=i&&s.to>=i)||e.push(t.lineBlockAt(i));return e}const Ua=Si.define({create(){return Te.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,s)=>t=nM(t,i,s)),t=t.map(e.changes);for(let i of e.effects)if(i.is(Sg)&&!qq(t,i.value.from,i.value.to)){let{preparePlaceholder:s}=e.state.facet(w3),r=s?Te.replace({widget:new Kq(s(e.state,i.value))}):oM;t=t.update({add:[r.range(i.value.from,i.value.to)]})}else i.is(kf)&&(t=t.update({filter:(s,r)=>i.value.from!=s||i.value.to!=r,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=nM(t,e.selection.main.head)),t},provide:t=>pe.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(s,r)=>{i.push(s,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 s=t[i++],r=t[i++];if(typeof s!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(oM.range(s,r))}return Te.set(e,!0)}});function nM(t,e,i=e){let s=!1;return t.between(e,i,(r,n)=>{r<i&&n>e&&(s=!0)}),s?t.update({filterFrom:e,filterTo:i,filter:(r,n)=>r>=i||n<=e}):t}function jm(t,e,i){var s;let r=null;return(s=t.field(Ua,!1))===null||s===void 0||s.between(e,i,(n,o)=>{(!r||r.from>n)&&(r={from:n,to:o})}),r}function qq(t,e,i){let s=!1;return t.between(e,e,(r,n)=>{r==e&&n==i&&(s=!0)}),s}function S3(t,e){return t.field(Ua,!1)?e:e.concat(Qe.appendConfig.of(C3()))}const Wq=t=>{for(let e of b3(t)){let i=Nm(t.state,e.from,e.to);if(i)return t.dispatch({effects:S3(t.state,[Sg.of(i),x3(t,i)])}),!0}return!1},Uq=t=>{if(!t.state.field(Ua,!1))return!1;let e=[];for(let i of b3(t)){let s=jm(t.state,i.from,i.to);s&&e.push(kf.of(s),x3(t,s,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function x3(t,e,i=!0){let s=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return pe.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${s} ${t.state.phrase("to")} ${r}.`)}const Yq=t=>{let{state:e}=t,i=[];for(let s=0;s<e.doc.length;){let r=t.lineBlockAt(s),n=Nm(e,r.from,r.to);n&&i.push(Sg.of(n)),s=(n?t.lineBlockAt(n.to):r).to+1}return i.length&&t.dispatch({effects:S3(t.state,i)}),!!i.length},Hq=t=>{let e=t.state.field(Ua,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(s,r)=>{i.push(kf.of({from:s,to:r}))}),t.dispatch({effects:i}),!0},Fq=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Wq},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Uq},{key:"Ctrl-Alt-[",run:Yq},{key:"Ctrl-Alt-]",run:Hq}],Gq={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},w3=ve.define({combine(t){return on(t,Gq)}});function C3(t){return[Ua,tW]}function k3(t,e){let{state:i}=t,s=i.facet(w3),r=o=>{let l=t.lineBlockAt(t.posAtDOM(o.target)),c=jm(t.state,l.from,l.to);c&&t.dispatch({effects:kf.of(c)}),o.preventDefault()};if(s.placeholderDOM)return s.placeholderDOM(t,r,e);let n=document.createElement("span");return n.textContent=s.placeholderText,n.setAttribute("aria-label",i.phrase("folded code")),n.title=i.phrase("unfold"),n.className="cm-foldPlaceholder",n.onclick=r,n}const oM=Te.replace({widget:new class extends kr{toDOM(t){return k3(t,null)}}});class Kq extends kr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return k3(e,this.value)}}const Jq={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Bv extends qn{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 eW(t={}){let e={...Jq,...t},i=new Bv(e,!0),s=new Bv(e,!1),r=Nt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Yo)!=o.state.facet(Yo)||o.startState.field(Ua,!1)!=o.state.field(Ua,!1)||ft(o.startState)!=ft(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new Zn;for(let c of o.viewportLineBlocks){let u=jm(o.state,c.from,c.to)?s:Nm(o.state,c.from,c.to)?i:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:n}=e;return[r,KI({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Ze.empty},initialSpacer(){return new Bv(e,!1)},domEventHandlers:{...n,click:(o,l,c)=>{if(n.click&&n.click(o,l,c))return!0;let u=jm(o.state,l.from,l.to);if(u)return o.dispatch({effects:kf.of(u)}),!0;let d=Nm(o.state,l.from,l.to);return d?(o.dispatch({effects:Sg.of(d)}),!0):!1}}}),C3()]}const tW=pe.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 Tf{constructor(e,i){this.specs=e;let s;function r(l){let c=Io.newName();return(s||(s=Object.create(null)))["."+c]=l,c}const n=typeof i.all=="string"?i.all:i.all?r(i.all):void 0,o=i.scope;this.scope=o instanceof rr?l=>l.prop($a)==o.data:o?l=>l==o:void 0,this.style=p3(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:n}).style,this.module=s?new Io(s):null,this.themeType=i.themeType}static define(e,i){return new Tf(e,i||{})}}const dy=ve.define(),T3=ve.define({combine(t){return t.length?[t[0]]:null}});function Dv(t){let e=t.facet(dy);return e.length?e:t.facet(T3)}function M3(t,e){let i=[sW],s;return t instanceof Tf&&(t.module&&i.push(pe.styleModule.of(t.module)),s=t.themeType),e!=null&&e.fallback?i.push(T3.of(t)):s?i.push(dy.computeN([pe.darkTheme],r=>r.facet(pe.darkTheme)==(s=="dark")?[t]:[])):i.push(dy.of(t)),i}class iW{constructor(e){this.markCache=Object.create(null),this.tree=ft(e.state),this.decorations=this.buildDeco(e,Dv(e.state)),this.decoratedTo=e.viewport.to}update(e){let i=ft(e.state),s=Dv(e.state),r=s!=Dv(e.startState),{viewport:n}=e.view,o=e.changes.mapPos(this.decoratedTo,1);i.length<n.to&&!r&&i.type==this.tree.type&&o>=n.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,s),this.decoratedTo=n.to)}buildDeco(e,i){if(!i||!this.tree.length)return Te.none;let s=new Zn;for(let{from:r,to:n}of e.visibleRanges)Tq(this.tree,i,(o,l,c)=>{s.add(o,l,this.markCache[c]||(this.markCache[c]=Te.mark({class:c})))},r,n);return s.finish()}}const sW=Wn.high(Nt.fromClass(iW,{decorations:t=>t.decorations})),rW=Tf.define([{tag:B.meta,color:"#404740"},{tag:B.link,textDecoration:"underline"},{tag:B.heading,textDecoration:"underline",fontWeight:"bold"},{tag:B.emphasis,fontStyle:"italic"},{tag:B.strong,fontWeight:"bold"},{tag:B.strikethrough,textDecoration:"line-through"},{tag:B.keyword,color:"#708"},{tag:[B.atom,B.bool,B.url,B.contentSeparator,B.labelName],color:"#219"},{tag:[B.literal,B.inserted],color:"#164"},{tag:[B.string,B.deleted],color:"#a11"},{tag:[B.regexp,B.escape,B.special(B.string)],color:"#e40"},{tag:B.definition(B.variableName),color:"#00f"},{tag:B.local(B.variableName),color:"#30a"},{tag:[B.typeName,B.namespace],color:"#085"},{tag:B.className,color:"#167"},{tag:[B.special(B.variableName),B.macroName],color:"#256"},{tag:B.definition(B.propertyName),color:"#00c"},{tag:B.comment,color:"#940"},{tag:B.invalid,color:"#f00"}]),nW=pe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),A3=1e4,E3="()[]{}",P3=ve.define({combine(t){return on(t,{afterCursor:!0,brackets:E3,maxScanDistance:A3,renderMatch:lW})}}),oW=Te.mark({class:"cm-matchingBracket"}),aW=Te.mark({class:"cm-nonmatchingBracket"});function lW(t){let e=[],i=t.matched?oW:aW;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 hW=Si.define({create(){return Te.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],s=e.state.facet(P3);for(let r of e.state.selection.ranges){if(!r.empty)continue;let n=Yr(e.state,r.head,-1,s)||r.head>0&&Yr(e.state,r.head-1,1,s)||s.afterCursor&&(Yr(e.state,r.head,1,s)||r.head<e.state.doc.length&&Yr(e.state,r.head+1,-1,s));n&&(i=i.concat(s.renderMatch(n,e.state)))}return Te.set(i,!0)},provide:t=>pe.decorations.from(t)}),cW=[hW,nW];function uW(t={}){return[P3.of(t),cW]}const R3=new Le;function py(t,e,i){let s=t.prop(e<0?Le.openedBy:Le.closedBy);if(s)return s;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 my(t){let e=t.type.prop(R3);return e?e(t.node):t}function Yr(t,e,i,s={}){let r=s.maxScanDistance||A3,n=s.brackets||E3,o=ft(t),l=o.resolveInner(e,i);for(let c=l;c;c=c.parent){let u=py(c.type,i,n);if(u&&c.from<c.to){let d=my(c);if(d&&(i>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return fW(t,e,i,c,d,u,n)}}return dW(t,e,i,o,l.type,r,n)}function fW(t,e,i,s,r,n,o){let l=s.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(i<0?d.childBefore(s.from):d.childAfter(s.to)))do if(i<0?d.to<=s.from:d.from>=s.to){if(u==0&&n.indexOf(d.type.name)>-1&&d.from<d.to){let m=my(d);return{start:c,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(py(d.type,i,o))u++;else if(py(d.type,-i,o)){if(u==0){let m=my(d);return{start:c,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}u--}}while(i<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function dW(t,e,i,s,r,n,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),m=0;for(let g=0;!d.next().done&&g<=n;){let v=d.value;i<0&&(g+=v.length);let y=e+g*i;for(let b=i>0?0:v.length-1,w=i>0?v.length:-1;b!=w;b+=i){let C=o.indexOf(v[b]);if(!(C<0||s.resolveInner(y+b,1).type!=r))if(C%2==0==i>0)m++;else{if(m==1)return{start:u,end:{from:y+b,to:y+b+1},matched:C>>1==c>>1};m--}}i>0&&(g+=v.length)}return d.done?{start:u,matched:!1}:null}const pW=Object.create(null),aM=[ri.none],lM=[],hM=Object.create(null),mW=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"]])mW[t]=gW(pW,e);function zv(t,e){lM.indexOf(t)>-1||(lM.push(t),console.warn(e))}function gW(t,e){let i=[];for(let l of e.split(" ")){let c=[];for(let u of l.split(".")){let d=t[u]||B[u];d?typeof d=="function"?c.length?c=c.map(d):zv(u,`Modifier ${u} used at start of tag`):c.length?zv(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:zv(u,`Unknown highlighting tag ${u}`)}for(let u of c)i.push(u)}if(!i.length)return 0;let s=e.replace(/ /g,"_"),r=s+" "+i.map(l=>l.id),n=hM[r];if(n)return n.id;let o=hM[r]=ri.define({id:aM.length,name:s,props:[Qh({[s]:i})]});return aM.push(o),o.id}ut.RTL,ut.LTR;const OW=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),s=AS(t.state,i.from);return s.line?vW(t):s.block?yW(t):!1};function MS(t,e){return({state:i,dispatch:s})=>{if(i.readOnly)return!1;let r=t(e,i);return r?(s(i.update(r)),!0):!1}}const vW=MS(xW,0),_W=MS(Q3,0),yW=MS((t,e)=>Q3(t,e,SW(e)),0);function AS(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const Wc=50;function bW(t,{open:e,close:i},s,r){let n=t.sliceDoc(s-Wc,s),o=t.sliceDoc(r,r+Wc),l=/\s*$/.exec(n)[0].length,c=/^\s*/.exec(o)[0].length,u=n.length-l;if(n.slice(u-e.length,u)==e&&o.slice(c,c+i.length)==i)return{open:{pos:s-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,m;r-s<=2*Wc?d=m=t.sliceDoc(s,r):(d=t.sliceDoc(s,s+Wc),m=t.sliceDoc(r-Wc,r));let g=/^\s*/.exec(d)[0].length,v=/\s*$/.exec(m)[0].length,y=m.length-v-i.length;return d.slice(g,g+e.length)==e&&m.slice(y,y+i.length)==i?{open:{pos:s+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:r-v-i.length,margin:/\s/.test(m.charAt(y-1))?1:0}}:null}function SW(t){let e=[];for(let i of t.selection.ranges){let s=t.doc.lineAt(i.from),r=i.to<=s.to?s:t.doc.lineAt(i.to);r.from>s.from&&r.from==i.to&&(r=i.to==s.to+1?s:t.doc.lineAt(i.to-1));let n=e.length-1;n>=0&&e[n].to>s.from?e[n].to=r.to:e.push({from:s.from+/^\s*/.exec(s.text)[0].length,to:r.to})}return e}function Q3(t,e,i=e.selection.ranges){let s=i.map(n=>AS(e,n.from).block);if(!s.every(n=>n))return null;let r=i.map((n,o)=>bW(e,s[o],n.from,n.to));if(t!=2&&!r.every(n=>n))return{changes:e.changes(i.map((n,o)=>r[o]?[]:[{from:n.from,insert:s[o].open+" "},{from:n.to,insert:" "+s[o].close}]))};if(t!=1&&r.some(n=>n)){let n=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let c=s[o],{open:u,close:d}=l;n.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:n}}return null}function xW(t,e,i=e.selection.ranges){let s=[],r=-1;e:for(let{from:n,to:o}of i){let l=s.length,c=1e9,u;for(let d=n;d<=o;){let m=e.doc.lineAt(d);if(u==null&&(u=AS(e,m.from).line,!u))continue e;if(m.from>r&&(n==o||o>m.from)){r=m.from;let g=/^\s*/.exec(m.text)[0].length,v=g==m.length,y=m.text.slice(g,g+u.length)==u?g:-1;g<m.text.length&&g<c&&(c=g),s.push({line:m,comment:y,token:u,indent:g,empty:v,single:!1})}d=m.to+1}if(c<1e9)for(let d=l;d<s.length;d++)s[d].indent<s[d].line.text.length&&(s[d].indent=c);s.length==l+1&&(s[l].single=!0)}if(t!=2&&s.some(n=>n.comment<0&&(!n.empty||n.single))){let n=[];for(let{line:l,token:c,indent:u,empty:d,single:m}of s)(m||!d)&&n.push({from:l.from+u,insert:c+" "});let o=e.changes(n);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&s.some(n=>n.comment>=0)){let n=[];for(let{line:o,comment:l,token:c}of s)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,n.push({from:u,to:d})}return{changes:n}}return null}const gy=nn.define(),wW=nn.define(),CW=ve.define(),L3=ve.define({combine(t){return on(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,i)=>i},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,i)=>(s,r)=>e(s,r)||i(s,r)})}}),$3=Si.define({create(){return Hr.empty},update(t,e){let i=e.state.facet(L3),s=e.annotation(gy);if(s){let c=vs.fromTransaction(e,s.selection),u=s.side,d=u==0?t.undone:t.done;return c?d=Xm(d,d.length,i.minDepth,c):d=z3(d,e.startState.selection),new Hr(u==0?s.rest:d,u==0?d:s.rest)}let r=e.annotation(wW);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Yt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let n=vs.fromTransaction(e),o=e.annotation(Yt.time),l=e.annotation(Yt.userEvent);return n?t=t.addChanges(n,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 Hr(t.done.map(vs.fromJSON),t.undone.map(vs.fromJSON))}});function kW(t={}){return[$3,L3.of(t),pe.domEventHandlers({beforeinput(e,i){let s=e.inputType=="historyUndo"?B3:e.inputType=="historyRedo"?Oy:null;return s?(e.preventDefault(),s(i)):!1}})]}function xg(t,e){return function({state:i,dispatch:s}){if(!e&&i.readOnly)return!1;let r=i.field($3,!1);if(!r)return!1;let n=r.pop(t,i,e);return n?(s(n),!0):!1}}const B3=xg(0,!1),Oy=xg(1,!1),TW=xg(0,!0),MW=xg(1,!0);class vs{constructor(e,i,s,r,n){this.changes=e,this.effects=i,this.mapped=s,this.startSelection=r,this.selectionsAfter=n}setSelAfter(e){return new vs(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,i,s;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:(s=this.startSelection)===null||s===void 0?void 0:s.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new vs(e.changes&&si.fromJSON(e.changes),[],e.mapped&&Kr.fromJSON(e.mapped),e.startSelection&&ne.fromJSON(e.startSelection),e.selectionsAfter.map(ne.fromJSON))}static fromTransaction(e,i){let s=nr;for(let r of e.startState.facet(CW)){let n=r(e);n.length&&(s=s.concat(n))}return!s.length&&e.changes.empty?null:new vs(e.changes.invert(e.startState.doc),s,void 0,i||e.startState.selection,nr)}static selection(e){return new vs(void 0,nr,void 0,void 0,e)}}function Xm(t,e,i,s){let r=e+1>i+20?e-i-1:0,n=t.slice(r,e);return n.push(s),n}function AW(t,e){let i=[],s=!1;return t.iterChangedRanges((r,n)=>i.push(r,n)),e.iterChangedRanges((r,n,o,l)=>{for(let c=0;c<i.length;){let u=i[c++],d=i[c++];l>=u&&o<=d&&(s=!0)}}),s}function EW(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((i,s)=>i.empty!=e.ranges[s].empty).length===0}function D3(t,e){return t.length?e.length?t.concat(e):t:e}const nr=[],PW=200;function z3(t,e){if(t.length){let i=t[t.length-1],s=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-PW));return s.length&&s[s.length-1].eq(e)?t:(s.push(e),Xm(t,t.length-1,1e9,i.setSelAfter(s)))}else return[vs.selection([e])]}function RW(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 Nv(t,e){if(!t.length)return t;let i=t.length,s=nr;for(;i;){let r=QW(t[i-1],e,s);if(r.changes&&!r.changes.empty||r.effects.length){let n=t.slice(0,i);return n[i-1]=r,n}else e=r.mapped,i--,s=r.selectionsAfter}return s.length?[vs.selection(s)]:nr}function QW(t,e,i){let s=D3(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):nr,i);if(!t.changes)return vs.selection(s);let r=t.changes.map(e),n=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(n):n;return new vs(r,Qe.mapEffects(t.effects,e),o,t.startSelection.map(n),s)}const LW=/^(input\.type|delete)($|\.)/;class Hr{constructor(e,i,s=0,r=void 0){this.done=e,this.undone=i,this.prevTime=s,this.prevUserEvent=r}isolate(){return this.prevTime?new Hr(this.done,this.undone):this}addChanges(e,i,s,r,n){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!s||LW.test(s))&&(!l.selectionsAfter.length&&i-this.prevTime<r.newGroupDelay&&r.joinToEvent(n,AW(l.changes,e.changes))||s=="input.type.compose")?o=Xm(o,o.length-1,r.minDepth,new vs(e.changes.compose(l.changes),D3(Qe.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,nr)):o=Xm(o,o.length,r.minDepth,e),new Hr(o,nr,i,s)}addSelection(e,i,s,r){let n=this.done.length?this.done[this.done.length-1].selectionsAfter:nr;return n.length>0&&i-this.prevTime<r&&s==this.prevUserEvent&&s&&/^select($|\.)/.test(s)&&EW(n[n.length-1],e)?this:new Hr(z3(this.done,e),this.undone,i,s)}addMapping(e){return new Hr(Nv(this.done,e),Nv(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,i,s){let r=e==0?this.done:this.undone;if(r.length==0)return null;let n=r[r.length-1],o=n.selectionsAfter[0]||(n.startSelection?n.startSelection.map(n.changes.invertedDesc,1):i.selection);if(s&&n.selectionsAfter.length)return i.update({selection:n.selectionsAfter[n.selectionsAfter.length-1],annotations:gy.of({side:e,rest:RW(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(n.changes){let l=r.length==1?nr:r.slice(0,r.length-1);return n.mapped&&(l=Nv(l,n.mapped)),i.update({changes:n.changes,selection:n.startSelection,effects:n.effects,annotations:gy.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Hr.empty=new Hr(nr,nr);const $W=[{key:"Mod-z",run:B3,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Oy,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Oy,preventDefault:!0},{key:"Mod-u",run:TW,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:MW,preventDefault:!0}];function Bh(t,e){return ne.create(t.ranges.map(e),t.mainIndex)}function Tr(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Mr({state:t,dispatch:e},i){let s=Bh(t.selection,i);return s.eq(t.selection,!0)?!1:(e(Tr(t,s)),!0)}function wg(t,e){return ne.cursor(e?t.to:t.from)}function N3(t,e){return Mr(t,i=>i.empty?t.moveByChar(i,e):wg(i,e))}function Wi(t){return t.textDirectionAt(t.state.selection.main.head)==ut.LTR}const j3=t=>N3(t,!Wi(t)),X3=t=>N3(t,Wi(t));function V3(t,e){return Mr(t,i=>i.empty?t.moveByGroup(i,e):wg(i,e))}const BW=t=>V3(t,!Wi(t)),DW=t=>V3(t,Wi(t));function zW(t,e,i){if(e.type.prop(i))return!0;let s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Cg(t,e,i){let s=ft(t).resolveInner(e.head),r=i?Le.closedBy:Le.openedBy;for(let c=e.head;;){let u=i?s.childAfter(c):s.childBefore(c);if(!u)break;zW(t,u,r)?s=u:c=i?u.to:u.from}let n=s.type.prop(r),o,l;return n&&(o=i?Yr(t,s.from,1):Yr(t,s.to,-1))&&o.matched?l=i?o.end.to:o.end.from:l=i?s.to:s.from,ne.cursor(l,i?-1:1)}const NW=t=>Mr(t,e=>Cg(t.state,e,!Wi(t))),jW=t=>Mr(t,e=>Cg(t.state,e,Wi(t)));function Z3(t,e){return Mr(t,i=>{if(!i.empty)return wg(i,e);let s=t.moveVertically(i,e);return s.head!=i.head?s:t.moveToLineBoundary(i,e)})}const I3=t=>Z3(t,!1),q3=t=>Z3(t,!0);function W3(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,i=0,s=0,r;if(e){for(let n of t.state.facet(pe.scrollMargins)){let o=n(t);o!=null&&o.top&&(i=Math.max(o==null?void 0:o.top,i)),o!=null&&o.bottom&&(s=Math.max(o==null?void 0:o.bottom,s))}r=t.scrollDOM.clientHeight-i-s}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:s,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function U3(t,e){let i=W3(t),{state:s}=t,r=Bh(s.selection,o=>o.empty?t.moveVertically(o,e,i.height):wg(o,e));if(r.eq(s.selection))return!1;let n;if(i.selfScroll){let o=t.coordsAtPos(s.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+i.marginTop,u=l.bottom-i.marginBottom;o&&o.top>c&&o.bottom<u&&(n=pe.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-c}))}return t.dispatch(Tr(s,r),{effects:n}),!0}const cM=t=>U3(t,!1),vy=t=>U3(t,!0);function Ko(t,e,i){let s=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,i);if(r.head==e.head&&r.head!=(i?s.to:s.from)&&(r=t.moveToLineBoundary(e,i,!1)),!i&&r.head==s.from&&s.length){let n=/^\s*/.exec(t.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;n&&e.head!=s.from+n&&(r=ne.cursor(s.from+n))}return r}const XW=t=>Mr(t,e=>Ko(t,e,!0)),VW=t=>Mr(t,e=>Ko(t,e,!1)),ZW=t=>Mr(t,e=>Ko(t,e,!Wi(t))),IW=t=>Mr(t,e=>Ko(t,e,Wi(t))),qW=t=>Mr(t,e=>ne.cursor(t.lineBlockAt(e.head).from,1)),WW=t=>Mr(t,e=>ne.cursor(t.lineBlockAt(e.head).to,-1));function UW(t,e,i){let s=!1,r=Bh(t.selection,n=>{let o=Yr(t,n.head,-1)||Yr(t,n.head,1)||n.head>0&&Yr(t,n.head-1,1)||n.head<t.doc.length&&Yr(t,n.head+1,-1);if(!o||!o.end)return n;s=!0;let l=o.start.from==n.head?o.end.to:o.end.from;return ne.cursor(l)});return s?(e(Tr(t,r)),!0):!1}const YW=({state:t,dispatch:e})=>UW(t,e);function cr(t,e){let i=Bh(t.state.selection,s=>{let r=e(s);return ne.range(s.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return i.eq(t.state.selection)?!1:(t.dispatch(Tr(t.state,i)),!0)}function Y3(t,e){return cr(t,i=>t.moveByChar(i,e))}const H3=t=>Y3(t,!Wi(t)),F3=t=>Y3(t,Wi(t));function G3(t,e){return cr(t,i=>t.moveByGroup(i,e))}const HW=t=>G3(t,!Wi(t)),FW=t=>G3(t,Wi(t)),GW=t=>cr(t,e=>Cg(t.state,e,!Wi(t))),KW=t=>cr(t,e=>Cg(t.state,e,Wi(t)));function K3(t,e){return cr(t,i=>t.moveVertically(i,e))}const J3=t=>K3(t,!1),e$=t=>K3(t,!0);function t$(t,e){return cr(t,i=>t.moveVertically(i,e,W3(t).height))}const uM=t=>t$(t,!1),fM=t=>t$(t,!0),JW=t=>cr(t,e=>Ko(t,e,!0)),eU=t=>cr(t,e=>Ko(t,e,!1)),tU=t=>cr(t,e=>Ko(t,e,!Wi(t))),iU=t=>cr(t,e=>Ko(t,e,Wi(t))),sU=t=>cr(t,e=>ne.cursor(t.lineBlockAt(e.head).from)),rU=t=>cr(t,e=>ne.cursor(t.lineBlockAt(e.head).to)),dM=({state:t,dispatch:e})=>(e(Tr(t,{anchor:0})),!0),pM=({state:t,dispatch:e})=>(e(Tr(t,{anchor:t.doc.length})),!0),mM=({state:t,dispatch:e})=>(e(Tr(t,{anchor:t.selection.main.anchor,head:0})),!0),gM=({state:t,dispatch:e})=>(e(Tr(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),nU=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),oU=({state:t,dispatch:e})=>{let i=kg(t).map(({from:s,to:r})=>ne.range(s,Math.min(r+1,t.doc.length)));return e(t.update({selection:ne.create(i),userEvent:"select"})),!0},aU=({state:t,dispatch:e})=>{let i=Bh(t.selection,s=>{let r=ft(t),n=r.resolveStack(s.from,1);if(s.empty){let o=r.resolveStack(s.from,-1);o.node.from>=n.node.from&&o.node.to<=n.node.to&&(n=o)}for(let o=n;o;o=o.next){let{node:l}=o;if((l.from<s.from&&l.to>=s.to||l.to>s.to&&l.from<=s.from)&&o.next)return ne.range(l.to,l.from)}return s});return i.eq(t.selection)?!1:(e(Tr(t,i)),!0)};function i$(t,e){let{state:i}=t,s=i.selection,r=i.selection.ranges.slice();for(let n of i.selection.ranges){let o=i.doc.lineAt(n.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=n;;){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==s.ranges.length?!1:(t.dispatch(Tr(i,ne.create(r,r.length-1))),!0)}const lU=t=>i$(t,!1),hU=t=>i$(t,!0),cU=({state:t,dispatch:e})=>{let i=t.selection,s=null;return i.ranges.length>1?s=ne.create([i.main]):i.main.empty||(s=ne.create([ne.cursor(i.main.head)])),s?(e(Tr(t,s)),!0):!1};function Mf(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:s}=t,r=s.changeByRange(n=>{let{from:o,to:l}=n;if(o==l){let c=e(n);c<o?(i="delete.backward",c=xp(t,c,!1)):c>o&&(i="delete.forward",c=xp(t,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=xp(t,o,!1),l=xp(t,l,!0);return o==l?{range:n}:{changes:{from:o,to:l},range:ne.cursor(o,o<n.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(s.update(r,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?pe.announce.of(s.phrase("Selection deleted")):void 0})),!0)}function xp(t,e,i){if(t instanceof pe)for(let s of t.state.facet(pe.atomicRanges).map(r=>r(t)))s.between(e,e,(r,n)=>{r<e&&n>e&&(e=i?n:r)});return e}const s$=(t,e,i)=>Mf(t,s=>{let r=s.from,{state:n}=t,o=n.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=xr(l,n.tabSize),d=u%zm(n)||zm(n);for(let m=0;m<d&&l[l.length-1-m]==" ";m++)r--;c=r}else c=bi(o.text,r-o.from,e,e)+o.from,c==r&&o.number!=(e?n.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,r-o.from))&&(c=bi(o.text,c-o.from,!1,!1)+o.from);return c}),_y=t=>s$(t,!1,!0),r$=t=>s$(t,!0,!1),n$=(t,e)=>Mf(t,i=>{let s=i.head,{state:r}=t,n=r.doc.lineAt(s),o=r.charCategorizer(s);for(let l=null;;){if(s==(e?n.to:n.from)){s==i.head&&n.number!=(e?r.doc.lines:1)&&(s+=e?1:-1);break}let c=bi(n.text,s-n.from,e)+n.from,u=n.text.slice(Math.min(s,c)-n.from,Math.max(s,c)-n.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||s!=i.head)&&(l=d),s=c}return s}),o$=t=>n$(t,!1),uU=t=>n$(t,!0),fU=t=>Mf(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),dU=t=>Mf(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),pU=t=>Mf(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),mU=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(s=>({changes:{from:s.from,to:s.to,insert:Je.of(["",""])},range:ne.cursor(s.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0},gU=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(s=>{if(!s.empty||s.from==0||s.from==t.doc.length)return{range:s};let r=s.from,n=t.doc.lineAt(r),o=r==n.from?r-1:bi(n.text,r-n.from,!1)+n.from,l=r==n.to?r+1:bi(n.text,r-n.from,!0)+n.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:ne.cursor(l)}});return i.changes.empty?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function kg(t){let e=[],i=-1;for(let s of t.selection.ranges){let r=t.doc.lineAt(s.from),n=t.doc.lineAt(s.to);if(!s.empty&&s.to==n.from&&(n=t.doc.lineAt(s.to-1)),i>=r.number){let o=e[e.length-1];o.to=n.to,o.ranges.push(s)}else e.push({from:r.from,to:n.to,ranges:[s]});i=n.number+1}return e}function a$(t,e,i){if(t.readOnly)return!1;let s=[],r=[];for(let n of kg(t)){if(i?n.to==t.doc.length:n.from==0)continue;let o=t.doc.lineAt(i?n.to+1:n.from-1),l=o.length+1;if(i){s.push({from:n.to,to:o.to},{from:n.from,insert:o.text+t.lineBreak});for(let c of n.ranges)r.push(ne.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{s.push({from:o.from,to:n.from},{from:n.to,insert:t.lineBreak+o.text});for(let c of n.ranges)r.push(ne.range(c.anchor-l,c.head-l))}}return s.length?(e(t.update({changes:s,scrollIntoView:!0,selection:ne.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const OU=({state:t,dispatch:e})=>a$(t,e,!1),vU=({state:t,dispatch:e})=>a$(t,e,!0);function l$(t,e,i){if(t.readOnly)return!1;let s=[];for(let n of kg(t))i?s.push({from:n.from,insert:t.doc.slice(n.from,n.to)+t.lineBreak}):s.push({from:n.to,insert:t.lineBreak+t.doc.slice(n.from,n.to)});let r=t.changes(s);return e(t.update({changes:r,selection:t.selection.map(r,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const _U=({state:t,dispatch:e})=>l$(t,e,!1),yU=({state:t,dispatch:e})=>l$(t,e,!0),bU=t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(kg(e).map(({from:r,to:n})=>(r>0?r--:n<e.doc.length&&n++,{from:r,to:n}))),s=Bh(e.selection,r=>{let n;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(n=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,n)}).map(i);return t.dispatch({changes:i,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0};function SU(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=ft(t).resolveInner(e),s=i.childBefore(e),r=i.childAfter(e),n;return s&&r&&s.to<=e&&r.from>=e&&(n=s.type.prop(Le.closedBy))&&n.indexOf(r.name)>-1&&t.doc.lineAt(s.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(s.to,r.from))?{from:s.to,to:r.from}:null}const OM=h$(!1),xU=h$(!0);function h$(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let s=e.changeByRange(r=>{let{from:n,to:o}=r,l=e.doc.lineAt(n),c=!t&&n==o&&SU(e,n);t&&(n=o=(o<=l.to?l:e.doc.lineAt(o)).to);let u=new bg(e,{simulateBreak:n,simulateDoubleBreak:!!c}),d=kS(u,n);for(d==null&&(d=xr(/^\s*/.exec(e.doc.lineAt(n).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;c?{from:n,to:o}=c:n>l.from&&n<l.from+100&&!/\S/.test(l.text.slice(0,n))&&(n=l.from);let m=["",Gu(e,d)];return c&&m.push(Gu(e,u.lineIndent(l.from,-1))),{changes:{from:n,to:o,insert:Je.of(m)},range:ne.cursor(n+1+m[1].length)}});return i(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0}}function ES(t,e){let i=-1;return t.changeByRange(s=>{let r=[];for(let o=s.from;o<=s.to;){let l=t.doc.lineAt(o);l.number>i&&(s.empty||s.to>l.from)&&(e(l,r,s),i=l.number),o=l.to+1}let n=t.changes(r);return{changes:r,range:ne.range(n.mapPos(s.anchor,1),n.mapPos(s.head,1))}})}const wU=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),s=new bg(t,{overrideIndentation:n=>{let o=i[n];return o??-1}}),r=ES(t,(n,o,l)=>{let c=kS(s,n.from);if(c==null)return;/\S/.test(n.text)||(c=0);let u=/^\s*/.exec(n.text)[0],d=Gu(t,c);(u!=d||l.from<n.from+u.length)&&(i[n.from]=c,o.push({from:n.from,to:n.from+u.length,insert:d}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},c$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(ES(t,(i,s)=>{s.push({from:i.from,insert:t.facet(Lh)})}),{userEvent:"input.indent"})),!0),u$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(ES(t,(i,s)=>{let r=/^\s*/.exec(i.text)[0];if(!r)return;let n=xr(r,t.tabSize),o=0,l=Gu(t,Math.max(0,n-zm(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;s.push({from:i.from+o,to:i.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),CU=t=>(t.setTabFocusMode(),!0),kU=[{key:"Ctrl-b",run:j3,shift:H3,preventDefault:!0},{key:"Ctrl-f",run:X3,shift:F3},{key:"Ctrl-p",run:I3,shift:J3},{key:"Ctrl-n",run:q3,shift:e$},{key:"Ctrl-a",run:qW,shift:sU},{key:"Ctrl-e",run:WW,shift:rU},{key:"Ctrl-d",run:r$},{key:"Ctrl-h",run:_y},{key:"Ctrl-k",run:fU},{key:"Ctrl-Alt-h",run:o$},{key:"Ctrl-o",run:mU},{key:"Ctrl-t",run:gU},{key:"Ctrl-v",run:vy}],TU=[{key:"ArrowLeft",run:j3,shift:H3,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:BW,shift:HW,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ZW,shift:tU,preventDefault:!0},{key:"ArrowRight",run:X3,shift:F3,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:DW,shift:FW,preventDefault:!0},{mac:"Cmd-ArrowRight",run:IW,shift:iU,preventDefault:!0},{key:"ArrowUp",run:I3,shift:J3,preventDefault:!0},{mac:"Cmd-ArrowUp",run:dM,shift:mM},{mac:"Ctrl-ArrowUp",run:cM,shift:uM},{key:"ArrowDown",run:q3,shift:e$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:pM,shift:gM},{mac:"Ctrl-ArrowDown",run:vy,shift:fM},{key:"PageUp",run:cM,shift:uM},{key:"PageDown",run:vy,shift:fM},{key:"Home",run:VW,shift:eU,preventDefault:!0},{key:"Mod-Home",run:dM,shift:mM},{key:"End",run:XW,shift:JW,preventDefault:!0},{key:"Mod-End",run:pM,shift:gM},{key:"Enter",run:OM,shift:OM},{key:"Mod-a",run:nU},{key:"Backspace",run:_y,shift:_y,preventDefault:!0},{key:"Delete",run:r$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:o$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:uU,preventDefault:!0},{mac:"Mod-Backspace",run:dU,preventDefault:!0},{mac:"Mod-Delete",run:pU,preventDefault:!0}].concat(kU.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),MU=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:NW,shift:GW},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:jW,shift:KW},{key:"Alt-ArrowUp",run:OU},{key:"Shift-Alt-ArrowUp",run:_U},{key:"Alt-ArrowDown",run:vU},{key:"Shift-Alt-ArrowDown",run:yU},{key:"Mod-Alt-ArrowUp",run:lU},{key:"Mod-Alt-ArrowDown",run:hU},{key:"Escape",run:cU},{key:"Mod-Enter",run:xU},{key:"Alt-l",mac:"Ctrl-l",run:oU},{key:"Mod-i",run:aU,preventDefault:!0},{key:"Mod-[",run:u$},{key:"Mod-]",run:c$},{key:"Mod-Alt-\\",run:wU},{key:"Shift-Mod-k",run:bU},{key:"Shift-Mod-\\",run:YW},{key:"Mod-/",run:OW},{key:"Alt-A",run:_W},{key:"Ctrl-m",mac:"Shift-Alt-m",run:CU}].concat(TU),AU={key:"Tab",run:c$,shift:u$},vM=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class wh{constructor(e,i,s=0,r=e.length,n,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(s,r),this.bufferStart=s,this.normalize=n?l=>n(vM(l)):vM,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 ps(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=tS(e),s=this.bufferStart+this.bufferPos;this.bufferPos+=Ir(e);let r=this.normalize(i);if(r.length)for(let n=0,o=s;;n++){let l=r.charCodeAt(n),c=this.match(l,o,this.bufferPos+this.bufferStart);if(n==r.length-1){if(c)return this.value=c,this;break}o==s&&n<i.length&&i.charCodeAt(n)==l&&o++}}}match(e,i,s){let r=null;for(let n=0;n<this.matches.length;n+=2){let o=this.matches[n],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[n+1],to:s}:(this.matches[n]++,l=!0)),l||(this.matches.splice(n,2),n-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:i,to:s}:this.matches.push(1,i)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(wh.prototype[Symbol.iterator]=function(){return this});const f$={from:-1,to:-1,match:/.*/.exec("")},PS="gm"+(/x/.unicode==null?"":"u");class d${constructor(e,i,s,r=0,n=e.length){if(this.text=e,this.to=n,this.curLine="",this.done=!1,this.value=f$,/\\[sWDnr]|\n|\r|\[\^/.test(i))return new p$(e,i,s,r,n);this.re=new RegExp(i,PS+(s!=null&&s.ignoreCase?"i":"")),this.test=s==null?void 0:s.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=Vm(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 s=this.curLineStart+i.index,r=s+i[0].length;if(this.matchPos=Vm(this.text,r+(s==r?1:0)),s==this.curLineStart+this.curLine.length&&this.nextLine(),(s<r||s>this.value.to)&&(!this.test||this.test(s,r,i)))return this.value={from:s,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 jv=new WeakMap;class dh{constructor(e,i){this.from=e,this.text=i}get to(){return this.from+this.text.length}static get(e,i,s){let r=jv.get(e);if(!r||r.from>=s||r.to<=i){let l=new dh(i,e.sliceString(i,s));return jv.set(e,l),l}if(r.from==i&&r.to==s)return r;let{text:n,from:o}=r;return o>i&&(n=e.sliceString(i,o)+n,o=i),r.to<s&&(n+=e.sliceString(r.to,s)),jv.set(e,new dh(o,n)),new dh(i,n.slice(i-o,s-o))}}class p${constructor(e,i,s,r,n){this.text=e,this.to=n,this.done=!1,this.value=f$,this.matchPos=Vm(e,r),this.re=new RegExp(i,PS+(s!=null&&s.ignoreCase?"i":"")),this.test=s==null?void 0:s.test,this.flat=dh.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 s=this.flat.from+i.index,r=s+i[0].length;if((this.flat.to>=this.to||i.index+i[0].length<=this.flat.text.length-10)&&(!this.test||this.test(s,r,i)))return this.value={from:s,to:r,match:i},this.matchPos=Vm(this.text,r+(s==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=dh.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(d$.prototype[Symbol.iterator]=p$.prototype[Symbol.iterator]=function(){return this});function EU(t){try{return new RegExp(t,PS),!0}catch{return!1}}function Vm(t,e){if(e>=t.length)return e;let i=t.lineAt(e),s;for(;e<i.to&&(s=i.text.charCodeAt(e-i.from))>=56320&&s<57344;)e++;return e}const PU=t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:s,result:r}=YI(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return r.then(n=>{let o=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!o){t.dispatch({effects:s});return}let l=e.doc.lineAt(e.selection.main.head),[,c,u,d,m]=o,g=d?+d.slice(1):0,v=u?+u:l.number;if(u&&m){let w=v/100;c&&(w=w*(c=="-"?-1:1)+l.number/e.doc.lines),v=Math.round(e.doc.lines*w)}else u&&c&&(v=v*(c=="-"?-1:1)+l.number);let y=e.doc.line(Math.max(1,Math.min(e.doc.lines,v))),b=ne.cursor(y.from+Math.max(0,Math.min(g,y.length)));t.dispatch({effects:[s,pe.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},RU={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},QU=ve.define({combine(t){return on(t,RU,{highlightWordAroundCursor:(e,i)=>e||i,minSelectionLength:Math.min,maxMatches:Math.min})}});function LU(t){return[NU,zU]}const $U=Te.mark({class:"cm-selectionMatch"}),BU=Te.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function _M(t,e,i,s){return(i==0||t(e.sliceDoc(i-1,i))!=St.Word)&&(s==e.doc.length||t(e.sliceDoc(s,s+1))!=St.Word)}function DU(t,e,i,s){return t(e.sliceDoc(i,i+1))==St.Word&&t(e.sliceDoc(s-1,s))==St.Word}const zU=Nt.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(QU),{state:i}=t,s=i.selection;if(s.ranges.length>1)return Te.none;let r=s.main,n,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return Te.none;let c=i.wordAt(r.head);if(!c)return Te.none;o=i.charCategorizer(r.head),n=i.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c<e.minSelectionLength||c>200)return Te.none;if(e.wholeWords){if(n=i.sliceDoc(r.from,r.to),o=i.charCategorizer(r.head),!(_M(o,i,r.from,r.to)&&DU(o,i,r.from,r.to)))return Te.none}else if(n=i.sliceDoc(r.from,r.to),!n)return Te.none}let l=[];for(let c of t.visibleRanges){let u=new wh(i.doc,n,c.from,c.to);for(;!u.next().done;){let{from:d,to:m}=u.value;if((!o||_M(o,i,d,m))&&(r.empty&&d<=r.from&&m>=r.to?l.push(BU.range(d,m)):(d>=r.to||m<=r.from)&&l.push($U.range(d,m)),l.length>e.maxMatches))return Te.none}}return Te.set(l)}},{decorations:t=>t.decorations}),NU=pe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),jU=({state:t,dispatch:e})=>{let{selection:i}=t,s=ne.create(i.ranges.map(r=>t.wordAt(r.head)||ne.cursor(r.head)),i.mainIndex);return s.eq(i)?!1:(e(t.update({selection:s})),!0)};function XU(t,e){let{main:i,ranges:s}=t.selection,r=t.wordAt(i.head),n=r&&r.from==i.from&&r.to==i.to;for(let o=!1,l=new wh(t.doc,e,s[s.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new wh(t.doc,e,0,Math.max(0,s[s.length-1].from-1)),o=!0}else{if(o&&s.some(c=>c.from==l.value.from))continue;if(n){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const VU=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(n=>n.from===n.to))return jU({state:t,dispatch:e});let s=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(n=>t.sliceDoc(n.from,n.to)!=s))return!1;let r=XU(t,s);return r?(e(t.update({selection:t.selection.addRange(ne.range(r.from,r.to),!1),effects:pe.scrollIntoView(r.to)})),!0):!1},Dh=ve.define({combine(t){return on(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new iY(e),scrollToMatch:e=>pe.scrollIntoView(e)})}});class m${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||EU(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,s)=>s=="n"?`
|
|
69
|
-
`:s=="r"?"\r":s=="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 YU(this):new qU(this)}getCursor(e,i=0,s){let r=e.doc?e:We.create({doc:e});return s==null&&(s=r.doc.length),this.regexp?Yl(this,r,i,s):Ul(this,r,i,s)}}class g${constructor(e){this.spec=e}}function ZU(t,e,i){return(s,r,n,o)=>{if(i&&!i(s,r,n,o))return!1;let l=s>=o&&r<=o+n.length?n.slice(s-o,r-o):e.doc.sliceString(s,r);return t(l,e,s,r)}}function Ul(t,e,i,s){let r;return t.wholeWord&&(r=IU(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(r=ZU(t.test,e,r)),new wh(e.doc,t.unquoted,i,s,t.caseSensitive?void 0:n=>n.toLowerCase(),r)}function IU(t,e){return(i,s,r,n)=>((n>i||n+r.length<s)&&(n=Math.max(0,i-2),r=t.sliceString(n,Math.min(t.length,s+2))),(e(Zm(r,i-n))!=St.Word||e(Im(r,i-n))!=St.Word)&&(e(Im(r,s-n))!=St.Word||e(Zm(r,s-n))!=St.Word))}class qU extends g${constructor(e){super(e)}nextMatch(e,i,s){let r=Ul(this.spec,e,s,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,i+this.spec.unquoted.length);r=Ul(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==i&&r.value.to==s?null:r.value}prevMatchInRange(e,i,s){for(let r=s;;){let n=Math.max(i,r-1e4-this.spec.unquoted.length),o=Ul(this.spec,e,n,r),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(n==i)return null;r-=1e4}}prevMatch(e,i,s){let r=this.prevMatchInRange(e,0,i);return r||(r=this.prevMatchInRange(e,Math.max(0,s-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=i||r.to!=s)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,i){let s=Ul(this.spec,e,0,e.doc.length),r=[];for(;!s.next().done;){if(r.length>=i)return null;r.push(s.value)}return r}highlight(e,i,s,r){let n=Ul(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(s+this.spec.unquoted.length,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}}function WU(t,e,i){return(s,r,n)=>(!i||i(s,r,n))&&t(n[0],e,s,r)}function Yl(t,e,i,s){let r;return t.wholeWord&&(r=UU(e.charCategorizer(e.selection.main.head))),t.test&&(r=WU(t.test,e,r)),new d$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:r},i,s)}function Zm(t,e){return t.slice(bi(t,e,!1),e)}function Im(t,e){return t.slice(e,bi(t,e))}function UU(t){return(e,i,s)=>!s[0].length||(t(Zm(s.input,s.index))!=St.Word||t(Im(s.input,s.index))!=St.Word)&&(t(Im(s.input,s.index+s[0].length))!=St.Word||t(Zm(s.input,s.index+s[0].length))!=St.Word)}class YU extends g${nextMatch(e,i,s){let r=Yl(this.spec,e,s,e.doc.length).next();return r.done&&(r=Yl(this.spec,e,0,i).next()),r.done?null:r.value}prevMatchInRange(e,i,s){for(let r=1;;r++){let n=Math.max(i,s-r*1e4),o=Yl(this.spec,e,n,s),l=null;for(;!o.next().done;)l=o.value;if(l&&(n==i||l.from>n+10))return l;if(n==i)return null}}prevMatch(e,i,s){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,s,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(i,s)=>{if(s=="&")return e.match[0];if(s=="$")return"$";for(let r=s.length;r>0;r--){let n=+s.slice(0,r);if(n>0&&n<e.match.length)return e.match[n]+s.slice(r)}return i})}matchAll(e,i){let s=Yl(this.spec,e,0,e.doc.length),r=[];for(;!s.next().done;){if(r.length>=i)return null;r.push(s.value)}return r}highlight(e,i,s,r){let n=Yl(this.spec,e,Math.max(0,i-250),Math.min(s+250,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}}const Ku=Qe.define(),RS=Qe.define(),jo=Si.define({create(t){return new Xv(yy(t).create(),null)},update(t,e){for(let i of e.effects)i.is(Ku)?t=new Xv(i.value.create(),t.panel):i.is(RS)&&(t=new Xv(t.query,i.value?QS:null));return t},provide:t=>Wu.from(t,e=>e.panel)});class Xv{constructor(e,i){this.query=e,this.panel=i}}const HU=Te.mark({class:"cm-searchMatch"}),FU=Te.mark({class:"cm-searchMatch cm-searchMatch-selected"}),GU=Nt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(jo))}update(t){let e=t.state.field(jo);(e!=t.startState.field(jo)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Te.none;let{view:i}=this,s=new Zn;for(let r=0,n=i.visibleRanges,o=n.length;r<o;r++){let{from:l,to:c}=n[r];for(;r<o-1&&c>n[r+1].from-500;)c=n[++r].to;t.highlight(i.state,l,c,(u,d)=>{let m=i.state.selection.ranges.some(g=>g.from==u&&g.to==d);s.add(u,d,m?FU:HU)})}return s.finish()}},{decorations:t=>t.decorations});function Af(t){return e=>{let i=e.state.field(jo,!1);return i&&i.query.spec.valid?t(e,i):_$(e)}}const qm=Af((t,{query:e})=>{let{to:i}=t.state.selection.main,s=e.nextMatch(t.state,i,i);if(!s)return!1;let r=ne.single(s.from,s.to),n=t.state.facet(Dh);return t.dispatch({selection:r,effects:[LS(t,s),n.scrollToMatch(r.main,t)],userEvent:"select.search"}),v$(t),!0}),Wm=Af((t,{query:e})=>{let{state:i}=t,{from:s}=i.selection.main,r=e.prevMatch(i,s,s);if(!r)return!1;let n=ne.single(r.from,r.to),o=t.state.facet(Dh);return t.dispatch({selection:n,effects:[LS(t,r),o.scrollToMatch(n.main,t)],userEvent:"select.search"}),v$(t),!0}),KU=Af((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:ne.create(i.map(s=>ne.range(s.from,s.to))),userEvent:"select.search.matches"}),!0)}),JU=({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:s,to:r}=i.main,n=[],o=0;for(let l=new wh(t.doc,t.sliceDoc(s,r));!l.next().done;){if(n.length>1e3)return!1;l.value.from==s&&(o=n.length),n.push(ne.range(l.value.from,l.value.to))}return e(t.update({selection:ne.create(n,o),userEvent:"select.search.matches"})),!0},yM=Af((t,{query:e})=>{let{state:i}=t,{from:s,to:r}=i.selection.main;if(i.readOnly)return!1;let n=e.nextMatch(i,s,s);if(!n)return!1;let o=n,l=[],c,u,d=[];o.from==s&&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(pe.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(s).number)+".")));let m=t.state.changes(l);return o&&(c=ne.single(o.from,o.to).map(m),d.push(LS(t,o)),d.push(i.facet(Dh).scrollToMatch(c.main,t))),t.dispatch({changes:m,selection:c,effects:d,userEvent:"input.replace"}),!0}),eY=Af((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map(r=>{let{from:n,to:o}=r;return{from:n,to:o,insert:e.getReplacement(r)}});if(!i.length)return!1;let s=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:pe.announce.of(s),userEvent:"input.replace.all"}),!0});function QS(t){return t.state.facet(Dh).createPanel(t)}function yy(t,e){var i,s,r,n,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(Dh);return new m$({search:((i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(s=e==null?void 0:e.caseSensitive)!==null&&s!==void 0?s:u.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:u.literal,regexp:(n=e==null?void 0:e.regexp)!==null&&n!==void 0?n:u.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function O$(t){let e=_S(t,QS);return e&&e.dom.querySelector("[main-field]")}function v$(t){let e=O$(t);e&&e==t.root.activeElement&&e.select()}const _$=t=>{let e=t.state.field(jo,!1);if(e&&e.panel){let i=O$(t);if(i&&i!=t.root.activeElement){let s=yy(t.state,e.query.spec);s.valid&&t.dispatch({effects:Ku.of(s)}),i.focus(),i.select()}}else t.dispatch({effects:[RS.of(!0),e?Ku.of(yy(t.state,e.query.spec)):Qe.appendConfig.of(rY)]});return!0},y$=t=>{let e=t.state.field(jo,!1);if(!e||!e.panel)return!1;let i=_S(t,QS);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:RS.of(!1)}),!0},tY=[{key:"Mod-f",run:_$,scope:"editor search-panel"},{key:"F3",run:qm,shift:Wm,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:qm,shift:Wm,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:y$,scope:"editor search-panel"},{key:"Mod-Shift-l",run:JU},{key:"Mod-Alt-g",run:PU},{key:"Mod-d",run:VU,preventDefault:!0}];class iY{constructor(e){this.view=e;let i=this.query=e.state.field(jo).query.spec;this.commit=this.commit.bind(this),this.searchField=lt("input",{value:i.search,placeholder:As(e,"Find"),"aria-label":As(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=lt("input",{value:i.replace,placeholder:As(e,"Replace"),"aria-label":As(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=lt("input",{type:"checkbox",name:"case",form:"",checked:i.caseSensitive,onchange:this.commit}),this.reField=lt("input",{type:"checkbox",name:"re",form:"",checked:i.regexp,onchange:this.commit}),this.wordField=lt("input",{type:"checkbox",name:"word",form:"",checked:i.wholeWord,onchange:this.commit});function s(r,n,o){return lt("button",{class:"cm-button",name:r,onclick:n,type:"button"},o)}this.dom=lt("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,s("next",()=>qm(e),[As(e,"next")]),s("prev",()=>Wm(e),[As(e,"previous")]),s("select",()=>KU(e),[As(e,"all")]),lt("label",null,[this.caseField,As(e,"match case")]),lt("label",null,[this.reField,As(e,"regexp")]),lt("label",null,[this.wordField,As(e,"by word")]),...e.state.readOnly?[]:[lt("br"),this.replaceField,s("replace",()=>yM(e),[As(e,"replace")]),s("replaceAll",()=>eY(e),[As(e,"replace all")])],lt("button",{name:"close",onclick:()=>y$(e),"aria-label":As(e,"close"),type:"button"},["×"])])}commit(){let e=new m$({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:Ku.of(e)}))}keydown(e){rI(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Wm:qm)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),yM(this.view))}update(e){for(let i of e.transactions)for(let s of i.effects)s.is(Ku)&&!s.value.eq(this.query)&&this.setQuery(s.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(Dh).top}}function As(t,e){return t.state.phrase(e)}const wp=30,Cp=/[\s\.,:;?!]/;function LS(t,{from:e,to:i}){let s=t.state.doc.lineAt(e),r=t.state.doc.lineAt(i).to,n=Math.max(s.from,e-wp),o=Math.min(r,i+wp),l=t.state.sliceDoc(n,o);if(n!=s.from){for(let c=0;c<wp;c++)if(!Cp.test(l[c+1])&&Cp.test(l[c])){l=l.slice(c);break}}if(o!=r){for(let c=l.length-1;c>l.length-wp;c--)if(!Cp.test(l[c-1])&&Cp.test(l[c])){l=l.slice(0,c);break}}return pe.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${s.number}.`)}const sY=pe.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"}}),rY=[jo,Wn.low(GU),sY];class $S{constructor(e,i,s,r){this.state=e,this.pos=i,this.explicit=s,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let i=ft(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),s=Math.max(i.from,this.pos-250),r=i.text.slice(s-i.from,this.pos-i.from),n=r.search(S$(e,!1));return n<0?null:{from:s+n,to:this.pos,text:r.slice(n)}}get aborted(){return this.abortListeners==null}addEventListener(e,i,s){e=="abort"&&this.abortListeners&&(this.abortListeners.push(i),s&&s.onDocChange&&(this.abortOnDocChange=!0))}}function bM(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 nY(t){let e=Object.create(null),i=Object.create(null);for(let{label:r}of t){e[r[0]]=!0;for(let n=1;n<r.length;n++)i[r[n]]=!0}let s=bM(e)+bM(i)+"*$";return[new RegExp("^"+s),new RegExp(s)]}function b$(t){let e=t.map(r=>typeof r=="string"?{label:r}:r),[i,s]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:nY(e);return r=>{let n=r.matchBefore(s);return n||r.explicit?{from:n?n.from:r.pos,options:e,validFor:i}:null}}function oY(t,e){return i=>{for(let s=ft(i.state).resolveInner(i.pos,-1);s;s=s.parent){if(t.indexOf(s.name)>-1)return null;if(s.type.isTop)break}return e(i)}}class SM{constructor(e,i,s,r){this.completion=e,this.source=i,this.match=s,this.score=r}}function ja(t){return t.selection.main.from}function S$(t,e){var i;let{source:s}=t,r=e&&s[0]!="^",n=s[s.length-1]!="$";return!r&&!n?t:new RegExp(`${r?"^":""}(?:${s})${n?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}const BS=nn.define();function aY(t,e,i,s){let{main:r}=t.selection,n=i-r.from,o=s-r.from;return{...t.changeByRange(l=>{if(l!=r&&i!=s&&t.sliceDoc(l.from+n,l.from+o)!=t.sliceDoc(i,s))return{range:l};let c=t.toText(e);return{changes:{from:l.from+n,to:s==r.from?l.to:l.from+o,insert:c},range:ne.cursor(l.from+n+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const xM=new WeakMap;function lY(t){if(!Array.isArray(t))return t;let e=xM.get(t);return e||xM.set(t,e=b$(t)),e}const Um=Qe.define(),Ju=Qe.define();class hY{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 s=ps(e,i),r=Ir(s);this.chars.push(s);let n=e.slice(i,i+r),o=n.toUpperCase();this.folded.push(ps(o==n?n.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:s,any:r,precise:n,byWord:o}=this;if(i.length==1){let T=ps(e,0),M=Ir(T),k=M==e.length?0:-100;if(T!=i[0])if(T==s[0])k+=-200;else return null;return this.ret(k,[0,M])}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 T=0,M=Math.min(e.length,200);T<M&&u<c;){let k=ps(e,T);(k==i[u]||k==s[u])&&(r[u++]=T),T+=Ir(k)}if(u<c)return null}let d=0,m=0,g=!1,v=0,y=-1,b=-1,w=/[a-z]/.test(e),C=!0;for(let T=0,M=Math.min(e.length,200),k=0;T<M&&m<c;){let P=ps(e,T);l<0&&(d<c&&P==i[d]&&(n[d++]=T),v<c&&(P==i[v]||P==s[v]?(v==0&&(y=T),b=T+1,v++):v=0));let E,z=P<255?P>=48&&P<=57||P>=97&&P<=122?2:P>=65&&P<=90?1:0:(E=tS(P))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!T||z==1&&w||k==0&&z!=0)&&(i[m]==P||s[m]==P&&(g=!0)?o[m++]=T:o.length&&(C=!1)),k=z,T+=Ir(P)}return m==c&&o[0]==0&&C?this.result(-100+(g?-200:0),o,e):v==c&&y==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]):v==c?this.ret(-900-e.length,[y,b]):m==c?this.result(-100+(g?-200:0)+-700+(C?0:-1100),o,e):i.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,i,s){let r=[],n=0;for(let o of i){let l=o+(this.astral?Ir(ps(s,o)):1);n&&r[n-1]==o?r[n-1]=l:(r[n++]=o,r[n++]=l)}return this.ret(e-s.length,r)}}class cY{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),s=i==this.pattern?0:i.toLowerCase()==this.folded?-200:null;return s==null?null:(this.matched=[0,i.length],this.score=s+(e.length==this.pattern.length?0:-100),this)}}const yi=ve.define({combine(t){return on(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:uY,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)=>s=>wM(e(s),i(s)),optionClass:(e,i)=>s=>wM(e(s),i(s)),addToOptions:(e,i)=>e.concat(i),filterStrict:(e,i)=>e||i})}});function wM(t,e){return t?e?t+" "+e:t:e}function uY(t,e,i,s,r,n){let o=t.textDirection==ut.RTL,l=o,c=!1,u="top",d,m,g=e.left-r.left,v=r.right-e.right,y=s.right-s.left,b=s.bottom-s.top;if(l&&g<Math.min(y,v)?l=!1:!l&&v<Math.min(y,g)&&(l=!0),y<=(l?g:v))d=Math.max(r.top,Math.min(i.top,r.bottom-b))-e.top,m=Math.min(400,l?g:v);else{c=!0,m=Math.min(400,(o?e.right:r.right-e.left)-30);let T=r.bottom-e.bottom;T>=b||T>e.top?d=i.bottom-e.top:(u="bottom",d=e.bottom-i.top)}let w=(e.bottom-e.top)/n.offsetHeight,C=(e.right-e.left)/n.offsetWidth;return{style:`${u}: ${d/w}px; max-width: ${m/C}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}function fY(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(i){let s=document.createElement("div");return s.classList.add("cm-completionIcon"),i.type&&s.classList.add(...i.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),s.setAttribute("aria-hidden","true"),s},position:20}),e.push({render(i,s,r,n){let o=document.createElement("span");o.className="cm-completionLabel";let l=i.displayLabel||i.label,c=0;for(let u=0;u<n.length;){let d=n[u++],m=n[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,m))),g.className="cm-completionMatchedText",c=m}return c<l.length&&o.appendChild(document.createTextNode(l.slice(c))),o},position:50},{render(i){if(!i.detail)return null;let s=document.createElement("span");return s.className="cm-completionDetail",s.textContent=i.detail,s},position:80}),e.sort((i,s)=>i.position-s.position).map(i=>i.render)}function Vv(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 s=Math.floor((t-e)/i);return{from:t-(s+1)*i,to:t-s*i}}class dY{constructor(e,i,s){this.view=e,this.stateField=i,this.applyCompletion=s,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:n,selected:o}=r.open,l=e.state.facet(yi);this.optionContent=fY(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Vv(n.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,m;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(m=/-(\d+)$/.exec(d.id))&&+m[1]<u.length){this.applyCompletion(e,u[+m[1]]),c.preventDefault();return}}),this.dom.addEventListener("focusout",c=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(yi).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:Ju.of(null)})}),this.showOptions(n,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 s=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),s!=r){let{options:n,selected:o,disabled:l}=s.open;(!r.open||r.open.options!=n)&&(this.range=Vv(n.length,o,e.state.facet(yi).maxRenderedOptions),this.showOptions(n,s.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 s of this.currentClass.split(" "))s&&this.dom.classList.remove(s);for(let s of i.split(" "))s&&this.dom.classList.add(s);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=Vv(i.options.length,i.selected,this.view.state.facet(yi).maxRenderedOptions),this.showOptions(i.options,e.id));let s=this.updateSelectedOption(i.selected);if(s){this.destroyInfo();let{completion:r}=i.options[i.selected],{info:n}=r;if(!n)return;let o=typeof n=="string"?document.createTextNode(n):n(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=>Os(this.view.state,l,"completion info")):(this.addInfoPane(o,r),s.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,i){this.destroyInfo();let s=this.info=document.createElement("div");if(s.className="cm-tooltip cm-completionInfo",s.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)s.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:n}=e;s.appendChild(r),this.infoDestroy=n||null}this.dom.appendChild(s),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let i=null;for(let s=this.list.firstChild,r=this.range.from;s;s=s.nextSibling,r++)s.nodeName!="LI"||!s.id?r--:r==e?s.hasAttribute("aria-selected")||(s.setAttribute("aria-selected","true"),i=s):s.hasAttribute("aria-selected")&&(s.removeAttribute("aria-selected"),s.removeAttribute("aria-describedby"));return i&&mY(this.list,i),i}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let i=this.dom.getBoundingClientRect(),s=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),n=this.space;if(!n){let o=this.dom.ownerDocument.documentElement;n={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(n.bottom,i.bottom)-10||r.bottom<Math.max(n.top,i.top)+10?null:this.view.state.facet(yi).positionInfo(this.view,i,r,s,n,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,s){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 n=null;for(let o=s.from;o<s.to;o++){let{completion:l,match:c}=e[o],{section:u}=l;if(u){let g=typeof u=="string"?u:u.name;if(g!=n&&(o>s.from||s.from==0))if(n=g,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let v=r.appendChild(document.createElement("completion-section"));v.textContent=g}}const d=r.appendChild(document.createElement("li"));d.id=i+"-"+o,d.setAttribute("role","option");let m=this.optionClass(l);m&&(d.className=m);for(let g of this.optionContent){let v=g(l,this.view.state,this.view,c);v&&d.appendChild(v)}}return s.from&&r.classList.add("cm-completionListIncompleteTop"),s.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 pY(t,e){return i=>new dY(i,t,e)}function mY(t,e){let i=t.getBoundingClientRect(),s=e.getBoundingClientRect(),r=i.height/t.offsetHeight;s.top<i.top?t.scrollTop-=(i.top-s.top)/r:s.bottom>i.bottom&&(t.scrollTop+=(s.bottom-i.bottom)/r)}function CM(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function gY(t,e){let i=[],s=null,r=null,n=d=>{i.push(d);let{section:m}=d.completion;if(m){s||(s=[]);let g=typeof m=="string"?m:m.name;s.some(v=>v.name==g)||s.push(typeof m=="string"?{name:g}:m)}},o=e.facet(yi);for(let d of t)if(d.hasResult()){let m=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)n(new SM(g,d.source,m?m(g):[],1e9-i.length));else{let g=e.sliceDoc(d.from,d.to),v,y=o.filterStrict?new cY(g):new hY(g);for(let b of d.result.options)if(v=y.match(b.label)){let w=b.displayLabel?m?m(b,v.matched):[]:v.matched,C=v.score+(b.boost||0);if(n(new SM(b,d.source,w,C)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:T}=b.section;r||(r=Object.create(null)),r[T]=Math.max(C,r[T]||-1e9)}}}}if(s){let d=Object.create(null),m=0,g=(v,y)=>(v.rank==="dynamic"&&y.rank==="dynamic"?r[y.name]-r[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(v.name<y.name?-1:1);for(let v of s.sort(g))m-=1e5,d[v.name]=m;for(let v of i){let{section:y}=v.completion;y&&(v.score+=d[typeof y=="string"?y:y.name])}}let l=[],c=null,u=o.compareCompletions;for(let d of i.sort((m,g)=>g.score-m.score||u(m.completion,g.completion))){let m=d.completion;!c||c.label!=m.label||c.detail!=m.detail||c.type!=null&&m.type!=null&&c.type!=m.type||c.apply!=m.apply||c.boost!=m.boost?l.push(d):CM(d.completion)>CM(c)&&(l[l.length-1]=d),c=d.completion}return l}class sh{constructor(e,i,s,r,n,o){this.options=e,this.attrs=i,this.tooltip=s,this.timestamp=r,this.selected=n,this.disabled=o}setSelected(e,i){return e==this.selected||e>=this.options.length?this:new sh(this.options,kM(i,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,i,s,r,n,o){if(r&&!o&&e.some(u=>u.isPending))return r.setDisabled();let l=gY(e,i);if(!l.length)return r&&e.some(u=>u.isPending)?r.setDisabled():null;let c=i.facet(yi).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 sh(l,kM(s,c),{pos:e.reduce((u,d)=>d.hasResult()?Math.min(u,d.from):u,1e8),create:SY,above:n.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(e){return new sh(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new sh(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Ym{constructor(e,i,s){this.active=e,this.id=i,this.open=s}static start(){return new Ym(yY,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:i}=e,s=i.facet(yi),n=(s.override||i.languageDataAt("autocomplete",ja(i)).map(lY)).map(c=>(this.active.find(d=>d.source==c)||new or(c,this.active.some(d=>d.state!=0)?1:0)).update(e,s));n.length==this.active.length&&n.every((c,u)=>c==this.active[u])&&(n=this.active);let o=this.open,l=e.effects.some(c=>c.is(DS));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||n.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!OY(n,this.active)||l?o=sh.build(n,i,this.id,o,s,l):o&&o.disabled&&!n.some(c=>c.isPending)&&(o=null),!o&&n.every(c=>!c.isPending)&&n.some(c=>c.hasResult())&&(n=n.map(c=>c.hasResult()?new or(c.source,0):c));for(let c of e.effects)c.is(w$)&&(o=o&&o.setSelected(c.value,this.id));return n==this.active&&o==this.open?this:new Ym(n,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?vY:_Y}}function OY(t,e){if(t==e)return!0;for(let i=0,s=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;s<e.length&&!e[s].hasResult();)s++;let r=i==t.length,n=s==e.length;if(r||n)return r==n;if(t[i++].result!=e[s++].result)return!1}}const vY={"aria-autocomplete":"list"},_Y={};function kM(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const yY=[];function x$(t,e){if(t.isUserEvent("input.complete")){let s=t.annotation(BS);if(s&&e.activateOnCompletion(s))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 or{constructor(e,i,s=!1){this.source=e,this.state=i,this.explicit=s}hasResult(){return!1}get isPending(){return this.state==1}update(e,i){let s=x$(e,i),r=this;(s&8||s&16&&this.touches(e))&&(r=new or(r.source,0)),s&4&&r.state==0&&(r=new or(this.source,1)),r=r.updateFor(e,s);for(let n of e.effects)if(n.is(Um))r=new or(r.source,1,n.value);else if(n.is(Ju))r=new or(r.source,0);else if(n.is(DS))for(let o of n.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(ja(e.state))}}class ph extends or{constructor(e,i,s,r,n,o){super(e,3,i),this.limit=s,this.result=r,this.from=n,this.to=o}hasResult(){return!0}updateFor(e,i){var s;if(!(i&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let n=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ja(e.state);if(l>o||!r||i&2&&(ja(e.startState)==this.from||l<this.limit))return new or(this.source,i&4?1:0);let c=e.changes.mapPos(this.limit);return bY(r.validFor,e.state,n,o)?new ph(this.source,this.explicit,c,r,n,o):r.update&&(r=r.update(r,n,o,new $S(e.state,l,!1)))?new ph(this.source,this.explicit,c,r,r.from,(s=r.to)!==null&&s!==void 0?s:ja(e.state)):new or(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new ph(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new or(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function bY(t,e,i,s){if(!t)return!1;let r=e.sliceDoc(i,s);return typeof t=="function"?t(r,i,s,e):S$(t,!0).test(r)}const DS=Qe.define({map(t,e){return t.map(i=>i.map(e))}}),w$=Qe.define(),ms=Si.define({create(){return Ym.start()},update(t,e){return t.update(e)},provide:t=>[vS.from(t,e=>e.tooltip),pe.contentAttributes.from(t,e=>e.attrs)]});function zS(t,e){const i=e.completion.apply||e.completion.label;let s=t.state.field(ms).active.find(r=>r.source==e.source);return s instanceof ph?(typeof i=="string"?t.dispatch({...aY(t.state,i,s.from,s.to),annotations:BS.of(e.completion)}):i(t,e.completion,s.from,s.to),!0):!1}const SY=pY(ms,zS);function kp(t,e="option"){return i=>{let s=i.state.field(ms,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp<i.state.facet(yi).interactionDelay)return!1;let r=1,n;e=="page"&&(n=t3(i,s.open.tooltip))&&(r=Math.max(2,Math.floor(n.dom.offsetHeight/n.dom.querySelector("li").offsetHeight)-1));let{length:o}=s.open.options,l=s.open.selected>-1?s.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:w$.of(l)}),!0}}const xY=t=>{let e=t.state.field(ms,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(yi).interactionDelay?!1:zS(t,e.open.options[e.open.selected])},Zv=t=>t.state.field(ms,!1)?(t.dispatch({effects:Um.of(!0)}),!0):!1,wY=t=>{let e=t.state.field(ms,!1);return!e||!e.active.some(i=>i.state!=0)?!1:(t.dispatch({effects:Ju.of(null)}),!0)};class CY{constructor(e,i){this.active=e,this.context=i,this.time=Date.now(),this.updates=[],this.done=void 0}}const kY=50,TY=1e3,MY=Nt.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(ms).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(ms),i=t.state.facet(yi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(ms)==e)return;let s=t.transactions.some(n=>{let o=x$(n,i);return o&8||(n.selection||n.docChanged)&&!(o&3)});for(let n=0;n<this.running.length;n++){let o=this.running[n];if(s||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>kY&&Date.now()-o.time>TY){for(let l of o.context.abortListeners)try{l()}catch(c){Os(this.view.state,c)}o.context.abortListeners=null,this.running.splice(n--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(n=>n.effects.some(o=>o.is(Um)))&&(this.pendingStart=!0);let r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(n=>n.isPending&&!this.running.some(o=>o.active.source==n.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let n of t.transactions)n.isUserEvent("input.type")?this.composing=2:this.composing==2&&n.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(ms);for(let i of e.active)i.isPending&&!this.running.some(s=>s.active.source==i.source)&&this.startQuery(i);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(yi).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=ja(e),s=new $S(e,i,t.explicit,this.view),r=new CY(t,s);this.running.push(r),Promise.resolve(t.source(s)).then(n=>{r.context.aborted||(r.done=n||null,this.scheduleAccept())},n=>{this.view.dispatch({effects:Ju.of(null)}),Os(this.view.state,n)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(yi).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(yi),s=this.view.state.field(ms);for(let r=0;r<this.running.length;r++){let n=this.running[r];if(n.done===void 0)continue;if(this.running.splice(r--,1),n.done){let l=ja(n.updates.length?n.updates[0].startState:this.view.state),c=Math.min(l,n.done.from+(n.active.explicit?0:1)),u=new ph(n.active.source,n.active.explicit,c,n.done,n.done.from,(t=n.done.to)!==null&&t!==void 0?t:l);for(let d of n.updates)u=u.update(d,i);if(u.hasResult()){e.push(u);continue}}let o=s.active.find(l=>l.source==n.active.source);if(o&&o.isPending)if(n.done==null){let l=new or(n.active.source,0);for(let c of n.updates)l=l.update(c,i);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||s.open&&s.open.disabled)&&this.view.dispatch({effects:DS.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(ms,!1);if(e&&e.tooltip&&this.view.state.facet(yi).closeOnBlur){let i=e.open&&t3(this.view,e.open.tooltip);(!i||!i.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Ju.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Um.of(!1)}),20),this.composing=0}}}),AY=typeof navigator=="object"&&/Win/.test(navigator.platform),EY=Wn.highest(pe.domEventHandlers({keydown(t,e){let i=e.state.field(ms,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&!(AY&&t.altKey)||t.metaKey)return!1;let s=i.open.options[i.open.selected],r=i.active.find(o=>o.source==s.source),n=s.completion.commitCharacters||r.result.commitCharacters;return n&&n.indexOf(t.key)>-1&&zS(e,s),!1}})),C$=pe.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 PY{constructor(e,i,s,r){this.field=e,this.line=i,this.from=s,this.to=r}}class NS{constructor(e,i,s){this.field=e,this.from=i,this.to=s}map(e){let i=e.mapPos(this.from,-1,Bi.TrackDel),s=e.mapPos(this.to,1,Bi.TrackDel);return i==null||s==null?null:new NS(this.field,i,s)}}class jS{constructor(e,i){this.lines=e,this.fieldPositions=i}instantiate(e,i){let s=[],r=[i],n=e.doc.lineAt(i),o=/^\s*/.exec(n.text)[0];for(let c of this.lines){if(s.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let m=0;m<d;m++)u+=e.facet(Lh);r.push(i+u.length-d),c=u+c.slice(d)}s.push(c),i+=c.length+1}let l=this.fieldPositions.map(c=>new NS(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:s,ranges:l}}static parse(e){let i=[],s=[],r=[],n;for(let o of e.split(/\r\n?|\n/)){for(;n=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=n[1]?+n[1]:null,c=n[2]||n[3]||"",u=-1,d=c.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m<i.length;m++)(l!=null?i[m].seq==l:d&&i[m].name==d)&&(u=m);if(u<0){let m=0;for(;m<i.length&&(l==null||i[m].seq!=null&&i[m].seq<l);)m++;i.splice(m,0,{seq:l,name:d}),u=m;for(let g of r)g.field>=u&&g.field++}for(let m of r)if(m.line==s.length&&m.from>n.index){let g=n[2]?3+(n[1]||"").length:2;m.from-=g,m.to-=g}r.push(new PY(u,s.length,n.index,n.index+d.length)),o=o.slice(0,n.index)+c+o.slice(n.index+n[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==s.length&&d.from>u&&(d.from--,d.to--);return c}),s.push(o)}return new jS(s,r)}}let RY=Te.widget({widget:new class extends kr{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),QY=Te.mark({class:"cm-snippetField"});class zh{constructor(e,i){this.ranges=e,this.active=i,this.deco=Te.set(e.map(s=>(s.from==s.to?RY:QY).range(s.from,s.to)),!0)}map(e){let i=[];for(let s of this.ranges){let r=s.map(e);if(!r)return null;i.push(r)}return new zh(i,this.active)}selectionInsideField(e){return e.ranges.every(i=>this.ranges.some(s=>s.field==this.active&&s.from<=i.from&&s.to>=i.to))}}const Ef=Qe.define({map(t,e){return t&&t.map(e)}}),LY=Qe.define(),ef=Si.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(Ef))return i.value;if(i.is(LY)&&t)return new zh(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=>pe.decorations.from(t,e=>e?e.deco:Te.none)});function XS(t,e){return ne.create(t.filter(i=>i.field==e).map(i=>ne.range(i.from,i.to)))}function $Y(t){let e=jS.parse(t);return(i,s,r,n)=>{let{text:o,ranges:l}=e.instantiate(i.state,r),{main:c}=i.state.selection,u={changes:{from:r,to:n==c.from?c.to:n,insert:Je.of(o)},scrollIntoView:!0,annotations:s?[BS.of(s),Yt.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=XS(l,0)),l.some(d=>d.field>0)){let d=new zh(l,0),m=u.effects=[Ef.of(d)];i.state.field(ef,!1)===void 0&&m.push(Qe.appendConfig.of([ef,jY,XY,C$]))}i.dispatch(i.state.update(u))}}function k$(t){return({state:e,dispatch:i})=>{let s=e.field(ef,!1);if(!s||t<0&&s.active==0)return!1;let r=s.active+t,n=t>0&&!s.ranges.some(o=>o.field==r+t);return i(e.update({selection:XS(s.ranges,r),effects:Ef.of(n?null:new zh(s.ranges,r)),scrollIntoView:!0})),!0}}const BY=({state:t,dispatch:e})=>t.field(ef,!1)?(e(t.update({effects:Ef.of(null)})),!0):!1,DY=k$(1),zY=k$(-1),NY=[{key:"Tab",run:DY,shift:zY},{key:"Escape",run:BY}],TM=ve.define({combine(t){return t.length?t[0]:NY}}),jY=Wn.highest(Ka.compute([TM],t=>t.facet(TM)));function ds(t,e){return{...e,apply:$Y(t)}}const XY=pe.domEventHandlers({mousedown(t,e){let i=e.state.field(ef,!1),s;if(!i||(s=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let r=i.ranges.find(n=>n.from<=s&&n.to>=s);return!r||r.field==i.active?!1:(e.dispatch({selection:XS(i.ranges,r.field),effects:Ef.of(i.ranges.some(n=>n.field>r.field)?new zh(i.ranges,r.field):null),scrollIntoView:!0}),!0)}}),tf={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ba=Qe.define({map(t,e){let i=e.mapPos(t,-1,Bi.TrackAfter);return i??void 0}}),VS=new class extends Zo{};VS.startSide=1;VS.endSide=-1;const T$=Si.define({create(){return Ze.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:s=>s>=i.from&&s<=i.to})}for(let i of e.effects)i.is(Ba)&&(t=t.update({add:[VS.range(i.value,i.value+1)]}));return t}});function VY(){return[IY,T$]}const Iv="()[]{}<>«»»«[]{}";function M$(t){for(let e=0;e<Iv.length;e+=2)if(Iv.charCodeAt(e)==t)return Iv.charAt(e+1);return tS(t<128?t:t+1)}function A$(t,e){return t.languageDataAt("closeBrackets",e)[0]||tf}const ZY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),IY=pe.inputHandler.of((t,e,i,s)=>{if((ZY?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let r=t.state.selection.main;if(s.length>2||s.length==2&&Ir(ps(s,0))==1||e!=r.from||i!=r.to)return!1;let n=UY(t.state,s);return n?(t.dispatch(n),!0):!1}),qY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let s=A$(t,t.selection.main.head).brackets||tf.brackets,r=null,n=t.changeByRange(o=>{if(o.empty){let l=YY(t.doc,o.head);for(let c of s)if(c==l&&Tg(t.doc,o.head)==M$(ps(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:ne.cursor(o.head-c.length)}}return{range:r=o}});return r||e(t.update(n,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},WY=[{key:"Backspace",run:qY}];function UY(t,e){let i=A$(t,t.selection.main.head),s=i.brackets||tf.brackets;for(let r of s){let n=M$(ps(r,0));if(e==r)return n==r?GY(t,r,s.indexOf(r+r+r)>-1,i):HY(t,r,n,i.before||tf.before);if(e==n&&E$(t,t.selection.main.from))return FY(t,r,n)}return null}function E$(t,e){let i=!1;return t.field(T$).between(0,t.doc.length,s=>{s==e&&(i=!0)}),i}function Tg(t,e){let i=t.sliceString(e,e+2);return i.slice(0,Ir(ps(i,0)))}function YY(t,e){let i=t.sliceString(e-2,e);return Ir(ps(i,0))==i.length?i:i.slice(1)}function HY(t,e,i,s){let r=null,n=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:i,from:o.to}],effects:Ba.of(o.to+e.length),range:ne.range(o.anchor+e.length,o.head+e.length)};let l=Tg(t.doc,o.head);return!l||/\s/.test(l)||s.indexOf(l)>-1?{changes:{insert:e+i,from:o.head},effects:Ba.of(o.head+e.length),range:ne.cursor(o.head+e.length)}:{range:r=o}});return r?null:t.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function FY(t,e,i){let s=null,r=t.changeByRange(n=>n.empty&&Tg(t.doc,n.head)==i?{changes:{from:n.head,to:n.head+i.length,insert:i},range:ne.cursor(n.head+i.length)}:s={range:n});return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function GY(t,e,i,s){let r=s.stringPrefixes||tf.stringPrefixes,n=null,o=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Ba.of(l.to+e.length),range:ne.range(l.anchor+e.length,l.head+e.length)};let c=l.head,u=Tg(t.doc,c),d;if(u==e){if(MM(t,c))return{changes:{insert:e+e,from:c},effects:Ba.of(c+e.length),range:ne.cursor(c+e.length)};if(E$(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:ne.cursor(c+g.length)}}}else{if(i&&t.sliceDoc(c-2*e.length,c)==e+e&&(d=AM(t,c-2*e.length,r))>-1&&MM(t,d))return{changes:{insert:e+e+e+e,from:c},effects:Ba.of(c+e.length),range:ne.cursor(c+e.length)};if(t.charCategorizer(c)(u)!=St.Word&&AM(t,c,r)>-1&&!KY(t,c,e,r))return{changes:{insert:e+e,from:c},effects:Ba.of(c+e.length),range:ne.cursor(c+e.length)}}return{range:n=l}});return n?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function MM(t,e){let i=ft(t).resolveInner(e+1);return i.parent&&i.from==e}function KY(t,e,i,s){let r=ft(t).resolveInner(e,-1),n=s.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+n)),c=l.indexOf(i);if(!c||c>-1&&s.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 AM(t,e,i){let s=t.charCategorizer(e);if(s(t.sliceDoc(e-1,e))!=St.Word)return e;for(let r of i){let n=e-r.length;if(t.sliceDoc(n,e)==r&&s(t.sliceDoc(n-1,n))!=St.Word)return n}return-1}function JY(t={}){return[EY,ms,yi.of(t),MY,eH,C$]}const P$=[{key:"Ctrl-Space",run:Zv},{mac:"Alt-`",run:Zv},{mac:"Alt-i",run:Zv},{key:"Escape",run:wY},{key:"ArrowDown",run:kp(!0)},{key:"ArrowUp",run:kp(!1)},{key:"PageDown",run:kp(!0,"page")},{key:"PageUp",run:kp(!1,"page")},{key:"Enter",run:xY}],eH=Wn.highest(Ka.computeN([yi],t=>t.facet(yi).defaultKeymap?[P$]:[]));class EM{constructor(e,i,s){this.from=e,this.to=i,this.diagnostic=s}}class Aa{constructor(e,i,s){this.diagnostics=e,this.panel=i,this.selected=s}static init(e,i,s){let r=s.facet(sf).markerFilter;r&&(e=r(e,s));let n=e.slice().sort((v,y)=>v.from-y.from||v.to-y.to),o=new Zn,l=[],c=0,u=s.doc.iter(),d=0,m=s.doc.length;for(let v=0;;){let y=v==n.length?null:n[v];if(!y&&!l.length)break;let b,w;if(l.length)b=c,w=l.reduce((M,k)=>Math.min(M,k.to),y&&y.from>b?y.from:1e8);else{if(b=y.from,b>m)break;w=y.to,l.push(y),v++}for(;v<n.length;){let M=n[v];if(M.from==b&&(M.to>M.from||M.to==b))l.push(M),v++,w=Math.min(M.to,w);else{w=Math.min(M.from,w);break}}w=Math.min(w,m);let C=!1;if(l.some(M=>M.from==b&&(M.to==w||w==m))&&(C=b==w,!C&&w-b<10)){let M=b-(d+u.value.length);M>0&&(u.next(M),d=b);for(let k=b;;){if(k>=w){C=!0;break}if(!u.lineBreak&&d+u.value.length>k)break;k=d+u.value.length,d+=u.value.length,u.next()}}let T=dH(l);if(C)o.add(b,b,Te.widget({widget:new hH(T),diagnostics:l.slice()}));else{let M=l.reduce((k,P)=>P.markClass?k+" "+P.markClass:k,"");o.add(b,w,Te.mark({class:"cm-lintRange cm-lintRange-"+T+M,diagnostics:l.slice(),inclusiveEnd:l.some(k=>k.to>w)}))}if(c=w,c==m)break;for(let M=0;M<l.length;M++)l[M].to<=c&&l.splice(M--,1)}let g=o.finish();return new Aa(g,i,Ho(g))}}function Ho(t,e=null,i=0){let s=null;return t.between(i,1e9,(r,n,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!s)s=new EM(r,n,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(s.diagnostic)<0)return!1;s=new EM(s.from,n,s.diagnostic)}}),s}function tH(t,e){let i=e.pos,s=e.end||i,r=t.state.facet(sf).hideOn(t,i,s);if(r!=null)return r;let n=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(R$))||t.changes.touchesRange(n.from,Math.max(n.to,s)))}function iH(t,e){return t.field(Ds,!1)?e:e.concat(Qe.appendConfig.of(pH))}const R$=Qe.define(),ZS=Qe.define(),Q$=Qe.define(),Ds=Si.define({create(){return new Aa(Te.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),s=null,r=t.panel;if(t.selected){let n=e.changes.mapPos(t.selected.from,1);s=Ho(i,t.selected.diagnostic,n)||Ho(i,null,n)}!i.size&&r&&e.state.facet(sf).autoPanel&&(r=null),t=new Aa(i,r,s)}for(let i of e.effects)if(i.is(R$)){let s=e.state.facet(sf).autoPanel?i.value.length?rf.open:null:t.panel;t=Aa.init(i.value,s,e.state)}else i.is(ZS)?t=new Aa(t.diagnostics,i.value?rf.open:null,t.selected):i.is(Q$)&&(t=new Aa(t.diagnostics,t.panel,i.value));return t},provide:t=>[Wu.from(t,e=>e.panel),pe.decorations.from(t,e=>e.diagnostics)]}),sH=Te.mark({class:"cm-lintRange cm-lintRange-active"});function rH(t,e,i){let{diagnostics:s}=t.state.field(Ds),r,n=-1,o=-1;s.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,n=c,o=u,!1});let l=t.state.facet(sf).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:n,end:o,above:t.state.doc.lineAt(n).to<o,create(){return{dom:nH(t,r)}}}:null}function nH(t,e){return lt("ul",{class:"cm-tooltip-lint"},e.map(i=>$$(t,i,!1)))}const oH=t=>{let e=t.state.field(Ds,!1);(!e||!e.panel)&&t.dispatch({effects:iH(t.state,[ZS.of(!0)])});let i=_S(t,rf.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},PM=t=>{let e=t.state.field(Ds,!1);return!e||!e.panel?!1:(t.dispatch({effects:ZS.of(!1)}),!0)},aH=t=>{let e=t.state.field(Ds,!1);if(!e)return!1;let i=t.state.selection.main,s=Ho(e.diagnostics,null,i.to+1);return!s&&(s=Ho(e.diagnostics,null,0),!s||s.from==i.from&&s.to==i.to)?!1:(t.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),!0)},lH=[{key:"Mod-Shift-m",run:oH,preventDefault:!0},{key:"F8",run:aH}],sf=ve.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...on(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:RM,tooltipFilter:RM,needsRefresh:(e,i)=>e?i?s=>e(s)||i(s):e:i,hideOn:(e,i)=>e?i?(s,r,n)=>e(s,r,n)||i(s,r,n):e:i,autoPanel:(e,i)=>e||i})}}});function RM(t,e){return t?e?(i,s)=>e(t(i,s),s):t:e}function L$(t){let e=[];if(t)e:for(let{name:i}of t){for(let s=0;s<i.length;s++){let r=i[s];if(/[a-zA-Z]/.test(r)&&!e.some(n=>n.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function $$(t,e,i){var s;let r=i?L$(e.actions):[];return lt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},lt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(s=e.actions)===null||s===void 0?void 0:s.map((n,o)=>{let l=!1,c=v=>{if(v.preventDefault(),l)return;l=!0;let y=Ho(t.state.field(Ds).diagnostics,e);y&&n.apply(t,y.from,y.to)},{name:u}=n,d=r[o]?u.indexOf(r[o]):-1,m=d<0?u:[u.slice(0,d),lt("u",u.slice(d,d+1)),u.slice(d+1)],g=n.markClass?" "+n.markClass:"";return lt("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},m)}),e.source&<("div",{class:"cm-diagnosticSource"},e.source))}class hH extends kr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return lt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class QM{constructor(e,i){this.diagnostic=i,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=$$(e,i,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class rf{constructor(e){this.view=e,this.items=[];let i=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)PM(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:n}=this.items[this.selectedIndex],o=L$(n.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let c=Ho(this.view.state.field(Ds).diagnostics,n);c&&n.actions[l].apply(e,c.from,c.to)}}else return;r.preventDefault()}},s=r=>{for(let n=0;n<this.items.length;n++)this.items[n].dom.contains(r.target)&&this.moveSelection(n)};this.list=lt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:i,onclick:s}),this.dom=lt("div",{class:"cm-panel-lint"},this.list,lt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>PM(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ds).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(Ds),s=0,r=!1,n=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 m=-1,g;for(let v=s;v<this.items.length;v++)if(this.items[v].diagnostic==d){m=v;break}m<0?(g=new QM(this.view,d),this.items.splice(s,0,g),r=!0):(g=this.items[m],m>s&&(this.items.splice(s,m-s),r=!0)),i&&g.diagnostic==i.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),n=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),s++}});s<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 QM(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),n?(this.list.setAttribute("aria-activedescendant",n.id),this.view.requestMeasure({key:this,read:()=>({sel:n.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 s=e;e=s.nextSibling,s.remove()}for(let s of this.items)if(s.dom.parentNode==this.list){for(;e!=s.dom;)i();e=s.dom.nextSibling}else this.list.insertBefore(s.dom,e);for(;e;)i()}moveSelection(e){if(this.selectedIndex<0)return;let i=this.view.state.field(Ds),s=Ho(i.diagnostics,this.items[e].diagnostic);s&&this.view.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:Q$.of(s)})}static open(e){return new rf(e)}}function cH(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 Tp(t){return cH(`<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 uH=pe.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:Tp("#d11")},".cm-lintRange-warning":{backgroundImage:Tp("orange")},".cm-lintRange-info":{backgroundImage:Tp("#999")},".cm-lintRange-hint":{backgroundImage:Tp("#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 fH(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function dH(t){let e="hint",i=1;for(let s of t){let r=fH(s.severity);r>i&&(i=r,e=s.severity)}return e}const pH=[Ds,pe.decorations.compute([Ds],t=>{let{selected:e,panel:i}=t.field(Ds);return!e||!i||e.from==e.to?Te.none:Te.set([sH.range(e.from,e.to)])}),WI(rH,{hideOn:tH}),uH];var LM=function(e){e===void 0&&(e={});var{crosshairCursor:i=!1}=e,s=[];e.closeBracketsKeymap!==!1&&(s=s.concat(WY)),e.defaultKeymap!==!1&&(s=s.concat(MU)),e.searchKeymap!==!1&&(s=s.concat(tY)),e.historyKeymap!==!1&&(s=s.concat($W)),e.foldKeymap!==!1&&(s=s.concat(Fq)),e.completionKeymap!==!1&&(s=s.concat(P$)),e.lintKeymap!==!1&&(s=s.concat(lH));var r=[];return e.lineNumbers!==!1&&r.push(nq()),e.highlightActiveLineGutter!==!1&&r.push(lq()),e.highlightSpecialChars!==!1&&r.push(bI()),e.history!==!1&&r.push(kW()),e.foldGutter!==!1&&r.push(eW()),e.drawSelection!==!1&&r.push(cI()),e.dropCursor!==!1&&r.push(mI()),e.allowMultipleSelections!==!1&&r.push(We.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(Vq()),e.syntaxHighlighting!==!1&&r.push(M3(rW,{fallback:!0})),e.bracketMatching!==!1&&r.push(uW()),e.closeBrackets!==!1&&r.push(VY()),e.autocompletion!==!1&&r.push(JY()),e.rectangularSelection!==!1&&r.push($I()),i!==!1&&r.push(zI()),e.highlightActiveLine!==!1&&r.push(TI()),e.highlightSelectionMatches!==!1&&r.push(LU()),e.tabSize&&typeof e.tabSize=="number"&&r.push(Lh.of(" ".repeat(e.tabSize))),r.concat([Ka.of(s.flat())]).filter(Boolean)};const mH="#e5c07b",$M="#e06c75",gH="#56b6c2",OH="#ffffff",tm="#abb2bf",by="#7d8799",vH="#61afef",_H="#98c379",BM="#d19a66",yH="#c678dd",bH="#21252b",DM="#2c313a",zM="#282c34",qv="#353a42",SH="#3E4451",NM="#528bff",xH=pe.theme({"&":{color:tm,backgroundColor:zM},".cm-content":{caretColor:NM},".cm-cursor, .cm-dropCursor":{borderLeftColor:NM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:SH},".cm-panels":{backgroundColor:bH,color:tm},".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:zM,color:by,border:"none"},".cm-activeLineGutter":{backgroundColor:DM},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:qv},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:qv,borderBottomColor:qv},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:DM,color:tm}}},{dark:!0}),wH=Tf.define([{tag:B.keyword,color:yH},{tag:[B.name,B.deleted,B.character,B.propertyName,B.macroName],color:$M},{tag:[B.function(B.variableName),B.labelName],color:vH},{tag:[B.color,B.constant(B.name),B.standard(B.name)],color:BM},{tag:[B.definition(B.name),B.separator],color:tm},{tag:[B.typeName,B.className,B.number,B.changed,B.annotation,B.modifier,B.self,B.namespace],color:mH},{tag:[B.operator,B.operatorKeyword,B.url,B.escape,B.regexp,B.link,B.special(B.string)],color:gH},{tag:[B.meta,B.comment],color:by},{tag:B.strong,fontWeight:"bold"},{tag:B.emphasis,fontStyle:"italic"},{tag:B.strikethrough,textDecoration:"line-through"},{tag:B.link,color:by,textDecoration:"underline"},{tag:B.heading,fontWeight:"bold",color:$M},{tag:[B.atom,B.bool,B.special(B.variableName)],color:BM},{tag:[B.processingInstruction,B.string,B.inserted],color:_H},{tag:B.invalid,color:OH}]),B$=[xH,M3(wH)];var CH=pe.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),kH=function(e){e===void 0&&(e={});var{indentWithTab:i=!0,editable:s=!0,readOnly:r=!1,theme:n="light",placeholder:o="",basicSetup:l=!0}=e,c=[];switch(i&&c.unshift(Ka.of([AU])),l&&(typeof l=="boolean"?c.unshift(LM()):c.unshift(LM(l))),o&&c.unshift(PI(o)),n){case"light":c.push(CH);break;case"dark":c.push(B$);break;case"none":break;default:c.push(n);break}return s===!1&&c.push(pe.editable.of(!1)),r&&c.push(We.readOnly.of(!0)),[...c]},TH=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 MH{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(s){console.error("TimeoutLatch callback error:",s)}})}}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 jM{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 Wv=null,AH=()=>typeof window>"u"?new jM:(Wv||(Wv=new jM),Wv),XM=nn.define(),EH=200,PH=[];function RH(t){var{value:e,selection:i,onChange:s,onStatistics:r,onCreateEditor:n,onUpdate:o,extensions:l=PH,autoFocus:c,theme:u="light",height:d=null,minHeight:m=null,maxHeight:g=null,width:v=null,minWidth:y=null,maxWidth:b=null,placeholder:w="",editable:C=!0,readOnly:T=!1,indentWithTab:M=!0,basicSetup:k=!0,root:P,initialState:E}=t,[z,$]=X.useState(),[Z,ie]=X.useState(),[F,R]=X.useState(),Q=X.useState(()=>({current:null}))[0],D=X.useState(()=>({current:null}))[0],I=pe.theme({"&":{height:d,minHeight:m,maxHeight:g,width:v,minWidth:y,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),L=pe.updateListener.of(Y=>{if(Y.docChanged&&typeof s=="function"&&!Y.transactions.some(G=>G.annotation(XM))){Q.current?Q.current.reset():(Q.current=new MH(()=>{if(D.current){var G=D.current;D.current=null,G()}Q.current=null},EH),AH().add(Q.current));var W=Y.state.doc,N=W.toString();s(N,Y)}r&&r(TH(Y))}),j=kH({theme:u,editable:C,readOnly:T,placeholder:w,indentWithTab:M,basicSetup:k}),U=[L,I,...j];return o&&typeof o=="function"&&U.push(pe.updateListener.of(o)),U=U.concat(l),X.useLayoutEffect(()=>{if(z&&!F){var Y={doc:e,selection:i,extensions:U},W=E?We.fromJSON(E.json,Y,E.fields):We.create(Y);if(R(W),!Z){var N=new pe({state:W,parent:z,root:P});ie(N),n&&n(N,W)}}return()=>{Z&&(R(void 0),ie(void 0))}},[z,F]),X.useEffect(()=>{t.container&&$(t.container)},[t.container]),X.useEffect(()=>()=>{Z&&(Z.destroy(),ie(void 0)),Q.current&&(Q.current.cancel(),Q.current=null)},[Z]),X.useEffect(()=>{c&&Z&&Z.focus()},[c,Z]),X.useEffect(()=>{Z&&Z.dispatch({effects:Qe.reconfigure.of(U)})},[u,l,d,m,g,v,y,b,w,C,T,M,k,s,o]),X.useEffect(()=>{if(e!==void 0){var Y=Z?Z.state.doc.toString():"";if(Z&&e!==Y){var W=Q.current&&!Q.current.isDone,N=()=>{Z&&e!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:e||""},annotations:[XM.of(!0)]})};W?D.current=N:N()}}},[e,Z]),{state:F,setState:R,view:Z,setView:ie,container:z,setContainer:$}}var QH=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],D$=X.forwardRef((t,e)=>{var{className:i,value:s="",selection:r,extensions:n=[],onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:m="light",height:g,minHeight:v,maxHeight:y,width:b,minWidth:w,maxWidth:C,basicSetup:T,placeholder:M,indentWithTab:k,editable:P,readOnly:E,root:z,initialState:$}=t,Z=FV(t,QH),ie=X.useRef(null),{state:F,view:R,container:Q,setContainer:D}=RH({root:z,value:s,autoFocus:d,theme:m,height:g,minHeight:v,maxHeight:y,width:b,minWidth:w,maxWidth:C,basicSetup:T,placeholder:M,indentWithTab:k,editable:P,readOnly:E,selection:r,onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:n,initialState:$});X.useImperativeHandle(e,()=>({editor:ie.current,state:F,view:R}),[ie,Q,F,R]);var I=X.useCallback(j=>{ie.current=j,D(j)},[D]);if(typeof s!="string")throw new Error("value must be typeof string but got "+typeof s);var L=typeof m=="string"?"cm-theme-"+m:"cm-theme";return S.jsx("div",M1({ref:I,className:""+L+(i?" "+i:"")},Z))});D$.displayName="CodeMirror";class Hm{static create(e,i,s,r,n){let o=r+(r<<8)+e+(i<<4)|0;return new Hm(e,i,s,o,n,[],[])}constructor(e,i,s,r,n,o,l){this.type=e,this.value=i,this.from=s,this.hash=r,this.end=n,this.children=o,this.positions=l,this.hashProp=[[Le.contextHash,r]]}addChild(e,i){e.prop(Le.contextHash)!=this.hash&&(e=new et(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(i)}toTree(e,i=this.end){let s=this.children.length-1;return s>=0&&(i=Math.max(i,this.positions[s]+this.children[s].length+this.from)),new et(e.types[this.type],this.children,this.positions,i-this.from).balance({makeTree:(r,n,o)=>new et(ri.none,r,n,o,this.hashProp)})}}var ue;(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"})(ue||(ue={}));class LH{constructor(e,i){this.start=e,this.content=i,this.marks=[],this.parsers=[]}}class $H{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 Eu(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,s=0){for(let r=i;r<e;r++)s+=this.text.charCodeAt(r)==9?4-s%4:1;return s}findColumn(e){let i=0;for(let s=0;i<this.text.length&&s<e;i++)s+=this.text.charCodeAt(i)==9?4-s%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 VM(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 s=(t.type==ue.OrderedList?WS:qS)(i,e,!1);return s>0&&(t.type!=ue.BulletList||IS(i,e,!1)<0)&&i.text.charCodeAt(i.pos+s-1)==t.value}const z$={[ue.Blockquote](t,e,i){return i.next!=62?!1:(i.markers.push(Ye(ue.QuoteMark,e.lineStart+i.pos,e.lineStart+i.pos+1)),i.moveBase(i.pos+(ur(i.text.charCodeAt(i.pos+1))?2:1)),t.end=e.lineStart+i.text.length,!0)},[ue.ListItem](t,e,i){return i.indent<i.baseIndent+t.value&&i.next>-1?!1:(i.moveBaseColumn(i.baseIndent+t.value),!0)},[ue.OrderedList]:VM,[ue.BulletList]:VM,[ue.Document](){return!0}};function ur(t){return t==32||t==9||t==10||t==13}function Eu(t,e=0){for(;e<t.length&&ur(t.charCodeAt(e));)e++;return e}function ZM(t,e,i){for(;e>i&&ur(t.charCodeAt(e-1));)e--;return e}function N$(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 j$(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function IS(t,e,i){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let s=1;for(let r=t.pos+1;r<t.text.length;r++){let n=t.text.charCodeAt(r);if(n==t.next)s++;else if(!ur(n))return-1}return i&&t.next==45&&Z$(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(U$.SetextHeading)>-1||s<3?-1:1}function X$(t,e){for(let i=t.stack.length-1;i>=0;i--)if(t.stack[i].type==e)return!0;return!1}function qS(t,e,i){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||ur(t.text.charCodeAt(t.pos+1)))&&(!i||X$(e,ue.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function WS(t,e,i){let s=t.pos,r=t.next;for(;r>=48&&r<=57;){s++;if(s==t.text.length)return-1;r=t.text.charCodeAt(s)}return s==t.pos||s>t.pos+9||r!=46&&r!=41||s<t.text.length-1&&!ur(t.text.charCodeAt(s+1))||i&&!X$(e,ue.OrderedList)&&(t.skipSpace(s+1)==t.text.length||s>t.pos+1||t.next!=49)?-1:s+1-t.pos}function V$(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 Z$(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&&ur(t.text.charCodeAt(e));)e++;return e==t.text.length?i:-1}const Sy=/^[ \t]*$/,I$=/-->/,q$=/\?>/,xy=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,I$],[/^\s*<\?/,q$],[/^\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,Sy],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Sy]];function W$(t,e,i){if(t.next!=60)return-1;let s=t.text.slice(t.pos);for(let r=0,n=xy.length-(i?1:0);r<n;r++)if(xy[r][0].test(s))return r;return-1}function IM(t,e){let i=t.countIndent(e,t.pos,t.indent),s=t.countIndent(t.skipSpace(e),e,i);return s>=i+5?i+1:s}function xo(t,e,i){let s=t.length-1;s>=0&&t[s].to==e&&t[s].type==ue.CodeText?t[s].to=i:t.push(Ye(ue.CodeText,e,i))}const Mp={LinkReference:void 0,IndentedCode(t,e){let i=e.baseIndent+4;if(e.indent<i)return!1;let s=e.findColumn(i),r=t.lineStart+s,n=t.lineStart+e.text.length,o=[],l=[];for(xo(o,r,n);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){xo(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==ue.CodeText?xo(o,u.from,u.to):o.push(u);l=[]}xo(o,t.lineStart-1,t.lineStart);for(let u of e.markers)o.push(u);n=t.lineStart+e.text.length;let c=t.lineStart+e.findColumn(e.baseIndent+4);c<n&&xo(o,c,n)}}return l.length&&(l=l.filter(c=>c.type!=ue.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-r).finish(ue.CodeBlock,n-r),r),!0},FencedCode(t,e){let i=N$(e);if(i<0)return!1;let s=t.lineStart+e.pos,r=e.next,n=i-e.pos,o=e.skipSpace(i),l=ZM(e.text,e.text.length,o),c=[Ye(ue.CodeMark,s,s+n)];o<l&&c.push(Ye(ue.CodeInfo,t.lineStart+o,t.lineStart+l));for(let u=!0,d=!0,m=!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>=n&&e.skipSpace(g)==e.text.length){for(let v of e.markers)c.push(v);d&&m&&xo(c,t.lineStart-1,t.lineStart),c.push(Ye(ue.CodeMark,t.lineStart+e.pos,t.lineStart+g)),t.nextLine();break}else{m=!0,u||(xo(c,t.lineStart-1,t.lineStart),d=!1);for(let b of e.markers)c.push(b);let v=t.lineStart+e.basePos,y=t.lineStart+e.text.length;v<y&&(xo(c,v,y),d=!1)}}return t.addNode(t.buffer.writeElements(c,-s).finish(ue.FencedCode,t.prevLineEnd()-s),s),!0},Blockquote(t,e){let i=j$(e);return i<0?!1:(t.startContext(ue.Blockquote,e.pos),t.addNode(ue.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+i),null)},HorizontalRule(t,e){if(IS(e,t,!1)<0)return!1;let i=t.lineStart+e.pos;return t.nextLine(),t.addNode(ue.HorizontalRule,i),!0},BulletList(t,e){let i=qS(e,t,!1);if(i<0)return!1;t.block.type!=ue.BulletList&&t.startContext(ue.BulletList,e.basePos,e.next);let s=IM(e,e.pos+1);return t.startContext(ue.ListItem,e.basePos,s-e.baseIndent),t.addNode(ue.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(s),null},OrderedList(t,e){let i=WS(e,t,!1);if(i<0)return!1;t.block.type!=ue.OrderedList&&t.startContext(ue.OrderedList,e.basePos,e.text.charCodeAt(e.pos+i-1));let s=IM(e,e.pos+i);return t.startContext(ue.ListItem,e.basePos,s-e.baseIndent),t.addNode(ue.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(s),null},ATXHeading(t,e){let i=V$(e);if(i<0)return!1;let s=e.pos,r=t.lineStart+s,n=ZM(e.text,e.text.length,s),o=n;for(;o>s&&e.text.charCodeAt(o-1)==e.next;)o--;(o==n||o==s||!ur(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=t.buffer.write(ue.HeaderMark,0,i).writeElements(t.parser.parseInline(e.text.slice(s+i+1,o),r+i+1),-r);o<e.text.length&&l.write(ue.HeaderMark,o-s,n-s);let c=l.finish(ue.ATXHeading1-1+i,e.text.length-s);return t.nextLine(),t.addNode(c,r),!0},HTMLBlock(t,e){let i=W$(e,t,!1);if(i<0)return!1;let s=t.lineStart+e.pos,r=xy[i][1],n=[],o=r!=Sy;for(;!r.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let u of e.markers)n.push(u)}o&&t.nextLine();let l=r==I$?ue.CommentBlock:r==q$?ue.ProcessingInstructionBlock:ue.HTMLBlock,c=t.prevLineEnd();return t.addNode(t.buffer.writeElements(n,-s).finish(l,c-s),s),!0},SetextHeading:void 0};class BH{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,i,s){if(this.stage==-1)return!1;let r=s.content+`
|
|
70
|
-
`+i.scrub(),n=this.advance(r);return n>-1&&n<r.length?this.complete(e,s,n):!1}finish(e,i){return(this.stage==2||this.stage==3)&&Eu(i.content,this.pos)==i.content.length?this.complete(e,i,i.content.length):!1}complete(e,i,s){return e.addLeafElement(i,Ye(ue.LinkReference,this.start,this.start+s,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(iB(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Ye(ue.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(eB(e,Eu(e,this.pos),this.start)))return-1}else if(this.stage==2){let i=Eu(e,this.pos),s=0;if(i>this.pos){let r=tB(e,i,this.start);if(r){let n=Uv(e,r.to-this.start);n>0&&(this.nextStage(r),s=n)}}return s||(s=Uv(e,this.pos)),s>0&&s<e.length?s:-1}else return Uv(e,this.pos)}}}function Uv(t,e){for(;e<t.length;e++){let i=t.charCodeAt(e);if(i==10)break;if(!ur(i))return-1}return e}class DH{nextLine(e,i,s){let r=i.depth<e.stack.length?-1:Z$(i),n=i.next;if(r<0)return!1;let o=Ye(ue.HeaderMark,e.lineStart+i.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(s,Ye(n==61?ue.SetextHeading1:ue.SetextHeading2,s.start,e.prevLineEnd(),[...e.parser.parseInline(s.content,s.start),o])),!0}finish(){return!1}}const U$={LinkReference(t,e){return e.content.charCodeAt(0)==91?new BH(e):null},SetextHeading(){return new DH}},zH=[(t,e)=>V$(e)>=0,(t,e)=>N$(e)>=0,(t,e)=>j$(e)>=0,(t,e)=>qS(e,t,!0)>=0,(t,e)=>WS(e,t,!0)>=0,(t,e)=>IS(e,t,!0)>=0,(t,e)=>W$(e,t,!0)>=0],NH={text:"",end:0};class jH{constructor(e,i,s,r){this.parser=e,this.input=i,this.ranges=r,this.line=new $H,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=Hm.create(ue.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=s.length?new ZH(s,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 s=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;s<e.markers.length&&(!r||e.markers[s].from<r.end);){let n=e.markers[s++];this.addNode(n.type,n.from,n.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 s of this.parser.blockParsers)if(s){let r=s(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let i=new LH(this.lineStart+e.pos,e.text.slice(e.pos));for(let s of this.parser.leafBlockParsers)if(s){let r=s(this,i);r&&i.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let s of this.parser.endLeafBlock)if(s(this,e,i))break e}for(let s of i.parsers)if(s.nextLine(this,e,i))return null;i.content+=`
|
|
71
|
-
`+e.scrub();for(let s of e.markers)i.marks.push(s)}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=sB(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=NH;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 s=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<i.end;){r++;let n=this.ranges[r].from,o=this.lineChunkAt(n);i.end=n+o.length,i.text=i.text.slice(0,this.ranges[r-1].to-s)+o,s=i.end-i.text.length}}return i}readLine(){let{line:e}=this,{text:i,end:s}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=s,e.reset(i);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],n=this.parser.skipContextMarkup[r.type];if(!n)throw new Error("Unhandled block context "+ue[r.type]);let o=this.line.markers.length;if(!n(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),s;if(this.input.lineChunks)s=i==`
|
|
72
|
-
`?"":i;else{let r=i.indexOf(`
|
|
73
|
-
`);s=r<0?i:i.slice(0,r)}return e+s.length>this.to?s.slice(0,this.to-e):s}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,i,s=0){this.block=Hm.create(e,s,this.lineStart+i,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,i,s=0){this.startContext(this.parser.getNodeType(e),i,s)}addNode(e,i,s){typeof e=="number"&&(e=new et(this.parser.nodeSet.types[e],Ch,Ch,(s??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(Cy(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?Y$(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let s of e.parsers)if(s.finish(this,e))return;let i=Cy(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(i,-e.start).finish(ue.Paragraph,e.content.length),e.start)}elt(e,i,s,r){return typeof e=="string"?Ye(this.parser.getNodeType(e),i,s,r):new G$(e,i)}get buffer(){return new F$(this.parser.nodeSet)}}function Y$(t,e,i,s,r){let n=t[e].to,o=[],l=[],c=i.from+s;function u(d,m){for(;m?d>=n:d>n;){let g=t[e+1].from-n;s+=g,d+=g,e++,n=t[e].to}}for(let d=i.firstChild;d;d=d.nextSibling){u(d.from+s,!0);let m=d.from+s,g,v=r.get(d.tree);v?g=v:d.to+s>n?(g=Y$(t,e,d,s,r),u(d.to+s,!1)):g=d.toTree(),o.push(g),l.push(m-c)}return u(i.to+s,!1),new et(i.type,o,l,i.to+s-c,i.tree?i.tree.propValues:void 0)}class Mg extends xS{constructor(e,i,s,r,n,o,l,c,u){super(),this.nodeSet=e,this.blockParsers=i,this.leafBlockParsers=s,this.blockNames=r,this.endLeafBlock=n,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,s){let r=new jH(this,e,i,s);for(let n of this.wrappers)r=n(r,e,i,s);return r}configure(e){let i=wy(e);if(!i)return this;let{nodeSet:s,skipContextMarkup:r}=this,n=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),m=this.wrappers;if(Uc(i.defineNodes)){r=Object.assign({},r);let g=s.types.slice(),v;for(let y of i.defineNodes){let{name:b,block:w,composite:C,style:T}=typeof y=="string"?{name:y}:y;if(g.some(P=>P.name==b))continue;C&&(r[g.length]=(P,E,z)=>C(E,z,P.value));let M=g.length,k=C?["Block","BlockContext"]:w?M>=ue.ATXHeading1&&M<=ue.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(ri.define({id:M,name:b,props:k&&[[Le.group,k]]})),T&&(v||(v={}),Array.isArray(T)||T instanceof Bs?v[b]=T:Object.assign(v,T))}s=new wf(g),v&&(s=s.extend(Qh(v)))}if(Uc(i.props)&&(s=s.extend(...i.props)),Uc(i.remove))for(let g of i.remove){let v=this.blockNames.indexOf(g),y=this.inlineNames.indexOf(g);v>-1&&(n[v]=o[v]=void 0),y>-1&&(c[y]=void 0)}if(Uc(i.parseBlock))for(let g of i.parseBlock){let v=l.indexOf(g.name);if(v>-1)n[v]=g.parse,o[v]=g.leaf;else{let y=g.before?Ap(l,g.before):g.after?Ap(l,g.after)+1:l.length-1;n.splice(y,0,g.parse),o.splice(y,0,g.leaf),l.splice(y,0,g.name)}g.endLeaf&&d.push(g.endLeaf)}if(Uc(i.parseInline))for(let g of i.parseInline){let v=u.indexOf(g.name);if(v>-1)c[v]=g.parse;else{let y=g.before?Ap(u,g.before):g.after?Ap(u,g.after)+1:u.length-1;c.splice(y,0,g.parse),u.splice(y,0,g.name)}}return i.wrap&&(m=m.concat(i.wrap)),new Mg(s,n,o,l,d,r,c,u,m)}getNodeType(e){let i=this.nodeTypes[e];if(i==null)throw new RangeError(`Unknown node type '${e}'`);return i}parseInline(e,i){let s=new US(this,e,i);e:for(let r=i;r<s.end;){let n=s.char(r);for(let o of this.inlineParsers)if(o){let l=o(s,n,r);if(l>=0){r=l;continue e}}r++}return s.resolveMarkers(0)}}function Uc(t){return t!=null&&t.length>0}function wy(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=wy(t[0]);if(t.length==1)return e;let i=wy(t.slice(1));if(!i||!e)return e||i;let s=(o,l)=>(o||Ch).concat(l||Ch),r=e.wrap,n=i.wrap;return{props:s(e.props,i.props),defineNodes:s(e.defineNodes,i.defineNodes),parseBlock:s(e.parseBlock,i.parseBlock),parseInline:s(e.parseInline,i.parseInline),remove:s(e.remove,i.remove),wrap:r?n?(o,l,c,u)=>r(n(o,l,c,u),l,c,u):r:n}}function Ap(t,e){let i=t.indexOf(e);if(i<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return i}let H$=[ri.none];for(let t=1,e;e=ue[t];t++)H$[t]=ri.define({id:t,name:e,props:t>=ue.Escape?[]:[[Le.group,t in z$?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Ch=[];class F${constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,i,s,r=0){return this.content.push(e,i,s,4+r*4),this}writeElements(e,i=0){for(let s of e)s.writeTo(this,i);return this}finish(e,i){return et.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:i})}}let nf=class{constructor(e,i,s,r=Ch){this.type=e,this.from=i,this.to=s,this.children=r}writeTo(e,i){let s=e.content.length;e.writeElements(this.children,i),e.content.push(this.type,this.from+i,this.to+i,e.content.length+4-s)}toTree(e){return new F$(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class G${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 Ch}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 Ye(t,e,i,s){return new nf(t,e,i,s)}const K$={resolve:"Emphasis",mark:"EmphasisMark"},J$={resolve:"Emphasis",mark:"EmphasisMark"},Ea={},Fm={};class $s{constructor(e,i,s,r){this.type=e,this.from=i,this.to=s,this.side=r}}const qM="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let of=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{of=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const Yv={Escape(t,e,i){if(e!=92||i==t.end-1)return-1;let s=t.char(i+1);for(let r=0;r<qM.length;r++)if(qM.charCodeAt(r)==s)return t.append(Ye(ue.Escape,i,i+2));return-1},Entity(t,e,i){if(e!=38)return-1;let s=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(i+1,i+31));return s?t.append(Ye(ue.Entity,i,i+1+s[0].length)):-1},InlineCode(t,e,i){if(e!=96||i&&t.char(i-1)==96)return-1;let s=i+1;for(;s<t.end&&t.char(s)==96;)s++;let r=s-i,n=0;for(;s<t.end;s++)if(t.char(s)==96){if(n++,n==r&&t.char(s+1)!=96)return t.append(Ye(ue.InlineCode,i,s+1,[Ye(ue.CodeMark,i,i+r),Ye(ue.CodeMark,s+1-r,s+1)]))}else n=0;return-1},HTMLTag(t,e,i){if(e!=60||i==t.end-1)return-1;let s=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(s);if(r)return t.append(Ye(ue.Autolink,i,i+1+r[0].length,[Ye(ue.LinkMark,i,i+1),Ye(ue.URL,i+1,i+r[0].length),Ye(ue.LinkMark,i+r[0].length,i+1+r[0].length)]));let n=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(s);if(n)return t.append(Ye(ue.Comment,i,i+1+n[0].length));let o=/^\?[^]*?\?>/.exec(s);if(o)return t.append(Ye(ue.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(s);return l?t.append(Ye(ue.HTMLTag,i,i+1+l[0].length)):-1},Emphasis(t,e,i){if(e!=95&&e!=42)return-1;let s=i+1;for(;t.char(s)==e;)s++;let r=t.slice(i-1,i),n=t.slice(s,s+1),o=of.test(r),l=of.test(n),c=/\s|^$/.test(r),u=/\s|^$/.test(n),d=!u&&(!l||c||o),m=!c&&(!o||u||l),g=d&&(e==42||!m||o),v=m&&(e==42||!d||l);return t.append(new $s(e==95?K$:J$,i,s,(g?1:0)|(v?2:0)))},HardBreak(t,e,i){if(e==92&&t.char(i+1)==10)return t.append(Ye(ue.HardBreak,i,i+2));if(e==32){let s=i+1;for(;t.char(s)==32;)s++;if(t.char(s)==10&&s>=i+2)return t.append(Ye(ue.HardBreak,i,s+1))}return-1},Link(t,e,i){return e==91?t.append(new $s(Ea,i,i+1,1)):-1},Image(t,e,i){return e==33&&t.char(i+1)==91?t.append(new $s(Fm,i,i+2,1)):-1},LinkEnd(t,e,i){if(e!=93)return-1;for(let s=t.parts.length-1;s>=0;s--){let r=t.parts[s];if(r instanceof $s&&(r.type==Ea||r.type==Fm)){if(!r.side||t.skipSpace(r.to)==i&&!/[(\[]/.test(t.slice(i+1,i+2)))return t.parts[s]=null,-1;let n=t.takeContent(s),o=t.parts[s]=XH(t,n,r.type==Ea?ue.Link:ue.Image,r.from,i+1);if(r.type==Ea)for(let l=0;l<s;l++){let c=t.parts[l];c instanceof $s&&c.type==Ea&&(c.side=0)}return o.to}}return-1}};function XH(t,e,i,s,r){let{text:n}=t,o=t.char(r),l=r;if(e.unshift(Ye(ue.LinkMark,s,s+(i==ue.Image?2:1))),e.push(Ye(ue.LinkMark,r-1,r)),o==40){let c=t.skipSpace(r+1),u=eB(n,c-t.offset,t.offset),d;u&&(c=t.skipSpace(u.to),c!=u.to&&(d=tB(n,c-t.offset,t.offset),d&&(c=t.skipSpace(d.to)))),t.char(c)==41&&(e.push(Ye(ue.LinkMark,r,r+1)),l=c+1,u&&e.push(u),d&&e.push(d),e.push(Ye(ue.LinkMark,c,l)))}else if(o==91){let c=iB(n,r-t.offset,t.offset,!1);c&&(e.push(c),l=c.to)}return Ye(i,s,l,e)}function eB(t,e,i){if(t.charCodeAt(e)==60){for(let r=e+1;r<t.length;r++){let n=t.charCodeAt(r);if(n==62)return Ye(ue.URL,e+i,r+1+i);if(n==60||n==10)return!1}return null}else{let r=0,n=e;for(let o=!1;n<t.length;n++){let l=t.charCodeAt(n);if(ur(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 n>e?Ye(ue.URL,e+i,n+i):n==t.length?null:!1}}function tB(t,e,i){let s=t.charCodeAt(e);if(s!=39&&s!=34&&s!=40)return!1;let r=s==40?41:s;for(let n=e+1,o=!1;n<t.length;n++){let l=t.charCodeAt(n);if(o)o=!1;else{if(l==r)return Ye(ue.LinkTitle,e+i,n+1+i);l==92&&(o=!0)}}return null}function iB(t,e,i,s){for(let r=!1,n=e+1,o=Math.min(t.length,n+999);n<o;n++){let l=t.charCodeAt(n);if(r)r=!1;else{if(l==93)return s?!1:Ye(ue.LinkLabel,e+i,n+1+i);if(s&&!ur(l)&&(s=!1),l==91)return!1;l==92&&(r=!0)}}return null}class US{constructor(e,i,s){this.parser=e,this.text=i,this.offset=s,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,s,r,n){return this.append(new $s(e,i,s,(r?1:0)|(n?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let i=this.parts[e];if(i instanceof $s&&(i.type==Ea||i.type==Fm))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let s=e;s<this.parts.length;s++){let r=this.parts[s];if(!(r instanceof $s&&r.type.resolve&&r.side&2))continue;let n=r.type==K$||r.type==J$,o=r.to-r.from,l,c=s-1;for(;c>=e;c--){let b=this.parts[c];if(b instanceof $s&&b.side&1&&b.type==r.type&&!(n&&(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=[],m=l.from,g=r.to;if(n){let b=Math.min(2,l.to-l.from,o);m=l.to-b,g=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,m,l.to));for(let b=c+1;b<s;b++)this.parts[b]instanceof nf&&d.push(this.parts[b]),this.parts[b]=null;r.type.mark&&d.push(this.elt(r.type.mark,r.from,g));let v=this.elt(u,m,g,d);this.parts[c]=n&&l.from!=m?new $s(l.type,l.from,m,l.side):null,(this.parts[s]=n&&r.to!=g?new $s(r.type,g,r.to,r.side):null)?this.parts.splice(s,0,v):this.parts[s]=v}let i=[];for(let s=e;s<this.parts.length;s++){let r=this.parts[s];r instanceof nf&&i.push(r)}return i}findOpeningDelimiter(e){for(let i=this.parts.length-1;i>=0;i--){let s=this.parts[i];if(s instanceof $s&&s.type==e&&s.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 $s?i:null}skipSpace(e){return Eu(this.text,e-this.offset)+this.offset}elt(e,i,s,r){return typeof e=="string"?Ye(this.parser.getNodeType(e),i,s,r):new G$(e,i)}}US.linkStart=Ea;US.imageStart=Fm;function Cy(t,e){if(!e.length)return t;if(!t.length)return e;let i=t.slice(),s=0;for(let r of e){for(;s<i.length&&i[s].to<r.to;)s++;if(s<i.length&&i[s].from<r.from){let n=i[s];n instanceof nf&&(i[s]=new nf(n.type,n.from,n.to,Cy(n.children,[r])))}else i.splice(s++,0,r)}return i}const VH=[ue.CodeBlock,ue.ListItem,ue.OrderedList,ue.BulletList];let ZH=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 n=this.fragment.to;for(;n>0&&this.input.read(n-1,n)!=`
|
|
74
|
-
`;)n--;this.fragmentEnd=n?n-1:0}let s=this.cursor;s||(s=this.cursor=this.fragment.tree.cursor(),s.firstChild());let r=e+this.fragment.offset;for(;s.to<=r;)if(!s.parent())return!1;for(;;){if(s.from>=r)return this.fragment.from<=i;if(!s.childAfter(r))return!1}}matches(e){let i=this.cursor.tree;return i&&i.prop(Le.contextHash)==e}takeNodes(e){let i=this.cursor,s=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),n=e.absoluteLineStart,o=n,l=e.block.children.length,c=o,u=l;for(;;){if(i.to-s>r){if(i.type.isAnonymous&&i.firstChild())continue;break}let d=sB(i.from-s,e.ranges);if(i.to-s<=e.ranges[e.rangeI].to)e.addNode(i.tree,d);else{let m=new et(e.parser.nodeSet.types[ue.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(m,i.tree),e.addNode(m,d)}if(i.type.is("Block")&&(VH.indexOf(i.type.id)<0?(o=i.to-s,l=e.block.children.length):(o=c,l=u),c=i.to-s,u=e.block.children.length),!i.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-n}};function sB(t,e){let i=t;for(let s=1;s<e.length;s++){let r=e[s-1].to,n=e[s].from;r<t&&(i-=n-r)}return i}const IH=Qh({"Blockquote/...":B.quote,HorizontalRule:B.contentSeparator,"ATXHeading1/... SetextHeading1/...":B.heading1,"ATXHeading2/... SetextHeading2/...":B.heading2,"ATXHeading3/...":B.heading3,"ATXHeading4/...":B.heading4,"ATXHeading5/...":B.heading5,"ATXHeading6/...":B.heading6,"Comment CommentBlock":B.comment,Escape:B.escape,Entity:B.character,"Emphasis/...":B.emphasis,"StrongEmphasis/...":B.strong,"Link/... Image/...":B.link,"OrderedList/... BulletList/...":B.list,"BlockQuote/...":B.quote,"InlineCode CodeText":B.monospace,"URL Autolink":B.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":B.processingInstruction,"CodeInfo LinkLabel":B.labelName,LinkTitle:B.string,Paragraph:B.content}),qH=new Mg(new wf(H$).extend(IH),Object.keys(Mp).map(t=>Mp[t]),Object.keys(Mp).map(t=>U$[t]),Object.keys(Mp),zH,z$,Object.keys(Yv).map(t=>Yv[t]),Object.keys(Yv),[]);function WH(t,e,i){let s=[];for(let r=t.firstChild,n=e;;r=r.nextSibling){let o=r?r.from:i;if(o>n&&s.push({from:n,to:o}),!r)break;n=r.to}return s}function UH(t){let{codeParser:e,htmlParser:i}=t;return{wrap:f3((r,n)=>{let o=r.type.id;if(e&&(o==ue.CodeBlock||o==ue.FencedCode)){let l="";if(o==ue.FencedCode){let u=r.node.getChild(ue.CodeInfo);u&&(l=n.read(u.from,u.to))}let c=e(l);if(c)return{parser:c,overlay:u=>u.type.id==ue.CodeText,bracketed:o==ue.FencedCode}}else if(i&&(o==ue.HTMLBlock||o==ue.HTMLTag||o==ue.CommentBlock))return{parser:i,overlay:WH(r.node,r.from,r.to)};return null})}}const YH={resolve:"Strikethrough",mark:"StrikethroughMark"},HH={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":B.strikethrough}},{name:"StrikethroughMark",style:B.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,i){if(e!=126||t.char(i+1)!=126||t.char(i+2)==126)return-1;let s=t.slice(i-1,i),r=t.slice(i+2,i+3),n=/\s|^$/.test(s),o=/\s|^$/.test(r),l=of.test(s),c=of.test(r);return t.addDelimiter(YH,i,i+2,!o&&(!c||n||l),!n&&(!l||o||c))},after:"Emphasis"}]};function Pu(t,e,i=0,s,r=0){let n=0,o=!0,l=-1,c=-1,u=!1,d=()=>{s.push(t.elt("TableCell",r+l,r+c,t.parser.parseInline(e.slice(l,c),r+l)))};for(let m=i;m<e.length;m++){let g=e.charCodeAt(m);g==124&&!u?((!o||l>-1)&&n++,o=!1,s&&(l>-1&&d(),s.push(t.elt("TableDelimiter",m+r,m+r+1))),l=c=-1):(u||g!=32&&g!=9)&&(l<0&&(l=m),c=m+1),u=!u&&g==92}return l>-1&&(n++,s&&d()),n}function WM(t,e){for(let i=e;i<t.length;i++){let s=t.charCodeAt(i);if(s==124)return!0;s==92&&i++}return!1}const rB=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class UM{constructor(){this.rows=null}nextLine(e,i,s){if(this.rows==null){this.rows=!1;let r;if((i.next==45||i.next==58||i.next==124)&&rB.test(r=i.text.slice(i.pos))){let n=[];Pu(e,s.content,0,n,s.start)==Pu(e,r,i.pos)&&(this.rows=[e.elt("TableHeader",s.start,s.start+s.content.length,n),e.elt("TableDelimiter",e.lineStart+i.pos,e.lineStart+i.text.length)])}}else if(this.rows){let r=[];Pu(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 FH={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":B.heading}},"TableRow",{name:"TableCell",style:B.content},{name:"TableDelimiter",style:B.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return WM(e.content,0)?new UM:null},endLeaf(t,e,i){if(i.parsers.some(r=>r instanceof UM)||!WM(e.text,e.basePos))return!1;let s=t.peekLine();return rB.test(s)&&Pu(t,e.text,e.basePos)==Pu(t,s,e.basePos)},before:"SetextHeading"}]};class GH{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 KH={defineNodes:[{name:"Task",block:!0,style:B.list},{name:"TaskMarker",style:B.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new GH:null},after:"SetextHeading"}]},YM=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,HM=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,JH=/[\w-]+\.[\w-]+($|\/)/,FM=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,GM=/\/[a-zA-Z\d@.]+/gy;function KM(t,e,i,s){let r=0;for(let n=e;n<i;n++)t[n]==s&&r++;return r}function eF(t,e){HM.lastIndex=e;let i=HM.exec(t);if(!i||JH.exec(i[0])[0].indexOf("_")>-1)return-1;let s=e+i[0].length;for(;;){let r=t[s-1],n;if(/[?!.,:*_~]/.test(r)||r==")"&&KM(t,e,s,")")>KM(t,e,s,"("))s--;else if(r==";"&&(n=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,s))))s=e+n.index;else break}return s}function JM(t,e){FM.lastIndex=e;let i=FM.exec(t);if(!i)return-1;let s=i[0][i[0].length-1];return s=="_"||s=="-"?-1:e+i[0].length-(s=="."?1:0)}const tF={parseInline:[{name:"Autolink",parse(t,e,i){let s=i-t.offset;if(s&&/\w/.test(t.text[s-1]))return-1;YM.lastIndex=s;let r=YM.exec(t.text),n=-1;if(!r)return-1;if(r[1]||r[2]){if(n=eF(t.text,s+r[0].length),n>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(s,n));n=s+o[0].length}}else r[3]?n=JM(t.text,s):(n=JM(t.text,s+r[0].length),n>-1&&r[0]=="xmpp:"&&(GM.lastIndex=n,r=GM.exec(t.text),r&&(n=r.index+r[0].length)));return n<0?-1:(t.addElement(t.elt("URL",i,n+t.offset)),n+t.offset)}}]},iF=[FH,KH,HH,tF];function nB(t,e,i){return(s,r,n)=>{if(r!=t||s.char(n+1)==t)return-1;let o=[s.elt(i,n,n+1)];for(let l=n+1;l<s.end;l++){let c=s.char(l);if(c==t)return s.addElement(s.elt(e,n,l+1,o.concat(s.elt(i,l,l+1))));if(c==92&&o.push(s.elt("Escape",l,l+++2)),ur(c))break}return-1}}const sF={defineNodes:[{name:"Superscript",style:B.special(B.content)},{name:"SuperscriptMark",style:B.processingInstruction}],parseInline:[{name:"Superscript",parse:nB(94,"Superscript","SuperscriptMark")}]},rF={defineNodes:[{name:"Subscript",style:B.special(B.content)},{name:"SubscriptMark",style:B.processingInstruction}],parseInline:[{name:"Subscript",parse:nB(126,"Subscript","SubscriptMark")}]},nF={defineNodes:[{name:"Emoji",style:B.character}],parseInline:[{name:"Emoji",parse(t,e,i){let s;return e!=58||!(s=/^[a-zA-Z_0-9]+:/.exec(t.slice(i+1,t.end)))?-1:t.addElement(t.elt("Emoji",i,i+1+s[0].length))}}]};var eA={};class Gm{constructor(e,i,s,r,n,o,l,c,u,d=0,m){this.p=e,this.stack=i,this.state=s,this.reducePos=r,this.pos=n,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=m}toString(){return`[${this.stack.filter((e,i)=>i%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,i,s=0){let r=e.parser.context;return new Gm(e,[],i,s,s,0,[],0,r?new tA(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 s=e>>19,r=e&65535,{parser:n}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=n.dynamicPrecedence(r);if(l&&(this.score+=l),s==0){this.pushState(n.getGoto(this.state,r,!0),this.reducePos),r<n.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let c=this.stack.length-(s-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 m=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-m;if(r<n.minRepeatTerm||e&131072){let v=n.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,u,v,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let v=this.stack[c-3];this.state=n.getGoto(v,r,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(r,u)}storeNode(e,i,s,r=4,n=!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==s)return;if(o.buffer[l-2]>=i){o.buffer[l-2]=s;return}}}if(!n||this.pos==s)this.buffer.push(e,i,s,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]>s;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>s;)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]=s,this.buffer[o+3]=r}}shift(e,i,s,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let n=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(n,1);!l&&(r>s||i<=o.maxNode)&&(this.reducePos=r),this.pushState(n,l?s:Math.min(s,this.reducePos)),this.shiftContext(i,s),i<=o.maxNode&&this.buffer.push(i,s,r,4)}else this.pos=r,this.shiftContext(i,s),i<=this.p.parser.maxNode&&this.buffer.push(i,s,r,4)}apply(e,i,s,r){e&65536?this.reduce(e):this.shift(e,i,s,r)}useNode(e,i){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=e)&&(this.p.reused.push(e),s++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(i,r),this.buffer.push(s,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 s=e.buffer.slice(i),r=e.bufferBase+i;for(;e&&r==e.bufferBase;)e=e.parent;return new Gm(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,i){let s=e<=this.p.parser.maxNode;s&&this.storeNode(e,this.pos,i,4),this.storeNode(0,this.pos,i,s?8:4),this.pos=this.reducePos=i,this.score-=190}canShift(e){for(let i=new oF(this);;){let s=this.p.parser.stateSlot(i.state,4)||this.p.parser.hasAction(i.state,e);if(s==0)return!1;if((s&65536)==0)return!0;i.reduce(s)}}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 n=0,o;n<i.length;n+=2)(o=i[n+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(i[n],o);if(this.stack.length<120)for(let n=0;r.length<8&&n<i.length;n+=2){let o=i[n+1];r.some((l,c)=>c&1&&l==o)||r.push(i[n],o)}i=r}let s=[];for(let r=0;r<i.length&&s.length<4;r+=2){let n=i[r+1];if(n==this.state)continue;let o=this.split();o.pushState(n,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(i[r],this.pos),o.reducePos=this.pos,o.score-=200,s.push(o)}return s}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 s=i>>19,r=i&65535,n=this.stack.length-s*3;if(n<0||e.getGoto(this.stack[n],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=[],s=(r,n)=>{if(!i.includes(r))return i.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-n;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=s(o,n+1);if(l!=null)return l}})};return s(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 tA(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 tA{constructor(e,i){this.tracker=e,this.context=i,this.hash=e.strict?e.hash(i):0}}class oF{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let i=e&65535,s=e>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],i,!0);this.state=r}}class Km{constructor(e,i,s){this.stack=e,this.pos=i,this.index=s,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,i=e.bufferBase+e.buffer.length){return new Km(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 Km(this.stack,this.pos,this.index)}}function fu(t,e=Uint16Array){if(typeof t!="string")return t;let i=null;for(let s=0,r=0;s<t.length;){let n=0;for(;;){let o=t.charCodeAt(s++),l=!1;if(o==126){n=65535;break}o>=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),n+=c,l)break;n*=46}i?i[r++]=n:i=new e(n)}return i}class im{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const iA=new im;class aF{constructor(e,i){this.input=e,this.ranges=i,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=iA,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 s=this.range,r=this.rangeIndex,n=this.pos+e;for(;n<s.from;){if(!r)return null;let o=this.ranges[--r];n-=s.from-o.to,s=o}for(;i<0?n>s.to:n>=s.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];n+=o.from-s.to,s=o}return n}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,s,r;if(i>=0&&i<this.chunk.length)s=this.pos+e,r=this.chunk.charCodeAt(i);else{let n=this.resolveOffset(e,1);if(n==null)return-1;if(s=n,s>=this.chunk2Pos&&s<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(s-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=s;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=s),s+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-s)),r=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),r}acceptToken(e,i=0){let s=i?this.resolveOffset(i,-1):this.pos;if(s==null||s<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=s}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=iA,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 s="";for(let r of this.ranges){if(r.from>=i)break;r.to>e&&(s+=this.input.read(Math.max(r.from,e),Math.min(r.to,i)))}return s}}class mh{constructor(e,i){this.data=e,this.id=i}token(e,i){let{parser:s}=i.p;oB(this.data,e,i,this.id,s.data,s.tokenPrecTable)}}mh.prototype.contextual=mh.prototype.fallback=mh.prototype.extend=!1;class Jm{constructor(e,i,s){this.precTable=i,this.elseToken=s,this.data=typeof e=="string"?fu(e):e}token(e,i){let s=e.pos,r=0;for(;;){let n=e.next<0,o=e.resolveOffset(1,1);if(oB(this.data,e,i,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(s,e.token),e.acceptToken(this.elseToken,r))}}Jm.prototype.contextual=mh.prototype.fallback=mh.prototype.extend=!1;class zs{constructor(e,i={}){this.token=e,this.contextual=!!i.contextual,this.fallback=!!i.fallback,this.extend=!!i.extend}}function oB(t,e,i,s,r,n){let o=0,l=1<<s,{dialect:c}=i.p.parser;e:for(;(l&t[o])!=0;){let u=t[o+1];for(let v=o+3;v<u;v+=2)if((t[v+1]&l)>0){let y=t[v];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||lF(y,e.token.value,r,n))){e.acceptToken(y);break}}let d=e.next,m=0,g=t[o+2];if(e.next<0&&g>m&&t[u+g*3-3]==65535){o=t[u+g*3-1];continue e}for(;m<g;){let v=m+g>>1,y=u+v+(v<<1),b=t[y],w=t[y+1]||65536;if(d<b)g=v;else if(d>=w)m=v+1;else{o=t[y+2],e.advance();continue e}}break}}function sA(t,e,i){for(let s=e,r;(r=t[s])!=65535;s++)if(r==i)return s-e;return-1}function lF(t,e,i,s){let r=sA(i,s,e);return r<0||sA(i,s,t)<r}const Es=typeof process<"u"&&eA&&/\bparse\b/.test(eA.LOG);let Hv=null;function rA(t,e,i){let s=t.cursor(tt.IncludeAnonymous);for(s.moveTo(e);;)if(!(i<0?s.childBefore(e):s.childAfter(e)))for(;;){if((i<0?s.to<e:s.from>e)&&!s.type.isError)return i<0?Math.max(0,Math.min(s.to-1,e-25)):Math.min(t.length,Math.max(s.from+1,e+25));if(i<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return i<0?0:t.length}}class hF{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?rA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?rA(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 s=this.trees[i],r=this.index[i];if(r==s.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let n=s.children[r],o=this.start[i]+s.positions[r];if(o>e)return this.nextStart=o,null;if(n instanceof et){if(o==e){if(o<this.safeFrom)return null;let l=o+n.length;if(l<=this.safeTo){let c=n.prop(Le.lookAhead);if(!c||l+c<this.fragment.to)return n}}this.index[i]++,o+n.length>=Math.max(this.safeFrom,e)&&(this.trees.push(n),this.start.push(o),this.index.push(0))}else this.index[i]++,this.nextStart=o+n.length}}}class cF{constructor(e,i){this.stream=i,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(s=>new im)}getActions(e){let i=0,s=null,{parser:r}=e.p,{tokenizers:n}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let u=0;u<n.length;u++){if((1<<u&o)==0)continue;let d=n[u],m=this.tokens[u];if(!(s&&!d.fallback)&&((d.contextual||m.start!=e.pos||m.mask!=o||m.context!=l)&&(this.updateCachedToken(m,d,e),m.mask=o,m.context=l),m.lookAhead>m.end+25&&(c=Math.max(m.lookAhead,c)),m.value!=0)){let g=i;if(m.extended>-1&&(i=this.addActions(e,m.extended,m.end,i)),i=this.addActions(e,m.value,m.end,i),!d.extend&&(s=m,i>g))break}}for(;this.actions.length>i;)this.actions.pop();return c&&e.setLookAhead(c),!s&&e.pos==this.stream.end&&(s=new im,s.value=e.p.parser.eofTerm,s.start=s.end=e.pos,i=this.addActions(e,s.value,s.end,i)),this.mainToken=s,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let i=new im,{pos:s,p:r}=e;return i.start=s,i.end=Math.min(s+1,r.stream.end),i.value=s==r.stream.end?r.parser.eofTerm:0,i}updateCachedToken(e,i,s){let r=this.stream.clipPos(s.pos);if(i.token(this.stream.reset(r,e),s),e.value>-1){let{parser:n}=s.p;for(let o=0;o<n.specialized.length;o++)if(n.specialized[o]==e.value){let l=n.specializers[o](this.stream.read(e.start,e.end),s);if(l>=0&&s.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,s,r){for(let n=0;n<r;n+=3)if(this.actions[n]==e)return r;return this.actions[r++]=e,this.actions[r++]=i,this.actions[r++]=s,r}addActions(e,i,s,r){let{state:n}=e,{parser:o}=e.p,{data:l}=o;for(let c=0;c<2;c++)for(let u=o.stateSlot(n,c?2:1);;u+=3){if(l[u]==65535)if(l[u+1]==1)u=Bn(l,u+2);else{r==0&&l[u+1]==2&&(r=this.putAction(Bn(l,u+2),i,s,r));break}l[u]==i&&(r=this.putAction(Bn(l,u+1),i,s,r))}return r}}class uF{constructor(e,i,s,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 aF(i,r),this.tokens=new cF(e,this.stream),this.topTerm=e.top[1];let{from:n}=r[0];this.stacks=[Gm.start(this,e.top[0],n)],this.fragments=s.length&&this.stream.end-n>e.bufferLength*4?new hF(s,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,i=this.minStackPos,s=this.stacks=[],r,n;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)s.push(l);else{if(this.advanceStack(l,s,e))continue;{r||(r=[],n=[]),r.push(l);let c=this.tokens.getMainToken(l);n.push(c.value,c.end)}}break}}if(!s.length){let o=r&&dF(r);if(o)return Es&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Es&&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,n,s);if(o)return Es&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(s.length>o)for(s.sort((l,c)=>c.score-l.score);s.length>o;)s.pop();s.some(l=>l.reducePos>i)&&this.recovering--}else if(s.length>1){e:for(let o=0;o<s.length-1;o++){let l=s[o];for(let c=o+1;c<s.length;c++){let u=s[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)s.splice(c--,1);else{s.splice(o--,1);continue e}}}s.length>12&&(s.sort((o,l)=>l.score-o.score),s.splice(12,s.length-12))}this.minStackPos=s[0].pos;for(let o=1;o<s.length;o++)s[o].pos<this.minStackPos&&(this.minStackPos=s[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,s){let r=e.pos,{parser:n}=this,o=Es?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 m=this.fragments.nodeAt(r);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?n.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!u||(m.prop(Le.contextHash)||0)==d))return e.useNode(m,g),Es&&console.log(o+this.stackID(e)+` (via reuse of ${n.getName(m.type.id)})`),!0;if(!(m instanceof et)||m.children.length==0||m.positions[0]>0)break;let v=m.children[0];if(v instanceof et&&m.positions[0]==0)m=v;else break}}let l=n.stateSlot(e.state,4);if(l>0)return e.reduce(l),Es&&console.log(o+this.stackID(e)+` (via always-reduce ${n.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++],m=c[u++],g=c[u++],v=u==c.length||!s,y=v?e:e.split(),b=this.tokens.mainToken;if(y.apply(d,m,b?b.start:y.pos,g),Es&&console.log(o+this.stackID(y)+` (via ${(d&65536)==0?"shift":`reduce of ${n.getName(d&65535)}`} for ${n.getName(m)} @ ${r}${y==e?"":", split"})`),v)return!0;y.pos>r?i.push(y):s.push(y)}return!1}advanceFully(e,i){let s=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>s)return nA(e,i),!0}}runRecovery(e,i,s){let r=null,n=!1;for(let o=0;o<e.length;o++){let l=e[o],c=i[o<<1],u=i[(o<<1)+1],d=Es?this.stackID(l)+" -> ":"";if(l.deadEnd&&(n||(n=!0,l.restart(),Es&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,s))))continue;let m=l.split(),g=d;for(let v=0;v<10&&m.forceReduce()&&(Es&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,s));v++)Es&&(g=this.stackID(m)+" -> ");for(let v of l.recoverByInsert(c))Es&&console.log(d+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,s);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),Es&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),nA(l,s)):(!r||r.score<m.score)&&(r=m)}return r}stackToTree(e){return e.close(),et.build({buffer:Km.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=(Hv||(Hv=new WeakMap)).get(e);return i||Hv.set(e,i=String.fromCodePoint(this.nextStackID++)),i+e}}function nA(t,e){for(let i=0;i<e.length;i++){let s=e[i];if(s.pos==t.pos&&s.sameState(t)){e[i].score<t.score&&(e[i]=t);return}}e.push(t)}class fF{constructor(e,i,s){this.source=e,this.flags=i,this.disabled=s}allows(e){return!this.disabled||this.disabled[e]==0}}const Fv=t=>t;class aB{constructor(e){this.start=e.start,this.shift=e.shift||Fv,this.reduce=e.reduce||Fv,this.reuse=e.reuse||Fv,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class kh extends xS{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 s=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<i.length;l++)r.push([]);function n(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=Le[c]);for(let u=1;u<l.length;){let d=l[u++];if(d>=0)n(d,c,l[u++]);else{let m=l[u+-d];for(let g=-d;g>0;g--)n(l[u++],c,m);u++}}}this.nodeSet=new wf(i.map((l,c)=>ri.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:s.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=a3;let o=fu(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(oA),this.states=fu(e.states,Uint32Array),this.data=fu(e.stateData),this.goto=fu(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new mh(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,s){let r=new uF(this,e,i,s);for(let n of this.wrappers)r=n(r,e,i,s);return r}getGoto(e,i,s=!1){let r=this.goto;if(i>=r[0])return-1;for(let n=r[i+1];;){let o=r[n++],l=o&1,c=r[n++];if(l&&s)return c;for(let u=n+(o>>1);n<u;n++)if(r[n]==e)return c;if(l)return-1}}hasAction(e,i){let s=this.data;for(let r=0;r<2;r++)for(let n=this.stateSlot(e,r?2:1),o;;n+=3){if((o=s[n])==65535)if(s[n+1]==1)o=s[n=Bn(s,n+2)];else{if(s[n+1]==2)return Bn(s,n+2);break}if(o==i||o==0)return Bn(s,n+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,s=>s==i?!0:null)}allActions(e,i){let s=this.stateSlot(e,4),r=s?i(s):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Bn(this.data,n+2);else break;r=i(Bn(this.data,n+1))}return r}nextStates(e){let i=[];for(let s=this.stateSlot(e,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Bn(this.data,s+2);else break;if((this.data[s+2]&1)==0){let r=this.data[s+1];i.some((n,o)=>o&1&&n==r)||i.push(this.data[s],r)}}return i}configure(e){let i=Object.assign(Object.create(kh.prototype),this);if(e.props&&(i.nodeSet=this.nodeSet.extend(...e.props)),e.top){let s=this.topRules[e.top];if(!s)throw new RangeError(`Invalid top rule name ${e.top}`);i.top=s}return e.tokenizers&&(i.tokenizers=this.tokenizers.map(s=>{let r=e.tokenizers.find(n=>n.from==s);return r?r.to:s})),e.specializers&&(i.specializers=this.specializers.slice(),i.specializerSpecs=this.specializerSpecs.map((s,r)=>{let n=e.specializers.find(l=>l.from==s.external);if(!n)return s;let o=Object.assign(Object.assign({},s),{external:n.to});return i.specializers[r]=oA(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),s=i.map(()=>!1);if(e)for(let n of e.split(" ")){let o=i.indexOf(n);o>=0&&(s[o]=!0)}let r=null;for(let n=0;n<i.length;n++)if(!s[n])for(let o=this.dialects[i[n]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new fF(e,s,r)}static deserialize(e){return new kh(e)}}function Bn(t,e){return t[e]|t[e+1]<<16}function dF(t){let e=null;for(let i of t){let s=i.p.stoppedAt;(i.pos==i.p.stream.end||s!=null&&i.pos>s)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.score<i.score)&&(e=i)}return e}function oA(t){if(t.external){let e=t.extend?1:0;return(i,s)=>t.external(i,s)<<1|e}return t.get}const pF=55,mF=1,gF=56,OF=2,vF=57,_F=3,aA=4,yF=5,YS=6,lB=7,hB=8,cB=9,uB=10,bF=11,SF=12,xF=13,Gv=58,wF=14,CF=15,lA=59,fB=21,kF=23,dB=24,TF=25,ky=27,pB=28,MF=29,AF=32,EF=35,PF=37,RF=38,QF=0,LF=1,$F={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},BF={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},hA={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 DF(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let cA=null,uA=null,fA=0;function Ty(t,e){let i=t.pos+e;if(fA==i&&uA==t)return cA;let s=t.peek(e),r="";for(;DF(s);)r+=String.fromCharCode(s),s=t.peek(++e);return uA=t,fA=i,cA=r?r.toLowerCase():s==zF||s==NF?void 0:null}const mB=60,eg=62,HS=47,zF=63,NF=33,jF=45;function dA(t,e){this.name=t,this.parent=e}const XF=[YS,uB,lB,hB,cB],VF=new aB({start:null,shift(t,e,i,s){return XF.indexOf(e)>-1?new dA(Ty(s,1)||"",t):t},reduce(t,e){return e==fB&&t?t.parent:t},reuse(t,e,i,s){let r=e.type.id;return r==YS||r==PF?new dA(Ty(s,1)||"",t):t},strict:!1}),ZF=new zs((t,e)=>{if(t.next!=mB){t.next<0&&e.context&&t.acceptToken(Gv);return}t.advance();let i=t.next==HS;i&&t.advance();let s=Ty(t,0);if(s===void 0)return;if(!s)return t.acceptToken(i?CF:wF);let r=e.context?e.context.name:null;if(i){if(s==r)return t.acceptToken(bF);if(r&&BF[r])return t.acceptToken(Gv,-2);if(e.dialectEnabled(QF))return t.acceptToken(SF);for(let n=e.context;n;n=n.parent)if(n.name==s)return;t.acceptToken(xF)}else{if(s=="script")return t.acceptToken(lB);if(s=="style")return t.acceptToken(hB);if(s=="textarea")return t.acceptToken(cB);if($F.hasOwnProperty(s))return t.acceptToken(uB);r&&hA[r]&&hA[r][s]?t.acceptToken(Gv,-1):t.acceptToken(YS)}},{contextual:!0}),IF=new zs(t=>{for(let e=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(lA);break}if(t.next==jF)e++;else if(t.next==eg&&e>=2){i>=3&&t.acceptToken(lA,-2);break}else e=0;t.advance()}});function qF(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const WF=new zs((t,e)=>{if(t.next==HS&&t.peek(1)==eg){let i=e.dialectEnabled(LF)||qF(e.context);t.acceptToken(i?yF:aA,2)}else t.next==eg&&t.acceptToken(aA,1)});function FS(t,e,i){let s=2+t.length;return new zs(r=>{for(let n=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(n==0&&r.next==mB||n==1&&r.next==HS||n>=2&&n<s&&r.next==t.charCodeAt(n-2))n++,o++;else if(n==s&&r.next==eg){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 n=o=0;r.advance()}})}const UF=FS("script",pF,mF),YF=FS("style",gF,OF),HF=FS("textarea",vF,_F),FF=Qh({"Text RawText IncompleteTag IncompleteCloseTag":B.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":B.angleBracket,TagName:B.tagName,"MismatchedCloseTag/TagName":[B.tagName,B.invalid],AttributeName:B.attributeName,"AttributeValue UnquotedAttributeValue":B.attributeValue,Is:B.definitionOperator,"EntityReference CharacterReference":B.character,Comment:B.blockComment,ProcessingInst:B.processingInstruction,DoctypeDecl:B.documentMeta}),GF=kh.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'#D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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:VF,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,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k!`!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:[UF,YF,HF,WF,ZF,IF,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function gB(t,e){let i=Object.create(null);for(let s of t.getChildren(dB)){let r=s.getChild(TF),n=s.getChild(ky)||s.getChild(pB);r&&(i[e.read(r.from,r.to)]=n?n.type.id==ky?e.read(n.from+1,n.to-1):e.read(n.from,n.to):"")}return i}function pA(t,e){let i=t.getChild(kF);return i?e.read(i.from,i.to):" "}function Kv(t,e,i){let s;for(let r of i)if(!r.attrs||r.attrs(s||(s=gB(t.node.parent.firstChild,e))))return{parser:r.parser,bracketed:!0};return null}function OB(t=[],e=[]){let i=[],s=[],r=[],n=[];for(let l of t)(l.tag=="script"?i:l.tag=="style"?s:l.tag=="textarea"?r:n).push(l);let o=e.length?Object.create(null):null;for(let l of e)(o[l.name]||(o[l.name]=[])).push(l);return f3((l,c)=>{let u=l.type.id;if(u==MF)return Kv(l,c,i);if(u==AF)return Kv(l,c,s);if(u==EF)return Kv(l,c,r);if(u==fB&&n.length){let d=l.node,m=d.firstChild,g=m&&pA(m,c),v;if(g){for(let y of n)if(y.tag==g&&(!y.attrs||y.attrs(v||(v=gB(m,c))))){let b=d.lastChild,w=b.type.id==RF?b.from:d.to;if(w>m.to)return{parser:y.parser,overlay:[{from:m.to,to:w}]}}}}if(o&&u==dB){let d=l.node,m;if(m=d.firstChild){let g=o[c.read(m.from,m.to)];if(g)for(let v of g){if(v.tagName&&v.tagName!=pA(d.parent,c))continue;let y=d.lastChild;if(y.type.id==ky){let b=y.from+1,w=y.lastChild,C=y.to-(w&&w.isError?0:1);if(C>b)return{parser:v.parser,overlay:[{from:b,to:C}],bracketed:!0}}else if(y.type.id==pB)return{parser:v.parser,overlay:[{from:y.from,to:y.to}]}}}}return null})}const KF=122,mA=1,JF=123,eG=124,vB=2,tG=125,iG=3,sG=4,_B=[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],rG=58,nG=40,yB=95,oG=91,sm=45,aG=46,lG=35,hG=37,cG=38,uG=92,fG=10,dG=42;function af(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function GS(t){return t>=48&&t<=57}function gA(t){return GS(t)||t>=97&&t<=102||t>=65&&t<=70}const bB=(t,e,i)=>(s,r)=>{for(let n=!1,o=0,l=0;;l++){let{next:c}=s;if(af(c)||c==sm||c==yB||n&&GS(c))!n&&(c!=sm||l>0)&&(n=!0),o===l&&c==sm&&o++,s.advance();else if(c==uG&&s.peek(1)!=fG){if(s.advance(),gA(s.next)){do s.advance();while(gA(s.next));s.next==32&&s.advance()}else s.next>-1&&s.advance();n=!0}else{n&&s.acceptToken(o==2&&r.canShift(vB)?e:c==nG?i:t);break}}},pG=new zs(bB(JF,vB,eG)),mG=new zs(bB(tG,iG,sG)),gG=new zs(t=>{if(_B.includes(t.peek(-1))){let{next:e}=t;(af(e)||e==yB||e==lG||e==aG||e==dG||e==oG||e==rG&&af(t.peek(1))||e==sm||e==cG)&&t.acceptToken(KF)}}),OG=new zs(t=>{if(!_B.includes(t.peek(-1))){let{next:e}=t;if(e==hG&&(t.advance(),t.acceptToken(mA)),af(e)){do t.advance();while(af(t.next)||GS(t.next));t.acceptToken(mA)}}}),vG=Qh({"AtKeyword import charset namespace keyframes media supports":B.definitionKeyword,"from to selector":B.keyword,NamespaceName:B.namespace,KeyframeName:B.labelName,KeyframeRangeName:B.operatorKeyword,TagName:B.tagName,ClassName:B.className,PseudoClassName:B.constant(B.className),IdName:B.labelName,"FeatureName PropertyName":B.propertyName,AttributeName:B.attributeName,NumberLiteral:B.number,KeywordQuery:B.keyword,UnaryQueryOp:B.operatorKeyword,"CallTag ValueName":B.atom,VariableName:B.variableName,Callee:B.operatorKeyword,Unit:B.unit,"UniversalSelector NestingSelector":B.definitionOperator,"MatchOp CompareOp":B.compareOperator,"ChildOp SiblingOp, LogicOp":B.logicOperator,BinOp:B.arithmeticOperator,Important:B.modifier,Comment:B.blockComment,ColorLiteral:B.color,"ParenthesizedContent StringLiteral":B.string,":":B.punctuation,"PseudoOp #":B.derefOperator,"; ,":B.separator,"( )":B.paren,"[ ]":B.squareBracket,"{ }":B.brace}),_G={__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},yG={__proto__:null,or:98,and:98,not:106,only:106,layer:170},bG={__proto__:null,selector:112,layer:166},SG={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},xG={__proto__:null,to:207},wG=kh.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'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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:[vG],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%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!}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:[gG,OG,pG,mG,1,2,3,4,new Jm("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=>_G[t]||-1},{term:125,get:t=>yG[t]||-1},{term:4,get:t=>bG[t]||-1},{term:25,get:t=>SG[t]||-1},{term:123,get:t=>xG[t]||-1}],tokenPrec:1963});let Jv=null;function e_(){if(!Jv&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],i=new Set;for(let s in t)s!="cssText"&&s!="cssFloat"&&typeof t[s]=="string"&&(/[A-Z]/.test(s)&&(s=s.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),i.has(s)||(e.push(s),i.add(s)));Jv=e.sort().map(s=>({type:"property",label:s,apply:s+": "}))}return Jv||[]}const OA=["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})),vA=["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}))),CG=["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})),kG=["@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})),Mn=/^(\w[\w-]*|-\w[\w-]*|)$/,TG=/^-(-[\w-]*)?$/;function MG(t,e){var i;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let s=(i=t.parent)===null||i===void 0?void 0:i.firstChild;return(s==null?void 0:s.name)!="Callee"?!1:e.sliceString(s.from,s.to)=="var"}const _A=new u3,AG=["Declaration"];function EG(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function SB(t,e,i){if(e.to-e.from>4096){let s=_A.get(e);if(s)return s;let r=[],n=new Set,o=e.cursor(tt.IncludeAnonymous);if(o.firstChild())do for(let l of SB(t,o.node,i))n.has(l.label)||(n.add(l.label),r.push(l));while(o.nextSibling());return _A.set(e,r),r}else{let s=[],r=new Set;return e.cursor().iterate(n=>{var o;if(i(n)&&n.matchContext(AG)&&((o=n.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=t.sliceString(n.from,n.to);r.has(l)||(r.add(l),s.push({label:l,type:"variable"}))}}),s}}const PG=t=>e=>{let{state:i,pos:s}=e,r=ft(i).resolveInner(s,-1),n=r.type.isError&&r.from==r.to-1&&i.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(n||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:e_(),validFor:Mn};if(r.name=="ValueName")return{from:r.from,options:vA,validFor:Mn};if(r.name=="PseudoClassName")return{from:r.from,options:OA,validFor:Mn};if(t(r)||(e.explicit||n)&&MG(r,i.doc))return{from:t(r)||n?r.from:s,options:SB(i.doc,EG(r),t),validFor:TG};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:e_(),validFor:Mn};return{from:r.from,options:CG,validFor:Mn}}if(r.name=="AtKeyword")return{from:r.from,options:kG,validFor:Mn};if(!e.explicit)return null;let o=r.resolve(s),l=o.childBefore(s);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:s,options:OA,validFor:Mn}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:s,options:vA,validFor:Mn}:o.name=="Block"||o.name=="Styles"?{from:s,options:e_(),validFor:Mn}:null},RG=PG(t=>t.name=="VariableName"),tg=Sh.define({name:"css",parser:wG.configure({props:[Cf.add({Declaration:em()}),$h.add({"Block KeyframeList":_3})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function QG(){return new Fu(tg,tg.data.of({autocomplete:RG}))}const LG=316,$G=317,yA=1,BG=2,DG=3,zG=4,NG=318,jG=320,XG=321,VG=5,ZG=6,IG=0,My=[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],xB=125,qG=59,Ay=47,WG=42,UG=43,YG=45,HG=60,FG=44,GG=63,KG=46,JG=91,eK=new aB({start:!1,shift(t,e){return e==VG||e==ZG||e==jG?t:e==XG},strict:!1}),tK=new zs((t,e)=>{let{next:i}=t;(i==xB||i==-1||e.context)&&t.acceptToken(NG)},{contextual:!0,fallback:!0}),iK=new zs((t,e)=>{let{next:i}=t,s;My.indexOf(i)>-1||i==Ay&&((s=t.peek(1))==Ay||s==WG)||i!=xB&&i!=qG&&i!=-1&&!e.context&&t.acceptToken(LG)},{contextual:!0}),sK=new zs((t,e)=>{t.next==JG&&!e.context&&t.acceptToken($G)},{contextual:!0}),rK=new zs((t,e)=>{let{next:i}=t;if(i==UG||i==YG){if(t.advance(),i==t.next){t.advance();let s=!e.context&&e.canShift(yA);t.acceptToken(s?yA:BG)}}else i==GG&&t.peek(1)==KG&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(DG))},{contextual:!0});function t_(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const nK=new zs((t,e)=>{if(t.next!=HG||!e.dialectEnabled(IG)||(t.advance(),t.next==Ay))return;let i=0;for(;My.indexOf(t.next)>-1;)t.advance(),i++;if(t_(t.next,!0)){for(t.advance(),i++;t_(t.next,!1);)t.advance(),i++;for(;My.indexOf(t.next)>-1;)t.advance(),i++;if(t.next==FG)return;for(let s=0;;s++){if(s==7){if(!t_(t.next,!0))return;break}if(t.next!="extends".charCodeAt(s))break;t.advance(),i++}}t.acceptToken(zG,-i)}),oK=Qh({"get set async static":B.modifier,"for while do if else switch try catch finally return throw break continue default case defer":B.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":B.operatorKeyword,"let var const using function class extends":B.definitionKeyword,"import export from":B.moduleKeyword,"with debugger new":B.keyword,TemplateString:B.special(B.string),super:B.atom,BooleanLiteral:B.bool,this:B.self,null:B.null,Star:B.modifier,VariableName:B.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":B.function(B.variableName),VariableDefinition:B.definition(B.variableName),Label:B.labelName,PropertyName:B.propertyName,PrivatePropertyName:B.special(B.propertyName),"CallExpression/MemberExpression/PropertyName":B.function(B.propertyName),"FunctionDeclaration/VariableDefinition":B.function(B.definition(B.variableName)),"ClassDeclaration/VariableDefinition":B.definition(B.className),"NewExpression/VariableName":B.className,PropertyDefinition:B.definition(B.propertyName),PrivatePropertyDefinition:B.definition(B.special(B.propertyName)),UpdateOp:B.updateOperator,"LineComment Hashbang":B.lineComment,BlockComment:B.blockComment,Number:B.number,String:B.string,Escape:B.escape,ArithOp:B.arithmeticOperator,LogicOp:B.logicOperator,BitOp:B.bitwiseOperator,CompareOp:B.compareOperator,RegExp:B.regexp,Equals:B.definitionOperator,Arrow:B.function(B.punctuation),": Spread":B.punctuation,"( )":B.paren,"[ ]":B.squareBracket,"{ }":B.brace,"InterpolationStart InterpolationEnd":B.special(B.brace),".":B.derefOperator,", ;":B.separator,"@":B.meta,TypeName:B.typeName,TypeDefinition:B.definition(B.typeName),"type enum interface implements namespace module declare":B.definitionKeyword,"abstract global Privacy readonly override":B.modifier,"is keyof unique infer asserts":B.operatorKeyword,JSXAttributeValue:B.attributeValue,JSXText:B.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":B.angleBracket,"JSXIdentifier JSXNameSpacedName":B.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":B.attributeName,"JSXBuiltin/JSXIdentifier":B.standard(B.tagName)}),aK={__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},lK={__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},hK={__proto__:null,"<":193},cK=kh.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<]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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:eK,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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YZXz{^~^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=>aK[t]||-1},{term:343,get:t=>lK[t]||-1},{term:95,get:t=>hK[t]||-1}],tokenPrec:15201}),wB=[ds("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ds("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ds("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ds("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ds("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ds(`try {
|
|
75
|
-
\${}
|
|
76
|
-
} catch (\${error}) {
|
|
77
|
-
\${}
|
|
78
|
-
}`,{label:"try",detail:"/ catch block",type:"keyword"}),ds("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),ds(`if (\${}) {
|
|
79
|
-
\${}
|
|
80
|
-
} else {
|
|
81
|
-
\${}
|
|
82
|
-
}`,{label:"if",detail:"/ else block",type:"keyword"}),ds(`class \${name} {
|
|
83
|
-
constructor(\${params}) {
|
|
84
|
-
\${}
|
|
85
|
-
}
|
|
86
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),ds('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ds('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],uK=wB.concat([ds("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ds("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ds("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),bA=new u3,CB=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Yc(t){return(e,i)=>{let s=e.node.getChild("VariableDefinition");return s&&i(s,t),!0}}const fK=["FunctionDeclaration"],dK={FunctionDeclaration:Yc("function"),ClassDeclaration:Yc("class"),ClassExpression:()=>!0,EnumDeclaration:Yc("constant"),TypeAliasDeclaration:Yc("type"),NamespaceDeclaration:Yc("namespace"),VariableDefinition(t,e){t.matchContext(fK)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function kB(t,e){let i=bA.get(e);if(i)return i;let s=[],r=!0;function n(o,l){let c=t.sliceString(o.from,o.to);s.push({label:c,type:l})}return e.cursor(tt.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=dK[o.name];if(l&&l(o,n)||CB.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of kB(t,o.node))s.push(l);return!1}}),bA.set(e,s),s}const SA=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,TB=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function pK(t){let e=ft(t.state).resolveInner(t.pos,-1);if(TB.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&SA.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let s=[];for(let r=e;r;r=r.parent)CB.has(r.name)&&(s=s.concat(kB(t.state.doc,r)));return{options:s,from:i?e.from:t.pos,validFor:SA}}const Jr=Sh.define({name:"javascript",parser:cK.configure({props:[Cf.add({IfStatement:em({except:/^\s*({|else\b)/}),TryStatement:em({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:jq,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),s=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:s?1:2)*t.unit},Block:Nq({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":em({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}}),$h.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":_3,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),MB={test:t=>/^JSX/.test(t.name),facet:wS({commentTokens:{block:{open:"{/*",close:"*/}"}}})},AB=Jr.configure({dialect:"ts"},"typescript"),EB=Jr.configure({dialect:"jsx",props:[CS.add(t=>t.isTop?[MB]:void 0)]}),PB=Jr.configure({dialect:"jsx ts",props:[CS.add(t=>t.isTop?[MB]:void 0)]},"typescript");let RB=t=>({label:t,type:"keyword"});const QB="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(RB),mK=QB.concat(["declare","implements","private","protected","public"].map(RB));function gK(t={}){let e=t.jsx?t.typescript?PB:EB:t.typescript?AB:Jr,i=t.typescript?uK.concat(mK):wB.concat(QB);return new Fu(e,[Jr.data.of({autocomplete:oY(TB,b$(i))}),Jr.data.of({autocomplete:pK}),t.jsx?_K:[]])}function OK(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 xA(t,e,i=t.length){for(let s=e==null?void 0:e.firstChild;s;s=s.nextSibling)if(s.name=="JSXIdentifier"||s.name=="JSXBuiltin"||s.name=="JSXNamespacedName"||s.name=="JSXMemberExpression")return t.sliceString(s.from,Math.min(s.to,i));return""}const vK=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),_K=pe.inputHandler.of((t,e,i,s,r)=>{if((vK?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||s!=">"&&s!="/"||!Jr.isActiveAt(t.state,e,-1))return!1;let n=r(),{state:o}=n,l=o.changeByRange(c=>{var u;let{head:d}=c,m=ft(o).resolveInner(d-1,-1),g;if(m.name=="JSXStartTag"&&(m=m.parent),!(o.doc.sliceString(d-1,d)!=s||m.name=="JSXAttributeValue"&&m.to>d)){if(s==">"&&m.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(s=="/"&&m.name=="JSXStartCloseTag"){let v=m.parent,y=v.parent;if(y&&v.from==d-2&&((g=xA(o.doc,y.firstChild,d))||((u=y.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${g}>`;return{range:ne.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(s==">"){let v=OK(m);if(v&&v.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(g=xA(o.doc,v,d)))return{range:c,changes:{from:d,insert:`</${g}>`}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([n,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Hc=["_blank","_self","_top","_parent"],i_=["ascii","utf-8","utf-16","latin1","latin1"],s_=["get","post","put","delete"],r_=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ps=["true","false"],ke={},yK={a:{attrs:{href:null,ping:null,type:null,media:null,target:Hc,hreflang:null}},abbr:ke,address:ke,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:ke,aside:ke,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:ke,base:{attrs:{href:null,target:Hc}},bdi:ke,bdo:ke,blockquote:{attrs:{cite:null}},body:ke,br:ke,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:r_,formmethod:s_,formnovalidate:["novalidate"],formtarget:Hc,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:ke,center:ke,cite:ke,code:ke,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:ke,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:ke,div:ke,dl:ke,dt:ke,em:ke,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:ke,figure:ke,footer:ke,form:{attrs:{action:null,name:null,"accept-charset":i_,autocomplete:["on","off"],enctype:r_,method:s_,novalidate:["novalidate"],target:Hc}},h1:ke,h2:ke,h3:ke,h4:ke,h5:ke,h6:ke,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:ke,hgroup:ke,hr:ke,html:{attrs:{manifest:null}},i:ke,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:r_,formmethod:s_,formnovalidate:["novalidate"],formtarget:Hc,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:ke,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:ke,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:ke,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:i_,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:ke,noscript:ke,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:ke,param:{attrs:{name:null,value:null}},pre:ke,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:ke,rt:ke,ruby:ke,samp:ke,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:i_}},section:ke,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:ke,source:{attrs:{src:null,type:null,media:null}},span:ke,strong:ke,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:ke,summary:ke,sup:ke,table:ke,tbody:ke,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:ke,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:ke,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:ke,time:{attrs:{datetime:null}},title:ke,tr:ke,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:ke,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:ke},LB={accesskey:null,class:null,contenteditable:Ps,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:Ps,autocorrect:Ps,autocapitalize:Ps,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":Ps,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ps,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ps,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ps,"aria-hidden":Ps,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ps,"aria-multiselectable":Ps,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ps,"aria-relevant":null,"aria-required":Ps,"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},$B="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 $B)LB[t]=null;class lf{constructor(e,i){this.tags={...yK,...e},this.globalAttrs={...LB,...i},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}lf.default=new lf;function Th(t,e,i=t.length){if(!e)return"";let s=e.firstChild,r=s&&s.getChild("TagName");return r?t.sliceString(r.from,Math.min(r.to,i)):""}function Mh(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function BB(t,e,i){let s=i.tags[Th(t,Mh(e))];return(s==null?void 0:s.children)||i.allTags}function KS(t,e){let i=[];for(let s=Mh(e);s&&!s.type.isTop;s=Mh(s.parent)){let r=Th(t,s);if(r&&s.lastChild.name=="CloseTag")break;r&&i.indexOf(r)<0&&(e.name=="EndTag"||e.from>=s.firstChild.to)&&i.push(r)}return i}const DB=/^[:\-\.\w\u00b7-\uffff]*$/;function wA(t,e,i,s,r){let n=/\s*>/.test(t.sliceDoc(r,r+5))?"":">",o=Mh(i,i.name=="StartTag"||i.name=="TagName");return{from:s,to:r,options:BB(t.doc,o,e).map(l=>({label:l,type:"type"})).concat(KS(t.doc,i).map((l,c)=>({label:"/"+l,apply:"/"+l+n,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function CA(t,e,i,s){let r=/\s*>/.test(t.sliceDoc(s,s+5))?"":">";return{from:i,to:s,options:KS(t.doc,e).map((n,o)=>({label:n,apply:n+r,type:"type",boost:99-o})),validFor:DB}}function bK(t,e,i,s){let r=[],n=0;for(let o of BB(t.doc,i,e))r.push({label:"<"+o,type:"type"});for(let o of KS(t.doc,i))r.push({label:"</"+o+">",type:"type",boost:99-n++});return{from:s,to:s,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function SK(t,e,i,s,r){let n=Mh(i),o=n?e.tags[Th(t.doc,n)]: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:s,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:DB}}function xK(t,e,i,s,r){var n;let o=(n=i.parent)===null||n===void 0?void 0:n.getChild("AttributeName"),l=[],c;if(o){let u=t.sliceDoc(o.from,o.to),d=e.globalAttrs[u];if(!d){let m=Mh(i),g=m?e.tags[Th(t.doc,m)]:null;d=(g==null?void 0:g.attrs)&&g.attrs[u]}if(d){let m=t.sliceDoc(s,r).toLowerCase(),g='"',v='"';/^['"]/.test(m)?(c=m[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",v=t.sliceDoc(r,r+1)==m[0]?"":m[0],m=m.slice(1),s++):c=/^[^\s<>='"]*$/;for(let y of d)l.push({label:y,apply:g+y+v,type:"constant"})}}return{from:s,to:r,options:l,validFor:c}}function zB(t,e){let{state:i,pos:s}=e,r=ft(i).resolveInner(s,-1),n=r.resolve(s);for(let o=s,l;n==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;n=r=l,o=c.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?CA(i,r,r.from,s):wA(i,t,r,r.from,s):r.name=="StartTag"||r.name=="IncompleteTag"?wA(i,t,r,s,s):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?CA(i,r,s,s):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?SK(i,t,r,r.name=="AttributeName"?r.from:s,s):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?xK(i,t,r,r.name=="Is"?s:r.from,s):e.explicit&&(n.name=="Element"||n.name=="Text"||n.name=="Document")?bK(i,t,r,s):null}function wK(t){return zB(lf.default,t)}function CK(t){let{extraTags:e,extraGlobalAttributes:i}=t,s=i||e?new lf(e,i):lf.default;return r=>zB(s,r)}const kK=Jr.parser.configure({top:"SingleExpression"}),NB=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:AB.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:EB.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:PB.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:kK},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:Jr.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:tg.parser}],jB=[{name:"style",parser:tg.parser.configure({top:"Styles"})}].concat($B.map(t=>({name:t,parser:Jr.parser}))),XB=Sh.define({name:"html",parser:GF.configure({props:[Cf.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 s=t.node;;){let r=s.lastChild;if(!r||r.name!="Element"||r.to!=s.to)break;e=s=r}return e&&!((i=e.lastChild)&&(i.name=="CloseTag"||i.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),$h.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}}}),R3.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),rm=XB.configure({wrap:OB(NB,jB)});function TK(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=OB((t.nestedLanguages||[]).concat(NB),(t.nestedAttributes||[]).concat(jB)));let s=i?XB.configure({wrap:i,dialect:e}):e?rm.configure({dialect:e}):rm;return new Fu(s,[rm.data.of({autocomplete:CK(t)}),t.autoCloseTags!==!1?MK:[],gK().support,QG().support])}const kA=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),MK=pe.inputHandler.of((t,e,i,s,r)=>{if(t.composing||t.state.readOnly||e!=i||s!=">"&&s!="/"||!rm.isActiveAt(t.state,e,-1))return!1;let n=r(),{state:o}=n,l=o.changeByRange(c=>{var u,d,m;let g=o.doc.sliceString(c.from-1,c.to)==s,{head:v}=c,y=ft(o).resolveInner(v,-1),b;if(g&&s==">"&&y.name=="EndTag"){let w=y.parent;if(((d=(u=w.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=Th(o.doc,w.parent,v))&&!kA.has(b)){let C=v+(o.doc.sliceString(v,v+1)===">"?1:0),T=`</${b}>`;return{range:c,changes:{from:v,to:C,insert:T}}}}else if(g&&s=="/"&&y.name=="IncompleteCloseTag"){let w=y.parent;if(y.from==v-2&&((m=w.lastChild)===null||m===void 0?void 0:m.name)!="CloseTag"&&(b=Th(o.doc,w,v))&&!kA.has(b)){let C=v+(o.doc.sliceString(v,v+1)===">"?1:0),T=`${b}>`;return{range:ne.cursor(v+T.length,-1),changes:{from:v,to:C,insert:T}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([n,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),VB=wS({commentTokens:{block:{open:"<!--",close:"-->"}}}),ZB=new Le,IB=qH.configure({props:[$h.add(t=>!t.is("Block")||t.is("Document")||Ey(t)!=null||AK(t)?void 0:(e,i)=>({from:i.doc.lineAt(e.from).to,to:e.to})),ZB.add(Ey),Cf.add({Document:()=>null}),$a.add({Document:VB})]});function Ey(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function AK(t){return t.name=="OrderedList"||t.name=="BulletList"}function EK(t,e){let i=t;for(;;){let s=i.nextSibling,r;if(!s||(r=Ey(s.type))!=null&&r<=e)break;i=s}return i.to}const PK=v3.of((t,e,i)=>{for(let s=ft(t).resolveInner(i,-1);s&&!(s.from<e);s=s.parent){let r=s.type.prop(ZB);if(r==null)continue;let n=EK(s,r);if(n>i)return{from:i,to:n}}return null});function JS(t){return new rr(VB,t,[],"markdown")}const RK=JS(IB),QK=IB.configure([iF,rF,sF,nF,{props:[$h.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),hf=JS(QK);function LK(t,e){return i=>{if(i&&t){let s=null;if(i=/\S*/.exec(i)[0],typeof t=="function"?s=t(i):s=Dm.matchLanguageName(t,i,!0),s instanceof Dm)return s.support?s.support.language.parser:Hu.getSkippingParser(s.load());if(s)return s.parser}return e?e.parser:null}}class n_{constructor(e,i,s,r,n,o,l){this.node=e,this.from=i,this.to=s,this.spaceBefore=r,this.spaceAfter=n,this.type=o,this.item=l}blank(e,i=!0){let s=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;s.length<e;)s+=" ";return s}else{for(let r=this.to-this.from-s.length-this.spaceAfter.length;r>0;r--)s+=" ";return s+(i?this.spaceAfter:"")}}marker(e,i){let s=this.node.name=="OrderedList"?String(+WB(this.item,e)[2]+i):"";return this.spaceBefore+s+this.type+this.spaceAfter}}function qB(t,e){let i=[],s=[];for(let r=t;r;r=r.parent){if(r.name=="FencedCode")return s;(r.name=="ListItem"||r.name=="Blockquote")&&i.push(r)}for(let r=i.length-1;r>=0;r--){let n=i[r],o,l=e.lineAt(n.from),c=n.from-l.from;if(n.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))s.push(new n_(n,c,c+o[0].length,"",o[1],">",null));else if(n.name=="ListItem"&&n.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),s.push(new n_(n.parent,c,c+d,o[1],u,o[2],n))}else if(n.name=="ListItem"&&n.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 m=o[2];o[3]&&(m+=o[3].replace(/[xX]/," ")),s.push(new n_(n.parent,c,c+d,o[1],u,m,n))}}return s}function WB(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function o_(t,e,i,s=0){for(let r=-1,n=t;;){if(n.name=="ListItem"){let l=WB(n,e),c=+l[2];if(r>=0){if(c!=r+1)return;i.push({from:n.from+l[1].length,to:n.from+l[0].length,insert:String(r+2+s)})}r=c}let o=n.nextSibling;if(!o)break;n=o}}function ex(t,e){let i=/^[ \t]*/.exec(t)[0].length;if(!i||e.facet(Lh)!=" ")return t;let s=xr(t,4,i),r="";for(let n=s;n>0;)n>=4?(r+=" ",n-=4):(r+=" ",n--);return r+t.slice(i)}const $K=(t={})=>({state:e,dispatch:i})=>{let s=ft(e),{doc:r}=e,n=null,o=e.changeByRange(l=>{if(!l.empty||!hf.isActiveAt(e,l.from,-1)&&!hf.isActiveAt(e,l.from,1))return n={range:l};let c=l.from,u=r.lineAt(c),d=qB(s.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return n={range:l};let m=d[d.length-1];if(m.to-m.spaceAfter.length>c-u.from)return n={range:l};let g=c>=m.to-m.spaceAfter.length&&!/\S/.test(u.text.slice(m.to));if(m.item&&g){let C=m.node.firstChild,T=m.node.getChild("ListItem","ListItem");if(C.to>=c||T&&T.to<c||u.from>0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||t.nonTightLists===!1){let M=d.length>1?d[d.length-2]:null,k,P="";M&&M.item?(k=u.from+M.from,P=M.marker(r,1)):k=u.from+(M?M.to:0);let E=[{from:k,to:c,insert:P}];return m.node.name=="OrderedList"&&o_(m.item,r,E,-2),M&&M.node.name=="OrderedList"&&o_(M.item,r,E),{range:ne.cursor(k+P.length),changes:E}}else{let M=MA(d,e,u);return{range:ne.cursor(c+M.length+1),changes:{from:u.from,insert:M+e.lineBreak}}}}if(m.node.name=="Blockquote"&&g&&u.from){let C=r.lineAt(u.from-1),T=/>\s*$/.exec(C.text);if(T&&T.index==m.from){let M=e.changes([{from:C.from+T.index,to:C.to},{from:u.from+m.from,to:u.to}]);return{range:l.map(M),changes:M}}}let v=[];m.node.name=="OrderedList"&&o_(m.item,r,v);let y=m.item&&m.item.from<u.from,b="";if(!y||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=m.to)for(let C=0,T=d.length-1;C<=T;C++)b+=C==T&&!y?d[C].marker(r,1):d[C].blank(C<T?xr(u.text,4,d[C+1].from)-b.length:null);let w=c;for(;w>u.from&&/\s/.test(u.text.charAt(w-u.from-1));)w--;return b=ex(b,e),DK(m.node,e.doc)&&(b=MA(d,e,u)+e.lineBreak+b),v.push({from:w,to:c,insert:e.lineBreak+b}),{range:ne.cursor(w+b.length+1),changes:v}});return n?!1:(i(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},BK=$K();function TA(t){return t.name=="QuoteMark"||t.name=="ListMark"}function DK(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let i=t.firstChild,s=t.getChild("ListItem","ListItem");if(!s)return!1;let r=e.lineAt(i.to),n=e.lineAt(s.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1)<n.number}function MA(t,e,i){let s="";for(let r=0,n=t.length-2;r<=n;r++)s+=t[r].blank(r<n?xr(i.text,4,t[r+1].from)-s.length:null,r<n);return ex(s,e)}function zK(t,e){let i=t.resolveInner(e,-1),s=e;TA(i)&&(s=i.from,i=i.parent);for(let r;r=i.childBefore(s);)if(TA(r))s=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")i=r.lastChild,s=i.to;else break;return i}const NK=({state:t,dispatch:e})=>{let i=ft(t),s=null,r=t.changeByRange(n=>{let o=n.from,{doc:l}=t;if(n.empty&&hf.isActiveAt(t,n.from)){let c=l.lineAt(o),u=qB(zK(i,o),l);if(u.length){let d=u[u.length-1],m=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>m&&!/\S/.test(c.text.slice(m,o-c.from)))return{range:ne.cursor(c.from+m),changes:{from:c.from+m,to:o}};if(o-c.from==m&&(!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 v=d.blank(xr(c.text,4,d.to)-xr(c.text,4,d.from));return g==c.from&&(v=ex(v,t)),{range:ne.cursor(g+v.length),changes:{from:g,to:c.from+d.to,insert:v}}}if(g<o)return{range:ne.cursor(g),changes:{from:g,to:o}}}}}return s={range:n}});return s?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},jK=[{key:"Enter",run:BK},{key:"Backspace",run:NK}],UB=TK({matchClosingTags:!1});function XK(t={}){let{codeLanguages:e,defaultCodeLanguage:i,addKeymap:s=!0,base:{parser:r}=RK,completeHTMLTags:n=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=UB}=t;if(!(r instanceof Mg))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=t.extensions?[t.extensions]:[],u=[l.support,PK],d;o&&u.push(qK),i instanceof Fu?(u.push(i.support),d=i.language):i&&(d=i);let m=e||d?LK(e,d):void 0;c.push(UH({codeParser:m,htmlParser:l.language.parser})),s&&u.push(Wn.high(Ka.of(jK)));let g=JS(r.configure(c));return n&&u.push(g.data.of({autocomplete:VK})),new Fu(g,u)}function VK(t){let{state:e,pos:i}=t,s=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(i-25,i));if(!s)return null;let r=ft(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-s[0].length,to:i,options:ZK(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let a_=null;function ZK(){if(a_)return a_;let t=wK(new $S(We.create({extensions:UB}),0,!0));return a_=t?t.options:[]}const IK=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,qK=pe.domEventHandlers({paste:(t,e)=>{var i;let{main:s}=e.state.selection;if(s.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),!hf.isActiveAt(e.state,s.from,1)))return!1;let n=ft(e.state),o=!1;return n.iterate({from:s.from,to:s.to,enter:l=>{(l.from>s.from||IK.test(l.name))&&(o=!0)},leave:l=>{l.to<s.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:s.from,insert:"["},{from:s.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});function WK({initialContent:t,filePath:e,onSave:i,onClose:s}){const[r,n]=X.useState(t),[o,l]=X.useState(!1),[c,u]=X.useState(!1),d=X.useRef(r);X.useEffect(()=>{d.current=r},[r]);const m=X.useCallback(b=>{n(b),u(b!==t)},[t]),g=X.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]),v=X.useCallback(()=>{c&&!window.confirm("Unsaved changes -- discard?")||s()},[c,s]),y=Ka.of([{key:"Mod-s",run:()=>(g(),!0)}]);return X.useEffect(()=>{const b=w=>{(w.ctrlKey||w.metaKey)&&w.key==="s"&&w.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:He("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:v,className:He("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(D$,{value:r,onChange:m,theme:B$,extensions:[XK({base:hf}),y],height:"calc(100vh - 56px)",basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0,bracketMatching:!0,indentOnInput:!0}})})]})}function UK({phaseId:t,onBack:e}){const{plans:i,context:s,research:r,loading:n,error:o,refetch:l}=UV(t),[c,u]=X.useState(null),[d,m]=X.useState(""),g=i.length>0?i[0].frontmatter.phase??t:t,v=X.useCallback(async w=>{try{const T=w.replace(/^\.planning[\\/]/,"").split(/[\\/]/),M=await fetch(`/api/plan/${T.join("/")}`);if(!M.ok)return;const k=await M.json();m(k.content),u(w)}catch(C){console.error("[phase-detail]",C)}},[]),y=X.useCallback(async w=>{if(!c)return;const T=c.replace(/^\.planning[\\/]/,"").split(/[\\/]/);if(!(await fetch(`/api/plan/${T.join("/")}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:w})})).ok)throw new Error("Failed to save plan")},[c]),b=X.useCallback(()=>{u(null),m(""),l()},[l]);return S.jsxs("div",{className:"space-y-6",children:[S.jsxs("button",{type:"button",onClick:e,className:He("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:[s&&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"}),!s&&!r&&!n&&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}),n&&i.length===0&&S.jsx("div",{className:"space-y-3",children:[1,2,3].map(w=>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"})]},w))}),!n&&!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(w=>S.jsx(HV,{plan:w,onEdit:v},w.path))}),c&&S.jsx(WK,{initialContent:d,filePath:c,onSave:y,onClose:b})]})}function YK(){const{lastChange:t}=pf(),[e,i]=X.useState([]),[s,r]=X.useState([]),[n,o]=X.useState(!0),[l,c]=X.useState(null),[u,d]=X.useState(""),[m,g]=X.useState(!1),[v,y]=X.useState(!1),b=X.useCallback(async()=>{try{c(null);const T=await fetch("/api/todos");if(!T.ok)throw new Error(`Failed to fetch todos: ${T.status}`);const M=await T.json();i(M.pending),r(M.completed)}catch(T){c(T instanceof Error?T.message:"Failed to fetch todos")}finally{o(!1)}},[]);X.useEffect(()=>{b()},[b]),X.useEffect(()=>{t>0&&b()},[t,b]);const w=X.useCallback(async()=>{const T=u.trim();if(T){g(!0);try{if(!(await fetch("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:T})})).ok)throw new Error("Failed to create todo");d(""),await b()}catch(M){c(M instanceof Error?M.message:"Failed to create todo")}finally{g(!1)}}},[u,b]),C=X.useCallback(async(T,M)=>{try{if(!(await fetch("/api/todos",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:T,completed:M})})).ok)throw new Error("Failed to update todo");await b()}catch(k){c(k instanceof Error?k.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:T=>d(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!m&&w()},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:w,disabled:m||!u.trim(),className:He("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}),n&&S.jsx("div",{className:"space-y-px",children:[1,2,3].map(T=>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"})]},T))}),!n&&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(T=>S.jsxs("button",{type:"button",onClick:()=>C(T.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:T.text})]},T.file))}),!n&&s.length>0&&S.jsxs("div",{className:"border-t border-border pt-4",children:[S.jsxs("button",{type:"button",onClick:()=>y(!v),className:"flex w-full items-center gap-2 text-left",children:[S.jsx("svg",{className:He("h-3 w-3 text-muted-foreground transition-transform",v&&"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 (",s.length,")"]})]}),v&&S.jsx("div",{className:"mt-2 space-y-1",children:s.map(T=>S.jsxs("button",{type:"button",onClick:()=>C(T.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:T.text})]},T.file))})]})]})}function HK({onEntryAdded:t}){const[e,i]=X.useState(!1),[s,r]=X.useState("decision"),[n,o]=X.useState(""),[l,c]=X.useState(""),[u,d]=X.useState(!1),[m,g]=X.useState(null),[v,y]=X.useState(null),b=X.useCallback(async()=>{const w=l.trim();if(w){d(!0),g(null),y(null);try{if(s==="decision"){const C=await fetch("/api/state/decision",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phase:n.trim()||void 0,text:w})});if(!C.ok){const T=await C.json().catch(()=>({}));throw new Error(T.error||"Could not add decision")}y("Decision added")}else{const C=await fetch("/api/state/blocker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:w})});if(!C.ok){const T=await C.json().catch(()=>({}));throw new Error(T.error||"Could not add blocker")}y("Blocker added")}c(""),o(""),t==null||t(),setTimeout(()=>y(null),2e3)}catch(C){g(C instanceof Error?C.message:"Failed to update STATE.md")}finally{d(!1)}}},[s,n,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:He("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:He("rounded-sm px-3 py-1 font-mono text-xs transition-colors",s==="decision"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"),children:"Decision"}),S.jsx("button",{type:"button",onClick:()=>r("blocker"),className:He("rounded-sm px-3 py-1 font-mono text-xs transition-colors",s==="blocker"?"bg-danger/20 text-danger":"text-muted-foreground hover:text-foreground"),children:"Blocker"})]}),s==="decision"&&S.jsx("input",{type:"text",value:n,onChange:w=>o(w.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:w=>c(w.target.value),onKeyDown:w=>{w.key==="Enter"&&!u&&b()},placeholder:s==="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:He("rounded-sm px-3 py-1.5 font-mono text-xs font-semibold transition-colors","disabled:opacity-40 disabled:cursor-not-allowed",s==="decision"?"bg-accent/20 text-accent hover:bg-accent/30":"bg-danger/20 text-danger hover:bg-danger/30"),children:u?"Saving...":`Add ${s==="decision"?"Decision":"Blocker"}`}),m&&S.jsx("p",{className:"text-xs text-danger",children:m}),v&&S.jsx("p",{className:"text-xs text-success",children:v})]})]})}function FK(t){return t.map(e=>({text:e.replace(/~~(.+)~~/,"$1").replace(/\s*RESOLVED.*$/i,"").trim(),resolved:e.includes("RESOLVED")||e.startsWith("~~")&&e.endsWith("~~")}))}function GK(){const{state:t}=Fa(),[e,i]=X.useState(!1),[s,r]=X.useState(null),[n,o]=X.useState(null),[l,c]=X.useState(0),u=FK((t==null?void 0:t.blockers)??[]),d=u.filter(y=>!y.resolved),m=u.filter(y=>y.resolved),g=X.useCallback(async y=>{r(y),o(null);try{if(!(await fetch("/api/state",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({field:"blockers",value:`~~${y}~~ RESOLVED`})})).ok)throw new Error("Failed to resolve blocker");c(w=>w+1)}catch(b){o(b instanceof Error?b.message:"Failed to resolve blocker")}finally{r(null)}},[]),v=X.useCallback(()=>{c(y=>y+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:He("font-mono text-xs",d.length>0?"text-danger":"text-success"),children:d.length>0?`${d.length} active`:"No active blockers"})]}),n&&S.jsx("div",{className:"border border-danger/30 px-3 py-2 font-mono text-xs text-danger",children:n}),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(y=>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:y.text})}),S.jsx("button",{type:"button",onClick:()=>g(y.text),disabled:s===y.text,className:He("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:s===y.text?"...":"Resolve"})]},y.text))}),m.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:He("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 (",m.length,")"]})]}),e&&S.jsx("div",{className:"mt-2 space-y-1",children:m.map(y=>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:y.text})]},y.text))})]}),S.jsx(HK,{onEntryAdded:v})]},l)}function KK({sidebar:t,children:e,mobileMenuOpen:i=!1,onMobileMenuToggle:s,onMobileMenuClose:r,headerRight:n,simpleMode:o=!1}){return S.jsxs("div",{className:"flex h-screen flex-col overflow-hidden md:flex-row",children:[S.jsxs("div",{className:He("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:[n,S.jsx("button",{type:"button",onClick:s,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"})]}),n]}),e]})]})}var Xl={},l_,AA;function JK(){return AA||(AA=1,l_=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),l_}var h_={},wo={},EA;function Ja(){if(EA)return wo;EA=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 wo.getSymbolSize=function(s){if(!s)throw new Error('"version" cannot be null or undefined');if(s<1||s>40)throw new Error('"version" should be in range from 1 to 40');return s*4+17},wo.getSymbolTotalCodewords=function(s){return e[s]},wo.getBCHDigit=function(i){let s=0;for(;i!==0;)s++,i>>>=1;return s},wo.setToSJISFunction=function(s){if(typeof s!="function")throw new Error('"toSJISFunc" is not a valid function.');t=s},wo.isKanjiModeEnabled=function(){return typeof t<"u"},wo.toSJIS=function(s){return t(s)},wo}var c_={},PA;function tx(){return PA||(PA=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(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},t.from=function(s,r){if(t.isValid(s))return s;try{return e(s)}catch{return r}}})(c_)),c_}var u_,RA;function eJ(){if(RA)return u_;RA=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 s=0;s<i;s++)this.putBit((e>>>i-s-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++}},u_=t,u_}var f_,QA;function tJ(){if(QA)return f_;QA=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,s,r){const n=e*this.size+i;this.data[n]=s,r&&(this.reservedBit[n]=!0)},t.prototype.get=function(e,i){return this.data[e*this.size+i]},t.prototype.xor=function(e,i,s){this.data[e*this.size+i]^=s},t.prototype.isReserved=function(e,i){return this.reservedBit[e*this.size+i]},f_=t,f_}var d_={},LA;function iJ(){return LA||(LA=1,(function(t){const e=Ja().getSymbolSize;t.getRowColCoords=function(s){if(s===1)return[];const r=Math.floor(s/7)+2,n=e(s),o=n===145?26:Math.ceil((n-13)/(2*r-2))*2,l=[n-7];for(let c=1;c<r-1;c++)l[c]=l[c-1]-o;return l.push(6),l.reverse()},t.getPositions=function(s){const r=[],n=t.getRowColCoords(s),o=n.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([n[l],n[c]]);return r}})(d_)),d_}var p_={},$A;function sJ(){if($A)return p_;$A=1;const t=Ja().getSymbolSize,e=7;return p_.getPositions=function(s){const r=t(s);return[[0,0],[r-e,0],[0,r-e]]},p_}var m_={},BA;function rJ(){return BA||(BA=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 n=r.size;let o=0,l=0,c=0,u=null,d=null;for(let m=0;m<n;m++){l=c=0,u=d=null;for(let g=0;g<n;g++){let v=r.get(m,g);v===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=v,l=1),v=r.get(g,m),v===d?c++:(c>=5&&(o+=e.N1+(c-5)),d=v,c=1)}l>=5&&(o+=e.N1+(l-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(r){const n=r.size;let o=0;for(let l=0;l<n-1;l++)for(let c=0;c<n-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 n=r.size;let o=0,l=0,c=0;for(let u=0;u<n;u++){l=c=0;for(let d=0;d<n;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 n=0;const o=r.data.length;for(let c=0;c<o;c++)n+=r.data[c];return Math.abs(Math.ceil(n*100/o/5)-10)*e.N4};function i(s,r,n){switch(s){case t.Patterns.PATTERN000:return(r+n)%2===0;case t.Patterns.PATTERN001:return r%2===0;case t.Patterns.PATTERN010:return n%3===0;case t.Patterns.PATTERN011:return(r+n)%3===0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2===0;case t.Patterns.PATTERN101:return r*n%2+r*n%3===0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2===0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2===0;default:throw new Error("bad maskPattern:"+s)}}t.applyMask=function(r,n){const o=n.size;for(let l=0;l<o;l++)for(let c=0;c<o;c++)n.isReserved(c,l)||n.xor(c,l,i(r,c,l))},t.getBestMask=function(r,n){const o=Object.keys(t.Patterns).length;let l=0,c=1/0;for(let u=0;u<o;u++){n(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}})(m_)),m_}var Ep={},DA;function YB(){if(DA)return Ep;DA=1;const t=tx(),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 Ep.getBlocksCount=function(r,n){switch(n){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}},Ep.getTotalCodewordsCount=function(r,n){switch(n){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}},Ep}var g_={},Fc={},zA;function nJ(){if(zA)return Fc;zA=1;const t=new Uint8Array(512),e=new Uint8Array(256);return(function(){let s=1;for(let r=0;r<255;r++)t[r]=s,e[s]=r,s<<=1,s&256&&(s^=285);for(let r=255;r<512;r++)t[r]=t[r-255]})(),Fc.log=function(s){if(s<1)throw new Error("log("+s+")");return e[s]},Fc.exp=function(s){return t[s]},Fc.mul=function(s,r){return s===0||r===0?0:t[e[s]+e[r]]},Fc}var NA;function oJ(){return NA||(NA=1,(function(t){const e=nJ();t.mul=function(s,r){const n=new Uint8Array(s.length+r.length-1);for(let o=0;o<s.length;o++)for(let l=0;l<r.length;l++)n[o+l]^=e.mul(s[o],r[l]);return n},t.mod=function(s,r){let n=new Uint8Array(s);for(;n.length-r.length>=0;){const o=n[0];for(let c=0;c<r.length;c++)n[c]^=e.mul(r[c],o);let l=0;for(;l<n.length&&n[l]===0;)l++;n=n.slice(l)}return n},t.generateECPolynomial=function(s){let r=new Uint8Array([1]);for(let n=0;n<s;n++)r=t.mul(r,new Uint8Array([1,e.exp(n)]));return r}})(g_)),g_}var O_,jA;function aJ(){if(jA)return O_;jA=1;const t=oJ();function e(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(s){this.degree=s,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(s){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(s.length+this.degree);r.set(s);const n=t.mod(r,this.genPoly),o=this.degree-n.length;if(o>0){const l=new Uint8Array(this.degree);return l.set(n,o),l}return n},O_=e,O_}var v_={},__={},y_={},XA;function HB(){return XA||(XA=1,y_.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),y_}var Br={},VA;function FB(){if(VA)return Br;VA=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 s="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
|
|
87
|
-
]))+`;Br.KANJI=new RegExp(i,"g"),Br.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Br.BYTE=new RegExp(s,"g"),Br.NUMERIC=new RegExp(t,"g"),Br.ALPHANUMERIC=new RegExp(e,"g");const r=new RegExp("^"+i+"$"),n=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Br.testKanji=function(c){return r.test(c)},Br.testNumeric=function(c){return n.test(c)},Br.testAlphanumeric=function(c){return o.test(c)},Br}var ZA;function el(){return ZA||(ZA=1,(function(t){const e=HB(),i=FB();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(n,o){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?n.ccBits[0]:o<27?n.ccBits[1]:n.ccBits[2]},t.getBestModeForData=function(n){return i.testNumeric(n)?t.NUMERIC:i.testAlphanumeric(n)?t.ALPHANUMERIC:i.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},t.isValid=function(n){return n&&n.bit&&n.ccBits};function s(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(n,o){if(t.isValid(n))return n;try{return s(n)}catch{return o}}})(__)),__}var IA;function lJ(){return IA||(IA=1,(function(t){const e=Ja(),i=YB(),s=tx(),r=el(),n=HB(),o=7973,l=e.getBCHDigit(o);function c(g,v,y){for(let b=1;b<=40;b++)if(v<=t.getCapacity(b,y,g))return b}function u(g,v){return r.getCharCountIndicator(g,v)+4}function d(g,v){let y=0;return g.forEach(function(b){const w=u(b.mode,v);y+=w+b.getBitsLength()}),y}function m(g,v){for(let y=1;y<=40;y++)if(d(g,y)<=t.getCapacity(y,v,r.MIXED))return y}t.from=function(v,y){return n.isValid(v)?parseInt(v,10):y},t.getCapacity=function(v,y,b){if(!n.isValid(v))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=r.BYTE);const w=e.getSymbolTotalCodewords(v),C=i.getTotalCodewordsCount(v,y),T=(w-C)*8;if(b===r.MIXED)return T;const M=T-u(b,v);switch(b){case r.NUMERIC:return Math.floor(M/10*3);case r.ALPHANUMERIC:return Math.floor(M/11*2);case r.KANJI:return Math.floor(M/13);case r.BYTE:default:return Math.floor(M/8)}},t.getBestVersionForData=function(v,y){let b;const w=s.from(y,s.M);if(Array.isArray(v)){if(v.length>1)return m(v,w);if(v.length===0)return 1;b=v[0]}else b=v;return c(b.mode,b.getLength(),w)},t.getEncodedBits=function(v){if(!n.isValid(v)||v<7)throw new Error("Invalid QR Code version");let y=v<<12;for(;e.getBCHDigit(y)-l>=0;)y^=o<<e.getBCHDigit(y)-l;return v<<12|y}})(v_)),v_}var b_={},qA;function hJ(){if(qA)return b_;qA=1;const t=Ja(),e=1335,i=21522,s=t.getBCHDigit(e);return b_.getEncodedBits=function(n,o){const l=n.bit<<3|o;let c=l<<10;for(;t.getBCHDigit(c)-s>=0;)c^=e<<t.getBCHDigit(c)-s;return(l<<10|c)^i},b_}var S_={},x_,WA;function cJ(){if(WA)return x_;WA=1;const t=el();function e(i){this.mode=t.NUMERIC,this.data=i.toString()}return e.getBitsLength=function(s){return 10*Math.floor(s/3)+(s%3?s%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(s){let r,n,o;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),o=parseInt(n,10),s.put(o,10);const l=this.data.length-r;l>0&&(n=this.data.substr(r),o=parseInt(n,10),s.put(o,l*3+1))},x_=e,x_}var w_,UA;function uJ(){if(UA)return w_;UA=1;const t=el(),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(s){this.mode=t.ALPHANUMERIC,this.data=s}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 n;for(n=0;n+2<=this.data.length;n+=2){let o=e.indexOf(this.data[n])*45;o+=e.indexOf(this.data[n+1]),r.put(o,11)}this.data.length%2&&r.put(e.indexOf(this.data[n]),6)},w_=i,w_}var C_,YA;function fJ(){if(YA)return C_;YA=1;const t=el();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(s){return s*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 s=0,r=this.data.length;s<r;s++)i.put(this.data[s],8)},C_=e,C_}var k_,HA;function dJ(){if(HA)return k_;HA=1;const t=el(),e=Ja();function i(s){this.mode=t.KANJI,this.data=s}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(s){let r;for(r=0;r<this.data.length;r++){let n=e.toSJIS(this.data[r]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[r]+`
|
|
88
|
-
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),s.put(n,13)}},k_=i,k_}var T_={exports:{}},FA;function pJ(){return FA||(FA=1,(function(t){var e={single_source_shortest_paths:function(i,s,r){var n={},o={};o[s]=0;var l=e.PriorityQueue.make();l.push(s,0);for(var c,u,d,m,g,v,y,b,w;!l.empty();){c=l.pop(),u=c.value,m=c.cost,g=i[u]||{};for(d in g)g.hasOwnProperty(d)&&(v=g[d],y=m+v,b=o[d],w=typeof o[d]>"u",(w||b>y)&&(o[d]=y,l.push(d,y),n[d]=u))}if(typeof r<"u"&&typeof o[r]>"u"){var C=["Could not find a path from ",s," to ",r,"."].join("");throw new Error(C)}return n},extract_shortest_path_from_predecessor_list:function(i,s){for(var r=[],n=s;n;)r.push(n),i[n],n=i[n];return r.reverse(),r},find_path:function(i,s,r){var n=e.single_source_shortest_paths(i,s,r);return e.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(i){var s=e.PriorityQueue,r={},n;i=i||{};for(n in s)s.hasOwnProperty(n)&&(r[n]=s[n]);return r.queue=[],r.sorter=i.sorter||s.default_sorter,r},default_sorter:function(i,s){return i.cost-s.cost},push:function(i,s){var r={value:i,cost:s};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})(T_)),T_.exports}var GA;function mJ(){return GA||(GA=1,(function(t){const e=el(),i=cJ(),s=uJ(),r=fJ(),n=dJ(),o=FB(),l=Ja(),c=pJ();function u(C){return unescape(encodeURIComponent(C)).length}function d(C,T,M){const k=[];let P;for(;(P=C.exec(M))!==null;)k.push({data:P[0],index:P.index,mode:T,length:P[0].length});return k}function m(C){const T=d(o.NUMERIC,e.NUMERIC,C),M=d(o.ALPHANUMERIC,e.ALPHANUMERIC,C);let k,P;return l.isKanjiModeEnabled()?(k=d(o.BYTE,e.BYTE,C),P=d(o.KANJI,e.KANJI,C)):(k=d(o.BYTE_KANJI,e.BYTE,C),P=[]),T.concat(M,k,P).sort(function(z,$){return z.index-$.index}).map(function(z){return{data:z.data,mode:z.mode,length:z.length}})}function g(C,T){switch(T){case e.NUMERIC:return i.getBitsLength(C);case e.ALPHANUMERIC:return s.getBitsLength(C);case e.KANJI:return n.getBitsLength(C);case e.BYTE:return r.getBitsLength(C)}}function v(C){return C.reduce(function(T,M){const k=T.length-1>=0?T[T.length-1]:null;return k&&k.mode===M.mode?(T[T.length-1].data+=M.data,T):(T.push(M),T)},[])}function y(C){const T=[];for(let M=0;M<C.length;M++){const k=C[M];switch(k.mode){case e.NUMERIC:T.push([k,{data:k.data,mode:e.ALPHANUMERIC,length:k.length},{data:k.data,mode:e.BYTE,length:k.length}]);break;case e.ALPHANUMERIC:T.push([k,{data:k.data,mode:e.BYTE,length:k.length}]);break;case e.KANJI:T.push([k,{data:k.data,mode:e.BYTE,length:u(k.data)}]);break;case e.BYTE:T.push([{data:k.data,mode:e.BYTE,length:u(k.data)}])}}return T}function b(C,T){const M={},k={start:{}};let P=["start"];for(let E=0;E<C.length;E++){const z=C[E],$=[];for(let Z=0;Z<z.length;Z++){const ie=z[Z],F=""+E+Z;$.push(F),M[F]={node:ie,lastCount:0},k[F]={};for(let R=0;R<P.length;R++){const Q=P[R];M[Q]&&M[Q].node.mode===ie.mode?(k[Q][F]=g(M[Q].lastCount+ie.length,ie.mode)-g(M[Q].lastCount,ie.mode),M[Q].lastCount+=ie.length):(M[Q]&&(M[Q].lastCount=ie.length),k[Q][F]=g(ie.length,ie.mode)+4+e.getCharCountIndicator(ie.mode,T))}}P=$}for(let E=0;E<P.length;E++)k[P[E]].end=0;return{map:k,table:M}}function w(C,T){let M;const k=e.getBestModeForData(C);if(M=e.from(T,k),M!==e.BYTE&&M.bit<k.bit)throw new Error('"'+C+'" cannot be encoded with mode '+e.toString(M)+`.
|
|
89
|
-
Suggested mode is: `+e.toString(k));switch(M===e.KANJI&&!l.isKanjiModeEnabled()&&(M=e.BYTE),M){case e.NUMERIC:return new i(C);case e.ALPHANUMERIC:return new s(C);case e.KANJI:return new n(C);case e.BYTE:return new r(C)}}t.fromArray=function(T){return T.reduce(function(M,k){return typeof k=="string"?M.push(w(k,null)):k.data&&M.push(w(k.data,k.mode)),M},[])},t.fromString=function(T,M){const k=m(T,l.isKanjiModeEnabled()),P=y(k),E=b(P,M),z=c.find_path(E.map,"start","end"),$=[];for(let Z=1;Z<z.length-1;Z++)$.push(E.table[z[Z]].node);return t.fromArray(v($))},t.rawSplit=function(T){return t.fromArray(m(T,l.isKanjiModeEnabled()))}})(S_)),S_}var KA;function gJ(){if(KA)return h_;KA=1;const t=Ja(),e=tx(),i=eJ(),s=tJ(),r=iJ(),n=sJ(),o=rJ(),l=YB(),c=aJ(),u=lJ(),d=hJ(),m=el(),g=mJ();function v(E,z){const $=E.size,Z=n.getPositions(z);for(let ie=0;ie<Z.length;ie++){const F=Z[ie][0],R=Z[ie][1];for(let Q=-1;Q<=7;Q++)if(!(F+Q<=-1||$<=F+Q))for(let D=-1;D<=7;D++)R+D<=-1||$<=R+D||(Q>=0&&Q<=6&&(D===0||D===6)||D>=0&&D<=6&&(Q===0||Q===6)||Q>=2&&Q<=4&&D>=2&&D<=4?E.set(F+Q,R+D,!0,!0):E.set(F+Q,R+D,!1,!0))}}function y(E){const z=E.size;for(let $=8;$<z-8;$++){const Z=$%2===0;E.set($,6,Z,!0),E.set(6,$,Z,!0)}}function b(E,z){const $=r.getPositions(z);for(let Z=0;Z<$.length;Z++){const ie=$[Z][0],F=$[Z][1];for(let R=-2;R<=2;R++)for(let Q=-2;Q<=2;Q++)R===-2||R===2||Q===-2||Q===2||R===0&&Q===0?E.set(ie+R,F+Q,!0,!0):E.set(ie+R,F+Q,!1,!0)}}function w(E,z){const $=E.size,Z=u.getEncodedBits(z);let ie,F,R;for(let Q=0;Q<18;Q++)ie=Math.floor(Q/3),F=Q%3+$-8-3,R=(Z>>Q&1)===1,E.set(ie,F,R,!0),E.set(F,ie,R,!0)}function C(E,z,$){const Z=E.size,ie=d.getEncodedBits(z,$);let F,R;for(F=0;F<15;F++)R=(ie>>F&1)===1,F<6?E.set(F,8,R,!0):F<8?E.set(F+1,8,R,!0):E.set(Z-15+F,8,R,!0),F<8?E.set(8,Z-F-1,R,!0):F<9?E.set(8,15-F-1+1,R,!0):E.set(8,15-F-1,R,!0);E.set(Z-8,8,1,!0)}function T(E,z){const $=E.size;let Z=-1,ie=$-1,F=7,R=0;for(let Q=$-1;Q>0;Q-=2)for(Q===6&&Q--;;){for(let D=0;D<2;D++)if(!E.isReserved(ie,Q-D)){let I=!1;R<z.length&&(I=(z[R]>>>F&1)===1),E.set(ie,Q-D,I),F--,F===-1&&(R++,F=7)}if(ie+=Z,ie<0||$<=ie){ie-=Z,Z=-Z;break}}}function M(E,z,$){const Z=new i;$.forEach(function(D){Z.put(D.mode.bit,4),Z.put(D.getLength(),m.getCharCountIndicator(D.mode,E)),D.write(Z)});const ie=t.getSymbolTotalCodewords(E),F=l.getTotalCodewordsCount(E,z),R=(ie-F)*8;for(Z.getLengthInBits()+4<=R&&Z.put(0,4);Z.getLengthInBits()%8!==0;)Z.putBit(0);const Q=(R-Z.getLengthInBits())/8;for(let D=0;D<Q;D++)Z.put(D%2?17:236,8);return k(Z,E,z)}function k(E,z,$){const Z=t.getSymbolTotalCodewords(z),ie=l.getTotalCodewordsCount(z,$),F=Z-ie,R=l.getBlocksCount(z,$),Q=Z%R,D=R-Q,I=Math.floor(Z/R),L=Math.floor(F/R),j=L+1,U=I-L,Y=new c(U);let W=0;const N=new Array(R),G=new Array(R);let se=0;const ce=new Uint8Array(E.buffer);for(let ye=0;ye<R;ye++){const mt=ye<D?L:j;N[ye]=ce.slice(W,W+mt),G[ye]=Y.encode(N[ye]),W+=mt,se=Math.max(se,mt)}const he=new Uint8Array(Z);let de=0,ge,Me;for(ge=0;ge<se;ge++)for(Me=0;Me<R;Me++)ge<N[Me].length&&(he[de++]=N[Me][ge]);for(ge=0;ge<U;ge++)for(Me=0;Me<R;Me++)he[de++]=G[Me][ge];return he}function P(E,z,$,Z){let ie;if(Array.isArray(E))ie=g.fromArray(E);else if(typeof E=="string"){let I=z;if(!I){const L=g.rawSplit(E);I=u.getBestVersionForData(L,$)}ie=g.fromString(E,I||40)}else throw new Error("Invalid data");const F=u.getBestVersionForData(ie,$);if(!F)throw new Error("The amount of data is too big to be stored in a QR Code");if(!z)z=F;else if(z<F)throw new Error(`
|
|
90
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
91
|
-
Minimum version required to store current data is: `+F+`.
|
|
92
|
-
`);const R=M(z,$,ie),Q=t.getSymbolSize(z),D=new s(Q);return v(D,z),y(D),b(D,z),C(D,$,0),z>=7&&w(D,z),T(D,R),isNaN(Z)&&(Z=o.getBestMask(D,C.bind(null,D,$))),o.applyMask(Z,D),C(D,$,Z),{modules:D,version:z,errorCorrectionLevel:$,maskPattern:Z,segments:ie}}return h_.create=function(z,$){if(typeof z>"u"||z==="")throw new Error("No input text");let Z=e.M,ie,F;return typeof $<"u"&&(Z=e.from($.errorCorrectionLevel,e.M),ie=u.from($.version),F=o.from($.maskPattern),$.toSJISFunc&&t.setToSJISFunction($.toSJISFunc)),P(z,ie,Z,F)},h_}var M_={},A_={},JA;function GB(){return JA||(JA=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 s=i.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+i);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(n){return[n,n]}))),s.length===6&&s.push("F","F");const r=parseInt(s.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+s.slice(0,6).join("")}}t.getOptions=function(s){s||(s={}),s.color||(s.color={});const r=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,n=s.width&&s.width>=21?s.width:void 0,o=s.scale||4;return{width:n,scale:n?4:o,margin:r,color:{dark:e(s.color.dark||"#000000ff"),light:e(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},t.getScale=function(s,r){return r.width&&r.width>=s+r.margin*2?r.width/(s+r.margin*2):r.scale},t.getImageWidth=function(s,r){const n=t.getScale(s,r);return Math.floor((s+r.margin*2)*n)},t.qrToImageData=function(s,r,n){const o=r.modules.size,l=r.modules.data,c=t.getScale(o,n),u=Math.floor((o+n.margin*2)*c),d=n.margin*c,m=[n.color.light,n.color.dark];for(let g=0;g<u;g++)for(let v=0;v<u;v++){let y=(g*u+v)*4,b=n.color.light;if(g>=d&&v>=d&&g<u-d&&v<u-d){const w=Math.floor((g-d)/c),C=Math.floor((v-d)/c);b=m[l[w*o+C]?1:0]}s[y++]=b.r,s[y++]=b.g,s[y++]=b.b,s[y]=b.a}}})(A_)),A_}var eE;function OJ(){return eE||(eE=1,(function(t){const e=GB();function i(r,n,o){r.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=o,n.width=o,n.style.height=o+"px",n.style.width=o+"px"}function s(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(n,o,l){let c=l,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=s()),c=e.getOptions(c);const d=e.getImageWidth(n.modules.size,c),m=u.getContext("2d"),g=m.createImageData(d,d);return e.qrToImageData(g.data,n,c),i(m,u,d),m.putImageData(g,0,0),u},t.renderToDataURL=function(n,o,l){let c=l;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=t.render(n,o,c),d=c.type||"image/png",m=c.rendererOpts||{};return u.toDataURL(d,m.quality)}})(M_)),M_}var E_={},tE;function vJ(){if(tE)return E_;tE=1;const t=GB();function e(r,n){const o=r.a/255,l=n+'="'+r.hex+'"';return o<1?l+" "+n+'-opacity="'+o.toFixed(2).slice(1)+'"':l}function i(r,n,o){let l=r+n;return typeof o<"u"&&(l+=" "+o),l}function s(r,n,o){let l="",c=0,u=!1,d=0;for(let m=0;m<r.length;m++){const g=Math.floor(m%n),v=Math.floor(m/n);!g&&!u&&(u=!0),r[m]?(d++,m>0&&g>0&&r[m-1]||(l+=u?i("M",g+o,.5+v+o):i("m",c,0),c=0,u=!1),g+1<n&&r[m+1]||(l+=i("h",d),d=0)):c++}return l}return E_.render=function(n,o,l){const c=t.getOptions(o),u=n.modules.size,d=n.modules.data,m=u+c.margin*2,g=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+m+"v"+m+'H0z"/>':"",v="<path "+e(c.color.dark,"stroke")+' d="'+s(d,u,c.margin)+'"/>',y='viewBox="0 0 '+m+" "+m+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+y+' shape-rendering="crispEdges">'+g+v+`</svg>
|
|
93
|
-
`;return typeof l=="function"&&l(null,w),w},E_}var iE;function _J(){if(iE)return Xl;iE=1;const t=JK(),e=gJ(),i=OJ(),s=vJ();function r(n,o,l,c,u){const d=[].slice.call(arguments,1),m=d.length,g=typeof d[m-1]=="function";if(!g&&!t())throw new Error("Callback required as last argument");if(g){if(m<2)throw new Error("Too few arguments provided");m===2?(u=l,l=o,o=c=void 0):m===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=o,o=void 0))}else{if(m<1)throw new Error("Too few arguments provided");return m===1?(l=o,o=c=void 0):m===2&&!o.getContext&&(c=l,l=o,o=void 0),new Promise(function(v,y){try{const b=e.create(l,c);v(n(b,o,c))}catch(b){y(b)}})}try{const v=e.create(l,c);u(null,n(v,o,c))}catch(v){u(v)}}return Xl.create=e.create,Xl.toCanvas=r.bind(null,i.render),Xl.toDataURL=r.bind(null,i.renderToDataURL),Xl.toString=r.bind(null,function(n,o,l){return s.render(n,l)}),Xl}var yJ=_J();const sE=Xz(yJ);function bJ(){const[t,e]=X.useState(null),[i,s]=X.useState(!1),[r,n]=X.useState(null),[o,l]=X.useState(null);X.useEffect(()=>{fetch("/api/server-info").then(m=>m.json()).then(m=>e(m)).catch(()=>{})},[]),X.useEffect(()=>{t!=null&&t.tailscaleUrl&&sE.toDataURL(t.tailscaleUrl,{width:192,margin:2}).then(n).catch(()=>{}),t!=null&&t.networkUrl&&sE.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:()=>s(m=>!m),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(SJ,{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 SJ({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 xJ(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 wJ({activeView:t,activePhaseId:e,onNavigate:i,logoAction:s}){const{roadmap:r,state:n,todos:o}=Fa(),{connected:l}=pf(),[c,u]=X.useState(!1);X.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 m=((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,v=(n==null?void 0:n.blockers.filter(b=>!b.includes("RESOLVED")).length)??0,y=(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"})]}),s]}),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:m.map(b=>{const w=t==="phase"&&e===b.number,C=b.number===g;return S.jsxs("button",{type:"button",onClick:()=>i("phase",b.number),className:He("flex w-full items-center gap-2.5 px-5 py-2 text-left transition-colors duration-200",w?"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:He("inline-block h-1.5 w-1.5 shrink-0",xJ(b.diskStatus))}),S.jsx("span",{className:He("font-mono text-xs tabular-nums shrink-0",C||w?"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:He("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"}),y>0&&S.jsx("span",{className:"font-mono text-xs text-warning tabular-nums",children:y})]}),S.jsxs("button",{type:"button",onClick:()=>i("blockers"),className:He("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"}),v>0&&S.jsx("span",{className:"font-mono text-xs text-danger tabular-nums",children:v})]})]}),S.jsx("div",{className:"border-t border-border",children:S.jsxs("button",{type:"button",onClick:()=>i("terminal"),className:He("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(bJ,{}),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:He("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:He("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 KB=Object.defineProperty,CJ=Object.getOwnPropertyDescriptor,kJ=(t,e)=>{for(var i in e)KB(t,i,{get:e[i],enumerable:!0})},Lt=(t,e,i,s)=>{for(var r=s>1?void 0:s?CJ(e,i):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&KB(e,i,r),r},Oe=(t,e)=>(i,s)=>e(i,s,t),rE="Terminal input",Py={get:()=>rE,set:t=>rE=t},nE="Too much output to announce, navigate to rows manually to read",Ry={get:()=>nE,set:t=>nE=t};function TJ(t){return t.replace(/\r?\n/g,"\r")}function MJ(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function AJ(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function EJ(t,e,i,s){if(t.stopPropagation(),t.clipboardData){let r=t.clipboardData.getData("text/plain");JB(r,e,i,s)}}function JB(t,e,i,s){t=TJ(t),t=MJ(t,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function eD(t,e,i){let s=i.getBoundingClientRect(),r=t.clientX-s.left-10,n=t.clientY-s.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${r}px`,e.style.top=`${n}px`,e.style.zIndex="1000",e.focus()}function oE(t,e,i,s,r){eD(t,e,i),r&&s.rightClickSelect(t),e.value=s.selectionText,e.select()}function $o(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function Ag(t,e=0,i=t.length){let s="";for(let r=e;r<i;++r){let n=t[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var PJ=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let o=e.charCodeAt(n++);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=n;o<s;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=s)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}},RJ=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,l,c,u=0,d=0;if(this.interim[0]){let v=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let b=0,w;for(;(w=this.interim[++b]&63)&&b<4;)y<<=6,y|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,T=C-b;for(;d<T;){if(d>=s)return 0;if(w=e[d++],(w&192)!==128){d--,v=!0;break}else this.interim[b++]=w,y<<=6,y|=w&63}v||(C===2?y<128?d--:i[r++]=y:C===3?y<2048||y>=55296&&y<=57343||y===65279||(i[r++]=y):y<65536||y>1114111||(i[r++]=y)),this.interim.fill(0)}let m=s-4,g=d;for(;g<s;){for(;g<m&&!((n=e[g])&128)&&!((o=e[g+1])&128)&&!((l=e[g+2])&128)&&!((c=e[g+3])&128);)i[r++]=n,i[r++]=o,i[r++]=l,i[r++]=c,g+=4;if(n=e[g++],n<128)i[r++]=n;else if((n&224)===192){if(g>=s)return this.interim[0]=n,r;if(o=e[g++],(o&192)!==128){g--;continue}if(u=(n&31)<<6|o&63,u<128){g--;continue}i[r++]=u}else if((n&240)===224){if(g>=s)return this.interim[0]=n,r;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=s)return this.interim[0]=n,this.interim[1]=o,r;if(l=e[g++],(l&192)!==128){g--;continue}if(u=(n&15)<<12|(o&63)<<6|l&63,u<2048||u>=55296&&u<=57343||u===65279)continue;i[r++]=u}else if((n&248)===240){if(g>=s)return this.interim[0]=n,r;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=s)return this.interim[0]=n,this.interim[1]=o,r;if(l=e[g++],(l&192)!==128){g--;continue}if(g>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=l,r;if(c=e[g++],(c&192)!==128){g--;continue}if(u=(n&7)<<18|(o&63)<<12|(l&63)<<6|c&63,u<65536||u>1114111)continue;i[r++]=u}}return r}},tD="",No=" ",Pf=class iD{constructor(){this.fg=0,this.bg=0,this.extended=new ig}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 iD;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}},ig=class sD{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 sD(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},lr=class rD extends Pf{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ig,this.combinedData=""}static fromCharData(e){let i=new rD;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?$o(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 s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-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()]}},aE="di$target",Qy="di$dependencies",P_=new Map;function QJ(t){return t[Qy]||[]}function xi(t){if(P_.has(t))return P_.get(t);let e=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");LJ(e,i,r)};return e._id=t,P_.set(t,e),e}function LJ(t,e,i){e[aE]===e?e[Qy].push({id:t,index:i}):(e[Qy]=[{id:t,index:i}],e[aE]=e)}var is=xi("BufferService"),nD=xi("CoreMouseService"),tl=xi("CoreService"),$J=xi("CharsetService"),ix=xi("InstantiationService"),oD=xi("LogService"),ss=xi("OptionsService"),aD=xi("OscLinkService"),BJ=xi("UnicodeService"),Rf=xi("DecorationService"),Ly=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){var m;let s=this._bufferService.buffer.lines.get(e-1);if(!s){i(void 0);return}let r=[],n=this._optionsService.rawOptions.linkHandler,o=new lr,l=s.getTrimmedLength(),c=-1,u=-1,d=!1;for(let g=0;g<l;g++)if(!(u===-1&&!s.hasContent(g))){if(s.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 v=(m=this._oscLinkService.getLinkData(c))==null?void 0:m.uri;if(v){let y={start:{x:u+1,y:e},end:{x:g+(!d&&g===l-1?1:0),y:e}},b=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{let w=new URL(v);["http:","https:"].includes(w.protocol)||(b=!0)}catch{b=!0}b||r.push({text:v,range:y,activate:(w,C)=>n?n.activate(w,C,y):DJ(w,C),hover:(w,C)=>{var T;return(T=n==null?void 0:n.hover)==null?void 0:T.call(n,w,C,y)},leave:(w,C)=>{var T;return(T=n==null?void 0:n.leave)==null?void 0:T.call(n,w,C,y)}})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=g,c=o.extended.urlId):(u=-1,c=-1)}}i(r)}};Ly=Lt([Oe(0,is),Oe(1,ss),Oe(2,aD)],Ly);function DJ(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 Eg=xi("CharSizeService"),Un=xi("CoreBrowserService"),sx=xi("MouseService"),Yn=xi("RenderService"),zJ=xi("SelectionService"),lD=xi("CharacterJoinerService"),Nh=xi("ThemeService"),hD=xi("LinkProviderService"),NJ=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?lE.isErrorNoTelemetry(e)?new lE(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)}},jJ=new NJ;function nm(t){XJ(t)||jJ.onUnexpectedError(t)}var $y="Canceled";function XJ(t){return t instanceof VJ?!0:t instanceof Error&&t.name===$y&&t.message===$y}var VJ=class extends Error{constructor(){super($y),this.name=this.message}};function ZJ(t){return new Error(`Illegal argument: ${t}`)}var lE=class By extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof By)return e;let i=new By;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Dy=class cD extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,cD.prototype)}};function Rs(t,e=0){return t[t.length-(1+e)]}var IJ;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(IJ||(IJ={}));function qJ(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var uD;(t=>{function e(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(k){yield k}t.single=r;function n(k){return e(k)?k:r(k)}t.wrap=n;function o(k){return k||i}t.from=o;function*l(k){for(let P=k.length-1;P>=0;P--)yield k[P]}t.reverse=l;function c(k){return!k||k[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(k){return k[Symbol.iterator]().next().value}t.first=u;function d(k,P){let E=0;for(let z of k)if(P(z,E++))return!0;return!1}t.some=d;function m(k,P){for(let E of k)if(P(E))return E}t.find=m;function*g(k,P){for(let E of k)P(E)&&(yield E)}t.filter=g;function*v(k,P){let E=0;for(let z of k)yield P(z,E++)}t.map=v;function*y(k,P){let E=0;for(let z of k)yield*P(z,E++)}t.flatMap=y;function*b(...k){for(let P of k)yield*P}t.concat=b;function w(k,P,E){let z=E;for(let $ of k)z=P(z,$);return z}t.reduce=w;function*C(k,P,E=k.length){for(P<0&&(P+=k.length),E<0?E+=k.length:E>k.length&&(E=k.length);P<E;P++)yield k[P]}t.slice=C;function T(k,P=Number.POSITIVE_INFINITY){let E=[];if(P===0)return[E,k];let z=k[Symbol.iterator]();for(let $=0;$<P;$++){let Z=z.next();if(Z.done)return[E,t.empty()];E.push(Z.value)}return[E,{[Symbol.iterator](){return z}}]}t.consume=T;async function M(k){let P=[];for await(let E of k)P.push(E);return Promise.resolve(P)}t.asyncToArray=M})(uD||(uD={}));function Ya(t){if(uD.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(s){e.push(s)}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 WJ(...t){return xt(()=>Ya(t))}function xt(t){return{dispose:qJ(()=>{t()})}}var fD=class dD{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{Ya(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?dD.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)}};fD.DISABLE_DISPOSED_WARNING=!1;var Xo=fD,je=class{constructor(){this._store=new Xo,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)}};je.None=Object.freeze({dispose(){}});var Ah=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}},zn=typeof window=="object"?window:globalThis,zy=class Ny{constructor(e){this.element=e,this.next=Ny.Undefined,this.prev=Ny.Undefined}};zy.Undefined=new zy(void 0);var wt=zy,hE=class{constructor(){this._first=wt.Undefined,this._last=wt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===wt.Undefined}clear(){let e=this._first;for(;e!==wt.Undefined;){let i=e.next;e.prev=wt.Undefined,e.next=wt.Undefined,e=i}this._first=wt.Undefined,this._last=wt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let s=new wt(e);if(this._first===wt.Undefined)this._first=s,this._last=s;else if(i){let n=this._last;this._last=s,s.prev=n,n.next=s}else{let n=this._first;this._first=s,s.next=n,n.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first!==wt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==wt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==wt.Undefined&&e.next!==wt.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===wt.Undefined&&e.next===wt.Undefined?(this._first=wt.Undefined,this._last=wt.Undefined):e.next===wt.Undefined?(this._last=this._last.prev,this._last.next=wt.Undefined):e.prev===wt.Undefined&&(this._first=this._first.next,this._first.prev=wt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==wt.Undefined;)yield e.element,e=e.next}},UJ=globalThis.performance&&typeof globalThis.performance.now=="function",YJ=class pD{static create(e){return new pD(e)}constructor(e){this._now=UJ&&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}},Di;(t=>{t.None=()=>je.None;function e(R,Q){return m(R,()=>{},0,void 0,!0,void 0,Q)}t.defer=e;function i(R){return(Q,D=null,I)=>{let L=!1,j;return j=R(U=>{if(!L)return j?j.dispose():L=!0,Q.call(D,U)},null,I),L&&j.dispose(),j}}t.once=i;function s(R,Q,D){return u((I,L=null,j)=>R(U=>I.call(L,Q(U)),null,j),D)}t.map=s;function r(R,Q,D){return u((I,L=null,j)=>R(U=>{Q(U),I.call(L,U)},null,j),D)}t.forEach=r;function n(R,Q,D){return u((I,L=null,j)=>R(U=>Q(U)&&I.call(L,U),null,j),D)}t.filter=n;function o(R){return R}t.signal=o;function l(...R){return(Q,D=null,I)=>{let L=WJ(...R.map(j=>j(U=>Q.call(D,U))));return d(L,I)}}t.any=l;function c(R,Q,D,I){let L=D;return s(R,j=>(L=Q(L,j),L),I)}t.reduce=c;function u(R,Q){let D,I={onWillAddFirstListener(){D=R(L.fire,L)},onDidRemoveLastListener(){D==null||D.dispose()}},L=new fe(I);return Q==null||Q.add(L),L.event}function d(R,Q){return Q instanceof Array?Q.push(R):Q&&Q.add(R),R}function m(R,Q,D=100,I=!1,L=!1,j,U){let Y,W,N,G=0,se,ce={leakWarningThreshold:j,onWillAddFirstListener(){Y=R(de=>{G++,W=Q(W,de),I&&!N&&(he.fire(W),W=void 0),se=()=>{let ge=W;W=void 0,N=void 0,(!I||G>1)&&he.fire(ge),G=0},typeof D=="number"?(clearTimeout(N),N=setTimeout(se,D)):N===void 0&&(N=0,queueMicrotask(se))})},onWillRemoveListener(){L&&G>0&&(se==null||se())},onDidRemoveLastListener(){se=void 0,Y.dispose()}},he=new fe(ce);return U==null||U.add(he),he.event}t.debounce=m;function g(R,Q=0,D){return t.debounce(R,(I,L)=>I?(I.push(L),I):[L],Q,void 0,!0,void 0,D)}t.accumulate=g;function v(R,Q=(I,L)=>I===L,D){let I=!0,L;return n(R,j=>{let U=I||!Q(j,L);return I=!1,L=j,U},D)}t.latch=v;function y(R,Q,D){return[t.filter(R,Q,D),t.filter(R,I=>!Q(I),D)]}t.split=y;function b(R,Q=!1,D=[],I){let L=D.slice(),j=R(W=>{L?L.push(W):Y.fire(W)});I&&I.add(j);let U=()=>{L==null||L.forEach(W=>Y.fire(W)),L=null},Y=new fe({onWillAddFirstListener(){j||(j=R(W=>Y.fire(W)),I&&I.add(j))},onDidAddFirstListener(){L&&(Q?setTimeout(U):U())},onDidRemoveLastListener(){j&&j.dispose(),j=null}});return I&&I.add(Y),Y.event}t.buffer=b;function w(R,Q){return(D,I,L)=>{let j=Q(new T);return R(function(U){let Y=j.evaluate(U);Y!==C&&D.call(I,Y)},void 0,L)}}t.chain=w;let C=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(Q){return this.steps.push(Q),this}forEach(Q){return this.steps.push(D=>(Q(D),D)),this}filter(Q){return this.steps.push(D=>Q(D)?D:C),this}reduce(Q,D){let I=D;return this.steps.push(L=>(I=Q(I,L),I)),this}latch(Q=(D,I)=>D===I){let D=!0,I;return this.steps.push(L=>{let j=D||!Q(L,I);return D=!1,I=L,j?L:C}),this}evaluate(Q){for(let D of this.steps)if(Q=D(Q),Q===C)break;return Q}}function M(R,Q,D=I=>I){let I=(...Y)=>U.fire(D(...Y)),L=()=>R.on(Q,I),j=()=>R.removeListener(Q,I),U=new fe({onWillAddFirstListener:L,onDidRemoveLastListener:j});return U.event}t.fromNodeEventEmitter=M;function k(R,Q,D=I=>I){let I=(...Y)=>U.fire(D(...Y)),L=()=>R.addEventListener(Q,I),j=()=>R.removeEventListener(Q,I),U=new fe({onWillAddFirstListener:L,onDidRemoveLastListener:j});return U.event}t.fromDOMEventEmitter=k;function P(R){return new Promise(Q=>i(R)(Q))}t.toPromise=P;function E(R){let Q=new fe;return R.then(D=>{Q.fire(D)},()=>{Q.fire(void 0)}).finally(()=>{Q.dispose()}),Q.event}t.fromPromise=E;function z(R,Q){return R(D=>Q.fire(D))}t.forward=z;function $(R,Q,D){return Q(D),R(I=>Q(I))}t.runAndSubscribe=$;class Z{constructor(Q,D){this._observable=Q,this._counter=0,this._hasChanged=!1;let I={onWillAddFirstListener:()=>{Q.addObserver(this)},onDidRemoveLastListener:()=>{Q.removeObserver(this)}};this.emitter=new fe(I),D&&D.add(this.emitter)}beginUpdate(Q){this._counter++}handlePossibleChange(Q){}handleChange(Q,D){this._hasChanged=!0}endUpdate(Q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ie(R,Q){return new Z(R,Q).emitter.event}t.fromObservable=ie;function F(R){return(Q,D,I)=>{let L=0,j=!1,U={beginUpdate(){L++},endUpdate(){L--,L===0&&(R.reportChanges(),j&&(j=!1,Q.call(D)))},handlePossibleChange(){},handleChange(){j=!0}};R.addObserver(U),R.reportChanges();let Y={dispose(){R.removeObserver(U)}};return I instanceof Xo?I.add(Y):Array.isArray(I)&&I.push(Y),Y}}t.fromObservableLight=F})(Di||(Di={}));var jy=class Xy{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Xy._idPool++}`,Xy.all.add(this)}start(e){this._stopWatch=new YJ,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}}};jy.all=new Set,jy._idPool=0;var HJ=jy,FJ=-1,mD=class gD{constructor(e,i,s=(gD._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let s=this.threshold;if(s<=0||i<s)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=s*.5;let[n,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(n);let c=new JJ(l,n);this._errorHandler(c)}return()=>{let n=this._stacks.get(e.value)||0;this._stacks.set(e.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[s,r]of this._stacks)(!e||i<r)&&(e=[s,r],i=r);return e}};mD._idPool=1;var GJ=mD,KJ=class OD{constructor(e){this.value=e}static create(){let e=new Error;return new OD(e.stack??"")}print(){console.warn(this.value.split(`
|
|
111
|
-
`).slice(2).join(`
|
|
112
|
-
`))}},JJ=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},eee=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},tee=0,R_=class{constructor(e){this.value=e,this.id=tee++}},iee=2,see,fe=class{constructor(e){var i,s,r,n;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new GJ((e==null?void 0:e.onListenerError)??nm,((s=this._options)==null?void 0:s.leakWarningThreshold)??FJ):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new HJ(this._options._profName):void 0,this._deliveryQueue=(n=this._options)==null?void 0:n.deliveryQueue}dispose(){var e,i,s,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),(s=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||s.call(i),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,i,s)=>{var l,c,u,d,m;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 v=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new eee(`${g}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(((l=this._options)==null?void 0:l.onListenerError)||nm)(y),je.None}if(this._disposed)return je.None;i&&(e=e.bind(i));let r=new R_(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=KJ.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof R_?(this._deliveryQueue??(this._deliveryQueue=new ree),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,(m=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||m.call(d,this)),this._size++;let o=xt(()=>{n==null||n(),this._removeListener(r)});return s instanceof Xo?s.add(o):Array.isArray(s)&&s.push(o),o}),this._event}_removeListener(e){var n,o,l,c;if((o=(n=this._options)==null?void 0:n.onWillRemoveListener)==null||o.call(n,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,s=i.indexOf(e);if(s===-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[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*iee<=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 s=((r=this._options)==null?void 0:r.onListenerError)||nm;if(!s){e.value(i);return}try{e.value(i)}catch(n){s(n)}}_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,s,r,n;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(s=this._perfMon)==null||s.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof R_)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(n=this._perfMon)==null||n.stop()}hasListeners(){return this._size>0}},ree=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,s){this.i=0,this.end=s,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Vy=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new fe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new fe,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 s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,e),this._onDidChangeZoomLevel.fire(s)}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 s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,e),this._onDidChangeFullscreen.fire(s)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Vy.INSTANCE=new Vy;var rx=Vy;function nee(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}rx.INSTANCE.onDidChangeZoomLevel;function oee(t){return rx.INSTANCE.getZoomFactor(t)}rx.INSTANCE.onDidChangeFullscreen;var jh=typeof navigator=="object"?navigator.userAgent:"",Zy=jh.indexOf("Firefox")>=0,aee=jh.indexOf("AppleWebKit")>=0,nx=jh.indexOf("Chrome")>=0,lee=!nx&&jh.indexOf("Safari")>=0;jh.indexOf("Electron/")>=0;jh.indexOf("Android")>=0;var Q_=!1;if(typeof zn.matchMedia=="function"){let t=zn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=zn.matchMedia("(display-mode: fullscreen)");Q_=t.matches,nee(zn,t,({matches:i})=>{Q_&&e.matches||(Q_=i)})}var rh="en",Iy=!1,qy=!1,om=!1,vD=!1,Pp,am=rh,cE=rh,hee,gr,Xa=globalThis,Qi,TP;typeof Xa.vscode<"u"&&typeof Xa.vscode.process<"u"?Qi=Xa.vscode.process:typeof process<"u"&&typeof((TP=process==null?void 0:process.versions)==null?void 0:TP.node)=="string"&&(Qi=process);var MP,cee=typeof((MP=Qi==null?void 0:Qi.versions)==null?void 0:MP.electron)=="string",uee=cee&&(Qi==null?void 0:Qi.type)==="renderer",AP;if(typeof Qi=="object"){Iy=Qi.platform==="win32",qy=Qi.platform==="darwin",om=Qi.platform==="linux",om&&Qi.env.SNAP&&Qi.env.SNAP_REVISION,Qi.env.CI||Qi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Pp=rh,am=rh;let t=Qi.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Pp=e.userLocale,cE=e.osLocale,am=e.resolvedLanguage||rh,hee=(AP=e.languagePack)==null?void 0:AP.translationsConfigFile}catch{}vD=!0}else typeof navigator=="object"&&!uee?(gr=navigator.userAgent,Iy=gr.indexOf("Windows")>=0,qy=gr.indexOf("Macintosh")>=0,(gr.indexOf("Macintosh")>=0||gr.indexOf("iPad")>=0||gr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,om=gr.indexOf("Linux")>=0,(gr==null?void 0:gr.indexOf("Mobi"))>=0,am=globalThis._VSCODE_NLS_LANGUAGE||rh,Pp=navigator.language.toLowerCase(),cE=Pp):console.error("Unable to resolve platform.");var _D=Iy,en=qy,fee=om,uE=vD,sn=gr,Co=am,dee;(t=>{function e(){return Co}t.value=e;function i(){return Co.length===2?Co==="en":Co.length>=3?Co[0]==="e"&&Co[1]==="n"&&Co[2]==="-":!1}t.isDefaultVariant=i;function s(){return Co==="en"}t.isDefault=s})(dee||(dee={}));var pee=typeof Xa.postMessage=="function"&&!Xa.importScripts;(()=>{if(pee){let t=[];Xa.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.id===i.data.vscodeScheduleAsyncWork){t.splice(s,1),n.callback();return}}});let e=0;return i=>{let s=++e;t.push({id:s,callback:i}),Xa.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var mee=!!(sn&&sn.indexOf("Chrome")>=0);sn&&sn.indexOf("Firefox")>=0;!mee&&sn&&sn.indexOf("Safari")>=0;sn&&sn.indexOf("Edg/")>=0;sn&&sn.indexOf("Android")>=0;var Vl=typeof navigator=="object"?navigator:{};uE||document.queryCommandSupported&&document.queryCommandSupported("copy")||Vl&&Vl.clipboard&&Vl.clipboard.writeText,uE||Vl&&Vl.clipboard&&Vl.clipboard.readText;var ox=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}},L_=new ox,fE=new ox,dE=new ox,gee=new Array(230),yD;(t=>{function e(l){return L_.keyCodeToStr(l)}t.toString=e;function i(l){return L_.strToKeyCode(l)}t.fromString=i;function s(l){return fE.keyCodeToStr(l)}t.toUserSettingsUS=s;function r(l){return dE.keyCodeToStr(l)}t.toUserSettingsGeneral=r;function n(l){return fE.strToKeyCode(l)||dE.strToKeyCode(l)}t.fromUserSettings=n;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 L_.keyCodeToStr(l)}t.toElectronAccelerator=o})(yD||(yD={}));var Oee=class bD{constructor(e,i,s,r,n){this.ctrlKey=e,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(e){return e instanceof bD&&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",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${e}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new vee([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},vee=class{constructor(t){if(t.length===0)throw ZJ("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 _ee(t){if(t.charCode){let i=String.fromCharCode(t.charCode).toUpperCase();return yD.fromString(i)}let e=t.keyCode;if(e===3)return 7;if(Zy)switch(e){case 59:return 85;case 60:if(fee)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(en)return 57;break}else if(aee&&(en&&e===93||!en&&e===92))return 57;return gee[e]||0}var yee=en?256:2048,bee=512,See=1024,xee=en?2048:256,pE=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=_ee(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|=yee),this.altKey&&(e|=bee),this.shiftKey&&(e|=See),this.metaKey&&(e|=xee),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new Oee(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},mE=new WeakMap;function wee(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 Cee=class{static getSameOriginWindowChain(t){let e=mE.get(t);if(!e){e=[],mE.set(t,e);let i=t,s;do s=wee(i),s?e.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):e.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let i=0,s=0,r=this.getSameOriginWindowChain(t);for(let n of r){let o=n.window.deref();if(i+=(o==null?void 0:o.scrollY)??0,s+=(o==null?void 0:o.scrollX)??0,o===e||!n.iframeElement)break;let l=n.iframeElement.getBoundingClientRect();i+=l.top,s+=l.left}return{top:i,left:s}}},Rp=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 s=Cee.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},gE=class{constructor(e,i=0,s=0){var n;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=s,this.deltaX=i;let r=!1;if(nx){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,c=((n=e.view)==null?void 0:n.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?Zy&&!en?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")lee&&_D?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?Zy&&!en?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()}},SD=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),kee;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof Tee?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Di.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:SD})})(kee||(kee={}));var Tee=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?SD:(this._emitter||(this._emitter=new fe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ax=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 Dy("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new Dy("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},Mee=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,s=globalThis){if(this.isDisposed)throw new Dy("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=s.setInterval(()=>{e()},i);this.disposable=xt(()=>{s.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Aee;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(Aee||(Aee={}));var OE=class Fs{static fromArray(e){return new Fs(i=>{i.emitMany(e)})}static fromPromise(e){return new Fs(async i=>{i.emitMany(await e)})}static fromPromises(e){return new Fs(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new Fs(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new fe,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.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 Di.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 Fs(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return Fs.map(this,e)}static filter(e,i){return new Fs(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return Fs.filter(this,e)}static coalesce(e){return Fs.filter(e,i=>!!i)}coalesce(){return Fs.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return Fs.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())}};OE.EMPTY=OE.fromArray([]);var{getWindow:Fr,getWindowId:Eee,onDidRegisterWindow:Pee}=(function(){let t=new Map,e={window:zn,disposables:new Xo};t.set(zn.vscodeWindowId,e);let i=new fe,s=new fe,r=new fe;function n(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(t.has(o.vscodeWindowId))return je.None;let l=new Xo,c={window:o,disposables:l.add(new Xo)};return t.set(o.vscodeWindowId,c),l.add(xt(()=>{t.delete(o.vscodeWindowId),s.fire(o)})),l.add(Re(o,ci.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:n,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:zn},getDocument(o){return Fr(o).document}}})(),Ree=class{constructor(e,i,s,r){this._node=e,this._type=i,this._handler=s,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 Re(t,e,i,s){return new Ree(t,e,i,s)}var vE=function(t,e,i,s){return Re(t,e,i,s)},lx,Qee=class extends Mee{constructor(t){super(),this.defaultTarget=t&&Fr(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},_E=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){nm(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let t=new Map,e=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=t.get(n)??[];for(e.set(n,o),t.set(n,[]),s.set(n,!0);o.length>0;)o.sort(_E.sort),o.shift().execute();s.set(n,!1)};lx=(n,o,l=0)=>{let c=Eee(n),u=new _E(o,l),d=t.get(c);return d||(d=[],t.set(c,d)),d.push(u),i.get(c)||(i.set(c,!0),n.requestAnimationFrame(()=>r(c))),u}})();function Lee(t){let e=t.getBoundingClientRect(),i=Fr(t);return{left:e.left+i.scrollX,top:e.top+i.scrollY,width:e.width,height:e.height}}var ci={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"},$ee=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=us(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=us(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=us(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=us(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=us(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=us(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=us(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=us(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=us(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=us(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=us(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=us(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=us(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=us(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 us(t){return typeof t=="number"?`${t}px`:t}function Ru(t){return new $ee(t)}var xD=class{constructor(){this._hooks=new Xo,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 s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,s,r,n){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=n;let o=e;try{e.setPointerCapture(i),this._hooks.add(xt(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{o=Fr(e)}this._hooks.add(Re(o,ci.POINTER_MOVE,l=>{if(l.buttons!==s){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Re(o,ci.POINTER_UP,l=>this.stopMonitoring(!0)))}};function Bee(t,e,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${e}`;i[s]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var Xr;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(Xr||(Xr={}));var du=class ji extends je{constructor(){super(),this.dispatched=!1,this.targets=new hE,this.ignoreTargets=new hE,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Di.runAndSubscribe(Pee,({window:e,disposables:i})=>{i.add(Re(e.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(Re(e.document,"touchend",s=>this.onTouchEnd(e,s))),i.add(Re(e.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:zn,disposables:this._store}))}static addTarget(e){if(!ji.isTouchDevice())return je.None;ji.INSTANCE||(ji.INSTANCE=new ji);let i=ji.INSTANCE.targets.push(e);return xt(i)}static ignoreTarget(e){if(!ji.isTouchDevice())return je.None;ji.INSTANCE||(ji.INSTANCE=new ji);let i=ji.INSTANCE.ignoreTargets.push(e);return xt(i)}static isTouchDevice(){return"ontouchstart"in zn||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 s=0,r=e.targetTouches.length;s<r;s++){let n=e.targetTouches.item(s);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:i,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[i],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let o=this.newGestureEvent(Xr.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,i){let s=Date.now(),r=Object.keys(this.activeTouches).length;for(let n=0,o=i.changedTouches.length;n<o;n++){let l=i.changedTouches.item(n);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<ji.HOLD_DELAY&&Math.abs(c.initialPageX-Rs(c.rollingPageX))<30&&Math.abs(c.initialPageY-Rs(c.rollingPageY))<30){let d=this.newGestureEvent(Xr.Tap,c.initialTarget);d.pageX=Rs(c.rollingPageX),d.pageY=Rs(c.rollingPageY),this.dispatchEvent(d)}else if(u>=ji.HOLD_DELAY&&Math.abs(c.initialPageX-Rs(c.rollingPageX))<30&&Math.abs(c.initialPageY-Rs(c.rollingPageY))<30){let d=this.newGestureEvent(Xr.Contextmenu,c.initialTarget);d.pageX=Rs(c.rollingPageX),d.pageY=Rs(c.rollingPageY),this.dispatchEvent(d)}else if(r===1){let d=Rs(c.rollingPageX),m=Rs(c.rollingPageY),g=Rs(c.rollingTimestamps)-c.rollingTimestamps[0],v=d-c.rollingPageX[0],y=m-c.rollingPageY[0],b=[...this.targets].filter(w=>c.initialTarget instanceof Node&&w.contains(c.initialTarget));this.inertia(e,b,s,Math.abs(v)/g,v>0?1:-1,d,Math.abs(y)/g,y>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(Xr.End,c.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let s=document.createEvent("CustomEvent");return s.initEvent(e,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(e){if(e.type===Xr.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>ji.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,e.tapCount=s}else(e.type===Xr.Change||e.type===Xr.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(e.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(e.initialTarget)){let r=0,n=e.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,s,r,n,o,l,c,u){this.handle=lx(e,()=>{let d=Date.now(),m=d-s,g=0,v=0,y=!0;r+=ji.SCROLL_FRICTION*m,l+=ji.SCROLL_FRICTION*m,r>0&&(y=!1,g=n*r*m),l>0&&(y=!1,v=c*l*m);let b=this.newGestureEvent(Xr.Change);b.translationX=g,b.translationY=v,i.forEach(w=>w.dispatchEvent(b)),y||this.inertia(e,i,d,r,n,o+g,l,c,u+v)})}onTouchMove(e){let i=Date.now();for(let s=0,r=e.changedTouches.length;s<r;s++){let n=e.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let o=this.activeTouches[n.identifier],l=this.newGestureEvent(Xr.Change,o.initialTarget);l.translationX=n.pageX-Rs(o.rollingPageX),l.translationY=n.pageY-Rs(o.rollingPageY),l.pageX=n.pageX,l.pageY=n.pageY,this.dispatchEvent(l),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};du.SCROLL_FRICTION=-.005,du.HOLD_DELAY=700,du.CLEAR_TAP_COUNT_TIME=400,Lt([Bee],du,"isTouchDevice",1);var Dee=du,hx=class extends je{onclick(e,i){this._register(Re(e,ci.CLICK,s=>i(new Rp(Fr(e),s))))}onmousedown(e,i){this._register(Re(e,ci.MOUSE_DOWN,s=>i(new Rp(Fr(e),s))))}onmouseover(e,i){this._register(Re(e,ci.MOUSE_OVER,s=>i(new Rp(Fr(e),s))))}onmouseleave(e,i){this._register(Re(e,ci.MOUSE_LEAVE,s=>i(new Rp(Fr(e),s))))}onkeydown(e,i){this._register(Re(e,ci.KEY_DOWN,s=>i(new pE(s))))}onkeyup(e,i){this._register(Re(e,ci.KEY_UP,s=>i(new pE(s))))}oninput(e,i){this._register(Re(e,ci.INPUT,i))}onblur(e,i){this._register(Re(e,ci.BLUR,i))}onfocus(e,i){this._register(Re(e,ci.FOCUS,i))}onchange(e,i){this._register(Re(e,ci.CHANGE,i))}ignoreGesture(e){return Dee.ignoreTarget(e)}},yE=11,zee=class extends hx{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=yE+"px",this.domNode.style.height=yE+"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 xD),this._register(vE(this.bgDomNode,ci.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(vE(this.domNode,ci.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Qee),this._pointerdownScheduleRepeatTimer=this._register(new ax)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Fr(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()}},Nee=class Wy{constructor(e,i,s,r,n,o,l){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,o=o|0,l=l|0),this.rawScrollLeft=r,this.rawScrollTop=l,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),l+n>o&&(l=o-n),l<0&&(l=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,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 Wy(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 Wy(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 s=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,n=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:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:c}}},jee=class extends je{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new Nee(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 s;let i=this._state.withScrollDimensions(t,e);this._setState(i,!!this._smoothScrolling),(s=this._smoothScrolling)==null||s.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 s;e?s=new SE(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(t);this._smoothScrolling=SE.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)))}},bE=class{constructor(e,i,s){this.scrollLeft=e,this.scrollTop=i,this.isDone=s}};function $_(t,e){let i=e-t;return function(s){return t+i*Zee(s)}}function Xee(t,e,i){return function(s){return s<i?t(s/i):e((s-i)/(1-i))}}var SE=class Uy{constructor(e,i,s,r){this.from=e,this.to=i,this.duration=r,this.startTime=s,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,s){if(Math.abs(e-i)>2.5*s){let r,n;return e<i?(r=e+.75*s,n=i-.75*s):(r=e-.75*s,n=i+.75*s),Xee($_(e,r),$_(n,i),.33)}return $_(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 s=this.scrollLeft(i),r=this.scrollTop(i);return new bE(s,r,!1)}return new bE(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,i,s){return Uy.start(e,i,s)}static start(e,i,s){s=s+10;let r=Date.now()-10;return new Uy(e,i,r,s)}};function Vee(t){return Math.pow(t,3)}function Zee(t){return 1-Vee(1-t)}var Iee=class extends je{constructor(e,i,s){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=s,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ax)}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":"")))}},qee=140,wD=class extends hx{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 Iee(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new xD),this._shouldRender=!0,this.domNode=Ru(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(Re(this.domNode.domNode,ci.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new zee(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,s,r){this.slider=Ru(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof s=="number"&&this.slider.setWidth(s),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Re(this.slider.domNode,ci.POINTER_DOWN,n=>{n.button===0&&(n.preventDefault(),this._sliderPointerDown(n))})),this.onclick(this.slider.domNode,n=>{n.leftButton&&n.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,s=i+this._scrollbarState.getSliderPosition(),r=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),n=this._sliderPointerPosition(e);s<=n&&n<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,s=e.offsetY;else{let n=Lee(this.domNode.domNode);i=e.pageX-n.left,s=e.pageY-n.top}let r=this._pointerDownRelativePosition(i,s);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),s=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{let o=this._sliderOrthogonalPointerPosition(n),l=Math.abs(o-s);if(_D&&l>qee){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let c=this._sliderPointerPosition(n)-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()}},CD=class Yy{constructor(e,i,s,r,n,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Yy(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,s,r,n){let o=Math.max(0,s-e),l=Math.max(0,o-2*i),c=r>0&&r>s;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(s*l/r))),d=(l-u)/(r-s),m=n*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(u),computedSliderRatio:d,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let e=Yy._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,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+e;return Math.round(i/this._computedSliderRatio)}},Wee=class extends wD{constructor(e,i,s){let r=e.getScrollDimensions(),n=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:s,scrollbarState:new CD(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,r.width,r.scrollWidth,n.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}},Uee=class extends wD{constructor(t,e,i){let s=t.getScrollDimensions(),r=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i,scrollbarState:new CD(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,s.height,s.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}},Yee=500,xE=50,Hee=class{constructor(e,i,s){this.timestamp=e,this.deltaX=i,this.deltaY=s,this.score=0}},Hy=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,s=1,r=this._rear;do{let n=r===this._front?e:Math.pow(2,-s);if(e-=n,i+=this._memory[r].score*n,r===this._front)break;r=(this._capacity+r-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(e){if(nx){let i=Fr(e.browserEvent),s=oee(i);this.accept(Date.now(),e.deltaX*s,e.deltaY*s)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,i,s){let r=null,n=new Hee(e,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=n,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]=n),n.score=this._computeScore(n,r)}_computeScore(e,i){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(s+=.25),i){let r=Math.abs(e.deltaX),n=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(n,l),1),d=Math.max(r,o),m=Math.max(n,l);d%c===0&&m%u===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};Hy.INSTANCE=new Hy;var Fee=Hy,Gee=class extends hx{constructor(t,e,i){super(),this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new fe),this.onWillScroll=this._onWillScroll.event,this._options=Jee(e),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Uee(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Wee(this._scrollable,this._options,s)),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=Ru(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ru(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ru(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 ax),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ya(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,en&&(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 gE(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Ya(this._mouseWheelToDispose),t)){let e=i=>{this._onMouseWheel(new gE(i))};this._mouseWheelToDispose.push(Re(this._listenOnDomNode,ci.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){var r;if((r=t.browserEvent)!=null&&r.defaultPrevented)return;let e=Fee.INSTANCE;e.acceptStandardWheelEvent(t);let i=!1;if(t.deltaY||t.deltaX){let n=t.deltaY*this._options.mouseWheelScrollSensitivity,o=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+n===0?o=n=0:Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);let l=!en&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!o&&(o=n,n=0),t.browserEvent&&t.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,n=n*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),u={};if(n){let d=xE*n,m=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,m)}if(o){let d=xE*o,m=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,m)}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 s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(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,s=i?" left":"",r=e?" top":"",n=i||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_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(),Yee)}},Kee=class extends Gee{constructor(e,i,s){super(e,i,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Jee(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,en&&(e.className+=" mac"),e}var Fy=class extends je{constructor(e,i,s,r,n,o,l,c){super(),this._bufferService=s,this._optionsService=l,this._renderService=c,this._onRequestScrollLines=this._register(new fe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let u=this._register(new jee({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>lx(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{u.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Kee(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(n.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Di.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(xt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(xt(()=>this._styleElement.remove())),this._register(Di.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),s=i-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};Fy=Lt([Oe(2,is),Oe(3,Un),Oe(4,nD),Oe(5,Nh),Oe(6,ss),Oe(7,Yn)],Fy);var Gy=class extends je{constructor(e,i,s,r,n){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=s,this._decorationService=r,this._renderService=n,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(xt(()=>{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 s=e.options.x??0;return s&&s>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 s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,i=e.element){if(!i)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=s?`${s*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()}};Gy=Lt([Oe(1,is),Oe(2,Un),Oe(3,Rf),Oe(4,Yn)],Gy);var ete=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,s){return i>=e.startBufferLine-this._linePadding[s||"full"]&&i<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},Dr={full:0,left:0,center:0,right:0},ko={full:0,left:0,center:0,right:0},Gc={full:0,left:0,center:0,right:0},sg=class extends je{constructor(e,i,s,r,n,o,l,c){var d;super(),this._viewportElement=e,this._screenElement=i,this._bufferService=s,this._decorationService=r,this._renderService=n,this._optionsService=o,this._themeService=l,this._coreBrowserService=c,this._colorZoneStore=new ete,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(xt(()=>{var m;return(m=this._canvas)==null?void 0:m.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);ko.full=this._canvas.width,ko.left=e,ko.center=i,ko.right=e,this._refreshDrawHeightConstants(),Gc.full=1,Gc.left=1,Gc.center=1+ko.left,Gc.right=1+ko.left+ko.center}_refreshDrawHeightConstants(){Dr.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);Dr.left=i,Dr.center=i,Dr.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.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(Gc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Dr[e.position||"full"]/2),ko[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Dr[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}))}};sg=Lt([Oe(2,is),Oe(3,Rf),Oe(4,Yn),Oe(5,ss),Oe(6,Nh),Oe(7,Un)],sg);var le;(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=""))(le||(le={}));var lm;(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=""))(lm||(lm={}));var kD;(t=>t.ST=`${le.ESC}\\`)(kD||(kD={}));var Ky=class{constructor(e,i,s,r,n,o){this._textarea=e,this._compositionView=i,this._bufferService=s,this._optionsService=r,this._coreService=n,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 s;i.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(i.start,this._compositionPosition.start):s=this._textarea.value.substring(i.start),s.length>0&&this._coreService.triggerDataEvent(s,!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,s=i.replace(e,"");this._dataAlreadySent=s,i.length>e.length?this._coreService.triggerDataEvent(s,!0):i.length<e.length?this._coreService.triggerDataEvent(`${le.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),s=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"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=n+"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)}}};Ky=Lt([Oe(2,is),Oe(3,ss),Oe(4,tl),Oe(5,Yn)],Ky);var ui=0,fi=0,di=0,Pt=0,wE={css:"#00000000",rgba:0},Ut;(t=>{function e(r,n,o,l){return l!==void 0?`#${ya(r)}${ya(n)}${ya(o)}${ya(l)}`:`#${ya(r)}${ya(n)}${ya(o)}`}t.toCss=e;function i(r,n,o,l=255){return(r<<24|n<<16|o<<8|l)>>>0}t.toRgba=i;function s(r,n,o,l){return{css:t.toCss(r,n,o,l),rgba:t.toRgba(r,n,o,l)}}t.toColor=s})(Ut||(Ut={}));var _t;(t=>{function e(c,u){if(Pt=(u.rgba&255)/255,Pt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,m=u.rgba>>16&255,g=u.rgba>>8&255,v=c.rgba>>24&255,y=c.rgba>>16&255,b=c.rgba>>8&255;ui=v+Math.round((d-v)*Pt),fi=y+Math.round((m-y)*Pt),di=b+Math.round((g-b)*Pt);let w=Ut.toCss(ui,fi,di),C=Ut.toRgba(ui,fi,di);return{css:w,rgba:C}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function s(c,u,d){let m=hm.ensureContrastRatio(c.rgba,u.rgba,d);if(m)return Ut.toColor(m>>24&255,m>>16&255,m>>8&255)}t.ensureContrastRatio=s;function r(c){let u=(c.rgba|255)>>>0;return[ui,fi,di]=hm.toChannels(u),{css:Ut.toCss(ui,fi,di),rgba:u}}t.opaque=r;function n(c,u){return Pt=Math.round(u*255),[ui,fi,di]=hm.toChannels(c.rgba),{css:Ut.toCss(ui,fi,di,Pt),rgba:Ut.toRgba(ui,fi,di,Pt)}}t.opacity=n;function o(c,u){return Pt=c.rgba&255,n(c,Pt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(_t||(_t={}));var Ct;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(e=n,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return ui=parseInt(r.slice(1,2).repeat(2),16),fi=parseInt(r.slice(2,3).repeat(2),16),di=parseInt(r.slice(3,4).repeat(2),16),Ut.toColor(ui,fi,di);case 5:return ui=parseInt(r.slice(1,2).repeat(2),16),fi=parseInt(r.slice(2,3).repeat(2),16),di=parseInt(r.slice(3,4).repeat(2),16),Pt=parseInt(r.slice(4,5).repeat(2),16),Ut.toColor(ui,fi,di,Pt);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 n=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(n)return ui=parseInt(n[1]),fi=parseInt(n[2]),di=parseInt(n[3]),Pt=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Ut.toColor(ui,fi,di,Pt);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),[ui,fi,di,Pt]=e.getImageData(0,0,1,1).data,Pt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ut.toRgba(ui,fi,di,Pt),css:r}}t.toColor=s})(Ct||(Ct={}));var Yi;(t=>{function e(s){return i(s>>16&255,s>>8&255,s&255)}t.relativeLuminance=e;function i(s,r,n){let o=s/255,l=r/255,c=n/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),m=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+m*.0722}t.relativeLuminance2=i})(Yi||(Yi={}));var hm;(t=>{function e(o,l){if(Pt=(l&255)/255,Pt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,m=o>>24&255,g=o>>16&255,v=o>>8&255;return ui=m+Math.round((c-m)*Pt),fi=g+Math.round((u-g)*Pt),di=v+Math.round((d-v)*Pt),Ut.toRgba(ui,fi,di)}t.blend=e;function i(o,l,c){let u=Yi.relativeLuminance(o>>8),d=Yi.relativeLuminance(l>>8);if(An(u,d)<c){if(d<u){let v=s(o,l,c),y=An(u,Yi.relativeLuminance(v>>8));if(y<c){let b=r(o,l,c),w=An(u,Yi.relativeLuminance(b>>8));return y>w?v:b}return v}let m=r(o,l,c),g=An(u,Yi.relativeLuminance(m>>8));if(g<c){let v=s(o,l,c),y=An(u,Yi.relativeLuminance(v>>8));return g>y?m:v}return m}}t.ensureContrastRatio=i;function s(o,l,c){let u=o>>24&255,d=o>>16&255,m=o>>8&255,g=l>>24&255,v=l>>16&255,y=l>>8&255,b=An(Yi.relativeLuminance2(g,v,y),Yi.relativeLuminance2(u,d,m));for(;b<c&&(g>0||v>0||y>0);)g-=Math.max(0,Math.ceil(g*.1)),v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),b=An(Yi.relativeLuminance2(g,v,y),Yi.relativeLuminance2(u,d,m));return(g<<24|v<<16|y<<8|255)>>>0}t.reduceLuminance=s;function r(o,l,c){let u=o>>24&255,d=o>>16&255,m=o>>8&255,g=l>>24&255,v=l>>16&255,y=l>>8&255,b=An(Yi.relativeLuminance2(g,v,y),Yi.relativeLuminance2(u,d,m));for(;b<c&&(g<255||v<255||y<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=An(Yi.relativeLuminance2(g,v,y),Yi.relativeLuminance2(u,d,m));return(g<<24|v<<16|y<<8|255)>>>0}t.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=n})(hm||(hm={}));function ya(t){let e=t.toString(16);return e.length<2?"0"+e:e}function An(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var tte=class extends Pf{constructor(e,i,s){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=s}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()]}},rg=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new lr}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=[],s=e.translateToString(!0),r=0,n=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(s,o,n,e,r);for(let m=0;m<d.length;m++)i.push(d[m])}r=u,o=n,l=this._workCell.fg,c=this._workCell.bg}n+=this._workCell.getChars().length||No.length}if(this._bufferService.cols-r>1){let u=this._getJoinedRanges(s,o,n,e,r);for(let d=0;d<u.length;d++)i.push(u[d])}return i}_getJoinedRanges(t,e,i,s,r){let n=t.substring(e,i),o=[];try{o=this._characterJoiners[0].handler(n)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let c=this._characterJoiners[l].handler(n);for(let u=0;u<c.length;u++)rg._mergeRanges(o,c[u])}catch(c){console.error(c)}return this._stringRangesToCellRanges(o,s,r),o}_stringRangesToCellRanges(t,e,i){let s=0,r=!1,n=0,o=t[s];if(o){for(let l=i;l<this._bufferService.cols;l++){let c=e.getWidth(l),u=e.getString(l).length||No.length;if(c!==0){if(!r&&o[0]<=n&&(o[0]=l,r=!0),o[1]<=n){if(o[1]=l,o=t[++s],!o)break;o[0]<=n?(o[0]=l,r=!0):r=!1}n+=u}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let i=!1;for(let s=0;s<t.length;s++){let r=t[s];if(i){if(e[1]<=r[0])return t[s-1][1]=e[1],t;if(e[1]<=r[1])return t[s-1][1]=Math.max(e[1],r[1]),t.splice(s,1),t;t.splice(s,1),s--}else{if(e[1]<=r[0])return t.splice(s,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}};rg=Lt([Oe(0,is)],rg);function ite(t){return 57508<=t&&t<=57558}function ste(t){return 9472<=t&&t<=9631}function rte(t){return ite(t)||ste(t)}function nte(){return{css:{canvas:Qp(),cell:Qp()},device:{canvas:Qp(),cell:Qp(),char:{width:0,height:0,left:0,top:0}}}}function Qp(){return{width:0,height:0}}var Jy=class{constructor(e,i,s,r,n,o,l){this._document=e,this._characterJoinerService=i,this._optionsService=s,this._coreBrowserService=r,this._coreService=n,this._decorationService=o,this._themeService=l,this._workCell=new lr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,s){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=s}createRow(e,i,s,r,n,o,l,c,u,d,m){let g=[],v=this._characterJoinerService.getJoinedCharacters(i),y=this._themeService.colors,b=e.getNoBgTrimmedLength();s&&b<o+1&&(b=o+1);let w,C=0,T="",M=0,k=0,P=0,E=0,z=!1,$=0,Z=!1,ie=0,F=0,R=[],Q=d!==-1&&m!==-1;for(let D=0;D<b;D++){e.loadCell(D,this._workCell);let I=this._workCell.getWidth();if(I===0)continue;let L=!1,j=D>=F,U=D,Y=this._workCell;if(v.length>0&&D===v[0][0]&&j){let Pe=v.shift(),ln=this._isCellInSelection(Pe[0],i);for(M=Pe[0]+1;M<Pe[1];M++)j&&(j=ln===this._isCellInSelection(M,i));j&&(j=!s||o<Pe[0]||o>=Pe[1]),j?(L=!0,Y=new tte(this._workCell,e.translateToString(!0,Pe[0],Pe[1]),Pe[1]-Pe[0]),U=Pe[1]-1,I=Y.getWidth()):F=Pe[1]}let W=this._isCellInSelection(D,i),N=s&&D===o,G=Q&&D>=d&&D<=m,se=!1;this._decorationService.forEachDecorationAtCell(D,i,void 0,Pe=>{se=!0});let ce=Y.getChars()||No;if(ce===" "&&(Y.isUnderline()||Y.isOverline())&&(ce=" "),ie=I*c-u.get(ce,Y.isBold(),Y.isItalic()),!w)w=this._document.createElement("span");else if(C&&(W&&Z||!W&&!Z&&Y.bg===k)&&(W&&Z&&y.selectionForeground||Y.fg===P)&&Y.extended.ext===E&&G===z&&ie===$&&!N&&!L&&!se&&j){Y.isInvisible()?T+=No:T+=ce,C++;continue}else C&&(w.textContent=T),w=this._document.createElement("span"),C=0,T="";if(k=Y.bg,P=Y.fg,E=Y.extended.ext,z=G,$=ie,Z=W,L&&o>=D&&o<=U&&(o=D),!this._coreService.isCursorHidden&&N&&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(n)switch(n){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(Y.isBold()&&R.push("xterm-bold"),Y.isItalic()&&R.push("xterm-italic"),Y.isDim()&&R.push("xterm-dim"),Y.isInvisible()?T=No:T=Y.getChars()||No,Y.isUnderline()&&(R.push(`xterm-underline-${Y.extended.underlineStyle}`),T===" "&&(T=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${Pf.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let Pe=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&Pe<8&&(Pe+=8),w.style.textDecorationColor=y.ansi[Pe].css}Y.isOverline()&&(R.push("xterm-overline"),T===" "&&(T=" ")),Y.isStrikethrough()&&R.push("xterm-strikethrough"),G&&(w.style.textDecoration="underline");let he=Y.getFgColor(),de=Y.getFgColorMode(),ge=Y.getBgColor(),Me=Y.getBgColorMode(),ye=!!Y.isInverse();if(ye){let Pe=he;he=ge,ge=Pe;let ln=de;de=Me,Me=ln}let mt,Ft,Gt=!1;this._decorationService.forEachDecorationAtCell(D,i,void 0,Pe=>{Pe.options.layer!=="top"&&Gt||(Pe.backgroundColorRGB&&(Me=50331648,ge=Pe.backgroundColorRGB.rgba>>8&16777215,mt=Pe.backgroundColorRGB),Pe.foregroundColorRGB&&(de=50331648,he=Pe.foregroundColorRGB.rgba>>8&16777215,Ft=Pe.foregroundColorRGB),Gt=Pe.options.layer==="top")}),!Gt&&W&&(mt=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ge=mt.rgba>>8&16777215,Me=50331648,Gt=!0,y.selectionForeground&&(de=50331648,he=y.selectionForeground.rgba>>8&16777215,Ft=y.selectionForeground)),Gt&&R.push("xterm-decoration-top");let oi;switch(Me){case 16777216:case 33554432:oi=y.ansi[ge],R.push(`xterm-bg-${ge}`);break;case 50331648:oi=Ut.toColor(ge>>16,ge>>8&255,ge&255),this._addStyle(w,`background-color:#${CE((ge>>>0).toString(16),"0",6)}`);break;case 0:default:ye?(oi=y.foreground,R.push("xterm-bg-257")):oi=y.background}switch(mt||Y.isDim()&&(mt=_t.multiplyOpacity(oi,.5)),de){case 16777216:case 33554432:Y.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(w,oi,y.ansi[he],Y,mt,void 0)||R.push(`xterm-fg-${he}`);break;case 50331648:let Pe=Ut.toColor(he>>16&255,he>>8&255,he&255);this._applyMinimumContrast(w,oi,Pe,Y,mt,Ft)||this._addStyle(w,`color:#${CE(he.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,oi,y.foreground,Y,mt,Ft)||ye&&R.push("xterm-fg-257")}R.length&&(w.className=R.join(" "),R.length=0),!N&&!L&&!se&&j?C++:w.textContent=T,ie!==this.defaultSpacing&&(w.style.letterSpacing=`${ie}px`),g.push(w),D=U}return w&&C&&(w.textContent=T),g}_applyMinimumContrast(e,i,s,r,n,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||rte(r.getCode()))return!1;let l=this._getContrastCache(r),c;if(!n&&!o&&(c=l.getColor(i.rgba,s.rgba)),c===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);c=_t.ensureContrastRatio(n||i,o||s,u),l.setColor((n||i).rgba,(o||s).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 s=this._selectionStart,r=this._selectionEnd;return!s||!r?!1:this._columnSelectMode?s[0]<=r[0]?e>=s[0]&&i>=s[1]&&e<r[0]&&i<=r[1]:e<s[0]&&i>=s[1]&&e>=r[0]&&i<=r[1]:i>s[1]&&i<r[1]||s[1]===r[1]&&i===s[1]&&e>=s[0]&&e<r[0]||s[1]<r[1]&&i===r[1]&&e<r[0]||s[1]<r[1]&&i===s[1]&&e>=s[0]}};Jy=Lt([Oe(1,lD),Oe(2,ss),Oe(3,Un),Oe(4,tl),Oe(5,Rf),Oe(6,Nh)],Jy);function CE(t,e,i){for(;t.length<i;)t=e+t;return t}var ote=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 s=e.createElement("span");s.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.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=[s,r,n,o],this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),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,s,r){e===this._font&&i===this._fontSize&&s===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=i,this._weight=s,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,i,s){let r=0;if(!i&&!s&&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 n=e;i&&(n+="B"),s&&(n+="I");let o=this._holey.get(n);if(o===void 0){let l=0;i&&(l|=1),s&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(n,o)}return o}_measure(e,i){let s=this._measureElements[i];return s.textContent=e.repeat(32),s.offsetWidth/32}},ate=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,s,r=!1){if(this.selectionStart=i,this.selectionEnd=s,!i||!s||i[0]===s[0]&&i[1]===s[1]){this.clear();return}let n=e.buffers.active.ydisp,o=i[1]-n,l=s[1]-n,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=s[0]}isCellSelected(e,i,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&s>=this.viewportCappedStartRow&&i<this.endCol&&s<=this.viewportCappedEndRow:i<this.startCol&&s>=this.viewportCappedStartRow&&i>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&i>=this.startCol):!1}};function lte(){return new ate}var B_="xterm-dom-renderer-owner-",Hs="xterm-rows",Lp="xterm-fg-",kE="xterm-bg-",Kc="xterm-focus",$p="xterm-selection",hte=1,eb=class extends je{constructor(e,i,s,r,n,o,l,c,u,d,m,g,v,y){super(),this._terminal=e,this._document=i,this._element=s,this._screenElement=r,this._viewportElement=n,this._helperContainer=o,this._linkifier2=l,this._charSizeService=u,this._optionsService=d,this._bufferService=m,this._coreService=g,this._coreBrowserService=v,this._themeService=y,this._terminalClass=hte++,this._rowElements=[],this._selectionRenderModel=lte(),this.onRequestRedraw=this._register(new fe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Hs),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($p),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=nte(),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(Jy,document),this._element.classList.add(B_+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(xt(()=>{this._element.classList.remove(B_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new ote(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 s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${Hs} 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} .${Hs} { 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} .${Hs} .xterm-dim { color: ${_t.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 s=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,n=`blink_block_${this._terminalClass}`;i+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${r} { 50% { box-shadow: none; }}`,i+=`@keyframes ${n} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${Hs}.${Kc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Hs}.${Kc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Hs}.${Kc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Hs} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Hs} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Hs} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Hs} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Hs} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${$p} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$p} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$p} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())i+=`${this._terminalSelector} .${Lp}${o} { color: ${l.css}; }${this._terminalSelector} .${Lp}${o}.xterm-dim { color: ${_t.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${kE}${o} { background-color: ${l.css}; }`;i+=`${this._terminalSelector} .${Lp}257 { color: ${_t.opaque(e.background).css}; }${this._terminalSelector} .${Lp}257.xterm-dim { color: ${_t.multiplyOpacity(_t.opaque(e.background),.5).css}; }${this._terminalSelector} .${kE}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 s=this._rowElements.length;s<=i;s++){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(Kc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Kc),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,s),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,s),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,n=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(s){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===n?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(o,u,d));let m=l-o-1;if(c.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,m)),o!==l){let g=n===l?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(l,0,g))}}this._selectionContainer.appendChild(c)}_createSelectionElement(e,i,s,r=1){let n=this._document.createElement("div"),o=i*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(s-i);return o+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-o),n.style.height=`${r*this.dimensions.css.cell.height}px`,n.style.top=`${e*this.dimensions.css.cell.height}px`,n.style.left=`${o}px`,n.style.width=`${l}px`,n}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 s=this._bufferService.buffer,r=s.ybase+s.y,n=Math.min(s.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+s.ydisp,m=this._rowElements[u],g=s.lines.get(d);if(!m||!g)break;m.replaceChildren(...this._rowFactory.createRow(g,d,d===r,l,c,n,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${B_}${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,s,r,n,o){s<0&&(e=0),r<0&&(i=0);let l=this._bufferService.rows-1;s=Math.max(Math.min(s,l),0),r=Math.max(Math.min(r,l),0),n=Math.min(n,this._bufferService.cols);let c=this._bufferService.buffer,u=c.ybase+c.y,d=Math.min(c.x,n-1),m=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=s;y<=r;++y){let b=y+c.ydisp,w=this._rowElements[y],C=c.lines.get(b);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,b,b===u,g,v,d,m,this.dimensions.css.cell.width,this._widthCache,o?y===s?e:0:-1,o?(y===r?i:n)-1:-1))}}};eb=Lt([Oe(7,ix),Oe(8,Eg),Oe(9,ss),Oe(10,is),Oe(11,tl),Oe(12,Un),Oe(13,Nh)],eb);var tb=class extends je{constructor(e,i,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new fe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new ute(this._optionsService))}catch{this._measureStrategy=this._register(new cte(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())}};tb=Lt([Oe(2,ss)],tb);var TD=class extends je{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)}},cte=class extends TD{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}},ute=class extends TD{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}},fte=class extends je{constructor(e,i,s){super(),this._textarea=e,this._window=i,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new dte(this._window)),this._onDprChange=this._register(new fe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new fe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Di.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Re(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Re(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}},dte=class extends je{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ah),this._onDprChange=this._register(new fe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(xt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Re(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)}},pte=class extends je{constructor(){super(),this.linkProviders=[],this._register(xt(()=>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 cx(t,e,i){let s=i.getBoundingClientRect(),r=t.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[e.clientX-s.left-n,e.clientY-s.top-o]}function mte(t,e,i,s,r,n,o,l,c){if(!n)return;let u=cx(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),s+(c?1:0)),u[1]=Math.min(Math.max(u[1],1),r),u}var ib=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,s,r,n){return mte(window,e,i,s,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(e,i){let s=cx(window,e,i);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};ib=Lt([Oe(0,Yn),Oe(1,Eg)],ib);var gte=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,s){this._rowCount=s,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=[]}},MD={};kJ(MD,{getSafariVersion:()=>vte,isChromeOS:()=>RD,isFirefox:()=>AD,isIpad:()=>_te,isIphone:()=>yte,isLegacyEdge:()=>Ote,isLinux:()=>ux,isMac:()=>ng,isNode:()=>Pg,isSafari:()=>ED,isWindows:()=>PD});var Pg=typeof process<"u"&&"title"in process,Qf=Pg?"node":navigator.userAgent,Lf=Pg?"node":navigator.platform,AD=Qf.includes("Firefox"),Ote=Qf.includes("Edge"),ED=/^((?!chrome|android).)*safari/i.test(Qf);function vte(){if(!ED)return 0;let t=Qf.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var ng=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Lf),_te=Lf==="iPad",yte=Lf==="iPhone",PD=["Windows","Win16","Win32","WinCE"].includes(Lf),ux=Lf.indexOf("Linux")>=0,RD=/\bCrOS\b/.test(Qf),QD=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,s=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){s-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-e))}ms`),this._start();return}s=r}this.clear()}},bte=class extends QD{_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())}}},Ste=class extends QD{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},og=!Pg&&"requestIdleCallback"in window?Ste:bte,xte=class{constructor(){this._queue=new og}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},sb=class extends je{constructor(e,i,s,r,n,o,l,c,u){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=r,this._coreService=n,this._coreBrowserService=c,this._renderer=this._register(new Ah),this._pausedResizeTask=new xte,this._observerDisposable=this._register(new Ah),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 fe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new fe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new fe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new fe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new gte((d,m)=>this._renderRows(d,m),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new wte(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(xt(()=>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 s=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});s.observe(i),this._observerDisposable.value=xt(()=>s.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,s=!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)),s||(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 s;return(s=this._renderer.value)==null?void 0:s.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,s){var r;this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=s,(r=this._renderer.value)==null||r.handleSelectionChanged(e,i,s)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};sb=Lt([Oe(2,ss),Oe(3,Eg),Oe(4,tl),Oe(5,Rf),Oe(6,is),Oe(7,Un),Oe(8,Nh)],sb);var wte=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 Cte(t,e,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return Mte(r,n,t,e,i,s)+Rg(n,e,i,s)+Ate(r,n,t,e,i,s);let o;if(n===e)return o=r>t?"D":"C",uf(Math.abs(r-t),cf(o,s));o=n>e?"D":"C";let l=Math.abs(n-e),c=Tte(n>e?t:r,i)+(l-1)*i.cols+1+kte(n>e?r:t);return uf(c,cf(o,s))}function kte(t,e){return t-1}function Tte(t,e){return e.cols-t}function Mte(t,e,i,s,r,n){return Rg(e,s,r,n).length===0?"":uf($D(t,e,t,e-Ha(e,r),!1,r).length,cf("D",n))}function Rg(t,e,i,s){let r=t-Ha(t,i),n=e-Ha(e,i),o=Math.abs(r-n)-Ete(t,e,i);return uf(o,cf(LD(t,e),s))}function Ate(t,e,i,s,r,n){let o;Rg(e,s,r,n).length>0?o=s-Ha(s,r):o=e;let l=s,c=Pte(t,e,i,s,r,n);return uf($D(t,o,i,l,c==="C",r).length,cf(c,n))}function Ete(t,e,i){var o;let s=0,r=t-Ha(t,i),n=e-Ha(e,i);for(let l=0;l<Math.abs(r-n);l++){let c=LD(t,e)==="A"?-1:1;(o=i.buffer.lines.get(r+c*l))!=null&&o.isWrapped&&s++}return s}function Ha(t,e){let i=0,s=e.buffer.lines.get(t),r=s==null?void 0:s.isWrapped;for(;r&&t>=0&&t<e.rows;)i++,s=e.buffer.lines.get(--t),r=s==null?void 0:s.isWrapped;return i}function Pte(t,e,i,s,r,n){let o;return Rg(i,s,r,n).length>0?o=s-Ha(s,r):o=e,t<i&&o<=s||t>=i&&o<s?"C":"D"}function LD(t,e){return t>e?"A":"B"}function $D(t,e,i,s,r,n){let o=t,l=e,c="";for(;(o!==i||l!==s)&&l>=0&&l<n.buffer.lines.length;)o+=r?1:-1,r&&o>n.cols-1?(c+=n.buffer.translateBufferLineToString(l,!1,t,o),o=0,t=0,l++):!r&&o<0&&(c+=n.buffer.translateBufferLineToString(l,!1,0,t+1),o=n.cols-1,t=o,l--);return c+n.buffer.translateBufferLineToString(l,!1,t,o)}function cf(t,e){let i=e?"O":"[";return le.ESC+i+t}function uf(t,e){t=Math.floor(t);let i="";for(let s=0;s<t;s++)i+=e;return i}var Rte=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 TE(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 D_=50,Qte=15,Lte=50,$te=500,Bte=" ",Dte=new RegExp(Bte,"g"),rb=class extends je{constructor(e,i,s,r,n,o,l,c,u){super(),this._element=e,this._screenElement=i,this._linkifier=s,this._bufferService=r,this._coreService=n,this._mouseService=o,this._optionsService=l,this._renderService=c,this._coreBrowserService=u,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new lr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new fe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new fe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new fe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new fe),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 Rte(this._bufferService),this._activeSelectionMode=0,this._register(xt(()=>{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 s=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let n=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=s.translateBufferLineToString(l,!0,n,o);r.push(c)}}else{let n=e[1]===i[1]?i[0]:void 0;r.push(s.translateBufferLineToString(e[1],!0,e[0],n));for(let o=e[1]+1;o<=i[1]-1;o++){let l=s.lines.get(o),c=s.translateBufferLineToString(o,!0);l!=null&&l.isWrapped?r[r.length-1]+=c:r.push(c)}if(e[1]!==i[1]){let o=s.lines.get(i[1]),l=s.translateBufferLineToString(i[1],!0,0,i[0]);o&&o.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(n=>n.replace(Dte," ")).join(PD?`\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())),ux&&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),s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r||!i?!1:this._areCoordsInSelection(i,s,r)}isCellInSelection(e,i){let s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r?!1:this._areCoordsInSelection([e,i],s,r)}_areCoordsInSelection(e,i,s){return e[1]>i[1]&&e[1]<s[1]||i[1]===s[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<s[0]||i[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||i[1]<s[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){var n,o;let s=(o=(n=this._linkifier.currentLink)==null?void 0:n.link)==null?void 0:o.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=TE(s,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=cx(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=s?0:(i>s&&(i-=s),i=Math.min(Math.max(i,-D_),D_),i/=D_,i/Math.abs(i)+Math.round(i*(Qte-1)))}shouldForceSelection(e){return ng?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(),Lte)}_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&&!(ng&&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 s=this._bufferService.buffer;if(this._model.selectionEnd[1]<s.lines.length){let r=s.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<$te&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let s=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&s[0]!==void 0&&s[1]!==void 0){let r=Cte(s[0]-1,s[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,s=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!s){this._oldHasSelection&&this._fireOnSelectionChange(e,i,s);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,s)}_fireOnSelectionChange(e,i,s){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=s,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let s=i;for(let r=0;i>=r;r++){let n=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:n>1&&i!==r&&(s+=n-1)}return s}setSelection(e,i,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,s=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let n=this._bufferService.buffer,o=n.lines.get(e[1]);if(!o)return;let l=n.translateBufferLineToString(e[1],!1),c=this._convertViewportColToCharacterIndex(o,e[0]),u=c,d=e[0]-c,m=0,g=0,v=0,y=0;if(l.charAt(c)===" "){for(;c>0&&l.charAt(c-1)===" ";)c--;for(;u<l.length&&l.charAt(u+1)===" ";)u++}else{let C=e[0],T=e[0];o.getWidth(C)===0&&(m++,C--),o.getWidth(T)===2&&(g++,T++);let M=o.getString(T).length;for(M>1&&(y+=M-1,u+=M-1);C>0&&c>0&&!this._isCharWordSeparator(o.loadCell(C-1,this._workCell));){o.loadCell(C-1,this._workCell);let k=this._workCell.getChars().length;this._workCell.getWidth()===0?(m++,C--):k>1&&(v+=k-1,c-=k-1),c--,C--}for(;T<o.length&&u+1<l.length&&!this._isCharWordSeparator(o.loadCell(T+1,this._workCell));){o.loadCell(T+1,this._workCell);let k=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,T++):k>1&&(y+=k-1,u+=k-1),u++,T++}}u++;let b=c+d-m+v,w=Math.min(this._bufferService.cols,u-c+m+g-v-y);if(!(!i&&l.slice(c,u).trim()==="")){if(s&&b===0&&o.getCodePoint(0)!==32){let C=n.lines.get(e[1]-1);if(C&&o.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let T=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(T){let M=this._bufferService.cols-T.start;b-=M,w+=M}}}if(r&&b+w===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let C=n.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let T=this._getWordAt([0,e[1]+1],!1,!1,!0);T&&(w+=T.length)}}return{start:b,length:w}}}_selectWordAt(e,i){let s=this._getWordAt(e,i);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let s=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),s={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=TE(s,this._bufferService.cols)}};rb=Lt([Oe(3,is),Oe(4,tl),Oe(5,sx),Oe(6,ss),Oe(7,Yn),Oe(8,Un)],rb);var ME=class{constructor(){this._data={}}set(e,i,s){this._data[e]||(this._data[e]={}),this._data[e][i]=s}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},AE=class{constructor(){this._color=new ME,this._css=new ME}setCss(e,i,s){this._css.set(e,i,s)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,s){this._color.set(e,i,s)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},ei=Object.freeze((()=>{let t=[Ct.toColor("#2e3436"),Ct.toColor("#cc0000"),Ct.toColor("#4e9a06"),Ct.toColor("#c4a000"),Ct.toColor("#3465a4"),Ct.toColor("#75507b"),Ct.toColor("#06989a"),Ct.toColor("#d3d7cf"),Ct.toColor("#555753"),Ct.toColor("#ef2929"),Ct.toColor("#8ae234"),Ct.toColor("#fce94f"),Ct.toColor("#729fcf"),Ct.toColor("#ad7fa8"),Ct.toColor("#34e2e2"),Ct.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=e[i/36%6|0],r=e[i/6%6|0],n=e[i%6];t.push({css:Ut.toCss(s,r,n),rgba:Ut.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;t.push({css:Ut.toCss(s,s,s),rgba:Ut.toRgba(s,s,s)})}return t})()),ka=Ct.toColor("#ffffff"),pu=Ct.toColor("#000000"),EE=Ct.toColor("#ffffff"),PE=pu,Jc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},zte=ka,nb=class extends je{constructor(e){super(),this._optionsService=e,this._contrastCache=new AE,this._halfContrastCache=new AE,this._onChangeColors=this._register(new fe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ka,background:pu,cursor:EE,cursorAccent:PE,selectionForeground:void 0,selectionBackgroundTransparent:Jc,selectionBackgroundOpaque:_t.blend(pu,Jc),selectionInactiveBackgroundTransparent:Jc,selectionInactiveBackgroundOpaque:_t.blend(pu,Jc),scrollbarSliderBackground:_t.opacity(ka,.2),scrollbarSliderHoverBackground:_t.opacity(ka,.4),scrollbarSliderActiveBackground:_t.opacity(ka,.5),overviewRulerBorder:ka,ansi:ei.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=at(e.foreground,ka),i.background=at(e.background,pu),i.cursor=_t.blend(i.background,at(e.cursor,EE)),i.cursorAccent=_t.blend(i.background,at(e.cursorAccent,PE)),i.selectionBackgroundTransparent=at(e.selectionBackground,Jc),i.selectionBackgroundOpaque=_t.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=at(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=_t.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?at(e.selectionForeground,wE):void 0,i.selectionForeground===wE&&(i.selectionForeground=void 0),_t.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=_t.opacity(i.selectionBackgroundTransparent,.3)),_t.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=_t.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=at(e.scrollbarSliderBackground,_t.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=at(e.scrollbarSliderHoverBackground,_t.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=at(e.scrollbarSliderActiveBackground,_t.opacity(i.foreground,.5)),i.overviewRulerBorder=at(e.overviewRulerBorder,zte),i.ansi=ei.slice(),i.ansi[0]=at(e.black,ei[0]),i.ansi[1]=at(e.red,ei[1]),i.ansi[2]=at(e.green,ei[2]),i.ansi[3]=at(e.yellow,ei[3]),i.ansi[4]=at(e.blue,ei[4]),i.ansi[5]=at(e.magenta,ei[5]),i.ansi[6]=at(e.cyan,ei[6]),i.ansi[7]=at(e.white,ei[7]),i.ansi[8]=at(e.brightBlack,ei[8]),i.ansi[9]=at(e.brightRed,ei[9]),i.ansi[10]=at(e.brightGreen,ei[10]),i.ansi[11]=at(e.brightYellow,ei[11]),i.ansi[12]=at(e.brightBlue,ei[12]),i.ansi[13]=at(e.brightMagenta,ei[13]),i.ansi[14]=at(e.brightCyan,ei[14]),i.ansi[15]=at(e.brightWhite,ei[15]),e.extendedAnsi){let s=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<s;r++)i.ansi[r+16]=at(e.extendedAnsi[r],ei[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()}}};nb=Lt([Oe(0,ss)],nb);function at(t,e){if(t!==void 0)try{return Ct.toColor(t)}catch{}return e}var Nte=class{constructor(...e){this._entries=new Map;for(let[i,s]of e)this.set(i,s)}set(e,i){let s=this._entries.get(e);return this._entries.set(e,i),s}forEach(e){for(let[i,s]of this._entries.entries())e(i,s)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},jte=class{constructor(){this._services=new Nte,this._services.set(ix,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let i=QJ(t).sort((n,o)=>n.index-o.index),s=[];for(let n of i){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${n.id._id}.`);s.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,...s)}},Xte={trace:0,debug:1,info:2,warn:3,error:4,off:5},Vte="xterm.js: ",ob=class extends je{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=Xte[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,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":Vte)+i,...s)}trace(e,...i){var s;this._logLevel<=0&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,i)}debug(e,...i){var s;this._logLevel<=1&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,i)}info(e,...i){var s;this._logLevel<=2&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,i)}warn(e,...i){var s;this._logLevel<=3&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,i)}error(e,...i){var s;this._logLevel<=4&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,i)}};ob=Lt([Oe(0,ss)],ob);var RE=class extends je{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new fe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new fe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new fe),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 s=0;s<Math.min(e,this.length);s++)i[s]=this._array[this._getCyclicIndex(s)];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,...s){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+s.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<s.length;r++)this._array[this._getCyclicIndex(e+r)]=s[r];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let r=this._length+s.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,s){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let n=i-1;n>=0;n--)this.set(e+n+s,this.get(e+n));let r=e+i+s-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+s,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},ze=3,It=Object.freeze(new Pf),Bp=0,z_=2,mu=class BD{constructor(e,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*ze);let r=i||lr.fromCharData([0,tD,1,0]);for(let n=0;n<e;++n)this.setCell(n,r);this.length=e}get(e){let i=this._data[e*ze+0],s=i&2097151;return[this._data[e*ze+1],i&2097152?this._combined[e]:s?$o(s):"",i>>22,i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):s]}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?$o(i&2097151):""}isProtected(e){return this._data[e*ze+2]&536870912}loadCell(e,i){return Bp=e*ze,i.content=this._data[Bp+0],i.fg=this._data[Bp+1],i.bg=this._data[Bp+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,s,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*ze+0]=i|s<<22,this._data[e*ze+1]=r.fg,this._data[e*ze+2]=r.bg}addCodepointToCell(e,i,s){let r=this._data[e*ze+0];r&2097152?this._combined[e]+=$o(i):r&2097151?(this._combined[e]=$o(r&2097151)+$o(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[e*ze+0]=r}insertCells(e,i,s){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),i<this.length-e){let r=new lr;for(let n=this.length-e-i-1;n>=0;--n)this.setCell(e+i+n,this.loadCell(e+n,r));for(let n=0;n<i;++n)this.setCell(e+n,s)}else for(let r=e;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(e,i,s){if(e%=this.length,i<this.length-e){let r=new lr;for(let n=0;n<this.length-e-i;++n)this.setCell(e+n,this.loadCell(e+i+n,r));for(let n=this.length-i;n<this.length;++n)this.setCell(n,s)}else for(let r=e;r<this.length;++r)this.setCell(r,s);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,s)}replaceCells(e,i,s,r=!1){if(r){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,s),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);e<i&&e<this.length;)this.setCell(e++,s)}resize(e,i){if(e===this.length)return this._data.length*4*z_<this._data.buffer.byteLength;let s=e*ze;if(e>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);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,s);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 n=Object.keys(this._extendedAttrs);for(let o=0;o<n.length;o++){let l=parseInt(n[o],10);l>=e&&delete this._extendedAttrs[l]}}return this.length=e,s*4*z_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*z_<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 s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,e);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,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 BD(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,s,r,n){let o=e._data;if(n)for(let c=r-1;c>=0;c--){for(let u=0;u<ze;u++)this._data[(s+c)*ze+u]=o[(i+c)*ze+u];o[(i+c)*ze+2]&268435456&&(this._extendedAttrs[s+c]=e._extendedAttrs[i+c])}else for(let c=0;c<r;c++){for(let u=0;u<ze;u++)this._data[(s+c)*ze+u]=o[(i+c)*ze+u];o[(i+c)*ze+2]&268435456&&(this._extendedAttrs[s+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+s]=e._combined[u])}}translateToString(e,i,s,r){i=i??0,s=s??this.length,e&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i<s;){let o=this._data[i*ze+0],l=o&2097151,c=o&2097152?this._combined[i]:l?$o(l):No;if(n+=c,r)for(let u=0;u<c.length;++u)r.push(i);i+=o>>22||1}return r&&r.push(i),n}};function Zte(t,e,i,s,r,n){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(!n&&s>=l&&s<c){l+=d.length-1;continue}let m=0,g=ff(d,m,e),v=1,y=0;for(;v<d.length;){let w=ff(d,v,e),C=w-y,T=i-g,M=Math.min(C,T);d[m].copyCellsFrom(d[v],y,g,M,!1),g+=M,g===i&&(m++,g=0),y+=M,y===w&&(v++,y=0),g===0&&m!==0&&d[m-1].getWidth(i-1)===2&&(d[m].copyCellsFrom(d[m-1],i-1,g++,1,!1),d[m-1].setCell(i-1,r))}d[m].replaceCells(g,i,r);let b=0;for(let w=d.length-1;w>0&&(w>m||d[w].getTrimmedLength()===0);w--)b++;b>0&&(o.push(l+d.length-b),o.push(b)),l+=d.length-1}return o}function Ite(t,e){let i=[],s=0,r=e[s],n=0;for(let o=0;o<t.length;o++)if(r===o){let l=e[++s];t.onDeleteEmitter.fire({index:o-n,amount:l}),o+=l-1,n+=l,r=e[++s]}else i.push(o);return{layout:i,countRemoved:n}}function qte(t,e){let i=[];for(let s=0;s<e.length;s++)i.push(t.get(e[s]));for(let s=0;s<i.length;s++)t.set(s,i[s]);t.length=e.length}function Wte(t,e,i){let s=[],r=t.map((c,u)=>ff(t,u,e)).reduce((c,u)=>c+u),n=0,o=0,l=0;for(;l<r;){if(r-l<i){s.push(r-l);break}n+=i;let c=ff(t,o,e);n>c&&(n-=c,o++);let u=t[o].getWidth(n-1)===2;u&&n--;let d=u?i-1:i;s.push(d),l+=d}return s}function ff(t,e,i){if(e===t.length-1)return t[e].getTrimmedLength();let s=!t[e].hasContent(i-1)&&t[e].getWidth(i-1)===1,r=t[e+1].getWidth(0)===2;return s&&r?i-1:i}var DD=class zD{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=zD._nextId++,this._onDispose=this.register(new fe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ya(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};DD._nextId=1;var Ute=DD,ni={},Ta=ni.B;ni[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ni.A={"#":"£"};ni.B=void 0;ni[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ni.C=ni[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ni.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ni.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ni.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ni.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ni.E=ni[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ni.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ni.H=ni[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ni["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var QE=4294967295,LE=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=It.clone(),this.savedCharset=Ta,this.markers=[],this._nullCell=lr.fromCharData([0,tD,1,0]),this._whitespaceCell=lr.fromCharData([0,No,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new og,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new RE(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 ig),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 ig),this._whitespaceCell}getBlankLine(t,e){return new mu(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>QE?QE:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=It);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 RE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(It),s=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++)s+=+this.lines.get(o).resize(t,i);let n=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 mu(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new mu(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),n&&(this.y+=n),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 n=0;n<this.lines.length;n++)s+=+this.lines.get(n).resize(t,i);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),s>.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,s=Zte(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(It),i);if(s.length>0){let r=Ite(this.lines,s);qte(this.lines,r.layout),this._reflowLargerAdjustViewport(t,e,r.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let s=this.getNullCell(It),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new mu(t,s))):(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,s=this.getNullCell(It),r=[],n=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 M=this.ybase+this.y;if(M>=o&&M<o+c.length)continue}let u=c[c.length-1].getTrimmedLength(),d=Wte(c,this._cols,t),m=d.length-c.length,g;this.ybase===0&&this.y!==this.lines.length-1?g=Math.max(0,this.y-this.lines.maxLength+m):g=Math.max(0,this.lines.length-this.lines.maxLength+m);let v=[];for(let M=0;M<m;M++){let k=this.getBlankLine(It,!0);v.push(k)}v.length>0&&(r.push({start:o+c.length+n,newLines:v}),n+=v.length),c.push(...v);let y=d.length-1,b=d[y];b===0&&(y--,b=d[y]);let w=c.length-m-1,C=u;for(;w>=0;){let M=Math.min(C,b);if(c[y]===void 0)break;if(c[y].copyCellsFrom(c[w],C-M,b-M,M,!0),b-=M,b===0&&(y--,b=d[y]),C-=M,C===0){w--;let k=Math.max(w,0);C=ff(c,k,this._cols)}}for(let M=0;M<c.length;M++)d[M]<t&&c[M].setCell(d[M],s);let T=m-g;for(;T-- >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+n)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,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,m=r[d];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let g=0;for(let b=Math.min(this.lines.maxLength-1,c+n-1);b>=0;b--)if(m&&m.start>u+g){for(let w=m.newLines.length-1;w>=0;w--)this.lines.set(b--,m.newLines[w]);b++,o.push({index:u+1,amount:m.newLines.length}),g+=m.newLines.length,m=r[++d]}else this.lines.set(b,l[u--]);let v=0;for(let b=o.length-1;b>=0;b--)o[b].index+=v,this.lines.onInsertEmitter.fire(o[b]),v+=o[b].amount;let y=Math.max(0,c+n-this.lines.maxLength);y>0&&this.lines.onTrimEmitter.fire(y)}}translateBufferLineToString(t,e,i=0,s){let r=this.lines.get(t);return r?r.translateToString(e,i,s):""}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 Ute(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)}},Yte=class extends je{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new fe),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 LE(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new LE(!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)}},ND=2,jD=1,ab=class extends je{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new fe),this.onResize=this._onResize.event,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,ND),this.rows=Math.max(t.rawOptions.rows||0,jD),this.buffers=this._register(new Yte(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,s=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==t.fg||s.getBg(0)!==t.bg)&&(s=i.getBlankLine(t,e),this._cachedBlankLine=s),s.isWrapped=e;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;n===i.lines.length-1?o?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=n-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(n,s.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 s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),s!==i.ydisp&&(e||this._onScroll.fire(i.ydisp))}};ab=Lt([Oe(0,ss)],ab);var Zl={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:ng,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Hte=["normal","bold","100","200","300","400","500","600","700","800","900"],Fte=class extends je{constructor(e){super(),this._onOptionChange=this._register(new fe),this.onOptionChange=this._onOptionChange.event;let i={...Zl};for(let s in e)if(s in i)try{let r=e[s];i[s]=this._sanitizeAndValidateOption(s,r)}catch(r){console.error(r)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(xt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(s=>{s===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&i()})}_setupOptions(){let e=s=>{if(!(s in Zl))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},i=(s,r)=>{if(!(s in Zl))throw new Error(`No option with key "${s}"`);r=this._sanitizeAndValidateOption(s,r),this.rawOptions[s]!==r&&(this.rawOptions[s]=r,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let r={get:e.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this.options,s,r)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Zl[e]),!Gte(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Zl[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=Hte.includes(i)?i:Zl[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 Gte(t){return t==="block"||t==="underline"||t==="bar"}function gu(t,e=5){if(typeof t!="object")return t;let i=Array.isArray(t)?[]:{};for(let s in t)i[s]=e<=1?t[s]:t[s]&&gu(t[s],e-1);return i}var $E=Object.freeze({insertMode:!1}),BE=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),lb=class extends je{constructor(e,i,s){super(),this._bufferService=e,this._logService=i,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new fe),this.onData=this._onData.event,this._onUserInput=this._register(new fe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new fe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new fe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=gu($E),this.decPrivateModes=gu(BE)}reset(){this.modes=gu($E),this.decPrivateModes=gu(BE)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.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))}};lb=Lt([Oe(0,is),Oe(1,oD),Oe(2,ss)],lb);var DE={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 N_(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 j_=String.fromCharCode,zE={DEFAULT:t=>{let e=[N_(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${j_(e[0])}${j_(e[1])}${j_(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${N_(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${N_(t,!0)};${t.x};${t.y}${e}`}},hb=class extends je{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 fe),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(DE))this.addProtocol(s,DE[s]);for(let s of Object.keys(zE))this.addEncoding(s,zE[s]);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 s=e/i,r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+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)}};hb=Lt([Oe(0,is),Oe(1,tl),Oe(2,ss)],hb);var X_=[[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]],Kte=[[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]],ti;function Jte(t,e){let i=0,s=e.length-1,r;if(t<e[0][0]||t>e[s][1])return!1;for(;s>=i;)if(r=i+s>>1,t>e[r][1])i=r+1;else if(t<e[r][0])s=r-1;else return!0;return!1}var eie=class{constructor(){if(this.version="6",!ti){ti=new Uint8Array(65536),ti.fill(1),ti[0]=0,ti.fill(0,1,32),ti.fill(0,127,160),ti.fill(2,4352,4448),ti[9001]=2,ti[9002]=2,ti.fill(2,11904,42192),ti[12351]=1,ti.fill(2,44032,55204),ti.fill(2,63744,64256),ti.fill(2,65040,65050),ti.fill(2,65072,65136),ti.fill(2,65280,65377),ti.fill(2,65504,65511);for(let e=0;e<X_.length;++e)ti.fill(0,X_[e][0],X_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ti[e]:Jte(e,Kte)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let s=this.wcwidth(e),r=s===0&&i!==0;if(r){let n=Da.extractWidth(i);n===0?r=!1:n>s&&(s=n)}return Da.createPropertyValue(0,s,r)}},Da=class cm{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new fe,this.onChange=this._onChange.event;let e=new eie;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,s=!1){return(e&16777215)<<3|(i&3)<<1|(s?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,s=0,r=e.length;for(let n=0;n<r;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+this.wcwidth(o);let u=e.charCodeAt(n);56320<=u&&u<=57343?o=(o-55296)*1024+u-56320+65536:i+=this.wcwidth(u)}let l=this.charProperties(o,s),c=cm.extractWidth(l);cm.extractShouldJoin(l)&&(c-=cm.extractWidth(s)),i+=c,s=l}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},tie=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 NE(t){var s;let e=(s=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1))==null?void 0:s.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 eu=2147483647,iie=256,XD=class cb{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>iie)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 cb;if(!e.length)return i;for(let s=Array.isArray(e[0])?1:0;s<e.length;++s){let r=e[s];if(Array.isArray(r))for(let n=0;n<r.length;++n)i.addSubParam(r[n]);else i.addParam(r)}return i}clone(){let e=new cb(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 s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&e.push(Array.prototype.slice.call(this._subParams,s,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>eu?eu: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>eu?eu: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,s=this._subParamsIdx[e]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&(e[i]=this._subParams.slice(s,r))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+e,eu):e}},tu=[],sie=class{constructor(){this._state=0,this._active=tu,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 s=this._handlers[e];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.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=tu}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=tu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||tu,!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,s){if(!this._active.length)this._handlerFb(this._id,"PUT",Ag(e,i,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,i,s)}start(){this.reset(),this._state=1}put(e,i,s){if(this._state!==3){if(this._state===1)for(;i<s;){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&&s-i>0&&this._put(e,i,s)}}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 s=!1,r=this._active.length-1,n=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=i,n=this._stack.fallThrough,this._stack.paused=!1),!n&&s===!1){for(;r>=0&&(s=this._active[r].end(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=tu,this._id=-1,this._state=0}}},Qs=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,s){this._hitLimit||(this._data+=Ag(e,i,s),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(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,i}},iu=[],rie=class{constructor(){this._handlers=Object.create(null),this._active=iu,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=iu}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.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=iu,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||iu,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(i)}put(e,i,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",Ag(e,i,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,i,s)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,r=this._active.length-1,n=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=i,n=this._stack.fallThrough,this._stack.paused=!1),!n&&s===!1){for(;r>=0&&(s=this._active[r].unhook(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=iu,this._ident=0}},Ou=new XD;Ou.addParam(0);var jE=class{constructor(t){this._handler=t,this._data="",this._params=Ou,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():Ou,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=Ag(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=Ou,this._data="",this._hitLimit=!1,i));return this._params=Ou,this._data="",this._hitLimit=!1,e}},nie=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,s,r){this.table[i<<8|e]=s<<4|r}addMany(e,i,s,r){for(let n=0;n<e.length;n++)this.table[i<<8|e[n]]=s<<4|r}},Js=160,oie=(function(){let t=new nie(4095),e=Array.apply(null,Array(256)).map((l,c)=>c),i=(l,c)=>e.slice(l,c),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),o;t.setDefault(1,0),t.addMany(s,0,2,0);for(o in n)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(s,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(s,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(s,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(Js,0,2,0),t.add(Js,8,5,8),t.add(Js,6,0,6),t.add(Js,11,0,11),t.add(Js,13,13,13),t})(),aie=class extends je{constructor(e=oie){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 XD,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,s,r)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,s)=>{},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(xt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new sie),this._dcsParser=this._register(new rie),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>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 n=0;n<e.intermediates.length;++n){let o=e.intermediates.charCodeAt(n);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=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 s<<=8,s|=r,s}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 s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let r=this._escHandlers[s];return r.push(i),{dispose:()=>{let n=r.indexOf(i);n!==-1&&r.splice(n,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 s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let r=this._csiHandlers[s];return r.push(i),{dispose:()=>{let n=r.indexOf(i);n!==-1&&r.splice(n,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,s,r,n){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=s,this._parseStack.transition=r,this._parseStack.chunkPos=n}parse(e,i,s){let r=0,n=0,o=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(s===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(s===!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(s===!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,s),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,s),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],n=this._transitions.table[this.currentState<<8|(r<160?r:Js)],n>>4){case 2:for(let v=c+1;;++v){if(v>=i||(r=e[v])<32||r>126&&r<Js){this._printHandler(e,c,v),c=v-1;break}if(++v>=i||(r=e[v])<32||r>126&&r<Js){this._printHandler(e,c,v),c=v-1;break}if(++v>=i||(r=e[v])<32||r>126&&r<Js){this._printHandler(e,c,v),c=v-1;break}if(++v>=i||(r=e[v])<32||r>126&&r<Js){this._printHandler(e,c,v),c=v-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,n,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 m=this._escHandlers[this._collect<<8|r],g=m?m.length-1:-1;for(;g>=0&&(l=m[g](),l!==!0);g--)if(l instanceof Promise)return this._preserveStack(4,m,g,n,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 v=c+1;;++v)if(v>=i||(r=e[v])===24||r===26||r===27||r>127&&r<Js){this._dcsParser.put(e,c,v),c=v-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,n,c),l;r===27&&(n|=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 v=c+1;;v++)if(v>=i||(r=e[v])<32||r>127&&r<Js){this._oscParser.put(e,c,v),c=v-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,n,c),l;r===27&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=n&15}}},lie=/^([\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})$/,hie=/^[\da-f]+$/;function XE(t){if(!t)return;let e=t.toLowerCase();if(e.indexOf("rgb:")===0){e=e.slice(4);let i=lie.exec(e);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(e.indexOf("#")===0&&(e=e.slice(1),hie.exec(e)&&[3,6,9,12].includes(e.length))){let i=e.length/3,s=[0,0,0];for(let r=0;r<3;++r){let n=parseInt(e.slice(i*r,i*r+i),16);s[r]=i===1?n<<4:i===2?n:i===3?n>>4:n>>8}return s}}function V_(t,e){let i=t.toString(16),s=i.length<2?"0"+i:i;switch(e){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function cie(t,e=16){let[i,s,r]=t;return`rgb:${V_(i,e)}/${V_(s,e)}/${V_(r,e)}`}var uie={"(":0,")":1,"*":2,"+":3,"-":1,".":2},To=131072,VE=10;function ZE(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 IE=5e3,qE=0,fie=class extends je{constructor(t,e,i,s,r,n,o,l,c=new aie){super(),this._bufferService=t,this._charsetService=e,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new PJ,this._utf8Decoder=new RJ,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=It.clone(),this._eraseAttrDataInternal=It.clone(),this._onRequestBell=this._register(new fe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new fe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new fe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new fe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new fe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new fe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new fe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new fe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new fe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new fe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new fe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new fe),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 ub(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,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:u,action:d,data:m})}),this._parser.setDcsHandlerFallback((u,d,m)=>{d==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(u),action:d,payload:m})}),this._parser.setPrintHandler((u,d,m)=>this.print(u,d,m)),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(le.BEL,()=>this.bell()),this._parser.setExecuteHandler(le.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(le.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(le.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(le.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(le.BS,()=>this.backspace()),this._parser.setExecuteHandler(le.HT,()=>this.tab()),this._parser.setExecuteHandler(le.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(le.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(lm.IND,()=>this.index()),this._parser.setExecuteHandler(lm.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(lm.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Qs(u=>(this.setTitle(u),this.setIconName(u),!0))),this._parser.registerOscHandler(1,new Qs(u=>this.setIconName(u))),this._parser.registerOscHandler(2,new Qs(u=>this.setTitle(u))),this._parser.registerOscHandler(4,new Qs(u=>this.setOrReportIndexedColor(u))),this._parser.registerOscHandler(8,new Qs(u=>this.setHyperlink(u))),this._parser.registerOscHandler(10,new Qs(u=>this.setOrReportFgColor(u))),this._parser.registerOscHandler(11,new Qs(u=>this.setOrReportBgColor(u))),this._parser.registerOscHandler(12,new Qs(u=>this.setOrReportCursorColor(u))),this._parser.registerOscHandler(104,new Qs(u=>this.restoreIndexedColor(u))),this._parser.registerOscHandler(110,new Qs(u=>this.restoreFgColor(u))),this._parser.registerOscHandler(111,new Qs(u=>this.restoreBgColor(u))),this._parser.registerOscHandler(112,new Qs(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 ni)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 jE((u,d)=>this.requestStatusString(u,d)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),IE))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${IE} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>To&&(n=this._parseStack.position+To)}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<To&&(this._parseBuffer=new Uint32Array(Math.min(t.length,To))),o||this._dirtyRowTracker.clearRange(),t.length>To)for(let u=n;u<t.length;u+=To){let d=u+To<t.length?u+To:t.length,m=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,m))return this._preserveStack(s,r,m,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(s,r,u,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||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 s,r,n=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,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-e>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let g=this._parser.precedingJoinState;for(let v=e;v<i;++v){if(s=t[v],s<127&&n){let C=n[String.fromCharCode(s)];C&&(s=C.charCodeAt(0))}let y=this._unicodeService.charProperties(s,g);r=Da.extractWidth(y);let b=Da.extractShouldJoin(y),w=b?Da.extractWidth(g):0;if(g=y,o&&this._onA11yChar.fire($o(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-w>l){if(c){let C=m,T=this._activeBuffer.x-w;for(this._activeBuffer.x=w,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),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),w>0&&m instanceof mu&&m.copyCellsFrom(C,T,0,w,!1);T<l;)C.setCellFromCodepoint(T++,0,1,d)}else if(this._activeBuffer.x=l-1,r===2)continue}if(b&&this._activeBuffer.x){let C=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-C,s,r);for(let T=r-w;--T>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(u&&(m.insertCells(this._activeBuffer.x,r-w,this._activeBuffer.getNullCell(d)),m.getWidth(l-1)===2&&m.setCellFromCodepoint(l-1,0,1,d)),m.setCellFromCodepoint(this._activeBuffer.x++,s,r,d),r>0)for(;--r;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=g,this._activeBuffer.x<l&&i-e>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.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=>ZE(i.params[0],this._optionsService.rawOptions.windowOptions)?e(i):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new jE(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Qs(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,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);n.replaceCells(e,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.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 s;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--&&!((s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i))!=null&&s.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,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+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,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;e--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,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(It));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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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,s=Da.extractWidth(e),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),o=new Uint32Array(n.length*i),l=0;for(let u=0;u<n.length;){let d=n.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(le.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(le.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(le.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(le.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(le.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,Ta),this._charsetService.setgCharset(1,Ta),this._charsetService.setgCharset(2,Ta),this._charsetService.setgCharset(3,Ta);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 s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:l,cols:c}=this._bufferService,{active:u,alt:d}=l,m=this._optionsService.rawOptions,g=(b,w)=>(o.triggerDataEvent(`${le.ESC}[${e?"":"?"}${b};${w}$y`),!0),v=b=>b?1:2,y=t.params[0];return e?y===2?g(y,4):y===4?g(y,v(o.modes.insertMode)):y===12?g(y,3):y===20?g(y,v(m.convertEol)):g(y,0):y===1?g(y,v(s.applicationCursorKeys)):y===3?g(y,m.windowOptions.setWinLines?c===80?2:c===132?1:0:0):y===6?g(y,v(s.origin)):y===7?g(y,v(s.wraparound)):y===8?g(y,3):y===9?g(y,v(r==="X10")):y===12?g(y,v(m.cursorBlink)):y===25?g(y,v(!o.isCursorHidden)):y===45?g(y,v(s.reverseWraparound)):y===66?g(y,v(s.applicationKeypad)):y===67?g(y,4):y===1e3?g(y,v(r==="VT200")):y===1002?g(y,v(r==="DRAG")):y===1003?g(y,v(r==="ANY")):y===1004?g(y,v(s.sendFocus)):y===1005?g(y,4):y===1006?g(y,v(n==="SGR")):y===1015?g(y,4):y===1016?g(y,v(n==="SGR_PIXELS")):y===1048?g(y,1):y===47||y===1047||y===1049?g(y,v(u===d)):y===2004?g(y,v(s.bracketedPasteMode)):y===2026?g(y,v(s.synchronizedOutput)):g(y,0)}_updateAttrColor(t,e,i,s,r){return e===2?(t|=50331648,t&=-16777216,t|=Pf.fromColorRGB([i,s,r])):e===5&&(t&=-50331904,t|=33554432|i&255),t}_extractColor(t,e,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=t.params[e+n],t.hasSubParams(e+n)){let o=t.getSubParams(e+n),l=0;do s[1]===5&&(r=1),s[n+l+1+r]=o[l];while(++l<o.length&&l+n+1+r<s.length);break}if(s[1]===5&&n+r>=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+e<t.length&&n+r<s.length);for(let o=2;o<s.length;++o)s[o]===-1&&(s[o]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_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=It.fg,t.bg=It.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,s=this._curAttrData;for(let r=0;r<e;r++)i=t.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(t.hasSubParams(r)?t.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=It.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=It.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(t,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=It.fg&16777215,s.bg&=-67108864,s.bg|=It.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${le.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${le.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(`${le.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=It.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(!ZE(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(`${le.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>VE&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>VE&&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 s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(WE(n))if(r==="?")e.push({type:0,index:n});else{let o=XE(r);o&&e.push({type:1,index:n,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(),s=t.slice(e+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let i=t.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,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 s=0;s<i.length&&!(e>=this._specialColors.length);++s,++e)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let r=XE(i[s]);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 s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let r=parseInt(i[s]);WE(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,Ta),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(uie[t[0]],ni[t[1]]||Ta),!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=It.clone(),this._eraseAttrDataInternal=It.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 lr;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,s=this._activeBuffer.lines.get(i);s&&(s.fill(t),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,e){let i=o=>(this._coreService.triggerDataEvent(`${le.ESC}${o}${le.ESC}\\`),!0),s=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${s.scrollTop+1};${s.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)}},ub=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&&(qE=t,t=e,e=qE),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};ub=Lt([Oe(0,is)],ub);function WE(t){return 0<=t&&t<256}var die=5e7,UE=12,pie=50,mie=class extends je{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 fe),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 s;for(;s=this._writeBuffer.shift();){this._action(s);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>die)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 s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],n=this._action(r,i);if(n){let l=c=>performance.now()-s>=UE?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(s,c);n.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()-s>=UE)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>pie&&(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()}},fb=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 s=e,r=this._getEntryIdKey(s),n=this._entriesWithId.get(r);if(n)return this.addLineToLink(n.id,i.ybase+i.y),n.id;let o=i.addMarker(i.ybase+i.y),l={id:this._nextId++,key:this._getEntryIdKey(s),data:s,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 s=this._dataByLinkId.get(e);if(s&&s.lines.every(r=>r.line!==i)){let r=this._bufferService.buffer.addMarker(i);s.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(s,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 s=e.lines.indexOf(i);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};fb=Lt([Oe(0,is)],fb);var YE=!1,gie=class extends je{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ah),this._onBinary=this._register(new fe),this.onBinary=this._onBinary.event,this._onData=this._register(new fe),this.onData=this._onData.event,this._onLineFeed=this._register(new fe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new fe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new fe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new fe),this._instantiationService=new jte,this.optionsService=this._register(new Fte(e)),this._instantiationService.setService(ss,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ab)),this._instantiationService.setService(is,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ob)),this._instantiationService.setService(oD,this._logService),this.coreService=this._register(this._instantiationService.createInstance(lb)),this._instantiationService.setService(tl,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(hb)),this._instantiationService.setService(nD,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Da)),this._instantiationService.setService(BJ,this.unicodeService),this._charsetService=this._instantiationService.createInstance(tie),this._instantiationService.setService($J,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(fb),this._instantiationService.setService(aD,this._oscLinkService),this._inputHandler=this._register(new fie(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Di.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Di.forward(this._bufferService.onResize,this._onResize)),this._register(Di.forward(this.coreService.onData,this._onData)),this._register(Di.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 mie((i,s)=>this._inputHandler.parse(i,s))),this._register(Di.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new fe),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&&!YE&&(this._logService.warn("writeSync is unreliable and will be removed soon."),YE=!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,ND),i=Math.max(i,jD),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(NE.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(NE(this._bufferService),!1))),this._windowsWrappingHeuristics.value=xt(()=>{for(let i of e)i.dispose()})}}},Oie={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 vie(t,e,i,s){var o;let r={type:0,cancel:!1,key:void 0},n=(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=le.ESC+"OA":r.key=le.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?r.key=le.ESC+"OD":r.key=le.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?r.key=le.ESC+"OC":r.key=le.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?r.key=le.ESC+"OB":r.key=le.ESC+"[B");break;case 8:r.key=t.ctrlKey?"\b":le.DEL,t.altKey&&(r.key=le.ESC+r.key);break;case 9:if(t.shiftKey){r.key=le.ESC+"[Z";break}r.key=le.HT,r.cancel=!0;break;case 13:r.key=t.altKey?le.ESC+le.CR:le.CR,r.cancel=!0;break;case 27:r.key=le.ESC,t.altKey&&(r.key=le.ESC+le.ESC),r.cancel=!0;break;case 37:if(t.metaKey)break;n?r.key=le.ESC+"[1;"+(n+1)+"D":e?r.key=le.ESC+"OD":r.key=le.ESC+"[D";break;case 39:if(t.metaKey)break;n?r.key=le.ESC+"[1;"+(n+1)+"C":e?r.key=le.ESC+"OC":r.key=le.ESC+"[C";break;case 38:if(t.metaKey)break;n?r.key=le.ESC+"[1;"+(n+1)+"A":e?r.key=le.ESC+"OA":r.key=le.ESC+"[A";break;case 40:if(t.metaKey)break;n?r.key=le.ESC+"[1;"+(n+1)+"B":e?r.key=le.ESC+"OB":r.key=le.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(r.key=le.ESC+"[2~");break;case 46:n?r.key=le.ESC+"[3;"+(n+1)+"~":r.key=le.ESC+"[3~";break;case 36:n?r.key=le.ESC+"[1;"+(n+1)+"H":e?r.key=le.ESC+"OH":r.key=le.ESC+"[H";break;case 35:n?r.key=le.ESC+"[1;"+(n+1)+"F":e?r.key=le.ESC+"OF":r.key=le.ESC+"[F";break;case 33:t.shiftKey?r.type=2:t.ctrlKey?r.key=le.ESC+"[5;"+(n+1)+"~":r.key=le.ESC+"[5~";break;case 34:t.shiftKey?r.type=3:t.ctrlKey?r.key=le.ESC+"[6;"+(n+1)+"~":r.key=le.ESC+"[6~";break;case 112:n?r.key=le.ESC+"[1;"+(n+1)+"P":r.key=le.ESC+"OP";break;case 113:n?r.key=le.ESC+"[1;"+(n+1)+"Q":r.key=le.ESC+"OQ";break;case 114:n?r.key=le.ESC+"[1;"+(n+1)+"R":r.key=le.ESC+"OR";break;case 115:n?r.key=le.ESC+"[1;"+(n+1)+"S":r.key=le.ESC+"OS";break;case 116:n?r.key=le.ESC+"[15;"+(n+1)+"~":r.key=le.ESC+"[15~";break;case 117:n?r.key=le.ESC+"[17;"+(n+1)+"~":r.key=le.ESC+"[17~";break;case 118:n?r.key=le.ESC+"[18;"+(n+1)+"~":r.key=le.ESC+"[18~";break;case 119:n?r.key=le.ESC+"[19;"+(n+1)+"~":r.key=le.ESC+"[19~";break;case 120:n?r.key=le.ESC+"[20;"+(n+1)+"~":r.key=le.ESC+"[20~";break;case 121:n?r.key=le.ESC+"[21;"+(n+1)+"~":r.key=le.ESC+"[21~";break;case 122:n?r.key=le.ESC+"[23;"+(n+1)+"~":r.key=le.ESC+"[23~";break;case 123:n?r.key=le.ESC+"[24;"+(n+1)+"~":r.key=le.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=le.NUL:t.keyCode>=51&&t.keyCode<=55?r.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?r.key=le.DEL:t.keyCode===219?r.key=le.ESC:t.keyCode===220?r.key=le.FS:t.keyCode===221&&(r.key=le.GS);else if((!i||s)&&t.altKey&&!t.metaKey){let l=(o=Oie[t.keyCode])==null?void 0:o[t.shiftKey?1:0];if(l)r.key=le.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=le.ESC+u}else if(t.keyCode===32)r.key=le.ESC+(t.ctrlKey?le.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let c=t.code.slice(3,4);t.shiftKey||(c=c.toLowerCase()),r.key=le.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=le.US),t.key==="@"&&(r.key=le.NUL));break}return r}var Dt=0,_ie=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new og,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new og,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((n,o)=>this._getKey(n)-this._getKey(o)),i=0,s=0,r=new Array(this._array.length+this._insertedValues.length);for(let n=0;n<r.length;n++)s>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[s])?(r[n]=e[i],i++):r[n]=this._array[s++];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||(Dt=this._search(i),Dt===-1)||this._getKey(this._array[Dt])!==i)return!1;do if(this._array[Dt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Dt),!0;while(++Dt<this._array.length&&this._getKey(this._array[Dt])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((n,o)=>n-o),i=0,s=new Array(this._array.length-e.length),r=0;for(let n=0;n<this._array.length;n++)e[i]===n?i++:s[r++]=this._array[n];this._array=s,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&&(Dt=this._search(e),!(Dt<0||Dt>=this._array.length)&&this._getKey(this._array[Dt])===e))do yield this._array[Dt];while(++Dt<this._array.length&&this._getKey(this._array[Dt])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Dt=this._search(e),!(Dt<0||Dt>=this._array.length)&&this._getKey(this._array[Dt])===e))do i(this._array[Dt]);while(++Dt<this._array.length&&this._getKey(this._array[Dt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,s=this._array.length-1;for(;s>=i;){let r=i+s>>1,n=this._getKey(this._array[r]);if(n>e)s=r-1;else if(n<e)i=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return i}},Z_=0,HE=0,yie=class extends je{constructor(){super(),this._decorations=new _ie(t=>t==null?void 0:t.marker.line),this._onDecorationRegistered=this._register(new fe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new fe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(xt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new bie(t);if(e){let i=e.marker.onDispose(()=>e.dispose()),s=e.onDispose(()=>{s.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 s=0,r=0;for(let n of this._decorations.getKeyIterator(e))s=n.options.x??0,r=s+(n.options.width??1),t>=s&&t<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(t,e,i,s){this._decorations.forEachByKey(e,r=>{Z_=r.options.x??0,HE=Z_+(r.options.width??1),t>=Z_&&t<HE&&(!i||(r.options.layer??"bottom")===i)&&s(r)})}},bie=class extends Xo{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new fe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new fe),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=Ct.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ct.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Sie=1e3,xie=class{constructor(e,i=Sie){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,s){this._rowCount=s,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 n=r-this._lastRefreshMs,o=this._debounceThresholdMS-n;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)}},FE=20,ag=class extends je{constructor(t,e,i,s){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=s,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 n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,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 xie(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(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
117
|
-
`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Re(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(xt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<FE+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
|
|
118
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===FE+1&&(this._liveRegion.textContent+=Ry.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,s=i.lines.length.toString();for(let r=t;r<=e;r++){let n=i.lines.get(i.ydisp+r),o=[],l=(n==null?void 0:n.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",s),this._alignRowWidth(u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,s=this._rowElements[e===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=e===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||t.relatedTarget!==s)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 s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:((l=s.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,m=parseInt(d==null?void 0:d.getAttribute("aria-posinset"),10)-1;if(isNaN(m))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 v=u<g.length?g[u]:g.slice(-1)[0]+1;return v>=this._terminal.cols&&(++m,v=0),{row:m,column:v}},n=r(e),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.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,n;t.style.transform="";let e=t.getBoundingClientRect().width,i=(n=(r=this._rowColumns.get(t))==null?void 0:r.slice(-1))==null?void 0:n[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${s/e})`}};ag=Lt([Oe(1,ix),Oe(2,Un),Oe(3,Yn)],ag);var db=class extends je{constructor(t,e,i,s,r){super(),this._element=t,this._mouseService=e,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new fe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new fe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(xt(()=>{var n;Ya(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(n=this._activeProviderReplies)==null||n.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Re(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Re(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Re(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Re(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 s=0;s<i.length;s++){let r=i[s];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 s,r;(!this._activeProviderReplies||!e)&&((s=this._activeProviderReplies)==null||s.forEach(n=>{n==null||n.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(let[n,o]of this._linkProviderService.linkProviders.entries())e?(r=this._activeProviderReplies)!=null&&r.get(n)&&(i=this._checkLinkProviderResult(n,t,i)):o.provideLinks(t.y,l=>{var u,d;if(this._isMouseOut)return;let c=l==null?void 0:l.map(m=>({link:m}));(u=this._activeProviderReplies)==null||u.set(n,c),i=this._checkLinkProviderResult(n,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 s=0;s<e.size;s++){let r=e.get(s);if(r)for(let n=0;n<r.length;n++){let o=r[n],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(n--,1);break}i.add(u)}}}}_checkLinkProviderResult(t,e,i){var n;if(!this._activeProviderReplies)return i;let s=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&&s){let o=s.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=(n=this._activeProviderReplies.get(o))==null?void 0:n.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&&wie(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,Ya(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,s;return(s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.pointerCursor},set:i=>{var s;(s=this._currentLink)!=null&&s.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,s;return(s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.underline},set:i=>{var s,r,n;(s=this._currentLink)!=null&&s.state&&((n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.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 s=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>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(t,e,i){var s;(s=this._currentLink)!=null&&s.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,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(t,e,i){var s;(s=this._currentLink)!=null&&s.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,s=t.range.end.y*this._bufferService.cols+t.range.end.x,r=e.y*this._bufferService.cols+e.x;return i<=r&&r<=s}_positionFromMouseEvent(t,e,i){let s=i.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,i,s,r){return{x1:t,y1:e,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};db=Lt([Oe(1,sx),Oe(2,Yn),Oe(3,is),Oe(4,hD)],db);function wie(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 Cie=class extends gie{constructor(e={}){super(e),this._linkifier=this._register(new Ah),this.browser=MD,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ah),this._onCursorMove=this._register(new fe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new fe),this.onKey=this._onKey.event,this._onRender=this._register(new fe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new fe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new fe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new fe),this.onBell=this._onBell.event,this._onFocus=this._register(new fe),this._onBlur=this._register(new fe),this._onA11yCharEmitter=this._register(new fe),this._onA11yTabEmitter=this._register(new fe),this._onWillOpen=this._register(new fe),this._setup(),this._decorationService=this._instantiationService.createInstance(yie),this._instantiationService.setService(Rf,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(pte),this._instantiationService.setService(hD,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Ly)),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(Di.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Di.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Di.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Di.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(xt(()=>{var i,s;this._customKeyEventHandler=void 0,(s=(i=this.element)==null?void 0:i.parentNode)==null||s.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 s,r="";switch(i.index){case 256:s="foreground",r="10";break;case 257:s="background",r="11";break;case 258:s="cursor",r="12";break;default:s="ansi",r="4;"+i.index}switch(i.type){case 0:let n=_t.toColorRGB(s==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${le.ESC}]${r};${cie(n)}${kD.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(o=>o.ansi[i.index]=Ut.toColor(...i.color));else{let o=s;this._themeService.modifyColors(l=>l[o]=Ut.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(ag,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.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(le.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 s=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,n=i.getWidth(s),o=this._renderService.dimensions.css.cell.width*n,l=this.buffer.y*this._renderService.dimensions.css.cell.height,c=s*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(Re(this.element,"copy",i=>{this.hasSelection()&&AJ(i,this._selectionService)}));let e=i=>EJ(i,this.textarea,this.coreService,this.optionsService);this._register(Re(this.textarea,"paste",e)),this._register(Re(this.element,"paste",e)),AD?this._register(Re(this.element,"mousedown",i=>{i.button===2&&oE(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Re(this.element,"contextmenu",i=>{oE(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),ux&&this._register(Re(this.element,"auxclick",i=>{i.button===1&&eD(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Re(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Re(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Re(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Re(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Re(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Re(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Re(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var n;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"),((n=this.element)==null?void 0:n.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(Re(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 s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Py.get()),RD||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",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(fte,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Un,this._coreBrowserService),this._register(Re(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(Re(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(tb,this._document,this._helperContainer),this._instantiationService.setService(Eg,this._charSizeService),this._themeService=this._instantiationService.createInstance(nb),this._instantiationService.setService(Nh,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(rg),this._instantiationService.setService(lD,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(sb,this.rows,this.screenElement)),this._instantiationService.setService(Yn,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(Ky,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(ib),this._instantiationService.setService(sx,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(db,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(Fy,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(rb,this.element,this.screenElement,r)),this._instantiationService.setService(zJ,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(Di.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var o;this._selectionService.refresh(),(o=this._viewport)==null||o.queueSync()})),this._register(this._instantiationService.createInstance(Gy,this.screenElement)),this._register(Re(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(ag,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(sg,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(sg,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(eb,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function s(o){var d,m,g,v,y;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,(v=(g=(m=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:m.device)==null?void 0:g.cell)==null?void 0:v.height,(y=e._coreBrowserService)==null?void 0:y.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},n={mouseup:o=>(s(o),o.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(o)),wheel:o=>(s(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&s(o)},mousemove:o=>{o.buttons||s(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",n.mousemove),r.mousemove=n.mousemove):(i.removeEventListener("mousemove",r.mousemove),r.mousemove=null),o&16?r.wheel||(i.addEventListener("wheel",n.wheel,{passive:!1}),r.wheel=n.wheel):(i.removeEventListener("wheel",r.wheel),r.wheel=null),o&2?r.mouseup||(r.mouseup=n.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),o&4?r.mousedrag||(r.mousedrag=n.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Re(i,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return s(o),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(o)})),this._register(Re(i,"wheel",o=>{var l,c,u,d,m;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,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return this.cancel(o,!0);let g=le.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 s;(s=this._renderService)==null||s.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){JB(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,s){this._selectionService.setSelection(e,i,s)}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 s;(s=this._selectionService)==null||s.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 s=vie(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let r=this.rows-1;return this.scrollLines(s.type===2?-r:r),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.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((s.key===le.ETX||s.key===le.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let s=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"?s:s&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(kie(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 s;(s=this._charSizeService)==null||s.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(It));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(le.ESC+"[I"):this.coreService.triggerDataEvent(le.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${le.ESC}[4;${s};${i}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),n=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${le.ESC}[6;${n};${r}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function kie(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var Tie=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let s={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(s),i.dispose=()=>this._wrappedAddonDispose(s),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let s=0;s<this._addons.length;s++)if(this._addons[s]===e){i=s;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)}},Mie=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 lr)}translateToString(e,i,s){return this._line.translateToString(e,i,s)}},GE=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 Mie(e)}getNullCell(){return new lr}},Aie=class extends je{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new fe),this.onBufferChange=this._onBufferChange.event,this._normal=new GE(this._core.buffers.normal,"normal"),this._alternate=new GE(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)}},Eie=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,s)=>e(i,s.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)}},Pie=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}},Rie=["cols","rows"],zr=0,Qie=class extends je{constructor(t){super(),this._core=this._register(new Cie(t)),this._addonManager=this._register(new Tie),this._publicOptions={...this._core.options};let e=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:e.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(t){if(Rie.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 Eie(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Pie(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 Aie(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 Py.get()},set promptLabel(t){Py.set(t)},get tooMuchOutput(){return Ry.get()},set tooMuchOutput(t){Ry.set(t)}}}_verifyIntegers(...t){for(zr of t)if(zr===1/0||isNaN(zr)||zr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(zr of t)if(zr&&(zr===1/0||isNaN(zr)||zr%1!==0||zr<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 Lie=2,$ie=1,Bie=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 m;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:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,c=o.right+o.left,u=s-l,d=r-c-e;return{cols:Math.max(Lie,Math.floor(d/t.css.cell.width)),rows:Math.max($ie,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 Die=(t,e,i,s)=>{for(var r=e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(r)||r);return r},zie=(t,e)=>(i,s)=>e(i,s,t),Nie=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?KE.isErrorNoTelemetry(t)?new KE(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)}},jie=new Nie;function I_(t){Xie(t)||jie.onUnexpectedError(t)}var pb="Canceled";function Xie(t){return t instanceof Vie?!0:t instanceof Error&&t.name===pb&&t.message===pb}var Vie=class extends Error{constructor(){super(pb),this.name=this.message}},KE=class mb extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof mb)return e;let i=new mb;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Zie;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Zie||(Zie={}));function Iie(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var VD;(t=>{function e(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(k){yield k}t.single=r;function n(k){return e(k)?k:r(k)}t.wrap=n;function o(k){return k||i}t.from=o;function*l(k){for(let P=k.length-1;P>=0;P--)yield k[P]}t.reverse=l;function c(k){return!k||k[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(k){return k[Symbol.iterator]().next().value}t.first=u;function d(k,P){let E=0;for(let z of k)if(P(z,E++))return!0;return!1}t.some=d;function m(k,P){for(let E of k)if(P(E))return E}t.find=m;function*g(k,P){for(let E of k)P(E)&&(yield E)}t.filter=g;function*v(k,P){let E=0;for(let z of k)yield P(z,E++)}t.map=v;function*y(k,P){let E=0;for(let z of k)yield*P(z,E++)}t.flatMap=y;function*b(...k){for(let P of k)yield*P}t.concat=b;function w(k,P,E){let z=E;for(let $ of k)z=P(z,$);return z}t.reduce=w;function*C(k,P,E=k.length){for(P<0&&(P+=k.length),E<0?E+=k.length:E>k.length&&(E=k.length);P<E;P++)yield k[P]}t.slice=C;function T(k,P=Number.POSITIVE_INFINITY){let E=[];if(P===0)return[E,k];let z=k[Symbol.iterator]();for(let $=0;$<P;$++){let Z=z.next();if(Z.done)return[E,t.empty()];E.push(Z.value)}return[E,{[Symbol.iterator](){return z}}]}t.consume=T;async function M(k){let P=[];for await(let E of k)P.push(E);return Promise.resolve(P)}t.asyncToArray=M})(VD||(VD={}));function ZD(t){if(VD.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(s){e.push(s)}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 ID(...t){return Zi(()=>ZD(t))}function Zi(t){return{dispose:Iie(()=>{t()})}}var qD=class WD{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{ZD(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?WD.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)}};qD.DISABLE_DISPOSED_WARNING=!1;var gh=qD,Cr=class{constructor(){this._store=new gh,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)}};Cr.None=Object.freeze({dispose(){}});var su=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}},fx=typeof process<"u"&&"title"in process,Qg=fx?"node":navigator.userAgent,qie=fx?"node":navigator.platform,Wie=Qg.includes("Firefox"),Uie=Qg.includes("Edge"),UD=/^((?!chrome|android).)*safari/i.test(Qg);function Yie(){if(!UD)return 0;let t=Qg.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}qie.indexOf("Linux")>=0;var Hie="",pi=0,mi=0,gi=0,Rt=0,Gs={css:"#00000000",rgba:0},Ki;(t=>{function e(r,n,o,l){return l!==void 0?`#${ba(r)}${ba(n)}${ba(o)}${ba(l)}`:`#${ba(r)}${ba(n)}${ba(o)}`}t.toCss=e;function i(r,n,o,l=255){return(r<<24|n<<16|o<<8|l)>>>0}t.toRgba=i;function s(r,n,o,l){return{css:t.toCss(r,n,o,l),rgba:t.toRgba(r,n,o,l)}}t.toColor=s})(Ki||(Ki={}));var vu;(t=>{function e(c,u){if(Rt=(u.rgba&255)/255,Rt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,m=u.rgba>>16&255,g=u.rgba>>8&255,v=c.rgba>>24&255,y=c.rgba>>16&255,b=c.rgba>>8&255;pi=v+Math.round((d-v)*Rt),mi=y+Math.round((m-y)*Rt),gi=b+Math.round((g-b)*Rt);let w=Ki.toCss(pi,mi,gi),C=Ki.toRgba(pi,mi,gi);return{css:w,rgba:C}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function s(c,u,d){let m=Va.ensureContrastRatio(c.rgba,u.rgba,d);if(m)return Ki.toColor(m>>24&255,m>>16&255,m>>8&255)}t.ensureContrastRatio=s;function r(c){let u=(c.rgba|255)>>>0;return[pi,mi,gi]=Va.toChannels(u),{css:Ki.toCss(pi,mi,gi),rgba:u}}t.opaque=r;function n(c,u){return Rt=Math.round(u*255),[pi,mi,gi]=Va.toChannels(c.rgba),{css:Ki.toCss(pi,mi,gi,Rt),rgba:Ki.toRgba(pi,mi,gi,Rt)}}t.opacity=n;function o(c,u){return Rt=c.rgba&255,n(c,Rt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(vu||(vu={}));var Fie;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(e=n,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return pi=parseInt(r.slice(1,2).repeat(2),16),mi=parseInt(r.slice(2,3).repeat(2),16),gi=parseInt(r.slice(3,4).repeat(2),16),Ki.toColor(pi,mi,gi);case 5:return pi=parseInt(r.slice(1,2).repeat(2),16),mi=parseInt(r.slice(2,3).repeat(2),16),gi=parseInt(r.slice(3,4).repeat(2),16),Rt=parseInt(r.slice(4,5).repeat(2),16),Ki.toColor(pi,mi,gi,Rt);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 n=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(n)return pi=parseInt(n[1]),mi=parseInt(n[2]),gi=parseInt(n[3]),Rt=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Ki.toColor(pi,mi,gi,Rt);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,mi,gi,Rt]=e.getImageData(0,0,1,1).data,Rt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ki.toRgba(pi,mi,gi,Rt),css:r}}t.toColor=s})(Fie||(Fie={}));var Hi;(t=>{function e(s){return i(s>>16&255,s>>8&255,s&255)}t.relativeLuminance=e;function i(s,r,n){let o=s/255,l=r/255,c=n/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),m=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+m*.0722}t.relativeLuminance2=i})(Hi||(Hi={}));var Va;(t=>{function e(o,l){if(Rt=(l&255)/255,Rt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,m=o>>24&255,g=o>>16&255,v=o>>8&255;return pi=m+Math.round((c-m)*Rt),mi=g+Math.round((u-g)*Rt),gi=v+Math.round((d-v)*Rt),Ki.toRgba(pi,mi,gi)}t.blend=e;function i(o,l,c){let u=Hi.relativeLuminance(o>>8),d=Hi.relativeLuminance(l>>8);if(En(u,d)<c){if(d<u){let v=s(o,l,c),y=En(u,Hi.relativeLuminance(v>>8));if(y<c){let b=r(o,l,c),w=En(u,Hi.relativeLuminance(b>>8));return y>w?v:b}return v}let m=r(o,l,c),g=En(u,Hi.relativeLuminance(m>>8));if(g<c){let v=s(o,l,c),y=En(u,Hi.relativeLuminance(v>>8));return g>y?m:v}return m}}t.ensureContrastRatio=i;function s(o,l,c){let u=o>>24&255,d=o>>16&255,m=o>>8&255,g=l>>24&255,v=l>>16&255,y=l>>8&255,b=En(Hi.relativeLuminance2(g,v,y),Hi.relativeLuminance2(u,d,m));for(;b<c&&(g>0||v>0||y>0);)g-=Math.max(0,Math.ceil(g*.1)),v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),b=En(Hi.relativeLuminance2(g,v,y),Hi.relativeLuminance2(u,d,m));return(g<<24|v<<16|y<<8|255)>>>0}t.reduceLuminance=s;function r(o,l,c){let u=o>>24&255,d=o>>16&255,m=o>>8&255,g=l>>24&255,v=l>>16&255,y=l>>8&255,b=En(Hi.relativeLuminance2(g,v,y),Hi.relativeLuminance2(u,d,m));for(;b<c&&(g<255||v<255||y<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=En(Hi.relativeLuminance2(g,v,y),Hi.relativeLuminance2(u,d,m));return(g<<24|v<<16|y<<8|255)>>>0}t.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=n})(Va||(Va={}));function ba(t){let e=t.toString(16);return e.length<2?"0"+e:e}function En(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}function Wt(t){if(!t)throw new Error("value must not be falsy");return t}function dx(t){return 57508<=t&&t<=57558}function Gie(t){return 57520<=t&&t<=57527}function Kie(t){return 57344<=t&&t<=63743}function Jie(t){return 9472<=t&&t<=9631}function ese(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 tse(t,e,i,s){return e===1&&i>Math.ceil(s*1.5)&&t!==void 0&&t>255&&!ese(t)&&!dx(t)&&!Kie(t)}function YD(t){return dx(t)||Jie(t)}function ise(){return{css:{canvas:Dp(),cell:Dp()},device:{canvas:Dp(),cell:Dp(),char:{width:0,height:0,left:0,top:0}}}}function Dp(){return{width:0,height:0}}function sse(t,e,i=0){return(t-(Math.round(e)*2-i))%(Math.round(e)*2)}var Ai=0,hi=0,Nr=!1,Pn=!1,zp=!1,fs,q_=0,rse=class{constructor(t,e,i,s,r,n){this._terminal=t,this._optionService=e,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=r,this._themeService=n,this.result={fg:0,bg:0,ext:0}}resolve(t,e,i,s){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,hi=0,Ai=0,Pn=!1,Nr=!1,zp=!1,fs=this._themeService.colors,q_=0,t.getCode()!==0&&t.extended.underlineStyle===4){let r=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));q_=e*s%(Math.round(r)*2)}if(this._decorationService.forEachDecorationAtCell(e,i,"bottom",r=>{r.backgroundColorRGB&&(hi=r.backgroundColorRGB.rgba>>8&16777215,Pn=!0),r.foregroundColorRGB&&(Ai=r.foregroundColorRGB.rgba>>8&16777215,Nr=!0)}),zp=this._selectionRenderModel.isCellSelected(this._terminal,e,i),zp){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:hi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:hi=(this.result.fg&16777215)<<8|255;break;case 0:default:hi=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:hi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:hi=(this.result.bg&16777215)<<8|255;break}hi=Va.blend(hi,(this._coreBrowserService.isFocused?fs.selectionBackgroundOpaque:fs.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else hi=(this._coreBrowserService.isFocused?fs.selectionBackgroundOpaque:fs.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Pn=!0,fs.selectionForeground&&(Ai=fs.selectionForeground.rgba>>8&16777215,Nr=!0),YD(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Ai=(this._coreBrowserService.isFocused?fs.selectionBackgroundOpaque:fs.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Ai=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Ai=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Ai=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Ai=(this.result.fg&16777215)<<8|255;break;case 0:default:Ai=this._themeService.colors.foreground.rgba}Ai=Va.blend(Ai,(this._coreBrowserService.isFocused?fs.selectionBackgroundOpaque:fs.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Nr=!0}}this._decorationService.forEachDecorationAtCell(e,i,"top",r=>{r.backgroundColorRGB&&(hi=r.backgroundColorRGB.rgba>>8&16777215,Pn=!0),r.foregroundColorRGB&&(Ai=r.foregroundColorRGB.rgba>>8&16777215,Nr=!0)}),Pn&&(zp?hi=t.bg&-16777216&-134217729|hi|50331648:hi=t.bg&-16777216|hi|50331648),Nr&&(Ai=t.fg&-16777216&-67108865|Ai|50331648),this.result.fg&67108864&&(Pn&&!Nr&&((this.result.bg&50331648)===0?Ai=this.result.fg&-134217728|fs.background.rgba>>8&16777215&16777215|50331648:Ai=this.result.fg&-134217728|this.result.bg&67108863,Nr=!0),!Pn&&Nr&&((this.result.fg&50331648)===0?hi=this.result.bg&-67108864|fs.foreground.rgba>>8&16777215&16777215|50331648:hi=this.result.bg&-67108864|this.result.fg&67108863,Pn=!0)),fs=void 0,this.result.bg=Pn?hi:this.result.bg,this.result.fg=Nr?Ai:this.result.fg,this.result.ext&=536870911,this.result.ext|=q_<<29&3758096384}},nse=.5,HD=Wie||Uie?"bottom":"ideographic",ose={"▀":[{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}]},ase={"░":[[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]]},lse={"─":{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.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╍":{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`}},df={"":{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}};df[""]=df[""];df[""]=df[""];function hse(t,e,i,s,r,n,o,l){let c=ose[e];if(c)return cse(t,c,i,s,r,n),!0;let u=ase[e];if(u)return use(t,u,i,s,r,n),!0;let d=lse[e];if(d)return fse(t,d,i,s,r,n,l),!0;let m=df[e];return m?(dse(t,m,i,s,r,n,o,l),!0):!1}function cse(t,e,i,s,r,n){for(let o=0;o<e.length;o++){let l=e[o],c=r/8,u=n/8;t.fillRect(i+l.x*c,s+l.y*u,l.w*c,l.h*u)}}var JE=new Map;function use(t,e,i,s,r,n){let o=JE.get(e);o||(o=new Map,JE.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,m=t.canvas.ownerDocument.createElement("canvas");m.width=u,m.height=d;let g=Wt(m.getContext("2d")),v=new ImageData(u,d),y,b,w,C;if(l.startsWith("#"))y=parseInt(l.slice(1,3),16),b=parseInt(l.slice(3,5),16),w=parseInt(l.slice(5,7),16),C=l.length>7&&parseInt(l.slice(7,9),16)||1;else if(l.startsWith("rgba"))[y,b,w,C]=l.substring(5,l.length-1).split(",").map(T=>parseFloat(T));else throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);for(let T=0;T<d;T++)for(let M=0;M<u;M++)v.data[(T*u+M)*4]=y,v.data[(T*u+M)*4+1]=b,v.data[(T*u+M)*4+2]=w,v.data[(T*u+M)*4+3]=e[T][M]*(C*255);g.putImageData(v,0,0),c=Wt(t.createPattern(m,null)),o.set(l,c)}t.fillStyle=c,t.fillRect(i,s,r,n)}function fse(t,e,i,s,r,n,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/n*r;u=c(.15,d)}else u=c;for(let d of u.split(" ")){let m=d[0],g=FD[m];if(!g){console.error(`Could not find drawing instructions for "${m}"`);continue}let v=d.substring(1).split(",");!v[0]||!v[1]||g(t,GD(v,r,n,i,s,!0,o))}t.stroke(),t.closePath()}}function dse(t,e,i,s,r,n,o,l){let c=new Path2D;c.rect(i,s,r,n),t.clip(c),t.beginPath();let u=o/12;t.lineWidth=l*u;for(let d of e.d.split(" ")){let m=d[0],g=FD[m];if(!g){console.error(`Could not find drawing instructions for "${m}"`);continue}let v=d.substring(1).split(",");!v[0]||!v[1]||g(t,GD(v,r,n,i,s,!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 eP(t,e,i=0){return Math.max(Math.min(t,e),i)}var FD={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 GD(t,e,i,s,r,n,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,n&&u[d]!==0&&(u[d]=eP(Math.round(u[d]+.5)-.5,e,0)),u[d]+=s+l*o;for(let d=1;d<u.length;d+=2)u[d]*=i,n&&u[d]!==0&&(u[d]=eP(Math.round(u[d]+.5)-.5,i,0)),u[d]+=r;return u}var tP=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={}}},iP=class{constructor(){this._data=new tP}set(t,e,i,s,r){this._data.get(t,e)||this._data.set(t,e,new tP),this._data.get(t,e).set(i,s,r)}get(t,e,i,s){var r;return(r=this._data.get(t,e))==null?void 0:r.get(i,s)}clear(){this._data.clear()}},KD=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,s=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){s-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-e))}ms`),this._start();return}s=r}this.clear()}},pse=class extends KD{_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())}}},mse=class extends KD{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},gse=!fx&&"requestIdleCallback"in window?mse:pse,nh=class JD{constructor(){this.fg=0,this.bg=0,this.extended=new e4}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 JD;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}},e4=class t4{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 t4(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ose=globalThis.performance&&typeof globalThis.performance.now=="function",vse=class i4{static create(e){return new i4(e)}constructor(e){this._now=Ose&&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}},Nn;(t=>{t.None=()=>Cr.None;function e(R,Q){return m(R,()=>{},0,void 0,!0,void 0,Q)}t.defer=e;function i(R){return(Q,D=null,I)=>{let L=!1,j;return j=R(U=>{if(!L)return j?j.dispose():L=!0,Q.call(D,U)},null,I),L&&j.dispose(),j}}t.once=i;function s(R,Q,D){return u((I,L=null,j)=>R(U=>I.call(L,Q(U)),null,j),D)}t.map=s;function r(R,Q,D){return u((I,L=null,j)=>R(U=>{Q(U),I.call(L,U)},null,j),D)}t.forEach=r;function n(R,Q,D){return u((I,L=null,j)=>R(U=>Q(U)&&I.call(L,U),null,j),D)}t.filter=n;function o(R){return R}t.signal=o;function l(...R){return(Q,D=null,I)=>{let L=ID(...R.map(j=>j(U=>Q.call(D,U))));return d(L,I)}}t.any=l;function c(R,Q,D,I){let L=D;return s(R,j=>(L=Q(L,j),L),I)}t.reduce=c;function u(R,Q){let D,I={onWillAddFirstListener(){D=R(L.fire,L)},onDidRemoveLastListener(){D==null||D.dispose()}},L=new yt(I);return Q==null||Q.add(L),L.event}function d(R,Q){return Q instanceof Array?Q.push(R):Q&&Q.add(R),R}function m(R,Q,D=100,I=!1,L=!1,j,U){let Y,W,N,G=0,se,ce={leakWarningThreshold:j,onWillAddFirstListener(){Y=R(de=>{G++,W=Q(W,de),I&&!N&&(he.fire(W),W=void 0),se=()=>{let ge=W;W=void 0,N=void 0,(!I||G>1)&&he.fire(ge),G=0},typeof D=="number"?(clearTimeout(N),N=setTimeout(se,D)):N===void 0&&(N=0,queueMicrotask(se))})},onWillRemoveListener(){L&&G>0&&(se==null||se())},onDidRemoveLastListener(){se=void 0,Y.dispose()}},he=new yt(ce);return U==null||U.add(he),he.event}t.debounce=m;function g(R,Q=0,D){return t.debounce(R,(I,L)=>I?(I.push(L),I):[L],Q,void 0,!0,void 0,D)}t.accumulate=g;function v(R,Q=(I,L)=>I===L,D){let I=!0,L;return n(R,j=>{let U=I||!Q(j,L);return I=!1,L=j,U},D)}t.latch=v;function y(R,Q,D){return[t.filter(R,Q,D),t.filter(R,I=>!Q(I),D)]}t.split=y;function b(R,Q=!1,D=[],I){let L=D.slice(),j=R(W=>{L?L.push(W):Y.fire(W)});I&&I.add(j);let U=()=>{L==null||L.forEach(W=>Y.fire(W)),L=null},Y=new yt({onWillAddFirstListener(){j||(j=R(W=>Y.fire(W)),I&&I.add(j))},onDidAddFirstListener(){L&&(Q?setTimeout(U):U())},onDidRemoveLastListener(){j&&j.dispose(),j=null}});return I&&I.add(Y),Y.event}t.buffer=b;function w(R,Q){return(D,I,L)=>{let j=Q(new T);return R(function(U){let Y=j.evaluate(U);Y!==C&&D.call(I,Y)},void 0,L)}}t.chain=w;let C=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(Q){return this.steps.push(Q),this}forEach(Q){return this.steps.push(D=>(Q(D),D)),this}filter(Q){return this.steps.push(D=>Q(D)?D:C),this}reduce(Q,D){let I=D;return this.steps.push(L=>(I=Q(I,L),I)),this}latch(Q=(D,I)=>D===I){let D=!0,I;return this.steps.push(L=>{let j=D||!Q(L,I);return D=!1,I=L,j?L:C}),this}evaluate(Q){for(let D of this.steps)if(Q=D(Q),Q===C)break;return Q}}function M(R,Q,D=I=>I){let I=(...Y)=>U.fire(D(...Y)),L=()=>R.on(Q,I),j=()=>R.removeListener(Q,I),U=new yt({onWillAddFirstListener:L,onDidRemoveLastListener:j});return U.event}t.fromNodeEventEmitter=M;function k(R,Q,D=I=>I){let I=(...Y)=>U.fire(D(...Y)),L=()=>R.addEventListener(Q,I),j=()=>R.removeEventListener(Q,I),U=new yt({onWillAddFirstListener:L,onDidRemoveLastListener:j});return U.event}t.fromDOMEventEmitter=k;function P(R){return new Promise(Q=>i(R)(Q))}t.toPromise=P;function E(R){let Q=new yt;return R.then(D=>{Q.fire(D)},()=>{Q.fire(void 0)}).finally(()=>{Q.dispose()}),Q.event}t.fromPromise=E;function z(R,Q){return R(D=>Q.fire(D))}t.forward=z;function $(R,Q,D){return Q(D),R(I=>Q(I))}t.runAndSubscribe=$;class Z{constructor(Q,D){this._observable=Q,this._counter=0,this._hasChanged=!1;let I={onWillAddFirstListener:()=>{Q.addObserver(this)},onDidRemoveLastListener:()=>{Q.removeObserver(this)}};this.emitter=new yt(I),D&&D.add(this.emitter)}beginUpdate(Q){this._counter++}handlePossibleChange(Q){}handleChange(Q,D){this._hasChanged=!0}endUpdate(Q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ie(R,Q){return new Z(R,Q).emitter.event}t.fromObservable=ie;function F(R){return(Q,D,I)=>{let L=0,j=!1,U={beginUpdate(){L++},endUpdate(){L--,L===0&&(R.reportChanges(),j&&(j=!1,Q.call(D)))},handlePossibleChange(){},handleChange(){j=!0}};R.addObserver(U),R.reportChanges();let Y={dispose(){R.removeObserver(U)}};return I instanceof gh?I.add(Y):Array.isArray(I)&&I.push(Y),Y}}t.fromObservableLight=F})(Nn||(Nn={}));var gb=class Ob{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Ob._idPool++}`,Ob.all.add(this)}start(e){this._stopWatch=new vse,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}}};gb.all=new Set,gb._idPool=0;var _se=gb,yse=-1,s4=class r4{constructor(e,i,s=(r4._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let s=this.threshold;if(s<=0||i<s)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=s*.5;let[n,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(n);let c=new xse(l,n);this._errorHandler(c)}return()=>{let n=this._stacks.get(e.value)||0;this._stacks.set(e.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[s,r]of this._stacks)(!e||i<r)&&(e=[s,r],i=r);return e}};s4._idPool=1;var bse=s4,Sse=class n4{constructor(e){this.value=e}static create(){let e=new Error;return new n4(e.stack??"")}print(){console.warn(this.value.split(`
|
|
146
|
-
`).slice(2).join(`
|
|
147
|
-
`))}},xse=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},wse=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},Cse=0,W_=class{constructor(t){this.value=t,this.id=Cse++}},kse=2,Tse,yt=class{constructor(e){var i,s,r,n;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new bse((e==null?void 0:e.onListenerError)??I_,((s=this._options)==null?void 0:s.leakWarningThreshold)??yse):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new _se(this._options._profName):void 0,this._deliveryQueue=(n=this._options)==null?void 0:n.deliveryQueue}dispose(){var e,i,s,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),(s=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||s.call(i),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,i,s)=>{var l,c,u,d,m;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 v=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new wse(`${g}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(((l=this._options)==null?void 0:l.onListenerError)||I_)(y),Cr.None}if(this._disposed)return Cr.None;i&&(e=e.bind(i));let r=new W_(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Sse.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof W_?(this._deliveryQueue??(this._deliveryQueue=new Mse),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,(m=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||m.call(d,this)),this._size++;let o=Zi(()=>{n==null||n(),this._removeListener(r)});return s instanceof gh?s.add(o):Array.isArray(s)&&s.push(o),o}),this._event}_removeListener(e){var n,o,l,c;if((o=(n=this._options)==null?void 0:n.onWillRemoveListener)==null||o.call(n,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,s=i.indexOf(e);if(s===-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[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*kse<=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 s=((r=this._options)==null?void 0:r.onListenerError)||I_;if(!s){e.value(i);return}try{e.value(i)}catch(n){s(n)}}_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,s,r,n;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(s=this._perfMon)==null||s.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof W_)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(n=this._perfMon)==null||n.stop()}hasListeners(){return this._size>0}},Mse=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}},sP={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}},ru=2,nu,Po=class Hl{constructor(e,i,s){this._document=e,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new iP,this._cacheMapCombined=new iP,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new nh,this._textureSize=512,this._onAddTextureAtlasCanvas=new yt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new yt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=o4(e,this._config.deviceCellWidth*4+ru*2,this._config.deviceCellHeight+ru*2),this._tmpCtx=Wt(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 gse;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}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(Hl.maxAtlasPages&&this._pages.length>=Math.max(4,Hl.maxAtlasPages)){let i=this._pages.filter(u=>u.canvas.width*2<=(Hl.maxTextureSize||4096)).sort((u,d)=>d.canvas.width!==u.canvas.width?d.canvas.width-u.canvas.width:d.percentageUsed-u.percentageUsed),s=-1,r=0;for(let u=0;u<i.length;u++)if(i[u].canvas.width!==r)s=u,r=i[u].canvas.width;else if(u-s===3)break;let n=i.slice(s,s+4),o=n.map(u=>u.glyphs[0].texturePage).sort((u,d)=>u>d?1:-1),l=this.pages.length-n.length,c=this._mergePages(n,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 U_(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,i){let s=e[0].canvas.width*2,r=new U_(this._document,s,e);for(let[n,o]of e.entries()){let l=n*o.canvas.width%s,c=Math.floor(n/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/s,d.sizeClipSpace.y=d.size.y/s,d.texturePosition.x+=l,d.texturePosition.y+=c,d.texturePositionClipSpace.x=d.texturePosition.x/s,d.texturePositionClipSpace.y=d.texturePosition.y/s;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 s=this._pages[i];for(let r of s.glyphs)r.texturePage--;s.version++}}getRasterizedGlyphCombinedChar(e,i,s,r,n,o){return this._getFromCacheMap(this._cacheMapCombined,e,i,s,r,n,o)}getRasterizedGlyph(e,i,s,r,n,o){return this._getFromCacheMap(this._cacheMap,e,i,s,r,n,o)}_getFromCacheMap(e,i,s,r,n,o,l){return nu=e.get(i,s,r,n),nu||(nu=this._drawToCache(i,s,r,n,o,l),e.set(i,s,r,n,nu)),nu}_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,s,r){if(this._config.allowTransparency)return Gs;let n;switch(e){case 16777216:case 33554432:n=this._getColorFromAnsiIndex(i);break;case 50331648:let o=nh.toColorRGB(i);n=Ki.toColor(o[0],o[1],o[2]);break;case 0:default:s?n=vu.opaque(this._config.colors.foreground):n=this._config.colors.background;break}return this._config.allowTransparency||(n=vu.opaque(n)),n}_getForegroundColor(e,i,s,r,n,o,l,c,u,d){let m=this._getMinimumContrastColor(e,i,s,r,n,o,l,u,c,d);if(m)return m;let g;switch(n){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&u&&o<8&&(o+=8),g=this._getColorFromAnsiIndex(o);break;case 50331648:let v=nh.toColorRGB(o);g=Ki.toColor(v[0],v[1],v[2]);break;case 0:default:l?g=this._config.colors.background:g=this._config.colors.foreground}return this._config.allowTransparency&&(g=vu.opaque(g)),c&&(g=vu.multiplyOpacity(g,nse)),g}_resolveBackgroundRgba(e,i,s){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return s?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,i,s,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 s?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,i,s,r,n,o,l,c,u,d){if(this._config.minimumContrastRatio===1||d)return;let m=this._getContrastCache(u),g=m.getColor(e,r);if(g!==void 0)return g||void 0;let v=this._resolveBackgroundRgba(i,s,l),y=this._resolveForegroundRgba(n,o,l,c),b=Va.ensureContrastRatio(v,y,this._config.minimumContrastRatio/(u?2:1));if(!b){m.setColor(e,r,null);return}let w=Ki.toColor(b>>24&255,b>>16&255,b>>8&255);return m.setColor(e,r,w),w}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,i,s,r,n,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)+ru*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<c&&(this._tmpCanvas.width=c);let u=Math.min(this._config.deviceCellHeight+ru*4,this._textureSize);if(this._tmpCanvas.height<u&&(this._tmpCanvas.height=u),this._tmpCtx.save(),this._workAttributeData.fg=s,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=r,!!this._workAttributeData.isInvisible())return sP;let d=!!this._workAttributeData.isBold(),m=!!this._workAttributeData.isInverse(),g=!!this._workAttributeData.isDim(),v=!!this._workAttributeData.isItalic(),y=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),w=!!this._workAttributeData.isOverline(),C=this._workAttributeData.getFgColor(),T=this._workAttributeData.getFgColorMode(),M=this._workAttributeData.getBgColor(),k=this._workAttributeData.getBgColorMode();if(m){let W=C;C=M,M=W;let N=T;T=k,k=N}let P=this._getBackgroundColor(k,M,m,g);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=P.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,z=v?"italic":"";this._tmpCtx.font=`${z} ${E} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=HD;let $=l.length===1&&dx(l.charCodeAt(0)),Z=l.length===1&&Gie(l.charCodeAt(0)),ie=this._getForegroundColor(i,k,M,s,T,C,m,g,d,YD(l.charCodeAt(0)));this._tmpCtx.fillStyle=ie.css;let F=Z?0:ru*2,R=!1;this._config.customGlyphs!==!1&&(R=hse(this._tmpCtx,l,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Q=!$,D;if(typeof e=="number"?D=this._unicodeService.wcwidth(e):D=this._unicodeService.getStringCellWidth(e),y){this._tmpCtx.save();let W=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=W%2===1?.5:0;if(this._tmpCtx.lineWidth=W,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Q=!1,this._tmpCtx.strokeStyle=`rgb(${nh.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Q=!1;let ge=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ge<8&&(ge+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ge).css}this._tmpCtx.beginPath();let G=F,se=Math.ceil(F+this._config.deviceCharHeight)-N-(n?W*2:0),ce=se+W,he=se+W*2,de=this._workAttributeData.getUnderlineVariantOffset();for(let ge=0;ge<D;ge++){this._tmpCtx.save();let Me=G+ge*this._config.deviceCellWidth,ye=G+(ge+1)*this._config.deviceCellWidth,mt=Me+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Me,se),this._tmpCtx.lineTo(ye,se),this._tmpCtx.moveTo(Me,he),this._tmpCtx.lineTo(ye,he);break;case 3:let Ft=W<=1?he:Math.ceil(F+this._config.deviceCharHeight-W/2)-N,Gt=W<=1?se:Math.ceil(F+this._config.deviceCharHeight+W/2)-N,oi=new Path2D;oi.rect(Me,se,this._config.deviceCellWidth,he-se),this._tmpCtx.clip(oi),this._tmpCtx.moveTo(Me-this._config.deviceCellWidth/2,ce),this._tmpCtx.bezierCurveTo(Me-this._config.deviceCellWidth/2,Gt,Me,Gt,Me,ce),this._tmpCtx.bezierCurveTo(Me,Ft,mt,Ft,mt,ce),this._tmpCtx.bezierCurveTo(mt,Gt,ye,Gt,ye,ce),this._tmpCtx.bezierCurveTo(ye,Ft,ye+this._config.deviceCellWidth/2,Ft,ye+this._config.deviceCellWidth/2,ce);break;case 4:let Pe=de===0?0:de>=W?W*2-de:W-de;de>=W||Pe===0?(this._tmpCtx.setLineDash([Math.round(W),Math.round(W)]),this._tmpCtx.moveTo(Me+Pe,se),this._tmpCtx.lineTo(ye,se)):(this._tmpCtx.setLineDash([Math.round(W),Math.round(W)]),this._tmpCtx.moveTo(Me,se),this._tmpCtx.lineTo(Me+Pe,se),this._tmpCtx.moveTo(Me+Pe+W,se),this._tmpCtx.lineTo(ye,se)),de=sse(ye-Me,W,de);break;case 5:let ln=.6,Vh=.3,Zh=ye-Me,Ih=Math.floor(ln*Zh),il=Math.floor(Vh*Zh),qh=Zh-Ih-il;this._tmpCtx.setLineDash([Ih,il,qh]),this._tmpCtx.moveTo(Me,se),this._tmpCtx.lineTo(ye,se);break;case 1:default:this._tmpCtx.moveTo(Me,se),this._tmpCtx.lineTo(ye,se);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 ge=this._tmpCtx.measureText(l);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ge&&ge.actualBoundingBoxDescent>0){this._tmpCtx.save();let Me=new Path2D;Me.rect(G,se-Math.ceil(W/2),this._config.deviceCellWidth*D,he-se+Math.ceil(W/2)),this._tmpCtx.clip(Me),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=P.css,this._tmpCtx.strokeText(l,F,F+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(w){let W=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=W%2===1?.5:0;this._tmpCtx.lineWidth=W,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+N),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*D,F+N),this._tmpCtx.stroke()}if(R||this._tmpCtx.fillText(l,F,F+this._config.deviceCharHeight),l==="_"&&!this._config.allowTransparency){let W=Y_(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),P,ie,Q);if(W)for(let N=1;N<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=P.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(l,F,F+this._config.deviceCharHeight-N),W=Y_(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),P,ie,Q),!!W);N++);}if(b){let W=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),N=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=W,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*D,F+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.stroke()}this._tmpCtx.restore();let I=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),L;if(this._config.allowTransparency?L=Ase(I):L=Y_(I,P,ie,Q),L)return sP;let j=this._findGlyphBoundingBox(I,this._workBoundingBox,c,Z,R,F),U,Y;for(;;){if(this._activePages.length===0){let W=this._createNewPage();U=W,Y=W.currentRow,Y.height=j.size.y;break}U=this._activePages[this._activePages.length-1],Y=U.currentRow;for(let W of this._activePages)j.size.y<=W.currentRow.height&&(U=W,Y=W.currentRow);for(let W=this._activePages.length-1;W>=0;W--)for(let N of this._activePages[W].fixedRows)N.height<=Y.height&&j.size.y<=N.height&&(U=this._activePages[W],Y=N);if(j.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new U_(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),U=this._overflowSizePage,Y=this._overflowSizePage.currentRow,Y.x+j.size.x>=U.canvas.width&&(Y.x=0,Y.y+=Y.height,Y.height=0);break}if(Y.y+j.size.y>=U.canvas.height||Y.height>j.size.y+2){let W=!1;if(U.currentRow.y+U.currentRow.height+j.size.y>=U.canvas.height){let N;for(let G of this._activePages)if(G.currentRow.y+G.currentRow.height+j.size.y<G.canvas.height){N=G;break}if(N)U=N;else if(Hl.maxAtlasPages&&this._pages.length>=Hl.maxAtlasPages&&Y.y+j.size.y<=U.canvas.height&&Y.height>=j.size.y&&Y.x+j.size.x<=U.canvas.width)W=!0;else{let G=this._createNewPage();U=G,Y=G.currentRow,Y.height=j.size.y,W=!0}}W||(U.currentRow.height>0&&U.fixedRows.push(U.currentRow),Y={x:0,y:U.currentRow.y+U.currentRow.height,height:j.size.y},U.fixedRows.push(Y),U.currentRow={x:0,y:Y.y+Y.height,height:0})}if(Y.x+j.size.x<=U.canvas.width)break;Y===U.currentRow?(Y.x=0,Y.y+=Y.height,Y.height=0):U.fixedRows.splice(U.fixedRows.indexOf(Y),1)}return j.texturePage=this._pages.indexOf(U),j.texturePosition.x=Y.x,j.texturePosition.y=Y.y,j.texturePositionClipSpace.x=Y.x/U.canvas.width,j.texturePositionClipSpace.y=Y.y/U.canvas.height,j.sizeClipSpace.x/=U.canvas.width,j.sizeClipSpace.y/=U.canvas.height,Y.height=Math.max(Y.height,j.size.y),Y.x+=j.size.x,U.ctx.putImageData(I,j.texturePosition.x-this._workBoundingBox.left,j.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,j.size.x,j.size.y),U.addGlyph(j),U.version++,j}_findGlyphBoundingBox(e,i,s,r,n,o){i.top=0;let l=r?this._config.deviceCellHeight:this._tmpCanvas.height,c=r?this._config.deviceCellWidth:s,u=!1;for(let d=0;d<l;d++){for(let m=0;m<c;m++){let g=d*this._tmpCanvas.width*4+m*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 m=0;m<l;m++){let g=m*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 m=0;m<l;m++){let g=m*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 m=0;m<c;m++){let g=d*this._tmpCanvas.width*4+m*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||n?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+o+(r||n?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},U_=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 s of i)this._glyphs.push(...s.glyphs),this._usedPixels+=s._usedPixels;this.canvas=o4(t,e,e),this.ctx=Wt(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 Y_(t,e,i,s){let r=e.rgba>>>24,n=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(n-c)+Math.abs(o-u))/12),m=!0;for(let g=0;g<t.data.length;g+=4)t.data[g]===r&&t.data[g+1]===n&&t.data[g+2]===o||s&&Math.abs(t.data[g]-r)+Math.abs(t.data[g+1]-n)+Math.abs(t.data[g+2]-o)<d?t.data[g+3]=0:m=!1;return m}function Ase(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}function o4(t,e,i){let s=t.createElement("canvas");return s.width=e,s.height=i,s}function Ese(t,e,i,s,r,n,o,l){let c={foreground:n.foreground,background:n.background,cursor:Gs,cursorAccent:Gs,selectionForeground:Gs,selectionBackgroundTransparent:Gs,selectionBackgroundOpaque:Gs,selectionInactiveBackgroundTransparent:Gs,selectionInactiveBackgroundOpaque:Gs,overviewRulerBorder:Gs,scrollbarSliderBackground:Gs,scrollbarSliderHoverBackground:Gs,scrollbarSliderActiveBackground:Gs,ansi:n.ansi.slice(),contrastCache:n.contrastCache,halfContrastCache:n.halfContrastCache};return{customGlyphs:r.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:l,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:i,deviceCharHeight:s,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,drawBoldTextInBrightColors:r.drawBoldTextInBrightColors,minimumContrastRatio:r.minimumContrastRatio,colors:c}}function rP(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 Pse(t){return(t&50331648)===16777216||(t&50331648)===33554432}var er=[];function a4(t,e,i,s,r,n,o,l,c){let u=Ese(s,r,n,o,e,i,l,c);for(let g=0;g<er.length;g++){let v=er[g],y=v.ownedBy.indexOf(t);if(y>=0){if(rP(v.config,u))return v.atlas;v.ownedBy.length===1?(v.atlas.dispose(),er.splice(g,1)):v.ownedBy.splice(y,1);break}}for(let g=0;g<er.length;g++){let v=er[g];if(rP(v.config,u))return v.ownedBy.push(t),v.atlas}let d=t._core,m={atlas:new Po(document,u,d.unicodeService),config:u,ownedBy:[t]};return er.push(m),m.atlas}function nP(t){for(let e=0;e<er.length;e++){let i=er[e].ownedBy.indexOf(t);if(i!==-1){er[e].ownedBy.length===1?(er[e].atlas.dispose(),er.splice(e,1)):er[e].ownedBy.splice(i,1);break}}}var Np=600,Rse=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=Np){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=Np-(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=Np-(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})},Np)},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 oP(t,e,i){let s=new e.ResizeObserver(r=>{let n=r.find(c=>c.target===t);if(!n)return;if(!("devicePixelContentBoxSize"in n)){s==null||s.disconnect(),s=void 0;return}let o=n.devicePixelContentBoxSize[0].inlineSize,l=n.devicePixelContentBoxSize[0].blockSize;o>0&&l>0&&i(o,l)});try{s.observe(t,{box:["device-pixel-content-box"]})}catch{s.disconnect(),s=void 0}return Zi(()=>s==null?void 0:s.disconnect())}function Qse(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var aP=class l4 extends nh{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new e4,this.combinedData=""}static fromCharData(e){let i=new l4;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?Qse(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 s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-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()]}},h4=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function c4(t,e,i){let s=Wt(t.createProgram());if(t.attachShader(s,Wt(lP(t,t.VERTEX_SHADER,e))),t.attachShader(s,Wt(lP(t,t.FRAGMENT_SHADER,i))),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS))return s;console.error(t.getProgramInfoLog(s)),t.deleteProgram(s)}function lP(t,e,i){let s=Wt(t.createShader(e));if(t.shaderSource(s,i),t.compileShader(s),t.getShaderParameter(s,t.COMPILE_STATUS))return s;console.error(t.getShaderInfoLog(s)),t.deleteShader(s)}function Lse(t,e){let i=Math.min(t.length*2,e),s=new Float32Array(i);for(let r=0;r<t.length;r++)s[r]=t[r];return s}var $se=class{constructor(t){this.texture=t,this.version=-1}},Bse=`#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 Dse(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 Ro=11,Il=Ro*Float32Array.BYTES_PER_ELEMENT,zse=2,At=0,vt,H_=0,ou=0,Nse=class extends Cr{constructor(t,e,i,s){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._optionsService=s,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let r=this._gl;Po.maxAtlasPages===void 0&&(Po.maxAtlasPages=Math.min(32,Wt(r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS))),Po.maxTextureSize=Wt(r.getParameter(r.MAX_TEXTURE_SIZE))),this._program=Wt(c4(r,Bse,Dse(Po.maxAtlasPages))),this._register(Zi(()=>r.deleteProgram(this._program))),this._projectionLocation=Wt(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=Wt(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=Wt(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Zi(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,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(Zi(()=>r.deleteBuffer(c))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,c),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=Wt(r.createBuffer()),this._register(Zi(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,Il,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,Il,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,1,r.FLOAT,!1,Il,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,Il,5*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(6),r.vertexAttribPointer(6,2,r.FLOAT,!1,Il,7*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(6,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,Il,9*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.useProgram(this._program);let u=new Int32Array(Po.maxAtlasPages);for(let d=0;d<Po.maxAtlasPages;d++)u[d]=d;r.uniform1iv(this._textureLocation,u),r.uniformMatrix4fv(this._projectionLocation,!1,h4),this._atlasTextures=[];for(let d=0;d<Po.maxAtlasPages;d++){let m=new $se(Wt(r.createTexture()));this._register(Zi(()=>r.deleteTexture(m.texture))),r.activeTexture(r.TEXTURE0+d),r.bindTexture(r.TEXTURE_2D,m.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]=m}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,s,r,n,o,l,c){this._updateCell(this._vertices.attributes,t,e,i,s,r,n,o,l,c)}_updateCell(t,e,i,s,r,n,o,l,c,u){if(At=(i*this._terminal.cols+e)*Ro,s===0||s===void 0){t.fill(0,At,At+Ro-1-zse);return}this._atlas&&(l&&l.length>1?vt=this._atlas.getRasterizedGlyphCombinedChar(l,r,n,o,!1,this._terminal.element):vt=this._atlas.getRasterizedGlyph(s,r,n,o,!1,this._terminal.element),H_=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r!==u&&vt.offset.x>H_?(ou=vt.offset.x-H_,t[At]=-(vt.offset.x-ou)+this._dimensions.device.char.left,t[At+1]=-vt.offset.y+this._dimensions.device.char.top,t[At+2]=(vt.size.x-ou)/this._dimensions.device.canvas.width,t[At+3]=vt.size.y/this._dimensions.device.canvas.height,t[At+4]=vt.texturePage,t[At+5]=vt.texturePositionClipSpace.x+ou/this._atlas.pages[vt.texturePage].canvas.width,t[At+6]=vt.texturePositionClipSpace.y,t[At+7]=vt.sizeClipSpace.x-ou/this._atlas.pages[vt.texturePage].canvas.width,t[At+8]=vt.sizeClipSpace.y):(t[At]=-vt.offset.x+this._dimensions.device.char.left,t[At+1]=-vt.offset.y+this._dimensions.device.char.top,t[At+2]=vt.size.x/this._dimensions.device.canvas.width,t[At+3]=vt.size.y/this._dimensions.device.canvas.height,t[At+4]=vt.texturePage,t[At+5]=vt.texturePositionClipSpace.x,t[At+6]=vt.texturePositionClipSpace.y,t[At+7]=vt.sizeClipSpace.x,t[At+8]=vt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&tse(s,c,vt.size.x,this._dimensions.device.cell.width)&&(t[At+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*Ro;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 s=0;s<t.rows;s++)for(let r=0;r<t.cols;r++)this._vertices.attributes[i+9]=r/t.cols,this._vertices.attributes[i+10]=s/t.rows,i+=Ro}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],s=0;for(let r=0;r<t.lineLengths.length;r++){let n=r*this._terminal.cols*Ro,o=this._vertices.attributes.subarray(n,n+t.lineLengths[r]*Ro);i.set(o,s),s+=o.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,s),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,s/Ro)}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}},jse=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,s=!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,n=e[1]-r,o=i[1]-r,l=Math.max(n,0),c=Math.min(o,t.rows-1);if(l>=t.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,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 Xse(){return new jse}var lg=4,um=1,fm=2,F_=3,Vse=2147483648,Zse=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=Xse()}resize(t,e){let i=t*e*lg;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)}},Ise=`#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
|
-
}`,qse=`#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
|
-
}`,$n=8,G_=$n*Float32Array.BYTES_PER_ELEMENT,Wse=20*$n,hP=class{constructor(){this.attributes=new Float32Array(Wse),this.count=0}},Rn=0,cP=0,uP=0,fP=0,dP=0,pP=0,mP=0,Use=class extends Cr{constructor(t,e,i,s){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=s,this._vertices=new hP,this._verticesCursor=new hP;let r=this._gl;this._program=Wt(c4(r,Ise,qse)),this._register(Zi(()=>r.deleteProgram(this._program))),this._projectionLocation=Wt(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Zi(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,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(Zi(()=>r.deleteBuffer(c))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,c),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=Wt(r.createBuffer()),this._register(Zi(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,G_,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,G_,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,G_,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.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,h4),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,s=1,r,n,o,l,c,u,d,m,g,v,y;for(r=0;r<e.rows;r++){for(o=-1,l=0,c=0,u=!1,n=0;n<e.cols;n++)d=(r*e.cols+n)*lg,m=t.cells[d+um],g=t.cells[d+fm],v=!!(g&67108864),(m!==l||g!==c&&(u||v))&&((l!==0||u&&c!==0)&&(y=s++*$n,this._updateRectangle(i,y,c,l,o,n,r)),o=n,l=m,c=g,u=v);(l!==0||u&&c!==0)&&(y=s++*$n,this._updateRectangle(i,y,c,l,o,e.cols,r))}i.count=s}updateCursor(t){let e=this._verticesCursor,i=t.cursor;if(!i||i.style==="block"){e.count=0;return}let s,r=0;(i.style==="bar"||i.style==="outline")&&(s=r++*$n,this._addRectangleFloat(e.attributes,s,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")&&(s=r++*$n,this._addRectangleFloat(e.attributes,s,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"&&(s=r++*$n,this._addRectangleFloat(e.attributes,s,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),s=r++*$n,this._addRectangleFloat(e.attributes,s,(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,s,r,n,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Rn=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Rn=(i&16777215)<<8;break;case 0:default:Rn=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:Rn=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Rn=(s&16777215)<<8;break;case 0:default:Rn=this._themeService.colors.background.rgba}t.attributes.length<e+4&&(t.attributes=Lse(t.attributes,this._terminal.rows*this._terminal.cols*$n)),cP=r*this._dimensions.device.cell.width,uP=o*this._dimensions.device.cell.height,fP=(Rn>>24&255)/255,dP=(Rn>>16&255)/255,pP=(Rn>>8&255)/255,mP=1,this._addRectangle(t.attributes,e,cP,uP,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,fP,dP,pP,mP)}_addRectangle(t,e,i,s,r,n,o,l,c,u){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=s/this._dimensions.device.canvas.height,t[e+2]=r/this._dimensions.device.canvas.width,t[e+3]=n/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,s,r,n,o){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=s/this._dimensions.device.canvas.height,t[e+2]=r/this._dimensions.device.canvas.width,t[e+3]=n/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])}},Yse=class extends Cr{constructor(t,e,i,s,r,n,o,l){super(),this._container=e,this._alpha=r,this._coreBrowserService=n,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=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(c=>{this._refreshCharAtlas(t,c),this.reset(t)})),this._register(Zi(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=Wt(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,s=!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=a4(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,s){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(t,e,i,s){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=HD,this._clipCell(i,s,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*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 s=e?t.options.fontWeightBold:t.options.fontWeight;return`${i?"italic":""} ${s} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},Hse=class extends Yse{constructor(t,e,i,s,r,n,o){super(i,t,"link",e,!0,r,n,o),this._register(s.onShowLinkUnderline(l=>this._handleShowLinkUnderline(l))),this._register(s.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&&Pse(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()}},za=typeof window=="object"?window:globalThis,vb=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new yt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new yt,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 s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,e),this._onDidChangeZoomLevel.fire(s)}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 s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,e),this._onDidChangeFullscreen.fire(s)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};vb.INSTANCE=new vb;var u4=vb;function Fse(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}u4.INSTANCE.onDidChangeZoomLevel;u4.INSTANCE.onDidChangeFullscreen;var Xh=typeof navigator=="object"?navigator.userAgent:"";Xh.indexOf("Firefox")>=0;Xh.indexOf("AppleWebKit")>=0;var Gse=Xh.indexOf("Chrome")>=0;!Gse&&Xh.indexOf("Safari")>=0;Xh.indexOf("Electron/")>=0;Xh.indexOf("Android")>=0;var K_=!1;if(typeof za.matchMedia=="function"){let t=za.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=za.matchMedia("(display-mode: fullscreen)");K_=t.matches,Fse(za,t,({matches:i})=>{K_&&e.matches||(K_=i)})}var oh="en",J_=!1,f4=!1,jp,dm=oh,gP=oh,Kse,Or,Za=globalThis,Li,EP;typeof Za.vscode<"u"&&typeof Za.vscode.process<"u"?Li=Za.vscode.process:typeof process<"u"&&typeof((EP=process==null?void 0:process.versions)==null?void 0:EP.node)=="string"&&(Li=process);var PP,Jse=typeof((PP=Li==null?void 0:Li.versions)==null?void 0:PP.electron)=="string",ere=Jse&&(Li==null?void 0:Li.type)==="renderer",RP;if(typeof Li=="object"){Li.platform,Li.platform,J_=Li.platform==="linux",J_&&Li.env.SNAP&&Li.env.SNAP_REVISION,Li.env.CI||Li.env.BUILD_ARTIFACTSTAGINGDIRECTORY,jp=oh,dm=oh;let t=Li.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);jp=e.userLocale,gP=e.osLocale,dm=e.resolvedLanguage||oh,Kse=(RP=e.languagePack)==null?void 0:RP.translationsConfigFile}catch{}f4=!0}else typeof navigator=="object"&&!ere?(Or=navigator.userAgent,Or.indexOf("Windows")>=0,Or.indexOf("Macintosh")>=0,(Or.indexOf("Macintosh")>=0||Or.indexOf("iPad")>=0||Or.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,J_=Or.indexOf("Linux")>=0,(Or==null?void 0:Or.indexOf("Mobi"))>=0,dm=globalThis._VSCODE_NLS_LANGUAGE||oh,jp=navigator.language.toLowerCase(),gP=jp):console.error("Unable to resolve platform.");var OP=f4,rn=Or,Mo=dm,tre;(t=>{function e(){return Mo}t.value=e;function i(){return Mo.length===2?Mo==="en":Mo.length>=3?Mo[0]==="e"&&Mo[1]==="n"&&Mo[2]==="-":!1}t.isDefaultVariant=i;function s(){return Mo==="en"}t.isDefault=s})(tre||(tre={}));var ire=typeof Za.postMessage=="function"&&!Za.importScripts;(()=>{if(ire){let t=[];Za.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.id===i.data.vscodeScheduleAsyncWork){t.splice(s,1),n.callback();return}}});let e=0;return i=>{let s=++e;t.push({id:s,callback:i}),Za.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var sre=!!(rn&&rn.indexOf("Chrome")>=0);rn&&rn.indexOf("Firefox")>=0;!sre&&rn&&rn.indexOf("Safari")>=0;rn&&rn.indexOf("Edg/")>=0;rn&&rn.indexOf("Android")>=0;var ql=typeof navigator=="object"?navigator:{};OP||document.queryCommandSupported&&document.queryCommandSupported("copy")||ql&&ql.clipboard&&ql.clipboard.writeText,OP||ql&&ql.clipboard&&ql.clipboard.readText;var px=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}},e1=new px,vP=new px,_P=new px;new Array(230);var rre;(t=>{function e(l){return e1.keyCodeToStr(l)}t.toString=e;function i(l){return e1.strToKeyCode(l)}t.fromString=i;function s(l){return vP.keyCodeToStr(l)}t.toUserSettingsUS=s;function r(l){return _P.keyCodeToStr(l)}t.toUserSettingsGeneral=r;function n(l){return vP.strToKeyCode(l)||_P.strToKeyCode(l)}t.fromUserSettings=n;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 e1.keyCodeToStr(l)}t.toElectronAccelerator=o})(rre||(rre={}));var d4=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),nre;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof ore?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Nn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:d4})})(nre||(nre={}));var ore=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?d4:(this._emitter||(this._emitter=new yt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},are;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(are||(are={}));var yP=class Ks{static fromArray(e){return new Ks(i=>{i.emitMany(e)})}static fromPromise(e){return new Ks(async i=>{i.emitMany(await e)})}static fromPromises(e){return new Ks(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new Ks(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new yt,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.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 Nn.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 Ks(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return Ks.map(this,e)}static filter(e,i){return new Ks(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return Ks.filter(this,e)}static coalesce(e){return Ks.filter(e,i=>!!i)}coalesce(){return Ks.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return Ks.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())}};yP.EMPTY=yP.fromArray([]);var{getWindow:lre}=(function(){let t=new Map,e={window:za,disposables:new gh};t.set(za.vscodeWindowId,e);let i=new yt,s=new yt,r=new yt;function n(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(t.has(o.vscodeWindowId))return Cr.None;let l=new gh,c={window:o,disposables:l.add(new gh)};return t.set(o.vscodeWindowId,c),l.add(Zi(()=>{t.delete(o.vscodeWindowId),s.fire(o)})),l.add(_b(o,cre.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:n,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:za},getDocument(o){return lre(o).document}}})(),hre=class{constructor(t,e,i,s){this._node=t,this._type=e,this._handler=i,this._options=s||!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 _b(t,e,i,s){return new hre(t,e,i,s)}var cre={BEFORE_UNLOAD:"beforeunload"},ure=class extends Cr{constructor(t,e,i,s,r,n,o,l,c){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=l,this._cursorBlinkStateManager=new su,this._charAtlasDisposable=this._register(new su),this._observerDisposable=this._register(new su),this._model=new Zse,this._workCell=new aP,this._workCell2=new aP,this._rectangleRenderer=this._register(new su),this._glyphRenderer=this._register(new su),this._onChangeTextureAtlas=this._register(new yt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new yt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new yt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new yt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new yt),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 rse(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Hse(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=ise(),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(_b(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(_b(this._canvas,"webglcontextrestored",d=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,nP(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=oP(this._canvas,this._coreBrowserService.window,(d,m)=>this._setCanvasDevicePixelDimensions(d,m)),this._register(this._coreBrowserService.onWindowChange(d=>{this._observerDisposable.value=oP(this._canvas,d,(m,g)=>this._setCanvasDevicePixelDimensions(m,g))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Zi(()=>{var d;for(let m of this._renderLayers)m.dispose();(d=this._canvas.parentElement)==null||d.removeChild(this._canvas),nP(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,s,r,n;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),(s=this._rectangleRenderer.value)==null||s.handleResize(),(r=this._glyphRenderer.value)==null||r.setDimensions(this.dimensions),(n=this._glyphRenderer.value)==null||n.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 s of this._renderLayers)s.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 Use(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Nse(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=a4(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=ID(Nn.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Nn.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 s of this._renderLayers)s.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 Rse(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let i=this._core,s=this._workCell,r,n,o,l,c,u,d=0,m=!0,g,v,y,b,w,C,T,M,k;t=bP(t,i.rows-1,0),e=bP(e,i.rows-1,0);let P=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",E=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,z=E-i.buffer.ydisp,$=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),Z=-1,ie=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let F=!1;for(n=t;n<=e;n++)for(o=n+i.buffer.ydisp,l=i.buffer.lines.get(o),this._model.lineLengths[n]=0,y=E===o,d=0,c=this._characterJoinerService.getJoinedCharacters(o),M=0;M<i.cols;M++){if(r=this._cellColorResolver.result.bg,l.loadCell(M,s),M===0&&(r=this._cellColorResolver.result.bg),u=!1,m=M>=d,g=M,c.length>0&&M===c[0][0]&&m){v=c.shift();let R=this._model.selection.isCellSelected(this._terminal,v[0],o);for(T=v[0]+1;T<v[1];T++)m&&(m=R===this._model.selection.isCellSelected(this._terminal,T,o));m&&(m=!y||$<v[0]||$>=v[1]),m?(u=!0,s=new fre(s,l.translateToString(!0,v[0],v[1]),v[1]-v[0]),g=v[1]-1):d=v[1]}if(b=s.getChars(),w=s.getCode(),T=(n*i.cols+M)*lg,this._cellColorResolver.resolve(s,M,o,this.dimensions.device.cell.width),ie&&o===E&&(M===$&&(this._model.cursor={x:$,y:z,width:s.getWidth(),style:this._coreBrowserService.isFocused?P:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},Z=$+s.getWidth()-1),M>=$&&M<=Z&&(this._coreBrowserService.isFocused&&P==="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)),w!==0&&(this._model.lineLengths[n]=M+1),!(this._model.cells[T]===w&&this._model.cells[T+um]===this._cellColorResolver.result.bg&&this._model.cells[T+fm]===this._cellColorResolver.result.fg&&this._model.cells[T+F_]===this._cellColorResolver.result.ext)&&(F=!0,b.length>1&&(w|=Vse),this._model.cells[T]=w,this._model.cells[T+um]=this._cellColorResolver.result.bg,this._model.cells[T+fm]=this._cellColorResolver.result.fg,this._model.cells[T+F_]=this._cellColorResolver.result.ext,C=s.getWidth(),this._glyphRenderer.value.updateCell(M,n,w,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,C,r),u)){for(s=this._workCell,M++;M<=g;M++)k=(n*i.cols+M)*lg,this._glyphRenderer.value.updateCell(M,n,0,0,0,0,Hie,0,0),this._model.cells[k]=0,this._model.cells[k+um]=this._cellColorResolver.result.bg,this._model.cells[k+fm]=this._cellColorResolver.result.fg,this._model.cells[k+F_]=this._cellColorResolver.result.ext;M--}}F&&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})}},fre=class extends nh{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 bP(t,e,i=0){return Math.max(Math.min(t,e),i)}var SP="di$target",xP="di$dependencies",t1=new Map;function an(t){if(t1.has(t))return t1.get(t);let e=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");dre(e,i,r)};return e._id=t,t1.set(t,e),e}function dre(t,e,i){e[SP]===e?e[xP].push({id:t,index:i}):(e[xP]=[{id:t,index:i}],e[SP]=e)}an("BufferService");an("CoreMouseService");an("CoreService");an("CharsetService");an("InstantiationService");an("LogService");var pre=an("OptionsService");an("OscLinkService");an("UnicodeService");an("DecorationService");var mre={trace:0,debug:1,info:2,warn:3,error:4,off:5},gre="xterm.js: ",wP=class extends Cr{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=mre[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?"":gre)+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)}};wP=Die([zie(0,pre)],wP);var Ore=class extends Cr{constructor(t){if(UD&&Yie()<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 yt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new yt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new yt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new yt),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,s=e.optionsService,r=e,n=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 ure(t,o,l,c,i,u,s,d,this._preserveDrawingBuffer)),this._register(Nn.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Nn.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Nn.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Nn.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),n.setRenderer(this._renderer),this._register(Zi(()=>{if(this._terminal._core._store._isDisposed)return;let m=this._terminal._core._renderService;m.setRenderer(this._terminal._core._createRenderer()),m.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 Oi=0,vi=0,_i=0,Qt=0,Vi;(t=>{function e(r,n,o,l){return l!==void 0?`#${Sa(r)}${Sa(n)}${Sa(o)}${Sa(l)}`:`#${Sa(r)}${Sa(n)}${Sa(o)}`}t.toCss=e;function i(r,n,o,l=255){return(r<<24|n<<16|o<<8|l)>>>0}t.toRgba=i;function s(r,n,o,l){return{css:t.toCss(r,n,o,l),rgba:t.toRgba(r,n,o,l)}}t.toColor=s})(Vi||(Vi={}));var vre;(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,m=u.rgba>>16&255,g=u.rgba>>8&255,v=c.rgba>>24&255,y=c.rgba>>16&255,b=c.rgba>>8&255;Oi=v+Math.round((d-v)*Qt),vi=y+Math.round((m-y)*Qt),_i=b+Math.round((g-b)*Qt);let w=Vi.toCss(Oi,vi,_i),C=Vi.toRgba(Oi,vi,_i);return{css:w,rgba:C}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function s(c,u,d){let m=pm.ensureContrastRatio(c.rgba,u.rgba,d);if(m)return Vi.toColor(m>>24&255,m>>16&255,m>>8&255)}t.ensureContrastRatio=s;function r(c){let u=(c.rgba|255)>>>0;return[Oi,vi,_i]=pm.toChannels(u),{css:Vi.toCss(Oi,vi,_i),rgba:u}}t.opaque=r;function n(c,u){return Qt=Math.round(u*255),[Oi,vi,_i]=pm.toChannels(c.rgba),{css:Vi.toCss(Oi,vi,_i,Qt),rgba:Vi.toRgba(Oi,vi,_i,Qt)}}t.opacity=n;function o(c,u){return Qt=c.rgba&255,n(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})(vre||(vre={}));var Ei;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(e=n,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Oi=parseInt(r.slice(1,2).repeat(2),16),vi=parseInt(r.slice(2,3).repeat(2),16),_i=parseInt(r.slice(3,4).repeat(2),16),Vi.toColor(Oi,vi,_i);case 5:return Oi=parseInt(r.slice(1,2).repeat(2),16),vi=parseInt(r.slice(2,3).repeat(2),16),_i=parseInt(r.slice(3,4).repeat(2),16),Qt=parseInt(r.slice(4,5).repeat(2),16),Vi.toColor(Oi,vi,_i,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 n=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(n)return Oi=parseInt(n[1]),vi=parseInt(n[2]),_i=parseInt(n[3]),Qt=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Vi.toColor(Oi,vi,_i,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),[Oi,vi,_i,Qt]=e.getImageData(0,0,1,1).data,Qt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Vi.toRgba(Oi,vi,_i,Qt),css:r}}t.toColor=s})(Ei||(Ei={}));var Fi;(t=>{function e(s){return i(s>>16&255,s>>8&255,s&255)}t.relativeLuminance=e;function i(s,r,n){let o=s/255,l=r/255,c=n/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),m=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+m*.0722}t.relativeLuminance2=i})(Fi||(Fi={}));var pm;(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,m=o>>24&255,g=o>>16&255,v=o>>8&255;return Oi=m+Math.round((c-m)*Qt),vi=g+Math.round((u-g)*Qt),_i=v+Math.round((d-v)*Qt),Vi.toRgba(Oi,vi,_i)}t.blend=e;function i(o,l,c){let u=Fi.relativeLuminance(o>>8),d=Fi.relativeLuminance(l>>8);if(Qn(u,d)<c){if(d<u){let v=s(o,l,c),y=Qn(u,Fi.relativeLuminance(v>>8));if(y<c){let b=r(o,l,c),w=Qn(u,Fi.relativeLuminance(b>>8));return y>w?v:b}return v}let m=r(o,l,c),g=Qn(u,Fi.relativeLuminance(m>>8));if(g<c){let v=s(o,l,c),y=Qn(u,Fi.relativeLuminance(v>>8));return g>y?m:v}return m}}t.ensureContrastRatio=i;function s(o,l,c){let u=o>>24&255,d=o>>16&255,m=o>>8&255,g=l>>24&255,v=l>>16&255,y=l>>8&255,b=Qn(Fi.relativeLuminance2(g,v,y),Fi.relativeLuminance2(u,d,m));for(;b<c&&(g>0||v>0||y>0);)g-=Math.max(0,Math.ceil(g*.1)),v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),b=Qn(Fi.relativeLuminance2(g,v,y),Fi.relativeLuminance2(u,d,m));return(g<<24|v<<16|y<<8|255)>>>0}t.reduceLuminance=s;function r(o,l,c){let u=o>>24&255,d=o>>16&255,m=o>>8&255,g=l>>24&255,v=l>>16&255,y=l>>8&255,b=Qn(Fi.relativeLuminance2(g,v,y),Fi.relativeLuminance2(u,d,m));for(;b<c&&(g<255||v<255||y<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Qn(Fi.relativeLuminance2(g,v,y),Fi.relativeLuminance2(u,d,m));return(g<<24|v<<16|y<<8|255)>>>0}t.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=n})(pm||(pm={}));function Sa(t){let e=t.toString(16);return e.length<2?"0"+e:e}function Qn(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var _re=Object.freeze((()=>{let t=[Ei.toColor("#2e3436"),Ei.toColor("#cc0000"),Ei.toColor("#4e9a06"),Ei.toColor("#c4a000"),Ei.toColor("#3465a4"),Ei.toColor("#75507b"),Ei.toColor("#06989a"),Ei.toColor("#d3d7cf"),Ei.toColor("#555753"),Ei.toColor("#ef2929"),Ei.toColor("#8ae234"),Ei.toColor("#fce94f"),Ei.toColor("#729fcf"),Ei.toColor("#ad7fa8"),Ei.toColor("#34e2e2"),Ei.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=e[i/36%6|0],r=e[i/6%6|0],n=e[i%6];t.push({css:Vi.toCss(s,r,n),rgba:Vi.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;t.push({css:Vi.toCss(s,s,s),rgba:Vi.toRgba(s,s,s)})}return t})());function CP(t,e,i){return Math.max(e,Math.min(t,i))}function yre(t){switch(t){case"&":return"&";case"<":return"<"}return t}var p4=class{constructor(t){this._buffer=t}serialize(t,e){let i=this._buffer.getNullCell(),s=this._buffer.getNullCell(),r=i,n=t.start.y,o=t.end.y,l=t.start.x,c=t.end.x;this._beforeSerialize(o-n,n,o);for(let u=n;u<=o;u++){let d=this._buffer.getLine(u);if(d){let m=u===t.start.y?l:0,g=u===t.end.y?c:d.length;for(let v=m;v<g;v++){let y=d.getCell(v,r===i?s:i);if(!y){console.warn(`Can't get cell at row=${u}, col=${v}`);continue}this._nextCell(y,r,u,v),r=y}}this._rowEnd(u,u===o)}return this._afterSerialize(),this._serializeString(e)}_nextCell(t,e,i,s){}_rowEnd(t,e){}_beforeSerialize(t,e,i){}_afterSerialize(){}_serializeString(t){return""}};function m4(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function Ln(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function g4(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 bre=class extends p4{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 s;this._nullCellCount>0&&!Ln(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let i="";if(!e){t-this._firstRow>=this._terminal.rows&&((s=this._buffer.getLine(this._cursorStyleRow))==null||s.getCell(this._cursorStyleCol,this._backgroundCell));let r=this._buffer.getLine(t),n=this._buffer.getLine(t+1);if(!n.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=n.getCell(0,this._nextRowFirstChar),u=c.getWidth()>1,d=!1;(c.getChars()&&u?this._nullCellCount<=1:this._nullCellCount<=0)&&((o.getChars()||o.getWidth()===0)&&Ln(o,c)&&(d=!0),u&&(l.getChars()||l.getWidth()===0)&&Ln(o,c)&&Ln(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=[],s=!m4(t,e),r=!Ln(t,e),n=!g4(t,e);if(s||r||n)if(t.isAttributeDefault())e.isAttributeDefault()||i.push(0);else{if(s){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)}n&&(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,s){if(t.getWidth()===0)return;let r=t.getChars()==="",n=this._diffStyle(t,this._cursorStyle);if(r?!Ln(this._cursorStyle,t):n.length>0){this._nullCellCount>0&&(Ln(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=s,this._currentRow+=`\x1B[${n.join(";")}m`;let o=this._buffer.getLine(i);o!==void 0&&(o.getCell(s,this._cursorStyle),this._cursorStyleRow=i,this._cursorStyleCol=s)}r?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(Ln(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=s+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 n=0;n<e;n++)i+=this._allRows[n],n+1<e&&(i+=this._allRowSeparators[n]);if(!t){let n=this._buffer.baseY+this._buffer.cursorY,o=this._buffer.cursorX,l=n!==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`)})(n-this._lastCursorRow),c(o-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,r=this._diffStyle(s,this._cursorStyle);return r.length>0&&(i+=`\x1B[${r.join(";")}m`),i}},Sre=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,e,i){let s=e.length,r=i===void 0?s:CP(i+t.rows,0,s);return this._serializeBufferByRange(t,e,{start:s-r,end:s-1},!1)}_serializeBufferByRange(t,e,i,s){return new bre(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}},s)}_serializeBufferAsHTML(t,e){var l;let i=t.buffer.active,s=new xre(i,t,e),r=e.onlySelection??!1,n=e.range;if(n)return s.serialize({start:{x:n.startCol,y:(n.startLine,n.startLine)},end:{x:t.cols,y:(n.endLine,n.endLine)}});if(!r){let c=i.length,u=e.scrollback,d=u===void 0?c:CP(u+t.rows,0,c);return s.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?s.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(){}},xre=class extends p4{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=_re}_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 s="#000000",r="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((o=this._terminal.options.theme)==null?void 0:o.foreground)??"#ffffff",r=((l=this._terminal.options.theme)==null?void 0:l.background)??"#000000");let n=[];n.push("color: "+s+";"),n.push("background-color: "+r+";"),n.push("font-family: "+this._terminal.options.fontFamily+";"),n.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+n.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(s=>this._padStart(s.toString(16),2,"0")).join("");if(e?t.isFgPalette():t.isBgPalette())return this._ansiColors[i].css}_diffStyle(t,e){let i=[],s=!m4(t,e),r=!Ln(t,e),n=!g4(t,e);if(s||r||n){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,s){if(t.getWidth()===0)return;let r=t.getChars()==="",n=this._diffStyle(t,e);n&&(this._currentRow+=n.length===0?"</span><span>":"</span><span style='"+n.join(" ")+"'>"),r?this._currentRow+=" ":this._currentRow+=yre(t.getChars())}_serializeString(){return this._htmlContent}};const wre=10,Cre=2e3;function kre(t={}){const{autoSpawn:e=!1,skipPermissions:i=!1}=t,[s,r]=X.useState(!1),[n,o]=X.useState(!1),[l,c]=X.useState(null),[u,d]=X.useState(null),m=X.useRef(null),g=X.useRef(0),v=X.useRef(null),y=X.useRef(!0),b=X.useRef(null),w=X.useRef(null),C=X.useRef(e),T=X.useRef(i);C.current=e,T.current=i;const M=X.useCallback($=>{const Z=m.current;Z&&Z.readyState===WebSocket.OPEN&&Z.send(JSON.stringify($))},[]),k=X.useCallback($=>{M({type:"spawn",skipPermissions:$})},[M]),P=X.useCallback(()=>{M({type:"kill"})},[M]),E=X.useCallback(($,Z)=>{M({type:"resize",cols:$,rows:Z})},[M]),z=X.useCallback($=>{M({type:"input",data:$})},[M]);return X.useEffect(()=>{y.current=!0;function $(){if(!y.current)return;const ie=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`,F=new WebSocket(ie);m.current=F,F.onopen=()=>{y.current&&(r(!0),g.current=0,C.current&&F.send(JSON.stringify({type:"spawn",skipPermissions:T.current})))},F.onclose=()=>{y.current&&(r(!1),m.current=null,g.current<wre&&(g.current++,v.current=setTimeout($,Cre)))},F.onmessage=R=>{var Q,D;if(y.current)try{const I=JSON.parse(R.data);switch(I.type){case"output":(Q=b.current)==null||Q.call(b,I.data);break;case"scrollback":(D=w.current)==null||D.call(w,I.data);break;case"status":c({pid:I.pid,uptime:I.uptime,cwd:I.cwd,memoryMB:I.memoryMB,isActive:I.isActive,skipPermissions:I.skipPermissions,alive:I.alive});break;case"exit":d(I.code??1);break;case"started":d(null);break;case"unavailable":o(!0);break}}catch{}},F.onerror=()=>{}}return $(),()=>{y.current=!1,v.current!==null&&(clearTimeout(v.current),v.current=null),m.current&&(m.current.onclose=null,m.current.close(),m.current=null)}},[]),{connected:s,unavailable:n,status:l,exitCode:u,send:M,spawn:k,kill:P,resize:E,writeInput:z,onOutput:b,onScrollback:w}}function Tre(t){const e=Math.floor(t/60),i=t%60;return`${e}m ${i}s`}function Mre(t){const e=t.replace(/\\/g,"/").split("/").filter(Boolean);return e.length<=2?t:".../"+e.slice(-2).join("/")}function Are({status:t,connected:e,exitCode:i,skipPermissions:s,onToggleSkipPermissions:r,onStop:n,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:He("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:Tre(t.uptime)}),S.jsx("span",{className:"text-border",children:"|"}),S.jsx("span",{title:t.cwd,children:Mre(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:s,onChange:r,className:"h-3 w-3 accent-accent"}),S.jsx("span",{children:"Skip Perms"})]}),l&&S.jsx("button",{type:"button",onClick:n,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 Ere=[{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"}],O4="maxsim-quick-commands",Pre=3e4;function Rre(){try{const t=localStorage.getItem(O4);if(t)return JSON.parse(t)}catch{}return Ere}function Qre(t){localStorage.setItem(O4,JSON.stringify(t))}function Lre({onSendCommand:t,isActive:e,isAlive:i,unavailable:s=!1}){const[r,n]=X.useState(!1),[o,l]=X.useState(Rre),[c,u]=X.useState(!1),[d,m]=X.useState(null),g=X.useRef(null),v=X.useCallback(async E=>{if(!E.includes(" N"))return E;const z=g.current;if(z&&Date.now()-z.ts<Pre)return E.replace(" N",` ${z.value}`);try{const $=await fetch("/api/state");if($.ok){const Z=await $.json(),ie=String(Z.currentPhase??"1");return g.current={value:ie,ts:Date.now()},E.replace(" N",` ${ie}`)}}catch{}return E},[]),y=s||!i,b=X.useCallback(async E=>{if(y)return;const z=await v(E.command);m({label:E.label,resolved:z})},[y,v]),w=X.useCallback(()=>{d&&(t(d.resolved+`\r
|
|
217
|
-
`),m(null))},[d,t]),C=X.useCallback(()=>{m(null)},[]);X.useEffect(()=>{if(!d)return;const E=z=>{z.key==="Enter"?(z.preventDefault(),w()):z.key==="Escape"&&C()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[d,w,C]);const[T,M]=X.useState([]),k=X.useCallback(()=>{M([...o]),u(!0)},[o]),P=X.useCallback(()=>{const E=T.filter(z=>z.label.trim()&&z.command.trim());l(E),Qre(E),u(!1)},[T]);return r?S.jsx("div",{className:"absolute bottom-2 right-2 z-20",children:S.jsx("button",{type:"button",onClick:()=>n(!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:w,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:C,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"}),T.map((E,z)=>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:$=>{const Z=[...T];Z[z]={...Z[z],label:$.target.value},M(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:$=>{const Z=[...T];Z[z]={...Z[z],command:$.target.value},M(Z)},placeholder:"Command"}),S.jsx("button",{type:"button",onClick:()=>M(T.filter(($,Z)=>Z!==z)),className:"text-muted-foreground hover:text-destructive transition-colors px-0.5",title:"Remove",children:"x"})]},z)),S.jsxs("div",{className:"flex justify-between mt-2",children:[S.jsx("button",{type:"button",onClick:()=>M([...T,{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:P,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:y,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:s?"Terminal unavailable — node-pty not installed":E.command,children:E.label},E.label)),S.jsx("button",{type:"button",onClick:k,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:()=>n(!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 $re({onReady:t,writeInputRef:e}){const i=X.useRef(null),s=X.useRef(null),r=X.useRef(null),n=X.useRef(null),o=X.useRef(null),[l,c]=X.useState(!0),{connected:u,unavailable:d,status:m,exitCode:g,writeInput:v,resize:y,spawn:b,kill:w,onOutput:C,onScrollback:T}=kre({autoSpawn:!0,skipPermissions:l});X.useEffect(()=>(e&&(e.current=v),()=>{e&&(e.current=null)}),[v,e]);const M=X.useCallback($=>{var Z;(Z=s.current)==null||Z.write($)},[]),k=X.useCallback($=>{var Z;(Z=s.current)==null||Z.write($)},[]);X.useEffect(()=>(C.current=M,T.current=k,()=>{C.current=null,T.current=null}),[M,k,C,T]),X.useEffect(()=>{if(!i.current)return;const $=new Qie({cursorBlink:!0,fontSize:14,lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0"}}),Z=new Bie,ie=new Sre;$.loadAddon(Z),$.loadAddon(ie);try{$.loadAddon(new Ore)}catch{}$.open(i.current),Z.fit(),s.current=$,r.current=Z;const F=$.onData(Q=>{v(Q)}),R=new ResizeObserver(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r.current&&s.current&&(r.current.fit(),y(s.current.cols,s.current.rows))},100)});return R.observe(i.current),n.current=R,t==null||t($),()=>{F.dispose(),R.disconnect(),o.current&&clearTimeout(o.current),$.dispose(),s.current=null,r.current=null,n.current=null}},[]);const P=X.useCallback(()=>{b(l),setTimeout(()=>{var $;return($=s.current)==null?void 0:$.focus()},100)},[b,l]),E=X.useCallback(()=>{w()},[w]),z=X.useCallback(()=>{c($=>!$)},[]);return S.jsxs("div",{className:"flex h-full w-full flex-col",onWheel:$=>$.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(Lre,{onSendCommand:v,isActive:(m==null?void 0:m.isActive)??!1,isAlive:(m==null?void 0:m.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:P,className:"rounded-sm bg-accent px-3 py-1 text-xs text-foreground transition-colors hover:bg-accent-glow",children:"Restart"})]})]}),S.jsx(Are,{status:m,connected:u,exitCode:g,skipPermissions:l,onToggleSkipPermissions:z,onStop:E,onRestart:P})]})}function Bre(){const[t,e]=X.useState(!1),i=X.useCallback(()=>e(s=>!s),[]);return{splitMode:t,toggleSplit:i}}function Dre({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 zre({mode:t,onToggle:e}){const[i,s]=X.useState(!1);function r(){s(!0),e(),setTimeout(()=>s(!1),420)}const n=t==="simple",o=n?"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(_f.span,{animate:{rotate:i?360:0},transition:{duration:.4,ease:"easeInOut"},style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n?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 Nre({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 xa(t){var e;return(((e=t==null?void 0:t.phases)==null?void 0:e.length)??0)>0}function kP(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 yb=[{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=>xa(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=>xa(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=>kP(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=>kP(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=>xa(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=>xa(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=>xa(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=>xa(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=>xa(t),unavailableReason:"No roadmap to display"}];function jre(){var c,u;const{roadmap:t}=Fa(),{setTab:e,setExpanded:i}=hg(),s=(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(s){const d=s.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 n=yb.find(d=>d.id===r);if(!n)return null;const o=s?`Phase ${s.number}: ${s.name}`:"your project";function l(){const d=n.tab;e(d),i(n.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:n.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:n.title})]})}function Xre({action:t,onExecute:e}){const{inputValues:i,setInput:s,reset:r}=hg(),{roadmap:n}=Fa(),o=X.useRef(null),[l,c]=X.useState(!1),[u,d]=X.useState(!1),m=(()=>{var P;if(!t.requiresInput)return"";const k=(P=n==null?void 0:n.phases)==null?void 0:P.find(E=>!E.roadmap_complete&&(E.disk_status==="empty"||E.disk_status==="no_directory"));return k?`Phase ${k.number}: ${k.name}`:""})(),g=i[t.id]??m;X.useEffect(()=>{const k=o.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[g]);function v(){const k=o.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)}function y(k){s(t.id,k)}function b(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),C())}function w(){const k=g.trim();return t.command===""?"":k?`${t.command} "${k}"`:t.command}function C(){if(t.requiresInput&&!g.trim()||t.id==="view-roadmap")return;const k=w();k&&e(k)}function T(){u?(r(),d(!1),c(!1)):(d(!0),setTimeout(()=>d(!1),3e3))}const M=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:k=>{y(k.target.value),v()},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:C,disabled:M,className:He("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",M?"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(k=>!k),"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:T,className:He("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 Vre({action:t,roadmap:e,onExecute:i}){var g,v;const{expandedCardId:s,setExpanded:r}=hg(),{roadmap:n}=Fa(),o=s===t.id,l=!t.isAvailable(e),c=(g=n==null?void 0:n.phases)==null?void 0:g.find(y=>y.number===(n==null?void 0:n.current_phase));let u=null;if(c){const y=c.disk_status;y==="empty"||y==="no_directory"||y==="discussed"||y==="researched"?u="plan-new-phase":y==="planned"||y==="partial"?u="execute-phase":y==="complete"&&(u="verify-work")}else(((v=n==null?void 0:n.phases)==null?void 0:v.length)??0)===0&&(u="new-project");const d=t.id===u;function m(){l||r(o?null:t.id)}return S.jsxs("div",{className:He("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:m,className:"flex w-full items-start gap-3 p-4 text-left","aria-expanded":o,children:[S.jsx("span",{className:He("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:He("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(hQ,{initial:!1,children:o&&S.jsx(_f.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(Xre,{action:t,onExecute:i})})},"expanded")})]})}const i1=6;function Zre({onExecute:t}){var M;const{roadmap:e}=Fa(),{activeTab:i,setTab:s}=hg(),r=X.useRef(i),[n,o]=X.useState({plan:!1,execute:!1}),l=e??null,c=yb.filter(k=>k.tab==="plan"),u=yb.filter(k=>k.tab==="execute"),d=(((M=e==null?void 0:e.phases)==null?void 0:M.length)??0)===0,m=d?c.filter(k=>k.id==="new-project"||k.id==="init-existing"):c,g=d?[]:u,v=i==="plan"?m:g,y=n[i],b=y?v:v.slice(0,i1),w=v.length>i1&&!y;function C(k){r.current=i,s(k)}const T=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(k=>{const P=k==="plan"?m.length:g.length,E=k==="plan"?"Plan & Discuss":"Execute & Verify";return S.jsxs("button",{type:"button",onClick:()=>C(k),className:He("flex-1 py-2.5 text-xs font-mono uppercase tracking-widest transition-colors duration-200 border-b-2",i===k?"border-b-simple-accent text-simple-accent":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[E," (",P,")"]},k)})}),S.jsx("div",{className:"overflow-hidden",children:S.jsx(hQ,{mode:"wait",initial:!1,children:S.jsx(_f.div,{initial:{x:T*20,opacity:0},animate:{x:0,opacity:1},exit:{x:T*-20,opacity:0},transition:{duration:.15},children:v.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(k=>S.jsx(Vre,{action:k,roadmap:l,onExecute:t},k.id))}),w&&S.jsxs("button",{type:"button",onClick:()=>o(k=>({...k,[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 (",v.length-i1," more)"]})]})},i)})})]})}function Ire({onExecute:t}){return 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(jre,{}),S.jsx(Zre,{onExecute:t})]})})})}function qre(){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 Wre({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 Ure(){const{roadmap:t,state:e,todos:i,loading:s,error:r}=Fa(),{mode:n,setMode:o,initialized:l}=rN(),[c,u]=X.useState("overview"),[d,m]=X.useState(null),[g,v]=X.useState(!1),{splitMode:y,toggleSplit:b}=Bre(),w=X.useRef(null),C=X.useCallback(()=>{o(n==="simple"?"advanced":"simple")},[n,o]),T=l?S.jsx(zre,{mode:n,onToggle:C}):null,M=X.useRef({view:"overview",phaseId:null}),k=X.useCallback((D,I)=>{D!=="terminal"&&(M.current={view:D,phaseId:D==="phase"&&I?I:null}),u(D),D==="phase"&&I&&m(I),v(!1)},[]),P=X.useCallback(D=>{var I;(I=w.current)==null||I.call(w,D+"\r"),k("terminal")},[k]),E=X.useCallback(D=>{u("phase"),m(D)},[]),z=X.useCallback(()=>{u("overview"),m(null)},[]),$=X.useCallback(async(D,I)=>{try{const L=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:D,checked:I})});L.ok||console.error("[toggle-phase]",await L.text())}catch(L){console.error("[toggle-phase]",L)}},[]),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})),ie=(t==null?void 0:t.current_phase)??null;function F(){if(s)return S.jsx(qre,{});if(r)return S.jsx(Wre,{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(KX,{roadmap:t,state:e,todos:i}),S.jsx(iV,{phases:Z,currentPhase:ie,onPhaseClick:E,onToggleComplete:$})]});case"phase":return d?S.jsx("div",{className:"mx-auto max-w-4xl",children:S.jsx(UK,{phaseId:d,onBack:z})}):null;case"todos":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(YK,{})});case"blockers":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(GK,{})});case"terminal":return null;default:return null}}const R=c==="terminal",Q=n==="simple";return S.jsxs(KK,{mobileMenuOpen:g,onMobileMenuToggle:()=>v(D=>!D),onMobileMenuClose:()=>v(!1),headerRight:T,simpleMode:Q,sidebar:S.jsx("div",{style:{display:Q?"none":"contents"},children:S.jsx(wJ,{activeView:c,activePhaseId:d,onNavigate:k,logoAction:T})}),children:[l&&n===null&&S.jsx(Nre,{onChoose:o}),Q&&l&&S.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:S.jsx(Ire,{onExecute:P})}),S.jsxs("div",{style:{display:Q?"none":"contents"},children:[S.jsx("div",{style:{display:R&&!y?"none":"block"},className:R&&y?"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:F()}),S.jsxs("div",{style:{display:R?"flex":"none"},className:`relative min-h-0 flex-col overflow-hidden ${R&&y?"h-1/2":"flex-1"}`,children:[S.jsx(Dre,{splitMode:y,onToggle:b}),S.jsx($re,{writeInputRef:w})]})]})]})}function Yre(){return S.jsx(eN,{children:S.jsx(sN,{children:S.jsx(Ure,{})})})}const v4=document.getElementById("root");if(!v4)throw new Error("Root element not found");Gz.createRoot(v4).render(S.jsx(X.StrictMode,{children:S.jsx(Yre,{})}));
|