pi-web-ui 0.21.2 → 0.22.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/README.md +84 -74
- package/README.zh-CN.md +79 -71
- package/dist/server/agent-service.js +116 -13
- package/dist/server/index.js +9 -0
- package/dist/server/patch-node-pty.js +80 -0
- package/dist/server/terminals.js +23 -0
- package/package.json +3 -2
- package/web/dist/assets/index-BehovRZ4.css +41 -0
- package/web/dist/assets/index-CFXSK8-7.js +128 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-Cx5p0OLy.js +0 -126
- package/web/dist/assets/index-DkYHV6iM.css +0 -41
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lh={exports:{}},Fo={},ch={exports:{}},Ge={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its 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 Vm;function Iw(){if(Vm)return Ge;Vm=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function E(I,P,N){this.props=I,this.context=P,this.refs=w,this.updater=N||y}E.prototype.isReactComponent={},E.prototype.setState=function(I,P){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,P,"setState")},E.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function k(){}k.prototype=E.prototype;function R(I,P,N){this.props=I,this.context=P,this.refs=w,this.updater=N||y}var T=R.prototype=new k;T.constructor=R,S(T,E.prototype),T.isPureReactComponent=!0;var A=Array.isArray,V=Object.prototype.hasOwnProperty,D={current:null},ne={key:!0,ref:!0,__self:!0,__source:!0};function Z(I,P,N){var ae,ye={},z=null,pe=null;if(P!=null)for(ae in P.ref!==void 0&&(pe=P.ref),P.key!==void 0&&(z=""+P.key),P)V.call(P,ae)&&!ne.hasOwnProperty(ae)&&(ye[ae]=P[ae]);var ve=arguments.length-2;if(ve===1)ye.children=N;else if(1<ve){for(var be=Array(ve),Be=0;Be<ve;Be++)be[Be]=arguments[Be+2];ye.children=be}if(I&&I.defaultProps)for(ae in ve=I.defaultProps,ve)ye[ae]===void 0&&(ye[ae]=ve[ae]);return{$$typeof:e,type:I,key:z,ref:pe,props:ye,_owner:D.current}}function ee(I,P){return{$$typeof:e,type:I.type,key:P,ref:I.ref,props:I.props,_owner:I._owner}}function W(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function H(I){var P={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(N){return P[N]})}var U=/\/+/g;function O(I,P){return typeof I=="object"&&I!==null&&I.key!=null?H(""+I.key):P.toString(36)}function q(I,P,N,ae,ye){var z=typeof I;(z==="undefined"||z==="boolean")&&(I=null);var pe=!1;if(I===null)pe=!0;else switch(z){case"string":case"number":pe=!0;break;case"object":switch(I.$$typeof){case e:case t:pe=!0}}if(pe)return pe=I,ye=ye(pe),I=ae===""?"."+O(pe,0):ae,A(ye)?(N="",I!=null&&(N=I.replace(U,"$&/")+"/"),q(ye,P,N,"",function(Be){return Be})):ye!=null&&(W(ye)&&(ye=ee(ye,N+(!ye.key||pe&&pe.key===ye.key?"":(""+ye.key).replace(U,"$&/")+"/")+I)),P.push(ye)),1;if(pe=0,ae=ae===""?".":ae+":",A(I))for(var ve=0;ve<I.length;ve++){z=I[ve];var be=ae+O(z,ve);pe+=q(z,P,N,be,ye)}else if(be=v(I),typeof be=="function")for(I=be.call(I),ve=0;!(z=I.next()).done;)z=z.value,be=ae+O(z,ve++),pe+=q(z,P,N,be,ye);else if(z==="object")throw P=String(I),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return pe}function F(I,P,N){if(I==null)return I;var ae=[],ye=0;return q(I,ae,"","",function(z){return P.call(N,z,ye++)}),ae}function Q(I){if(I._status===-1){var P=I._result;P=P(),P.then(function(N){(I._status===0||I._status===-1)&&(I._status=1,I._result=N)},function(N){(I._status===0||I._status===-1)&&(I._status=2,I._result=N)}),I._status===-1&&(I._status=0,I._result=P)}if(I._status===1)return I._result.default;throw I._result}var ie={current:null},M={transition:null},Y={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:M,ReactCurrentOwner:D};function C(){throw Error("act(...) is not supported in production builds of React.")}return Ge.Children={map:F,forEach:function(I,P,N){F(I,function(){P.apply(this,arguments)},N)},count:function(I){var P=0;return F(I,function(){P++}),P},toArray:function(I){return F(I,function(P){return P})||[]},only:function(I){if(!W(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ge.Component=E,Ge.Fragment=n,Ge.Profiler=o,Ge.PureComponent=R,Ge.StrictMode=r,Ge.Suspense=d,Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Ge.act=C,Ge.cloneElement=function(I,P,N){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ae=S({},I.props),ye=I.key,z=I.ref,pe=I._owner;if(P!=null){if(P.ref!==void 0&&(z=P.ref,pe=D.current),P.key!==void 0&&(ye=""+P.key),I.type&&I.type.defaultProps)var ve=I.type.defaultProps;for(be in P)V.call(P,be)&&!ne.hasOwnProperty(be)&&(ae[be]=P[be]===void 0&&ve!==void 0?ve[be]:P[be])}var be=arguments.length-2;if(be===1)ae.children=N;else if(1<be){ve=Array(be);for(var Be=0;Be<be;Be++)ve[Be]=arguments[Be+2];ae.children=ve}return{$$typeof:e,type:I.type,key:ye,ref:z,props:ae,_owner:pe}},Ge.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:a,_context:I},I.Consumer=I},Ge.createElement=Z,Ge.createFactory=function(I){var P=Z.bind(null,I);return P.type=I,P},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(I){return{$$typeof:u,render:I}},Ge.isValidElement=W,Ge.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:Q}},Ge.memo=function(I,P){return{$$typeof:h,type:I,compare:P===void 0?null:P}},Ge.startTransition=function(I){var P=M.transition;M.transition={};try{I()}finally{M.transition=P}},Ge.unstable_act=C,Ge.useCallback=function(I,P){return ie.current.useCallback(I,P)},Ge.useContext=function(I){return ie.current.useContext(I)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(I){return ie.current.useDeferredValue(I)},Ge.useEffect=function(I,P){return ie.current.useEffect(I,P)},Ge.useId=function(){return ie.current.useId()},Ge.useImperativeHandle=function(I,P,N){return ie.current.useImperativeHandle(I,P,N)},Ge.useInsertionEffect=function(I,P){return ie.current.useInsertionEffect(I,P)},Ge.useLayoutEffect=function(I,P){return ie.current.useLayoutEffect(I,P)},Ge.useMemo=function(I,P){return ie.current.useMemo(I,P)},Ge.useReducer=function(I,P,N){return ie.current.useReducer(I,P,N)},Ge.useRef=function(I){return ie.current.useRef(I)},Ge.useState=function(I){return ie.current.useState(I)},Ge.useSyncExternalStore=function(I,P,N){return ie.current.useSyncExternalStore(I,P,N)},Ge.useTransition=function(){return ie.current.useTransition()},Ge.version="18.3.1",Ge}var Gm;function qd(){return Gm||(Gm=1,ch.exports=Iw()),ch.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its 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 Ym;function Pw(){if(Ym)return Fo;Ym=1;var e=qd(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,h){var g,p={},v=null,y=null;h!==void 0&&(v=""+h),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(y=d.ref);for(g in d)r.call(d,g)&&!a.hasOwnProperty(g)&&(p[g]=d[g]);if(u&&u.defaultProps)for(g in d=u.defaultProps,d)p[g]===void 0&&(p[g]=d[g]);return{$$typeof:t,type:u,key:v,ref:y,props:p,_owner:o.current}}return Fo.Fragment=n,Fo.jsx=l,Fo.jsxs=l,Fo}var Xm;function Bw(){return Xm||(Xm=1,lh.exports=Pw()),lh.exports}var m=Bw(),K=qd();const rs=gc(K);var Ml={},uh={exports:{}},An={},hh={exports:{}},dh={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its 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 Zm;function Fw(){return Zm||(Zm=1,(function(e){function t(M,Y){var C=M.length;M.push(Y);e:for(;0<C;){var I=C-1>>>1,P=M[I];if(0<o(P,Y))M[I]=Y,M[C]=P,C=I;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var Y=M[0],C=M.pop();if(C!==Y){M[0]=C;e:for(var I=0,P=M.length,N=P>>>1;I<N;){var ae=2*(I+1)-1,ye=M[ae],z=ae+1,pe=M[z];if(0>o(ye,C))z<P&&0>o(pe,ye)?(M[I]=pe,M[z]=C,I=z):(M[I]=ye,M[ae]=C,I=ae);else if(z<P&&0>o(pe,C))M[I]=pe,M[z]=C,I=z;else break e}}return Y}function o(M,Y){var C=M.sortIndex-Y.sortIndex;return C!==0?C:M.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],g=1,p=null,v=3,y=!1,S=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(M){for(var Y=n(h);Y!==null;){if(Y.callback===null)r(h);else if(Y.startTime<=M)r(h),Y.sortIndex=Y.expirationTime,t(d,Y);else break;Y=n(h)}}function A(M){if(w=!1,T(M),!S)if(n(d)!==null)S=!0,Q(V);else{var Y=n(h);Y!==null&&ie(A,Y.startTime-M)}}function V(M,Y){S=!1,w&&(w=!1,k(Z),Z=-1),y=!0;var C=v;try{for(T(Y),p=n(d);p!==null&&(!(p.expirationTime>Y)||M&&!H());){var I=p.callback;if(typeof I=="function"){p.callback=null,v=p.priorityLevel;var P=I(p.expirationTime<=Y);Y=e.unstable_now(),typeof P=="function"?p.callback=P:p===n(d)&&r(d),T(Y)}else r(d);p=n(d)}if(p!==null)var N=!0;else{var ae=n(h);ae!==null&&ie(A,ae.startTime-Y),N=!1}return N}finally{p=null,v=C,y=!1}}var D=!1,ne=null,Z=-1,ee=5,W=-1;function H(){return!(e.unstable_now()-W<ee)}function U(){if(ne!==null){var M=e.unstable_now();W=M;var Y=!0;try{Y=ne(!0,M)}finally{Y?O():(D=!1,ne=null)}}else D=!1}var O;if(typeof R=="function")O=function(){R(U)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,F=q.port2;q.port1.onmessage=U,O=function(){F.postMessage(null)}}else O=function(){E(U,0)};function Q(M){ne=M,D||(D=!0,O())}function ie(M,Y){Z=E(function(){M(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){S||y||(S=!0,Q(V))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var C=v;v=Y;try{return M()}finally{v=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,Y){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var C=v;v=M;try{return Y()}finally{v=C}},e.unstable_scheduleCallback=function(M,Y,C){var I=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?I+C:I):C=I,M){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=C+P,M={id:g++,callback:Y,priorityLevel:M,startTime:C,expirationTime:P,sortIndex:-1},C>I?(M.sortIndex=C,t(h,M),n(d)===null&&M===n(h)&&(w?(k(Z),Z=-1):w=!0,ie(A,C-I))):(M.sortIndex=P,t(d,M),S||y||(S=!0,Q(V))),M},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(M){var Y=v;return function(){var C=v;v=Y;try{return M.apply(this,arguments)}finally{v=C}}}})(dh)),dh}var Qm;function zw(){return Qm||(Qm=1,hh.exports=Fw()),hh.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its 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 Jm;function jw(){if(Jm)return An;Jm=1;var e=qd(),t=zw();function n(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,c=1;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function a(i,s){l(i,s),l(i+"Capture",s)}function l(i,s){for(o[i]=s,i=0;i<s.length;i++)r.add(s[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,g={},p={};function v(i){return d.call(p,i)?!0:d.call(g,i)?!1:h.test(i)?p[i]=!0:(g[i]=!0,!1)}function y(i,s,c,f){if(c!==null&&c.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return f?!1:c!==null?!c.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function S(i,s,c,f){if(s===null||typeof s>"u"||y(i,s,c,f))return!0;if(f)return!1;if(c!==null)switch(c.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(i,s,c,f,_,b,x){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=f,this.attributeNamespace=_,this.mustUseProperty=c,this.propertyName=i,this.type=s,this.sanitizeURL=b,this.removeEmptyString=x}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){E[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];E[s]=new w(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){E[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){E[i]=new w(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){E[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){E[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){E[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){E[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){E[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function R(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(k,R);E[s]=new w(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(k,R);E[s]=new w(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(k,R);E[s]=new w(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){E[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),E.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){E[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function T(i,s,c,f){var _=E.hasOwnProperty(s)?E[s]:null;(_!==null?_.type!==0:f||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(S(s,c,_,f)&&(c=null),f||_===null?v(s)&&(c===null?i.removeAttribute(s):i.setAttribute(s,""+c)):_.mustUseProperty?i[_.propertyName]=c===null?_.type===3?!1:"":c:(s=_.attributeName,f=_.attributeNamespace,c===null?i.removeAttribute(s):(_=_.type,c=_===3||_===4&&c===!0?"":""+c,f?i.setAttributeNS(f,s,c):i.setAttribute(s,c))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),D=Symbol.for("react.portal"),ne=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),H=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),M=Symbol.iterator;function Y(i){return i===null||typeof i!="object"?null:(i=M&&i[M]||i["@@iterator"],typeof i=="function"?i:null)}var C=Object.assign,I;function P(i){if(I===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);I=s&&s[1]||""}return`
|
|
34
|
-
`+I+i}var N=!1;function ae(i,s){if(!i||N)return"";N=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(J){var f=J}Reflect.construct(i,[],s)}else{try{s.call()}catch(J){f=J}i.call(s.prototype)}else{try{throw Error()}catch(J){f=J}i()}}catch(J){if(J&&f&&typeof J.stack=="string"){for(var _=J.stack.split(`
|
|
35
|
-
`),b=f.stack.split(`
|
|
36
|
-
`),x=_.length-1,L=b.length-1;1<=x&&0<=L&&_[x]!==b[L];)L--;for(;1<=x&&0<=L;x--,L--)if(_[x]!==b[L]){if(x!==1||L!==1)do if(x--,L--,0>L||_[x]!==b[L]){var j=`
|
|
37
|
-
`+_[x].replace(" at new "," at ");return i.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",i.displayName)),j}while(1<=x&&0<=L);break}}}finally{N=!1,Error.prepareStackTrace=c}return(i=i?i.displayName||i.name:"")?P(i):""}function ye(i){switch(i.tag){case 5:return P(i.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return i=ae(i.type,!1),i;case 11:return i=ae(i.type.render,!1),i;case 1:return i=ae(i.type,!0),i;default:return""}}function z(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ne:return"Fragment";case D:return"Portal";case ee:return"Profiler";case Z:return"StrictMode";case O:return"Suspense";case q:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case H:return(i.displayName||"Context")+".Consumer";case W:return(i._context.displayName||"Context")+".Provider";case U:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case F:return s=i.displayName||null,s!==null?s:z(i.type)||"Memo";case Q:s=i._payload,i=i._init;try{return z(i(s))}catch{}}return null}function pe(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return z(s);case 8:return s===Z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ve(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function be(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Be(i){var s=be(i)?"checked":"value",c=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),f=""+i[s];if(!i.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var _=c.get,b=c.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return _.call(this)},set:function(x){f=""+x,b.call(this,x)}}),Object.defineProperty(i,s,{enumerable:c.enumerable}),{getValue:function(){return f},setValue:function(x){f=""+x},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function st(i){i._valueTracker||(i._valueTracker=Be(i))}function It(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var c=s.getValue(),f="";return i&&(f=be(i)?i.checked?"true":"false":i.value),i=f,i!==c?(s.setValue(i),!0):!1}function Re(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function In(i,s){var c=s.checked;return C({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??i._wrapperState.initialChecked})}function Pi(i,s){var c=s.defaultValue==null?"":s.defaultValue,f=s.checked!=null?s.checked:s.defaultChecked;c=ve(s.value!=null?s.value:c),i._wrapperState={initialChecked:f,initialValue:c,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function et(i,s){s=s.checked,s!=null&&T(i,"checked",s,!1)}function Pn(i,s){et(i,s);var c=ve(s.value),f=s.type;if(c!=null)f==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+c):i.value!==""+c&&(i.value=""+c);else if(f==="submit"||f==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?vi(i,s.type,c):s.hasOwnProperty("defaultValue")&&vi(i,s.type,ve(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function Kn(i,s,c){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var f=s.type;if(!(f!=="submit"&&f!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,c||s===i.value||(i.value=s),i.defaultValue=s}c=i.name,c!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,c!==""&&(i.name=c)}function vi(i,s,c){(s!=="number"||Re(i.ownerDocument)!==i)&&(c==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+c&&(i.defaultValue=""+c))}var oi=Array.isArray;function yi(i,s,c,f){if(i=i.options,s){s={};for(var _=0;_<c.length;_++)s["$"+c[_]]=!0;for(c=0;c<i.length;c++)_=s.hasOwnProperty("$"+i[c].value),i[c].selected!==_&&(i[c].selected=_),_&&f&&(i[c].defaultSelected=!0)}else{for(c=""+ve(c),s=null,_=0;_<i.length;_++){if(i[_].value===c){i[_].selected=!0,f&&(i[_].defaultSelected=!0);return}s!==null||i[_].disabled||(s=i[_])}s!==null&&(s.selected=!0)}}function Mr(i,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return C({},s,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Ar(i,s){var c=s.value;if(c==null){if(c=s.children,s=s.defaultValue,c!=null){if(s!=null)throw Error(n(92));if(oi(c)){if(1<c.length)throw Error(n(93));c=c[0]}s=c}s==null&&(s=""),c=s}i._wrapperState={initialValue:ve(c)}}function qn(i,s){var c=ve(s.value),f=ve(s.defaultValue);c!=null&&(c=""+c,c!==i.value&&(i.value=c),s.defaultValue==null&&i.defaultValue!==c&&(i.defaultValue=c)),f!=null&&(i.defaultValue=""+f)}function Lr(i){var s=i.textContent;s===i._wrapperState.initialValue&&s!==""&&s!==null&&(i.value=s)}function te(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fe(i,s){return i==null||i==="http://www.w3.org/1999/xhtml"?te(s):i==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Pe,We=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,c,f,_){MSApp.execUnsafeLocalFunction(function(){return i(s,c,f,_)})}:i})(function(i,s){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=s;else{for(Pe=Pe||document.createElement("div"),Pe.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Pe.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function Qe(i,s){if(s){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=s;return}}i.textContent=s}var Ut={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ai=["Webkit","ms","Moz","O"];Object.keys(Ut).forEach(function(i){ai.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),Ut[s]=Ut[i]})});function En(i,s,c){return s==null||typeof s=="boolean"||s===""?"":c||typeof s!="number"||s===0||Ut.hasOwnProperty(i)&&Ut[i]?(""+s).trim():s+"px"}function li(i,s){i=i.style;for(var c in s)if(s.hasOwnProperty(c)){var f=c.indexOf("--")===0,_=En(c,s[c],f);c==="float"&&(c="cssFloat"),f?i.setProperty(c,_):i[c]=_}}var Bi=C({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ht(i,s){if(s){if(Bi[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Vn(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){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 rn=null;function ms(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var gs=null,er=null,Fi=null;function zi(i){if(i=xo(i)){if(typeof gs!="function")throw Error(n(280));var s=i.stateNode;s&&(s=Ka(s),gs(i.stateNode,i.type,s))}}function B(i){er?Fi?Fi.push(i):Fi=[i]:er=i}function re(){if(er){var i=er,s=Fi;if(Fi=er=null,zi(i),s)for(i=0;i<s.length;i++)zi(s[i])}}function _e(i,s){return i(s)}function ze(){}var ft=!1;function _t(i,s,c){if(ft)return i(s,c);ft=!0;try{return _e(i,s,c)}finally{ft=!1,(er!==null||Fi!==null)&&(ze(),re())}}function ke(i,s){var c=i.stateNode;if(c===null)return null;var f=Ka(c);if(f===null)return null;c=f[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(n(231,s,typeof c));return c}var xe=!1;if(u)try{var Le={};Object.defineProperty(Le,"passive",{get:function(){xe=!0}}),window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch{xe=!1}function Pt(i,s,c,f,_,b,x,L,j){var J=Array.prototype.slice.call(arguments,3);try{s.apply(c,J)}catch(le){this.onError(le)}}var ht=!1,bi=null,tr=!1,Or=null,Tc={onError:function(i){ht=!0,bi=i}};function no(i,s,c,f,_,b,x,L,j){ht=!1,bi=null,Pt.apply(Tc,arguments)}function Rc(i,s,c,f,_,b,x,L,j){if(no.apply(this,arguments),ht){if(ht){var J=bi;ht=!1,bi=null}else throw Error(n(198));tr||(tr=!0,Or=J)}}function ji(i){var s=i,c=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(c=s.return),i=s.return;while(i)}return s.tag===3?c:null}function xa(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function io(i){if(ji(i)!==i)throw Error(n(188))}function _s(i){var s=i.alternate;if(!s){if(s=ji(i),s===null)throw Error(n(188));return s!==i?null:i}for(var c=i,f=s;;){var _=c.return;if(_===null)break;var b=_.alternate;if(b===null){if(f=_.return,f!==null){c=f;continue}break}if(_.child===b.child){for(b=_.child;b;){if(b===c)return io(_),i;if(b===f)return io(_),s;b=b.sibling}throw Error(n(188))}if(c.return!==f.return)c=_,f=b;else{for(var x=!1,L=_.child;L;){if(L===c){x=!0,c=_,f=b;break}if(L===f){x=!0,f=_,c=b;break}L=L.sibling}if(!x){for(L=b.child;L;){if(L===c){x=!0,c=b,f=_;break}if(L===f){x=!0,f=b,c=_;break}L=L.sibling}if(!x)throw Error(n(189))}}if(c.alternate!==f)throw Error(n(190))}if(c.tag!==3)throw Error(n(188));return c.stateNode.current===c?i:s}function ka(i){return i=_s(i),i!==null?Ea(i):null}function Ea(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var s=Ea(i);if(s!==null)return s;i=i.sibling}return null}var Ca=t.unstable_scheduleCallback,ci=t.unstable_cancelCallback,Na=t.unstable_shouldYield,Ta=t.unstable_requestPaint,St=t.unstable_now,Mc=t.unstable_getCurrentPriorityLevel,ro=t.unstable_ImmediatePriority,Dr=t.unstable_UserBlockingPriority,vs=t.unstable_NormalPriority,he=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,Ke=null,Xe=null;function At(i){if(Xe&&typeof Xe.onCommitFiberRoot=="function")try{Xe.onCommitFiberRoot(Ke,i,void 0,(i.current.flags&128)===128)}catch{}}var wt=Math.clz32?Math.clz32:gn,Si=Math.log,ys=Math.LN2;function gn(i){return i>>>=0,i===0?32:31-(Si(i)/ys|0)|0}var _n=64,Ir=4194304;function nr(i){switch(i&-i){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: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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Pr(i,s){var c=i.pendingLanes;if(c===0)return 0;var f=0,_=i.suspendedLanes,b=i.pingedLanes,x=c&268435455;if(x!==0){var L=x&~_;L!==0?f=nr(L):(b&=x,b!==0&&(f=nr(b)))}else x=c&~_,x!==0?f=nr(x):b!==0&&(f=nr(b));if(f===0)return 0;if(s!==0&&s!==f&&(s&_)===0&&(_=f&-f,b=s&-s,_>=b||_===16&&(b&4194240)!==0))return s;if((f&4)!==0&&(f|=c&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=f;0<s;)c=31-wt(s),_=1<<c,f|=i[c],s&=~_;return f}function Ac(i,s){switch(i){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lc(i,s){for(var c=i.suspendedLanes,f=i.pingedLanes,_=i.expirationTimes,b=i.pendingLanes;0<b;){var x=31-wt(b),L=1<<x,j=_[x];j===-1?((L&c)===0||(L&f)!==0)&&(_[x]=Ac(L,s)):j<=s&&(i.expiredLanes|=L),b&=~L}}function so(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Ra(){var i=_n;return _n<<=1,(_n&4194240)===0&&(_n=64),i}function ir(i){for(var s=[],c=0;31>c;c++)s.push(i);return s}function rr(i,s,c){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-wt(s),i[s]=c}function Gn(i,s){var c=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var f=i.eventTimes;for(i=i.expirationTimes;0<c;){var _=31-wt(c),b=1<<_;s[_]=0,f[_]=-1,i[_]=-1,c&=~b}}function oo(i,s){var c=i.entangledLanes|=s;for(i=i.entanglements;c;){var f=31-wt(c),_=1<<f;_&s|i[f]&s&&(i[f]|=s),c&=~_}}var nt=0;function He(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var ao,Lt,ot,Br,wi,Fr=!1,sr=[],ge=null,Ee=null,Fe=null,Je=new Map,Nt=new Map,Gt=[],Oc="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 submit".split(" ");function Ma(i,s){switch(i){case"focusin":case"focusout":ge=null;break;case"dragenter":case"dragleave":Ee=null;break;case"mouseover":case"mouseout":Fe=null;break;case"pointerover":case"pointerout":Je.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nt.delete(s.pointerId)}}function lo(i,s,c,f,_,b){return i===null||i.nativeEvent!==b?(i={blockedOn:s,domEventName:c,eventSystemFlags:f,nativeEvent:b,targetContainers:[_]},s!==null&&(s=xo(s),s!==null&&Lt(s)),i):(i.eventSystemFlags|=f,s=i.targetContainers,_!==null&&s.indexOf(_)===-1&&s.push(_),i)}function rS(i,s,c,f,_){switch(s){case"focusin":return ge=lo(ge,i,s,c,f,_),!0;case"dragenter":return Ee=lo(Ee,i,s,c,f,_),!0;case"mouseover":return Fe=lo(Fe,i,s,c,f,_),!0;case"pointerover":var b=_.pointerId;return Je.set(b,lo(Je.get(b)||null,i,s,c,f,_)),!0;case"gotpointercapture":return b=_.pointerId,Nt.set(b,lo(Nt.get(b)||null,i,s,c,f,_)),!0}return!1}function Af(i){var s=zr(i.target);if(s!==null){var c=ji(s);if(c!==null){if(s=c.tag,s===13){if(s=xa(c),s!==null){i.blockedOn=s,wi(i.priority,function(){ot(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Aa(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var c=Ic(i.domEventName,i.eventSystemFlags,s[0],i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);rn=f,c.target.dispatchEvent(f),rn=null}else return s=xo(c),s!==null&&Lt(s),i.blockedOn=c,!1;s.shift()}return!0}function Lf(i,s,c){Aa(i)&&c.delete(s)}function sS(){Fr=!1,ge!==null&&Aa(ge)&&(ge=null),Ee!==null&&Aa(Ee)&&(Ee=null),Fe!==null&&Aa(Fe)&&(Fe=null),Je.forEach(Lf),Nt.forEach(Lf)}function co(i,s){i.blockedOn===s&&(i.blockedOn=null,Fr||(Fr=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,sS)))}function uo(i){function s(_){return co(_,i)}if(0<sr.length){co(sr[0],i);for(var c=1;c<sr.length;c++){var f=sr[c];f.blockedOn===i&&(f.blockedOn=null)}}for(ge!==null&&co(ge,i),Ee!==null&&co(Ee,i),Fe!==null&&co(Fe,i),Je.forEach(s),Nt.forEach(s),c=0;c<Gt.length;c++)f=Gt[c],f.blockedOn===i&&(f.blockedOn=null);for(;0<Gt.length&&(c=Gt[0],c.blockedOn===null);)Af(c),c.blockedOn===null&&Gt.shift()}var bs=A.ReactCurrentBatchConfig,La=!0;function oS(i,s,c,f){var _=nt,b=bs.transition;bs.transition=null;try{nt=1,Dc(i,s,c,f)}finally{nt=_,bs.transition=b}}function aS(i,s,c,f){var _=nt,b=bs.transition;bs.transition=null;try{nt=4,Dc(i,s,c,f)}finally{nt=_,bs.transition=b}}function Dc(i,s,c,f){if(La){var _=Ic(i,s,c,f);if(_===null)Qc(i,s,f,Oa,c),Ma(i,f);else if(rS(_,i,s,c,f))f.stopPropagation();else if(Ma(i,f),s&4&&-1<Oc.indexOf(i)){for(;_!==null;){var b=xo(_);if(b!==null&&ao(b),b=Ic(i,s,c,f),b===null&&Qc(i,s,f,Oa,c),b===_)break;_=b}_!==null&&f.stopPropagation()}else Qc(i,s,f,null,c)}}var Oa=null;function Ic(i,s,c,f){if(Oa=null,i=ms(f),i=zr(i),i!==null)if(s=ji(i),s===null)i=null;else if(c=s.tag,c===13){if(i=xa(s),i!==null)return i;i=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null);return Oa=i,null}function Of(i){switch(i){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Mc()){case ro:return 1;case Dr:return 4;case vs:case he:return 16;case Ae:return 536870912;default:return 16}default:return 16}}var or=null,Pc=null,Da=null;function Df(){if(Da)return Da;var i,s=Pc,c=s.length,f,_="value"in or?or.value:or.textContent,b=_.length;for(i=0;i<c&&s[i]===_[i];i++);var x=c-i;for(f=1;f<=x&&s[c-f]===_[b-f];f++);return Da=_.slice(i,1<f?1-f:void 0)}function Ia(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Pa(){return!0}function If(){return!1}function Bn(i){function s(c,f,_,b,x){this._reactName=c,this._targetInst=_,this.type=f,this.nativeEvent=b,this.target=x,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(c=i[L],this[L]=c?c(b):b[L]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Pa:If,this.isPropagationStopped=If,this}return C(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Pa)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Pa)},persist:function(){},isPersistent:Pa}),s}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bc=Bn(Ss),ho=C({},Ss,{view:0,detail:0}),lS=Bn(ho),Fc,zc,fo,Ba=C({},ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==fo&&(fo&&i.type==="mousemove"?(Fc=i.screenX-fo.screenX,zc=i.screenY-fo.screenY):zc=Fc=0,fo=i),Fc)},movementY:function(i){return"movementY"in i?i.movementY:zc}}),Pf=Bn(Ba),cS=C({},Ba,{dataTransfer:0}),uS=Bn(cS),hS=C({},ho,{relatedTarget:0}),jc=Bn(hS),dS=C({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),fS=Bn(dS),pS=C({},Ss,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),mS=Bn(pS),gS=C({},Ss,{data:0}),Bf=Bn(gS),_S={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vS={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"},yS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bS(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=yS[i])?!!s[i]:!1}function Uc(){return bS}var SS=C({},ho,{key:function(i){if(i.key){var s=_S[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Ia(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?vS[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(i){return i.type==="keypress"?Ia(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ia(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),wS=Bn(SS),xS=C({},Ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ff=Bn(xS),kS=C({},ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),ES=Bn(kS),CS=C({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),NS=Bn(CS),TS=C({},Ba,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),RS=Bn(TS),MS=[9,13,27,32],Hc=u&&"CompositionEvent"in window,po=null;u&&"documentMode"in document&&(po=document.documentMode);var AS=u&&"TextEvent"in window&&!po,zf=u&&(!Hc||po&&8<po&&11>=po),jf=" ",Uf=!1;function Hf(i,s){switch(i){case"keyup":return MS.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $f(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ws=!1;function LS(i,s){switch(i){case"compositionend":return $f(s);case"keypress":return s.which!==32?null:(Uf=!0,jf);case"textInput":return i=s.data,i===jf&&Uf?null:i;default:return null}}function OS(i,s){if(ws)return i==="compositionend"||!Hc&&Hf(i,s)?(i=Df(),Da=Pc=or=null,ws=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return zf&&s.locale!=="ko"?null:s.data;default:return null}}var DS={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 Wf(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!DS[i.type]:s==="textarea"}function Kf(i,s,c,f){B(f),s=Ha(s,"onChange"),0<s.length&&(c=new Bc("onChange","change",null,c,f),i.push({event:c,listeners:s}))}var mo=null,go=null;function IS(i){cp(i,0)}function Fa(i){var s=Ns(i);if(It(s))return i}function PS(i,s){if(i==="change")return s}var qf=!1;if(u){var $c;if(u){var Wc="oninput"in document;if(!Wc){var Vf=document.createElement("div");Vf.setAttribute("oninput","return;"),Wc=typeof Vf.oninput=="function"}$c=Wc}else $c=!1;qf=$c&&(!document.documentMode||9<document.documentMode)}function Gf(){mo&&(mo.detachEvent("onpropertychange",Yf),go=mo=null)}function Yf(i){if(i.propertyName==="value"&&Fa(go)){var s=[];Kf(s,go,i,ms(i)),_t(IS,s)}}function BS(i,s,c){i==="focusin"?(Gf(),mo=s,go=c,mo.attachEvent("onpropertychange",Yf)):i==="focusout"&&Gf()}function FS(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Fa(go)}function zS(i,s){if(i==="click")return Fa(s)}function jS(i,s){if(i==="input"||i==="change")return Fa(s)}function US(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var ui=typeof Object.is=="function"?Object.is:US;function _o(i,s){if(ui(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var c=Object.keys(i),f=Object.keys(s);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var _=c[f];if(!d.call(s,_)||!ui(i[_],s[_]))return!1}return!0}function Xf(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Zf(i,s){var c=Xf(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=s&&f>=s)return{node:c,offset:s-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Xf(c)}}function Qf(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Qf(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Jf(){for(var i=window,s=Re();s instanceof i.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)i=s.contentWindow;else break;s=Re(i.document)}return s}function Kc(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function HS(i){var s=Jf(),c=i.focusedElem,f=i.selectionRange;if(s!==c&&c&&c.ownerDocument&&Qf(c.ownerDocument.documentElement,c)){if(f!==null&&Kc(c)){if(s=f.start,i=f.end,i===void 0&&(i=s),"selectionStart"in c)c.selectionStart=s,c.selectionEnd=Math.min(i,c.value.length);else if(i=(s=c.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var _=c.textContent.length,b=Math.min(f.start,_);f=f.end===void 0?b:Math.min(f.end,_),!i.extend&&b>f&&(_=f,f=b,b=_),_=Zf(c,b);var x=Zf(c,f);_&&x&&(i.rangeCount!==1||i.anchorNode!==_.node||i.anchorOffset!==_.offset||i.focusNode!==x.node||i.focusOffset!==x.offset)&&(s=s.createRange(),s.setStart(_.node,_.offset),i.removeAllRanges(),b>f?(i.addRange(s),i.extend(x.node,x.offset)):(s.setEnd(x.node,x.offset),i.addRange(s)))}}for(s=[],i=c;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<s.length;c++)i=s[c],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var $S=u&&"documentMode"in document&&11>=document.documentMode,xs=null,qc=null,vo=null,Vc=!1;function ep(i,s,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Vc||xs==null||xs!==Re(f)||(f=xs,"selectionStart"in f&&Kc(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),vo&&_o(vo,f)||(vo=f,f=Ha(qc,"onSelect"),0<f.length&&(s=new Bc("onSelect","select",null,s,c),i.push({event:s,listeners:f}),s.target=xs)))}function za(i,s){var c={};return c[i.toLowerCase()]=s.toLowerCase(),c["Webkit"+i]="webkit"+s,c["Moz"+i]="moz"+s,c}var ks={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionend:za("Transition","TransitionEnd")},Gc={},tp={};u&&(tp=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function ja(i){if(Gc[i])return Gc[i];if(!ks[i])return i;var s=ks[i],c;for(c in s)if(s.hasOwnProperty(c)&&c in tp)return Gc[i]=s[c];return i}var np=ja("animationend"),ip=ja("animationiteration"),rp=ja("animationstart"),sp=ja("transitionend"),op=new Map,ap="abort auxClick 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(" ");function ar(i,s){op.set(i,s),a(s,[i])}for(var Yc=0;Yc<ap.length;Yc++){var Xc=ap[Yc],WS=Xc.toLowerCase(),KS=Xc[0].toUpperCase()+Xc.slice(1);ar(WS,"on"+KS)}ar(np,"onAnimationEnd"),ar(ip,"onAnimationIteration"),ar(rp,"onAnimationStart"),ar("dblclick","onDoubleClick"),ar("focusin","onFocus"),ar("focusout","onBlur"),ar(sp,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qS=new Set("cancel close invalid load scroll toggle".split(" ").concat(yo));function lp(i,s,c){var f=i.type||"unknown-event";i.currentTarget=c,Rc(f,s,void 0,i),i.currentTarget=null}function cp(i,s){s=(s&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],_=f.event;f=f.listeners;e:{var b=void 0;if(s)for(var x=f.length-1;0<=x;x--){var L=f[x],j=L.instance,J=L.currentTarget;if(L=L.listener,j!==b&&_.isPropagationStopped())break e;lp(_,L,J),b=j}else for(x=0;x<f.length;x++){if(L=f[x],j=L.instance,J=L.currentTarget,L=L.listener,j!==b&&_.isPropagationStopped())break e;lp(_,L,J),b=j}}}if(tr)throw i=Or,tr=!1,Or=null,i}function pt(i,s){var c=s[ru];c===void 0&&(c=s[ru]=new Set);var f=i+"__bubble";c.has(f)||(up(s,i,2,!1),c.add(f))}function Zc(i,s,c){var f=0;s&&(f|=4),up(c,i,f,s)}var Ua="_reactListening"+Math.random().toString(36).slice(2);function bo(i){if(!i[Ua]){i[Ua]=!0,r.forEach(function(c){c!=="selectionchange"&&(qS.has(c)||Zc(c,!1,i),Zc(c,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Ua]||(s[Ua]=!0,Zc("selectionchange",!1,s))}}function up(i,s,c,f){switch(Of(s)){case 1:var _=oS;break;case 4:_=aS;break;default:_=Dc}c=_.bind(null,s,c,i),_=void 0,!xe||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(_=!0),f?_!==void 0?i.addEventListener(s,c,{capture:!0,passive:_}):i.addEventListener(s,c,!0):_!==void 0?i.addEventListener(s,c,{passive:_}):i.addEventListener(s,c,!1)}function Qc(i,s,c,f,_){var b=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var x=f.tag;if(x===3||x===4){var L=f.stateNode.containerInfo;if(L===_||L.nodeType===8&&L.parentNode===_)break;if(x===4)for(x=f.return;x!==null;){var j=x.tag;if((j===3||j===4)&&(j=x.stateNode.containerInfo,j===_||j.nodeType===8&&j.parentNode===_))return;x=x.return}for(;L!==null;){if(x=zr(L),x===null)return;if(j=x.tag,j===5||j===6){f=b=x;continue e}L=L.parentNode}}f=f.return}_t(function(){var J=b,le=ms(c),ce=[];e:{var oe=op.get(i);if(oe!==void 0){var we=Bc,Ne=i;switch(i){case"keypress":if(Ia(c)===0)break e;case"keydown":case"keyup":we=wS;break;case"focusin":Ne="focus",we=jc;break;case"focusout":Ne="blur",we=jc;break;case"beforeblur":case"afterblur":we=jc;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=Pf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=uS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=ES;break;case np:case ip:case rp:we=fS;break;case sp:we=NS;break;case"scroll":we=lS;break;case"wheel":we=RS;break;case"copy":case"cut":case"paste":we=mS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=Ff}var Te=(s&4)!==0,Ot=!Te&&i==="scroll",G=Te?oe!==null?oe+"Capture":null:oe;Te=[];for(var $=J,X;$!==null;){X=$;var de=X.stateNode;if(X.tag===5&&de!==null&&(X=de,G!==null&&(de=ke($,G),de!=null&&Te.push(So($,de,X)))),Ot)break;$=$.return}0<Te.length&&(oe=new we(oe,Ne,null,c,le),ce.push({event:oe,listeners:Te}))}}if((s&7)===0){e:{if(oe=i==="mouseover"||i==="pointerover",we=i==="mouseout"||i==="pointerout",oe&&c!==rn&&(Ne=c.relatedTarget||c.fromElement)&&(zr(Ne)||Ne[Ui]))break e;if((we||oe)&&(oe=le.window===le?le:(oe=le.ownerDocument)?oe.defaultView||oe.parentWindow:window,we?(Ne=c.relatedTarget||c.toElement,we=J,Ne=Ne?zr(Ne):null,Ne!==null&&(Ot=ji(Ne),Ne!==Ot||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(we=null,Ne=J),we!==Ne)){if(Te=Pf,de="onMouseLeave",G="onMouseEnter",$="mouse",(i==="pointerout"||i==="pointerover")&&(Te=Ff,de="onPointerLeave",G="onPointerEnter",$="pointer"),Ot=we==null?oe:Ns(we),X=Ne==null?oe:Ns(Ne),oe=new Te(de,$+"leave",we,c,le),oe.target=Ot,oe.relatedTarget=X,de=null,zr(le)===J&&(Te=new Te(G,$+"enter",Ne,c,le),Te.target=X,Te.relatedTarget=Ot,de=Te),Ot=de,we&&Ne)t:{for(Te=we,G=Ne,$=0,X=Te;X;X=Es(X))$++;for(X=0,de=G;de;de=Es(de))X++;for(;0<$-X;)Te=Es(Te),$--;for(;0<X-$;)G=Es(G),X--;for(;$--;){if(Te===G||G!==null&&Te===G.alternate)break t;Te=Es(Te),G=Es(G)}Te=null}else Te=null;we!==null&&hp(ce,oe,we,Te,!1),Ne!==null&&Ot!==null&&hp(ce,Ot,Ne,Te,!0)}}e:{if(oe=J?Ns(J):window,we=oe.nodeName&&oe.nodeName.toLowerCase(),we==="select"||we==="input"&&oe.type==="file")var Me=PS;else if(Wf(oe))if(qf)Me=jS;else{Me=FS;var Oe=BS}else(we=oe.nodeName)&&we.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Me=zS);if(Me&&(Me=Me(i,J))){Kf(ce,Me,c,le);break e}Oe&&Oe(i,oe,J),i==="focusout"&&(Oe=oe._wrapperState)&&Oe.controlled&&oe.type==="number"&&vi(oe,"number",oe.value)}switch(Oe=J?Ns(J):window,i){case"focusin":(Wf(Oe)||Oe.contentEditable==="true")&&(xs=Oe,qc=J,vo=null);break;case"focusout":vo=qc=xs=null;break;case"mousedown":Vc=!0;break;case"contextmenu":case"mouseup":case"dragend":Vc=!1,ep(ce,c,le);break;case"selectionchange":if($S)break;case"keydown":case"keyup":ep(ce,c,le)}var De;if(Hc)e:{switch(i){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else ws?Hf(i,c)&&(je="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(je="onCompositionStart");je&&(zf&&c.locale!=="ko"&&(ws||je!=="onCompositionStart"?je==="onCompositionEnd"&&ws&&(De=Df()):(or=le,Pc="value"in or?or.value:or.textContent,ws=!0)),Oe=Ha(J,je),0<Oe.length&&(je=new Bf(je,i,null,c,le),ce.push({event:je,listeners:Oe}),De?je.data=De:(De=$f(c),De!==null&&(je.data=De)))),(De=AS?LS(i,c):OS(i,c))&&(J=Ha(J,"onBeforeInput"),0<J.length&&(le=new Bf("onBeforeInput","beforeinput",null,c,le),ce.push({event:le,listeners:J}),le.data=De))}cp(ce,s)})}function So(i,s,c){return{instance:i,listener:s,currentTarget:c}}function Ha(i,s){for(var c=s+"Capture",f=[];i!==null;){var _=i,b=_.stateNode;_.tag===5&&b!==null&&(_=b,b=ke(i,c),b!=null&&f.unshift(So(i,b,_)),b=ke(i,s),b!=null&&f.push(So(i,b,_))),i=i.return}return f}function Es(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function hp(i,s,c,f,_){for(var b=s._reactName,x=[];c!==null&&c!==f;){var L=c,j=L.alternate,J=L.stateNode;if(j!==null&&j===f)break;L.tag===5&&J!==null&&(L=J,_?(j=ke(c,b),j!=null&&x.unshift(So(c,j,L))):_||(j=ke(c,b),j!=null&&x.push(So(c,j,L)))),c=c.return}x.length!==0&&i.push({event:s,listeners:x})}var VS=/\r\n?/g,GS=/\u0000|\uFFFD/g;function dp(i){return(typeof i=="string"?i:""+i).replace(VS,`
|
|
38
|
-
`).replace(GS,"")}function $a(i,s,c){if(s=dp(s),dp(i)!==s&&c)throw Error(n(425))}function Wa(){}var Jc=null,eu=null;function tu(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var nu=typeof setTimeout=="function"?setTimeout:void 0,YS=typeof clearTimeout=="function"?clearTimeout:void 0,fp=typeof Promise=="function"?Promise:void 0,XS=typeof queueMicrotask=="function"?queueMicrotask:typeof fp<"u"?function(i){return fp.resolve(null).then(i).catch(ZS)}:nu;function ZS(i){setTimeout(function(){throw i})}function iu(i,s){var c=s,f=0;do{var _=c.nextSibling;if(i.removeChild(c),_&&_.nodeType===8)if(c=_.data,c==="/$"){if(f===0){i.removeChild(_),uo(s);return}f--}else c!=="$"&&c!=="$?"&&c!=="$!"||f++;c=_}while(c);uo(s)}function lr(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return i}function pp(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"){if(s===0)return i;s--}else c==="/$"&&s++}i=i.previousSibling}return null}var Cs=Math.random().toString(36).slice(2),xi="__reactFiber$"+Cs,wo="__reactProps$"+Cs,Ui="__reactContainer$"+Cs,ru="__reactEvents$"+Cs,QS="__reactListeners$"+Cs,JS="__reactHandles$"+Cs;function zr(i){var s=i[xi];if(s)return s;for(var c=i.parentNode;c;){if(s=c[Ui]||c[xi]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(i=pp(i);i!==null;){if(c=i[xi])return c;i=pp(i)}return s}i=c,c=i.parentNode}return null}function xo(i){return i=i[xi]||i[Ui],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Ns(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Ka(i){return i[wo]||null}var su=[],Ts=-1;function cr(i){return{current:i}}function mt(i){0>Ts||(i.current=su[Ts],su[Ts]=null,Ts--)}function dt(i,s){Ts++,su[Ts]=i.current,i.current=s}var ur={},cn=cr(ur),Cn=cr(!1),jr=ur;function Rs(i,s){var c=i.type.contextTypes;if(!c)return ur;var f=i.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===s)return f.__reactInternalMemoizedMaskedChildContext;var _={},b;for(b in c)_[b]=s[b];return f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=_),_}function Nn(i){return i=i.childContextTypes,i!=null}function qa(){mt(Cn),mt(cn)}function mp(i,s,c){if(cn.current!==ur)throw Error(n(168));dt(cn,s),dt(Cn,c)}function gp(i,s,c){var f=i.stateNode;if(s=s.childContextTypes,typeof f.getChildContext!="function")return c;f=f.getChildContext();for(var _ in f)if(!(_ in s))throw Error(n(108,pe(i)||"Unknown",_));return C({},c,f)}function Va(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ur,jr=cn.current,dt(cn,i),dt(Cn,Cn.current),!0}function _p(i,s,c){var f=i.stateNode;if(!f)throw Error(n(169));c?(i=gp(i,s,jr),f.__reactInternalMemoizedMergedChildContext=i,mt(Cn),mt(cn),dt(cn,i)):mt(Cn),dt(Cn,c)}var Hi=null,Ga=!1,ou=!1;function vp(i){Hi===null?Hi=[i]:Hi.push(i)}function ew(i){Ga=!0,vp(i)}function hr(){if(!ou&&Hi!==null){ou=!0;var i=0,s=nt;try{var c=Hi;for(nt=1;i<c.length;i++){var f=c[i];do f=f(!0);while(f!==null)}Hi=null,Ga=!1}catch(_){throw Hi!==null&&(Hi=Hi.slice(i+1)),Ca(ro,hr),_}finally{nt=s,ou=!1}}return null}var Ms=[],As=0,Ya=null,Xa=0,Yn=[],Xn=0,Ur=null,$i=1,Wi="";function Hr(i,s){Ms[As++]=Xa,Ms[As++]=Ya,Ya=i,Xa=s}function yp(i,s,c){Yn[Xn++]=$i,Yn[Xn++]=Wi,Yn[Xn++]=Ur,Ur=i;var f=$i;i=Wi;var _=32-wt(f)-1;f&=~(1<<_),c+=1;var b=32-wt(s)+_;if(30<b){var x=_-_%5;b=(f&(1<<x)-1).toString(32),f>>=x,_-=x,$i=1<<32-wt(s)+_|c<<_|f,Wi=b+i}else $i=1<<b|c<<_|f,Wi=i}function au(i){i.return!==null&&(Hr(i,1),yp(i,1,0))}function lu(i){for(;i===Ya;)Ya=Ms[--As],Ms[As]=null,Xa=Ms[--As],Ms[As]=null;for(;i===Ur;)Ur=Yn[--Xn],Yn[Xn]=null,Wi=Yn[--Xn],Yn[Xn]=null,$i=Yn[--Xn],Yn[Xn]=null}var Fn=null,zn=null,vt=!1,hi=null;function bp(i,s){var c=ei(5,null,null,0);c.elementType="DELETED",c.stateNode=s,c.return=i,s=i.deletions,s===null?(i.deletions=[c],i.flags|=16):s.push(c)}function Sp(i,s){switch(i.tag){case 5:var c=i.type;return s=s.nodeType!==1||c.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(i.stateNode=s,Fn=i,zn=lr(s.firstChild),!0):!1;case 6:return s=i.pendingProps===""||s.nodeType!==3?null:s,s!==null?(i.stateNode=s,Fn=i,zn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(c=Ur!==null?{id:$i,overflow:Wi}:null,i.memoizedState={dehydrated:s,treeContext:c,retryLane:1073741824},c=ei(18,null,null,0),c.stateNode=s,c.return=i,i.child=c,Fn=i,zn=null,!0):!1;default:return!1}}function cu(i){return(i.mode&1)!==0&&(i.flags&128)===0}function uu(i){if(vt){var s=zn;if(s){var c=s;if(!Sp(i,s)){if(cu(i))throw Error(n(418));s=lr(c.nextSibling);var f=Fn;s&&Sp(i,s)?bp(f,c):(i.flags=i.flags&-4097|2,vt=!1,Fn=i)}}else{if(cu(i))throw Error(n(418));i.flags=i.flags&-4097|2,vt=!1,Fn=i}}}function wp(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Fn=i}function Za(i){if(i!==Fn)return!1;if(!vt)return wp(i),vt=!0,!1;var s;if((s=i.tag!==3)&&!(s=i.tag!==5)&&(s=i.type,s=s!=="head"&&s!=="body"&&!tu(i.type,i.memoizedProps)),s&&(s=zn)){if(cu(i))throw xp(),Error(n(418));for(;s;)bp(i,s),s=lr(s.nextSibling)}if(wp(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"){if(s===0){zn=lr(i.nextSibling);break e}s--}else c!=="$"&&c!=="$!"&&c!=="$?"||s++}i=i.nextSibling}zn=null}}else zn=Fn?lr(i.stateNode.nextSibling):null;return!0}function xp(){for(var i=zn;i;)i=lr(i.nextSibling)}function Ls(){zn=Fn=null,vt=!1}function hu(i){hi===null?hi=[i]:hi.push(i)}var tw=A.ReactCurrentBatchConfig;function ko(i,s,c){if(i=c.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(n(309));var f=c.stateNode}if(!f)throw Error(n(147,i));var _=f,b=""+i;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===b?s.ref:(s=function(x){var L=_.refs;x===null?delete L[b]:L[b]=x},s._stringRef=b,s)}if(typeof i!="string")throw Error(n(284));if(!c._owner)throw Error(n(290,i))}return i}function Qa(i,s){throw i=Object.prototype.toString.call(s),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i))}function kp(i){var s=i._init;return s(i._payload)}function Ep(i){function s(G,$){if(i){var X=G.deletions;X===null?(G.deletions=[$],G.flags|=16):X.push($)}}function c(G,$){if(!i)return null;for(;$!==null;)s(G,$),$=$.sibling;return null}function f(G,$){for(G=new Map;$!==null;)$.key!==null?G.set($.key,$):G.set($.index,$),$=$.sibling;return G}function _(G,$){return G=yr(G,$),G.index=0,G.sibling=null,G}function b(G,$,X){return G.index=X,i?(X=G.alternate,X!==null?(X=X.index,X<$?(G.flags|=2,$):X):(G.flags|=2,$)):(G.flags|=1048576,$)}function x(G){return i&&G.alternate===null&&(G.flags|=2),G}function L(G,$,X,de){return $===null||$.tag!==6?($=nh(X,G.mode,de),$.return=G,$):($=_($,X),$.return=G,$)}function j(G,$,X,de){var Me=X.type;return Me===ne?le(G,$,X.props.children,de,X.key):$!==null&&($.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===Q&&kp(Me)===$.type)?(de=_($,X.props),de.ref=ko(G,$,X),de.return=G,de):(de=wl(X.type,X.key,X.props,null,G.mode,de),de.ref=ko(G,$,X),de.return=G,de)}function J(G,$,X,de){return $===null||$.tag!==4||$.stateNode.containerInfo!==X.containerInfo||$.stateNode.implementation!==X.implementation?($=ih(X,G.mode,de),$.return=G,$):($=_($,X.children||[]),$.return=G,$)}function le(G,$,X,de,Me){return $===null||$.tag!==7?($=Xr(X,G.mode,de,Me),$.return=G,$):($=_($,X),$.return=G,$)}function ce(G,$,X){if(typeof $=="string"&&$!==""||typeof $=="number")return $=nh(""+$,G.mode,X),$.return=G,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case V:return X=wl($.type,$.key,$.props,null,G.mode,X),X.ref=ko(G,null,$),X.return=G,X;case D:return $=ih($,G.mode,X),$.return=G,$;case Q:var de=$._init;return ce(G,de($._payload),X)}if(oi($)||Y($))return $=Xr($,G.mode,X,null),$.return=G,$;Qa(G,$)}return null}function oe(G,$,X,de){var Me=$!==null?$.key:null;if(typeof X=="string"&&X!==""||typeof X=="number")return Me!==null?null:L(G,$,""+X,de);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case V:return X.key===Me?j(G,$,X,de):null;case D:return X.key===Me?J(G,$,X,de):null;case Q:return Me=X._init,oe(G,$,Me(X._payload),de)}if(oi(X)||Y(X))return Me!==null?null:le(G,$,X,de,null);Qa(G,X)}return null}function we(G,$,X,de,Me){if(typeof de=="string"&&de!==""||typeof de=="number")return G=G.get(X)||null,L($,G,""+de,Me);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case V:return G=G.get(de.key===null?X:de.key)||null,j($,G,de,Me);case D:return G=G.get(de.key===null?X:de.key)||null,J($,G,de,Me);case Q:var Oe=de._init;return we(G,$,X,Oe(de._payload),Me)}if(oi(de)||Y(de))return G=G.get(X)||null,le($,G,de,Me,null);Qa($,de)}return null}function Ne(G,$,X,de){for(var Me=null,Oe=null,De=$,je=$=0,Zt=null;De!==null&&je<X.length;je++){De.index>je?(Zt=De,De=null):Zt=De.sibling;var rt=oe(G,De,X[je],de);if(rt===null){De===null&&(De=Zt);break}i&&De&&rt.alternate===null&&s(G,De),$=b(rt,$,je),Oe===null?Me=rt:Oe.sibling=rt,Oe=rt,De=Zt}if(je===X.length)return c(G,De),vt&&Hr(G,je),Me;if(De===null){for(;je<X.length;je++)De=ce(G,X[je],de),De!==null&&($=b(De,$,je),Oe===null?Me=De:Oe.sibling=De,Oe=De);return vt&&Hr(G,je),Me}for(De=f(G,De);je<X.length;je++)Zt=we(De,G,je,X[je],de),Zt!==null&&(i&&Zt.alternate!==null&&De.delete(Zt.key===null?je:Zt.key),$=b(Zt,$,je),Oe===null?Me=Zt:Oe.sibling=Zt,Oe=Zt);return i&&De.forEach(function(br){return s(G,br)}),vt&&Hr(G,je),Me}function Te(G,$,X,de){var Me=Y(X);if(typeof Me!="function")throw Error(n(150));if(X=Me.call(X),X==null)throw Error(n(151));for(var Oe=Me=null,De=$,je=$=0,Zt=null,rt=X.next();De!==null&&!rt.done;je++,rt=X.next()){De.index>je?(Zt=De,De=null):Zt=De.sibling;var br=oe(G,De,rt.value,de);if(br===null){De===null&&(De=Zt);break}i&&De&&br.alternate===null&&s(G,De),$=b(br,$,je),Oe===null?Me=br:Oe.sibling=br,Oe=br,De=Zt}if(rt.done)return c(G,De),vt&&Hr(G,je),Me;if(De===null){for(;!rt.done;je++,rt=X.next())rt=ce(G,rt.value,de),rt!==null&&($=b(rt,$,je),Oe===null?Me=rt:Oe.sibling=rt,Oe=rt);return vt&&Hr(G,je),Me}for(De=f(G,De);!rt.done;je++,rt=X.next())rt=we(De,G,je,rt.value,de),rt!==null&&(i&&rt.alternate!==null&&De.delete(rt.key===null?je:rt.key),$=b(rt,$,je),Oe===null?Me=rt:Oe.sibling=rt,Oe=rt);return i&&De.forEach(function(Dw){return s(G,Dw)}),vt&&Hr(G,je),Me}function Ot(G,$,X,de){if(typeof X=="object"&&X!==null&&X.type===ne&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case V:e:{for(var Me=X.key,Oe=$;Oe!==null;){if(Oe.key===Me){if(Me=X.type,Me===ne){if(Oe.tag===7){c(G,Oe.sibling),$=_(Oe,X.props.children),$.return=G,G=$;break e}}else if(Oe.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===Q&&kp(Me)===Oe.type){c(G,Oe.sibling),$=_(Oe,X.props),$.ref=ko(G,Oe,X),$.return=G,G=$;break e}c(G,Oe);break}else s(G,Oe);Oe=Oe.sibling}X.type===ne?($=Xr(X.props.children,G.mode,de,X.key),$.return=G,G=$):(de=wl(X.type,X.key,X.props,null,G.mode,de),de.ref=ko(G,$,X),de.return=G,G=de)}return x(G);case D:e:{for(Oe=X.key;$!==null;){if($.key===Oe)if($.tag===4&&$.stateNode.containerInfo===X.containerInfo&&$.stateNode.implementation===X.implementation){c(G,$.sibling),$=_($,X.children||[]),$.return=G,G=$;break e}else{c(G,$);break}else s(G,$);$=$.sibling}$=ih(X,G.mode,de),$.return=G,G=$}return x(G);case Q:return Oe=X._init,Ot(G,$,Oe(X._payload),de)}if(oi(X))return Ne(G,$,X,de);if(Y(X))return Te(G,$,X,de);Qa(G,X)}return typeof X=="string"&&X!==""||typeof X=="number"?(X=""+X,$!==null&&$.tag===6?(c(G,$.sibling),$=_($,X),$.return=G,G=$):(c(G,$),$=nh(X,G.mode,de),$.return=G,G=$),x(G)):c(G,$)}return Ot}var Os=Ep(!0),Cp=Ep(!1),Ja=cr(null),el=null,Ds=null,du=null;function fu(){du=Ds=el=null}function pu(i){var s=Ja.current;mt(Ja),i._currentValue=s}function mu(i,s,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),i===c)break;i=i.return}}function Is(i,s){el=i,du=Ds=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(Tn=!0),i.firstContext=null)}function Zn(i){var s=i._currentValue;if(du!==i)if(i={context:i,memoizedValue:s,next:null},Ds===null){if(el===null)throw Error(n(308));Ds=i,el.dependencies={lanes:0,firstContext:i}}else Ds=Ds.next=i;return s}var $r=null;function gu(i){$r===null?$r=[i]:$r.push(i)}function Np(i,s,c,f){var _=s.interleaved;return _===null?(c.next=c,gu(s)):(c.next=_.next,_.next=c),s.interleaved=c,Ki(i,f)}function Ki(i,s){i.lanes|=s;var c=i.alternate;for(c!==null&&(c.lanes|=s),c=i,i=i.return;i!==null;)i.childLanes|=s,c=i.alternate,c!==null&&(c.childLanes|=s),c=i,i=i.return;return c.tag===3?c.stateNode:null}var dr=!1;function _u(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tp(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function qi(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function fr(i,s,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(it&2)!==0){var _=f.pending;return _===null?s.next=s:(s.next=_.next,_.next=s),f.pending=s,Ki(i,c)}return _=f.interleaved,_===null?(s.next=s,gu(f)):(s.next=_.next,_.next=s),f.interleaved=s,Ki(i,c)}function tl(i,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194240)!==0)){var f=s.lanes;f&=i.pendingLanes,c|=f,s.lanes=c,oo(i,c)}}function Rp(i,s){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var _=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var x={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};b===null?_=b=x:b=b.next=x,c=c.next}while(c!==null);b===null?_=b=s:b=b.next=s}else _=b=s;c={baseState:f.baseState,firstBaseUpdate:_,lastBaseUpdate:b,shared:f.shared,effects:f.effects},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=s}function nl(i,s,c,f){var _=i.updateQueue;dr=!1;var b=_.firstBaseUpdate,x=_.lastBaseUpdate,L=_.shared.pending;if(L!==null){_.shared.pending=null;var j=L,J=j.next;j.next=null,x===null?b=J:x.next=J,x=j;var le=i.alternate;le!==null&&(le=le.updateQueue,L=le.lastBaseUpdate,L!==x&&(L===null?le.firstBaseUpdate=J:L.next=J,le.lastBaseUpdate=j))}if(b!==null){var ce=_.baseState;x=0,le=J=j=null,L=b;do{var oe=L.lane,we=L.eventTime;if((f&oe)===oe){le!==null&&(le=le.next={eventTime:we,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Ne=i,Te=L;switch(oe=s,we=c,Te.tag){case 1:if(Ne=Te.payload,typeof Ne=="function"){ce=Ne.call(we,ce,oe);break e}ce=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Te.payload,oe=typeof Ne=="function"?Ne.call(we,ce,oe):Ne,oe==null)break e;ce=C({},ce,oe);break e;case 2:dr=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,oe=_.effects,oe===null?_.effects=[L]:oe.push(L))}else we={eventTime:we,lane:oe,tag:L.tag,payload:L.payload,callback:L.callback,next:null},le===null?(J=le=we,j=ce):le=le.next=we,x|=oe;if(L=L.next,L===null){if(L=_.shared.pending,L===null)break;oe=L,L=oe.next,oe.next=null,_.lastBaseUpdate=oe,_.shared.pending=null}}while(!0);if(le===null&&(j=ce),_.baseState=j,_.firstBaseUpdate=J,_.lastBaseUpdate=le,s=_.shared.interleaved,s!==null){_=s;do x|=_.lane,_=_.next;while(_!==s)}else b===null&&(_.shared.lanes=0);qr|=x,i.lanes=x,i.memoizedState=ce}}function Mp(i,s,c){if(i=s.effects,s.effects=null,i!==null)for(s=0;s<i.length;s++){var f=i[s],_=f.callback;if(_!==null){if(f.callback=null,f=c,typeof _!="function")throw Error(n(191,_));_.call(f)}}}var Eo={},ki=cr(Eo),Co=cr(Eo),No=cr(Eo);function Wr(i){if(i===Eo)throw Error(n(174));return i}function vu(i,s){switch(dt(No,s),dt(Co,i),dt(ki,Eo),i=s.nodeType,i){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:fe(null,"");break;default:i=i===8?s.parentNode:s,s=i.namespaceURI||null,i=i.tagName,s=fe(s,i)}mt(ki),dt(ki,s)}function Ps(){mt(ki),mt(Co),mt(No)}function Ap(i){Wr(No.current);var s=Wr(ki.current),c=fe(s,i.type);s!==c&&(dt(Co,i),dt(ki,c))}function yu(i){Co.current===i&&(mt(ki),mt(Co))}var xt=cr(0);function il(i){for(var s=i;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var bu=[];function Su(){for(var i=0;i<bu.length;i++)bu[i]._workInProgressVersionPrimary=null;bu.length=0}var rl=A.ReactCurrentDispatcher,wu=A.ReactCurrentBatchConfig,Kr=0,kt=null,$t=null,Yt=null,sl=!1,To=!1,Ro=0,nw=0;function un(){throw Error(n(321))}function xu(i,s){if(s===null)return!1;for(var c=0;c<s.length&&c<i.length;c++)if(!ui(i[c],s[c]))return!1;return!0}function ku(i,s,c,f,_,b){if(Kr=b,kt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,rl.current=i===null||i.memoizedState===null?ow:aw,i=c(f,_),To){b=0;do{if(To=!1,Ro=0,25<=b)throw Error(n(301));b+=1,Yt=$t=null,s.updateQueue=null,rl.current=lw,i=c(f,_)}while(To)}if(rl.current=ll,s=$t!==null&&$t.next!==null,Kr=0,Yt=$t=kt=null,sl=!1,s)throw Error(n(300));return i}function Eu(){var i=Ro!==0;return Ro=0,i}function Ei(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?kt.memoizedState=Yt=i:Yt=Yt.next=i,Yt}function Qn(){if($t===null){var i=kt.alternate;i=i!==null?i.memoizedState:null}else i=$t.next;var s=Yt===null?kt.memoizedState:Yt.next;if(s!==null)Yt=s,$t=i;else{if(i===null)throw Error(n(310));$t=i,i={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Yt===null?kt.memoizedState=Yt=i:Yt=Yt.next=i}return Yt}function Mo(i,s){return typeof s=="function"?s(i):s}function Cu(i){var s=Qn(),c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=i;var f=$t,_=f.baseQueue,b=c.pending;if(b!==null){if(_!==null){var x=_.next;_.next=b.next,b.next=x}f.baseQueue=_=b,c.pending=null}if(_!==null){b=_.next,f=f.baseState;var L=x=null,j=null,J=b;do{var le=J.lane;if((Kr&le)===le)j!==null&&(j=j.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),f=J.hasEagerState?J.eagerState:i(f,J.action);else{var ce={lane:le,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};j===null?(L=j=ce,x=f):j=j.next=ce,kt.lanes|=le,qr|=le}J=J.next}while(J!==null&&J!==b);j===null?x=f:j.next=L,ui(f,s.memoizedState)||(Tn=!0),s.memoizedState=f,s.baseState=x,s.baseQueue=j,c.lastRenderedState=f}if(i=c.interleaved,i!==null){_=i;do b=_.lane,kt.lanes|=b,qr|=b,_=_.next;while(_!==i)}else _===null&&(c.lanes=0);return[s.memoizedState,c.dispatch]}function Nu(i){var s=Qn(),c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=i;var f=c.dispatch,_=c.pending,b=s.memoizedState;if(_!==null){c.pending=null;var x=_=_.next;do b=i(b,x.action),x=x.next;while(x!==_);ui(b,s.memoizedState)||(Tn=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),c.lastRenderedState=b}return[b,f]}function Lp(){}function Op(i,s){var c=kt,f=Qn(),_=s(),b=!ui(f.memoizedState,_);if(b&&(f.memoizedState=_,Tn=!0),f=f.queue,Tu(Pp.bind(null,c,f,i),[i]),f.getSnapshot!==s||b||Yt!==null&&Yt.memoizedState.tag&1){if(c.flags|=2048,Ao(9,Ip.bind(null,c,f,_,s),void 0,null),Xt===null)throw Error(n(349));(Kr&30)!==0||Dp(c,s,_)}return _}function Dp(i,s,c){i.flags|=16384,i={getSnapshot:s,value:c},s=kt.updateQueue,s===null?(s={lastEffect:null,stores:null},kt.updateQueue=s,s.stores=[i]):(c=s.stores,c===null?s.stores=[i]:c.push(i))}function Ip(i,s,c,f){s.value=c,s.getSnapshot=f,Bp(s)&&Fp(i)}function Pp(i,s,c){return c(function(){Bp(s)&&Fp(i)})}function Bp(i){var s=i.getSnapshot;i=i.value;try{var c=s();return!ui(i,c)}catch{return!0}}function Fp(i){var s=Ki(i,1);s!==null&&mi(s,i,1,-1)}function zp(i){var s=Ei();return typeof i=="function"&&(i=i()),s.memoizedState=s.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:i},s.queue=i,i=i.dispatch=sw.bind(null,kt,i),[s.memoizedState,i]}function Ao(i,s,c,f){return i={tag:i,create:s,destroy:c,deps:f,next:null},s=kt.updateQueue,s===null?(s={lastEffect:null,stores:null},kt.updateQueue=s,s.lastEffect=i.next=i):(c=s.lastEffect,c===null?s.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,s.lastEffect=i)),i}function jp(){return Qn().memoizedState}function ol(i,s,c,f){var _=Ei();kt.flags|=i,_.memoizedState=Ao(1|s,c,void 0,f===void 0?null:f)}function al(i,s,c,f){var _=Qn();f=f===void 0?null:f;var b=void 0;if($t!==null){var x=$t.memoizedState;if(b=x.destroy,f!==null&&xu(f,x.deps)){_.memoizedState=Ao(s,c,b,f);return}}kt.flags|=i,_.memoizedState=Ao(1|s,c,b,f)}function Up(i,s){return ol(8390656,8,i,s)}function Tu(i,s){return al(2048,8,i,s)}function Hp(i,s){return al(4,2,i,s)}function $p(i,s){return al(4,4,i,s)}function Wp(i,s){if(typeof s=="function")return i=i(),s(i),function(){s(null)};if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function Kp(i,s,c){return c=c!=null?c.concat([i]):null,al(4,4,Wp.bind(null,s,i),c)}function Ru(){}function qp(i,s){var c=Qn();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&xu(s,f[1])?f[0]:(c.memoizedState=[i,s],i)}function Vp(i,s){var c=Qn();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&xu(s,f[1])?f[0]:(i=i(),c.memoizedState=[i,s],i)}function Gp(i,s,c){return(Kr&21)===0?(i.baseState&&(i.baseState=!1,Tn=!0),i.memoizedState=c):(ui(c,s)||(c=Ra(),kt.lanes|=c,qr|=c,i.baseState=!0),s)}function iw(i,s){var c=nt;nt=c!==0&&4>c?c:4,i(!0);var f=wu.transition;wu.transition={};try{i(!1),s()}finally{nt=c,wu.transition=f}}function Yp(){return Qn().memoizedState}function rw(i,s,c){var f=_r(i);if(c={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null},Xp(i))Zp(s,c);else if(c=Np(i,s,c,f),c!==null){var _=yn();mi(c,i,f,_),Qp(c,s,f)}}function sw(i,s,c){var f=_r(i),_={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null};if(Xp(i))Zp(s,_);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var x=s.lastRenderedState,L=b(x,c);if(_.hasEagerState=!0,_.eagerState=L,ui(L,x)){var j=s.interleaved;j===null?(_.next=_,gu(s)):(_.next=j.next,j.next=_),s.interleaved=_;return}}catch{}finally{}c=Np(i,s,_,f),c!==null&&(_=yn(),mi(c,i,f,_),Qp(c,s,f))}}function Xp(i){var s=i.alternate;return i===kt||s!==null&&s===kt}function Zp(i,s){To=sl=!0;var c=i.pending;c===null?s.next=s:(s.next=c.next,c.next=s),i.pending=s}function Qp(i,s,c){if((c&4194240)!==0){var f=s.lanes;f&=i.pendingLanes,c|=f,s.lanes=c,oo(i,c)}}var ll={readContext:Zn,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},ow={readContext:Zn,useCallback:function(i,s){return Ei().memoizedState=[i,s===void 0?null:s],i},useContext:Zn,useEffect:Up,useImperativeHandle:function(i,s,c){return c=c!=null?c.concat([i]):null,ol(4194308,4,Wp.bind(null,s,i),c)},useLayoutEffect:function(i,s){return ol(4194308,4,i,s)},useInsertionEffect:function(i,s){return ol(4,2,i,s)},useMemo:function(i,s){var c=Ei();return s=s===void 0?null:s,i=i(),c.memoizedState=[i,s],i},useReducer:function(i,s,c){var f=Ei();return s=c!==void 0?c(s):s,f.memoizedState=f.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},f.queue=i,i=i.dispatch=rw.bind(null,kt,i),[f.memoizedState,i]},useRef:function(i){var s=Ei();return i={current:i},s.memoizedState=i},useState:zp,useDebugValue:Ru,useDeferredValue:function(i){return Ei().memoizedState=i},useTransition:function(){var i=zp(!1),s=i[0];return i=iw.bind(null,i[1]),Ei().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,c){var f=kt,_=Ei();if(vt){if(c===void 0)throw Error(n(407));c=c()}else{if(c=s(),Xt===null)throw Error(n(349));(Kr&30)!==0||Dp(f,s,c)}_.memoizedState=c;var b={value:c,getSnapshot:s};return _.queue=b,Up(Pp.bind(null,f,b,i),[i]),f.flags|=2048,Ao(9,Ip.bind(null,f,b,c,s),void 0,null),c},useId:function(){var i=Ei(),s=Xt.identifierPrefix;if(vt){var c=Wi,f=$i;c=(f&~(1<<32-wt(f)-1)).toString(32)+c,s=":"+s+"R"+c,c=Ro++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=nw++,s=":"+s+"r"+c.toString(32)+":";return i.memoizedState=s},unstable_isNewReconciler:!1},aw={readContext:Zn,useCallback:qp,useContext:Zn,useEffect:Tu,useImperativeHandle:Kp,useInsertionEffect:Hp,useLayoutEffect:$p,useMemo:Vp,useReducer:Cu,useRef:jp,useState:function(){return Cu(Mo)},useDebugValue:Ru,useDeferredValue:function(i){var s=Qn();return Gp(s,$t.memoizedState,i)},useTransition:function(){var i=Cu(Mo)[0],s=Qn().memoizedState;return[i,s]},useMutableSource:Lp,useSyncExternalStore:Op,useId:Yp,unstable_isNewReconciler:!1},lw={readContext:Zn,useCallback:qp,useContext:Zn,useEffect:Tu,useImperativeHandle:Kp,useInsertionEffect:Hp,useLayoutEffect:$p,useMemo:Vp,useReducer:Nu,useRef:jp,useState:function(){return Nu(Mo)},useDebugValue:Ru,useDeferredValue:function(i){var s=Qn();return $t===null?s.memoizedState=i:Gp(s,$t.memoizedState,i)},useTransition:function(){var i=Nu(Mo)[0],s=Qn().memoizedState;return[i,s]},useMutableSource:Lp,useSyncExternalStore:Op,useId:Yp,unstable_isNewReconciler:!1};function di(i,s){if(i&&i.defaultProps){s=C({},s),i=i.defaultProps;for(var c in i)s[c]===void 0&&(s[c]=i[c]);return s}return s}function Mu(i,s,c,f){s=i.memoizedState,c=c(f,s),c=c==null?s:C({},s,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var cl={isMounted:function(i){return(i=i._reactInternals)?ji(i)===i:!1},enqueueSetState:function(i,s,c){i=i._reactInternals;var f=yn(),_=_r(i),b=qi(f,_);b.payload=s,c!=null&&(b.callback=c),s=fr(i,b,_),s!==null&&(mi(s,i,_,f),tl(s,i,_))},enqueueReplaceState:function(i,s,c){i=i._reactInternals;var f=yn(),_=_r(i),b=qi(f,_);b.tag=1,b.payload=s,c!=null&&(b.callback=c),s=fr(i,b,_),s!==null&&(mi(s,i,_,f),tl(s,i,_))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var c=yn(),f=_r(i),_=qi(c,f);_.tag=2,s!=null&&(_.callback=s),s=fr(i,_,f),s!==null&&(mi(s,i,f,c),tl(s,i,f))}};function Jp(i,s,c,f,_,b,x){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,b,x):s.prototype&&s.prototype.isPureReactComponent?!_o(c,f)||!_o(_,b):!0}function em(i,s,c){var f=!1,_=ur,b=s.contextType;return typeof b=="object"&&b!==null?b=Zn(b):(_=Nn(s)?jr:cn.current,f=s.contextTypes,b=(f=f!=null)?Rs(i,_):ur),s=new s(c,b),i.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=cl,i.stateNode=s,s._reactInternals=i,f&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=_,i.__reactInternalMemoizedMaskedChildContext=b),s}function tm(i,s,c,f){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,f),s.state!==i&&cl.enqueueReplaceState(s,s.state,null)}function Au(i,s,c,f){var _=i.stateNode;_.props=c,_.state=i.memoizedState,_.refs={},_u(i);var b=s.contextType;typeof b=="object"&&b!==null?_.context=Zn(b):(b=Nn(s)?jr:cn.current,_.context=Rs(i,b)),_.state=i.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(Mu(i,s,b,c),_.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(s=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),s!==_.state&&cl.enqueueReplaceState(_,_.state,null),nl(i,c,_,f),_.state=i.memoizedState),typeof _.componentDidMount=="function"&&(i.flags|=4194308)}function Bs(i,s){try{var c="",f=s;do c+=ye(f),f=f.return;while(f);var _=c}catch(b){_=`
|
|
39
|
-
Error generating stack: `+b.message+`
|
|
40
|
-
`+b.stack}return{value:i,source:s,stack:_,digest:null}}function Lu(i,s,c){return{value:i,source:null,stack:c??null,digest:s??null}}function Ou(i,s){try{console.error(s.value)}catch(c){setTimeout(function(){throw c})}}var cw=typeof WeakMap=="function"?WeakMap:Map;function nm(i,s,c){c=qi(-1,c),c.tag=3,c.payload={element:null};var f=s.value;return c.callback=function(){gl||(gl=!0,Gu=f),Ou(i,s)},c}function im(i,s,c){c=qi(-1,c),c.tag=3;var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var _=s.value;c.payload=function(){return f(_)},c.callback=function(){Ou(i,s)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(c.callback=function(){Ou(i,s),typeof f!="function"&&(mr===null?mr=new Set([this]):mr.add(this));var x=s.stack;this.componentDidCatch(s.value,{componentStack:x!==null?x:""})}),c}function rm(i,s,c){var f=i.pingCache;if(f===null){f=i.pingCache=new cw;var _=new Set;f.set(s,_)}else _=f.get(s),_===void 0&&(_=new Set,f.set(s,_));_.has(c)||(_.add(c),i=xw.bind(null,i,s,c),s.then(i,i))}function sm(i){do{var s;if((s=i.tag===13)&&(s=i.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return i;i=i.return}while(i!==null);return null}function om(i,s,c,f,_){return(i.mode&1)===0?(i===s?i.flags|=65536:(i.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(s=qi(-1,1),s.tag=2,fr(c,s,1))),c.lanes|=1),i):(i.flags|=65536,i.lanes=_,i)}var uw=A.ReactCurrentOwner,Tn=!1;function vn(i,s,c,f){s.child=i===null?Cp(s,null,c,f):Os(s,i.child,c,f)}function am(i,s,c,f,_){c=c.render;var b=s.ref;return Is(s,_),f=ku(i,s,c,f,b,_),c=Eu(),i!==null&&!Tn?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~_,Vi(i,s,_)):(vt&&c&&au(s),s.flags|=1,vn(i,s,f,_),s.child)}function lm(i,s,c,f,_){if(i===null){var b=c.type;return typeof b=="function"&&!th(b)&&b.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(s.tag=15,s.type=b,cm(i,s,b,f,_)):(i=wl(c.type,null,f,s,s.mode,_),i.ref=s.ref,i.return=s,s.child=i)}if(b=i.child,(i.lanes&_)===0){var x=b.memoizedProps;if(c=c.compare,c=c!==null?c:_o,c(x,f)&&i.ref===s.ref)return Vi(i,s,_)}return s.flags|=1,i=yr(b,f),i.ref=s.ref,i.return=s,s.child=i}function cm(i,s,c,f,_){if(i!==null){var b=i.memoizedProps;if(_o(b,f)&&i.ref===s.ref)if(Tn=!1,s.pendingProps=f=b,(i.lanes&_)!==0)(i.flags&131072)!==0&&(Tn=!0);else return s.lanes=i.lanes,Vi(i,s,_)}return Du(i,s,c,f,_)}function um(i,s,c){var f=s.pendingProps,_=f.children,b=i!==null?i.memoizedState:null;if(f.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(zs,jn),jn|=c;else{if((c&1073741824)===0)return i=b!==null?b.baseLanes|c:c,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:i,cachePool:null,transitions:null},s.updateQueue=null,dt(zs,jn),jn|=i,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=b!==null?b.baseLanes:c,dt(zs,jn),jn|=f}else b!==null?(f=b.baseLanes|c,s.memoizedState=null):f=c,dt(zs,jn),jn|=f;return vn(i,s,_,c),s.child}function hm(i,s){var c=s.ref;(i===null&&c!==null||i!==null&&i.ref!==c)&&(s.flags|=512,s.flags|=2097152)}function Du(i,s,c,f,_){var b=Nn(c)?jr:cn.current;return b=Rs(s,b),Is(s,_),c=ku(i,s,c,f,b,_),f=Eu(),i!==null&&!Tn?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~_,Vi(i,s,_)):(vt&&f&&au(s),s.flags|=1,vn(i,s,c,_),s.child)}function dm(i,s,c,f,_){if(Nn(c)){var b=!0;Va(s)}else b=!1;if(Is(s,_),s.stateNode===null)hl(i,s),em(s,c,f),Au(s,c,f,_),f=!0;else if(i===null){var x=s.stateNode,L=s.memoizedProps;x.props=L;var j=x.context,J=c.contextType;typeof J=="object"&&J!==null?J=Zn(J):(J=Nn(c)?jr:cn.current,J=Rs(s,J));var le=c.getDerivedStateFromProps,ce=typeof le=="function"||typeof x.getSnapshotBeforeUpdate=="function";ce||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L!==f||j!==J)&&tm(s,x,f,J),dr=!1;var oe=s.memoizedState;x.state=oe,nl(s,f,x,_),j=s.memoizedState,L!==f||oe!==j||Cn.current||dr?(typeof le=="function"&&(Mu(s,c,le,f),j=s.memoizedState),(L=dr||Jp(s,c,L,f,oe,j,J))?(ce||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=j),x.props=f,x.state=j,x.context=J,f=L):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{x=s.stateNode,Tp(i,s),L=s.memoizedProps,J=s.type===s.elementType?L:di(s.type,L),x.props=J,ce=s.pendingProps,oe=x.context,j=c.contextType,typeof j=="object"&&j!==null?j=Zn(j):(j=Nn(c)?jr:cn.current,j=Rs(s,j));var we=c.getDerivedStateFromProps;(le=typeof we=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L!==ce||oe!==j)&&tm(s,x,f,j),dr=!1,oe=s.memoizedState,x.state=oe,nl(s,f,x,_);var Ne=s.memoizedState;L!==ce||oe!==Ne||Cn.current||dr?(typeof we=="function"&&(Mu(s,c,we,f),Ne=s.memoizedState),(J=dr||Jp(s,c,J,f,oe,Ne,j)||!1)?(le||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,Ne,j),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,Ne,j)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||L===i.memoizedProps&&oe===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&oe===i.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=Ne),x.props=f,x.state=Ne,x.context=j,f=J):(typeof x.componentDidUpdate!="function"||L===i.memoizedProps&&oe===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&oe===i.memoizedState||(s.flags|=1024),f=!1)}return Iu(i,s,c,f,b,_)}function Iu(i,s,c,f,_,b){hm(i,s);var x=(s.flags&128)!==0;if(!f&&!x)return _&&_p(s,c,!1),Vi(i,s,b);f=s.stateNode,uw.current=s;var L=x&&typeof c.getDerivedStateFromError!="function"?null:f.render();return s.flags|=1,i!==null&&x?(s.child=Os(s,i.child,null,b),s.child=Os(s,null,L,b)):vn(i,s,L,b),s.memoizedState=f.state,_&&_p(s,c,!0),s.child}function fm(i){var s=i.stateNode;s.pendingContext?mp(i,s.pendingContext,s.pendingContext!==s.context):s.context&&mp(i,s.context,!1),vu(i,s.containerInfo)}function pm(i,s,c,f,_){return Ls(),hu(_),s.flags|=256,vn(i,s,c,f),s.child}var Pu={dehydrated:null,treeContext:null,retryLane:0};function Bu(i){return{baseLanes:i,cachePool:null,transitions:null}}function mm(i,s,c){var f=s.pendingProps,_=xt.current,b=!1,x=(s.flags&128)!==0,L;if((L=x)||(L=i!==null&&i.memoizedState===null?!1:(_&2)!==0),L?(b=!0,s.flags&=-129):(i===null||i.memoizedState!==null)&&(_|=1),dt(xt,_&1),i===null)return uu(s),i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((s.mode&1)===0?s.lanes=1:i.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(x=f.children,i=f.fallback,b?(f=s.mode,b=s.child,x={mode:"hidden",children:x},(f&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=x):b=xl(x,f,0,null),i=Xr(i,f,c,null),b.return=s,i.return=s,b.sibling=i,s.child=b,s.child.memoizedState=Bu(c),s.memoizedState=Pu,i):Fu(s,x));if(_=i.memoizedState,_!==null&&(L=_.dehydrated,L!==null))return hw(i,s,x,f,L,_,c);if(b){b=f.fallback,x=s.mode,_=i.child,L=_.sibling;var j={mode:"hidden",children:f.children};return(x&1)===0&&s.child!==_?(f=s.child,f.childLanes=0,f.pendingProps=j,s.deletions=null):(f=yr(_,j),f.subtreeFlags=_.subtreeFlags&14680064),L!==null?b=yr(L,b):(b=Xr(b,x,c,null),b.flags|=2),b.return=s,f.return=s,f.sibling=b,s.child=f,f=b,b=s.child,x=i.child.memoizedState,x=x===null?Bu(c):{baseLanes:x.baseLanes|c,cachePool:null,transitions:x.transitions},b.memoizedState=x,b.childLanes=i.childLanes&~c,s.memoizedState=Pu,f}return b=i.child,i=b.sibling,f=yr(b,{mode:"visible",children:f.children}),(s.mode&1)===0&&(f.lanes=c),f.return=s,f.sibling=null,i!==null&&(c=s.deletions,c===null?(s.deletions=[i],s.flags|=16):c.push(i)),s.child=f,s.memoizedState=null,f}function Fu(i,s){return s=xl({mode:"visible",children:s},i.mode,0,null),s.return=i,i.child=s}function ul(i,s,c,f){return f!==null&&hu(f),Os(s,i.child,null,c),i=Fu(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function hw(i,s,c,f,_,b,x){if(c)return s.flags&256?(s.flags&=-257,f=Lu(Error(n(422))),ul(i,s,x,f)):s.memoizedState!==null?(s.child=i.child,s.flags|=128,null):(b=f.fallback,_=s.mode,f=xl({mode:"visible",children:f.children},_,0,null),b=Xr(b,_,x,null),b.flags|=2,f.return=s,b.return=s,f.sibling=b,s.child=f,(s.mode&1)!==0&&Os(s,i.child,null,x),s.child.memoizedState=Bu(x),s.memoizedState=Pu,b);if((s.mode&1)===0)return ul(i,s,x,null);if(_.data==="$!"){if(f=_.nextSibling&&_.nextSibling.dataset,f)var L=f.dgst;return f=L,b=Error(n(419)),f=Lu(b,f,void 0),ul(i,s,x,f)}if(L=(x&i.childLanes)!==0,Tn||L){if(f=Xt,f!==null){switch(x&-x){case 4:_=2;break;case 16:_=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(f.suspendedLanes|x))!==0?0:_,_!==0&&_!==b.retryLane&&(b.retryLane=_,Ki(i,_),mi(f,i,_,-1))}return eh(),f=Lu(Error(n(421))),ul(i,s,x,f)}return _.data==="$?"?(s.flags|=128,s.child=i.child,s=kw.bind(null,i),_._reactRetry=s,null):(i=b.treeContext,zn=lr(_.nextSibling),Fn=s,vt=!0,hi=null,i!==null&&(Yn[Xn++]=$i,Yn[Xn++]=Wi,Yn[Xn++]=Ur,$i=i.id,Wi=i.overflow,Ur=s),s=Fu(s,f.children),s.flags|=4096,s)}function gm(i,s,c){i.lanes|=s;var f=i.alternate;f!==null&&(f.lanes|=s),mu(i.return,s,c)}function zu(i,s,c,f,_){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:_}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=f,b.tail=c,b.tailMode=_)}function _m(i,s,c){var f=s.pendingProps,_=f.revealOrder,b=f.tail;if(vn(i,s,f.children,c),f=xt.current,(f&2)!==0)f=f&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&gm(i,c,s);else if(i.tag===19)gm(i,c,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}f&=1}if(dt(xt,f),(s.mode&1)===0)s.memoizedState=null;else switch(_){case"forwards":for(c=s.child,_=null;c!==null;)i=c.alternate,i!==null&&il(i)===null&&(_=c),c=c.sibling;c=_,c===null?(_=s.child,s.child=null):(_=c.sibling,c.sibling=null),zu(s,!1,_,c,b);break;case"backwards":for(c=null,_=s.child,s.child=null;_!==null;){if(i=_.alternate,i!==null&&il(i)===null){s.child=_;break}i=_.sibling,_.sibling=c,c=_,_=i}zu(s,!0,c,null,b);break;case"together":zu(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function hl(i,s){(s.mode&1)===0&&i!==null&&(i.alternate=null,s.alternate=null,s.flags|=2)}function Vi(i,s,c){if(i!==null&&(s.dependencies=i.dependencies),qr|=s.lanes,(c&s.childLanes)===0)return null;if(i!==null&&s.child!==i.child)throw Error(n(153));if(s.child!==null){for(i=s.child,c=yr(i,i.pendingProps),s.child=c,c.return=s;i.sibling!==null;)i=i.sibling,c=c.sibling=yr(i,i.pendingProps),c.return=s;c.sibling=null}return s.child}function dw(i,s,c){switch(s.tag){case 3:fm(s),Ls();break;case 5:Ap(s);break;case 1:Nn(s.type)&&Va(s);break;case 4:vu(s,s.stateNode.containerInfo);break;case 10:var f=s.type._context,_=s.memoizedProps.value;dt(Ja,f._currentValue),f._currentValue=_;break;case 13:if(f=s.memoizedState,f!==null)return f.dehydrated!==null?(dt(xt,xt.current&1),s.flags|=128,null):(c&s.child.childLanes)!==0?mm(i,s,c):(dt(xt,xt.current&1),i=Vi(i,s,c),i!==null?i.sibling:null);dt(xt,xt.current&1);break;case 19:if(f=(c&s.childLanes)!==0,(i.flags&128)!==0){if(f)return _m(i,s,c);s.flags|=128}if(_=s.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),dt(xt,xt.current),f)break;return null;case 22:case 23:return s.lanes=0,um(i,s,c)}return Vi(i,s,c)}var vm,ju,ym,bm;vm=function(i,s){for(var c=s.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},ju=function(){},ym=function(i,s,c,f){var _=i.memoizedProps;if(_!==f){i=s.stateNode,Wr(ki.current);var b=null;switch(c){case"input":_=In(i,_),f=In(i,f),b=[];break;case"select":_=C({},_,{value:void 0}),f=C({},f,{value:void 0}),b=[];break;case"textarea":_=Mr(i,_),f=Mr(i,f),b=[];break;default:typeof _.onClick!="function"&&typeof f.onClick=="function"&&(i.onclick=Wa)}Ht(c,f);var x;c=null;for(J in _)if(!f.hasOwnProperty(J)&&_.hasOwnProperty(J)&&_[J]!=null)if(J==="style"){var L=_[J];for(x in L)L.hasOwnProperty(x)&&(c||(c={}),c[x]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(o.hasOwnProperty(J)?b||(b=[]):(b=b||[]).push(J,null));for(J in f){var j=f[J];if(L=_!=null?_[J]:void 0,f.hasOwnProperty(J)&&j!==L&&(j!=null||L!=null))if(J==="style")if(L){for(x in L)!L.hasOwnProperty(x)||j&&j.hasOwnProperty(x)||(c||(c={}),c[x]="");for(x in j)j.hasOwnProperty(x)&&L[x]!==j[x]&&(c||(c={}),c[x]=j[x])}else c||(b||(b=[]),b.push(J,c)),c=j;else J==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,L=L?L.__html:void 0,j!=null&&L!==j&&(b=b||[]).push(J,j)):J==="children"?typeof j!="string"&&typeof j!="number"||(b=b||[]).push(J,""+j):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(o.hasOwnProperty(J)?(j!=null&&J==="onScroll"&&pt("scroll",i),b||L===j||(b=[])):(b=b||[]).push(J,j))}c&&(b=b||[]).push("style",c);var J=b;(s.updateQueue=J)&&(s.flags|=4)}},bm=function(i,s,c,f){c!==f&&(s.flags|=4)};function Lo(i,s){if(!vt)switch(i.tailMode){case"hidden":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function hn(i){var s=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(s)for(var _=i.child;_!==null;)c|=_.lanes|_.childLanes,f|=_.subtreeFlags&14680064,f|=_.flags&14680064,_.return=i,_=_.sibling;else for(_=i.child;_!==null;)c|=_.lanes|_.childLanes,f|=_.subtreeFlags,f|=_.flags,_.return=i,_=_.sibling;return i.subtreeFlags|=f,i.childLanes=c,s}function fw(i,s,c){var f=s.pendingProps;switch(lu(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(s),null;case 1:return Nn(s.type)&&qa(),hn(s),null;case 3:return f=s.stateNode,Ps(),mt(Cn),mt(cn),Su(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(Za(s)?s.flags|=4:i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,hi!==null&&(Zu(hi),hi=null))),ju(i,s),hn(s),null;case 5:yu(s);var _=Wr(No.current);if(c=s.type,i!==null&&s.stateNode!=null)ym(i,s,c,f,_),i.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!f){if(s.stateNode===null)throw Error(n(166));return hn(s),null}if(i=Wr(ki.current),Za(s)){f=s.stateNode,c=s.type;var b=s.memoizedProps;switch(f[xi]=s,f[wo]=b,i=(s.mode&1)!==0,c){case"dialog":pt("cancel",f),pt("close",f);break;case"iframe":case"object":case"embed":pt("load",f);break;case"video":case"audio":for(_=0;_<yo.length;_++)pt(yo[_],f);break;case"source":pt("error",f);break;case"img":case"image":case"link":pt("error",f),pt("load",f);break;case"details":pt("toggle",f);break;case"input":Pi(f,b),pt("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!b.multiple},pt("invalid",f);break;case"textarea":Ar(f,b),pt("invalid",f)}Ht(c,b),_=null;for(var x in b)if(b.hasOwnProperty(x)){var L=b[x];x==="children"?typeof L=="string"?f.textContent!==L&&(b.suppressHydrationWarning!==!0&&$a(f.textContent,L,i),_=["children",L]):typeof L=="number"&&f.textContent!==""+L&&(b.suppressHydrationWarning!==!0&&$a(f.textContent,L,i),_=["children",""+L]):o.hasOwnProperty(x)&&L!=null&&x==="onScroll"&&pt("scroll",f)}switch(c){case"input":st(f),Kn(f,b,!0);break;case"textarea":st(f),Lr(f);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(f.onclick=Wa)}f=_,s.updateQueue=f,f!==null&&(s.flags|=4)}else{x=_.nodeType===9?_:_.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=te(c)),i==="http://www.w3.org/1999/xhtml"?c==="script"?(i=x.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof f.is=="string"?i=x.createElement(c,{is:f.is}):(i=x.createElement(c),c==="select"&&(x=i,f.multiple?x.multiple=!0:f.size&&(x.size=f.size))):i=x.createElementNS(i,c),i[xi]=s,i[wo]=f,vm(i,s,!1,!1),s.stateNode=i;e:{switch(x=Vn(c,f),c){case"dialog":pt("cancel",i),pt("close",i),_=f;break;case"iframe":case"object":case"embed":pt("load",i),_=f;break;case"video":case"audio":for(_=0;_<yo.length;_++)pt(yo[_],i);_=f;break;case"source":pt("error",i),_=f;break;case"img":case"image":case"link":pt("error",i),pt("load",i),_=f;break;case"details":pt("toggle",i),_=f;break;case"input":Pi(i,f),_=In(i,f),pt("invalid",i);break;case"option":_=f;break;case"select":i._wrapperState={wasMultiple:!!f.multiple},_=C({},f,{value:void 0}),pt("invalid",i);break;case"textarea":Ar(i,f),_=Mr(i,f),pt("invalid",i);break;default:_=f}Ht(c,_),L=_;for(b in L)if(L.hasOwnProperty(b)){var j=L[b];b==="style"?li(i,j):b==="dangerouslySetInnerHTML"?(j=j?j.__html:void 0,j!=null&&We(i,j)):b==="children"?typeof j=="string"?(c!=="textarea"||j!=="")&&Qe(i,j):typeof j=="number"&&Qe(i,""+j):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(o.hasOwnProperty(b)?j!=null&&b==="onScroll"&&pt("scroll",i):j!=null&&T(i,b,j,x))}switch(c){case"input":st(i),Kn(i,f,!1);break;case"textarea":st(i),Lr(i);break;case"option":f.value!=null&&i.setAttribute("value",""+ve(f.value));break;case"select":i.multiple=!!f.multiple,b=f.value,b!=null?yi(i,!!f.multiple,b,!1):f.defaultValue!=null&&yi(i,!!f.multiple,f.defaultValue,!0);break;default:typeof _.onClick=="function"&&(i.onclick=Wa)}switch(c){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return hn(s),null;case 6:if(i&&s.stateNode!=null)bm(i,s,i.memoizedProps,f);else{if(typeof f!="string"&&s.stateNode===null)throw Error(n(166));if(c=Wr(No.current),Wr(ki.current),Za(s)){if(f=s.stateNode,c=s.memoizedProps,f[xi]=s,(b=f.nodeValue!==c)&&(i=Fn,i!==null))switch(i.tag){case 3:$a(f.nodeValue,c,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&$a(f.nodeValue,c,(i.mode&1)!==0)}b&&(s.flags|=4)}else f=(c.nodeType===9?c:c.ownerDocument).createTextNode(f),f[xi]=s,s.stateNode=f}return hn(s),null;case 13:if(mt(xt),f=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(vt&&zn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)xp(),Ls(),s.flags|=98560,b=!1;else if(b=Za(s),f!==null&&f.dehydrated!==null){if(i===null){if(!b)throw Error(n(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(n(317));b[xi]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;hn(s),b=!1}else hi!==null&&(Zu(hi),hi=null),b=!0;if(!b)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=c,s):(f=f!==null,f!==(i!==null&&i.memoizedState!==null)&&f&&(s.child.flags|=8192,(s.mode&1)!==0&&(i===null||(xt.current&1)!==0?Wt===0&&(Wt=3):eh())),s.updateQueue!==null&&(s.flags|=4),hn(s),null);case 4:return Ps(),ju(i,s),i===null&&bo(s.stateNode.containerInfo),hn(s),null;case 10:return pu(s.type._context),hn(s),null;case 17:return Nn(s.type)&&qa(),hn(s),null;case 19:if(mt(xt),b=s.memoizedState,b===null)return hn(s),null;if(f=(s.flags&128)!==0,x=b.rendering,x===null)if(f)Lo(b,!1);else{if(Wt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=il(i),x!==null){for(s.flags|=128,Lo(b,!1),f=x.updateQueue,f!==null&&(s.updateQueue=f,s.flags|=4),s.subtreeFlags=0,f=c,c=s.child;c!==null;)b=c,i=f,b.flags&=14680066,x=b.alternate,x===null?(b.childLanes=0,b.lanes=i,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=x.childLanes,b.lanes=x.lanes,b.child=x.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=x.memoizedProps,b.memoizedState=x.memoizedState,b.updateQueue=x.updateQueue,b.type=x.type,i=x.dependencies,b.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),c=c.sibling;return dt(xt,xt.current&1|2),s.child}i=i.sibling}b.tail!==null&&St()>js&&(s.flags|=128,f=!0,Lo(b,!1),s.lanes=4194304)}else{if(!f)if(i=il(x),i!==null){if(s.flags|=128,f=!0,c=i.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),Lo(b,!0),b.tail===null&&b.tailMode==="hidden"&&!x.alternate&&!vt)return hn(s),null}else 2*St()-b.renderingStartTime>js&&c!==1073741824&&(s.flags|=128,f=!0,Lo(b,!1),s.lanes=4194304);b.isBackwards?(x.sibling=s.child,s.child=x):(c=b.last,c!==null?c.sibling=x:s.child=x,b.last=x)}return b.tail!==null?(s=b.tail,b.rendering=s,b.tail=s.sibling,b.renderingStartTime=St(),s.sibling=null,c=xt.current,dt(xt,f?c&1|2:c&1),s):(hn(s),null);case 22:case 23:return Ju(),f=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==f&&(s.flags|=8192),f&&(s.mode&1)!==0?(jn&1073741824)!==0&&(hn(s),s.subtreeFlags&6&&(s.flags|=8192)):hn(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function pw(i,s){switch(lu(s),s.tag){case 1:return Nn(s.type)&&qa(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ps(),mt(Cn),mt(cn),Su(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return yu(s),null;case 13:if(mt(xt),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return mt(xt),null;case 4:return Ps(),null;case 10:return pu(s.type._context),null;case 22:case 23:return Ju(),null;case 24:return null;default:return null}}var dl=!1,dn=!1,mw=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function Fs(i,s){var c=i.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(f){Tt(i,s,f)}else c.current=null}function Uu(i,s,c){try{c()}catch(f){Tt(i,s,f)}}var Sm=!1;function gw(i,s){if(Jc=La,i=Jf(),Kc(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var _=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var x=0,L=-1,j=-1,J=0,le=0,ce=i,oe=null;t:for(;;){for(var we;ce!==c||_!==0&&ce.nodeType!==3||(L=x+_),ce!==b||f!==0&&ce.nodeType!==3||(j=x+f),ce.nodeType===3&&(x+=ce.nodeValue.length),(we=ce.firstChild)!==null;)oe=ce,ce=we;for(;;){if(ce===i)break t;if(oe===c&&++J===_&&(L=x),oe===b&&++le===f&&(j=x),(we=ce.nextSibling)!==null)break;ce=oe,oe=ce.parentNode}ce=we}c=L===-1||j===-1?null:{start:L,end:j}}else c=null}c=c||{start:0,end:0}}else c=null;for(eu={focusedElem:i,selectionRange:c},La=!1,Ce=s;Ce!==null;)if(s=Ce,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Ce=i;else for(;Ce!==null;){s=Ce;try{var Ne=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Te=Ne.memoizedProps,Ot=Ne.memoizedState,G=s.stateNode,$=G.getSnapshotBeforeUpdate(s.elementType===s.type?Te:di(s.type,Te),Ot);G.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var X=s.stateNode.containerInfo;X.nodeType===1?X.textContent="":X.nodeType===9&&X.documentElement&&X.removeChild(X.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){Tt(s,s.return,de)}if(i=s.sibling,i!==null){i.return=s.return,Ce=i;break}Ce=s.return}return Ne=Sm,Sm=!1,Ne}function Oo(i,s,c){var f=s.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var _=f=f.next;do{if((_.tag&i)===i){var b=_.destroy;_.destroy=void 0,b!==void 0&&Uu(s,c,b)}_=_.next}while(_!==f)}}function fl(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&i)===i){var f=c.create;c.destroy=f()}c=c.next}while(c!==s)}}function Hu(i){var s=i.ref;if(s!==null){var c=i.stateNode;switch(i.tag){case 5:i=c;break;default:i=c}typeof s=="function"?s(i):s.current=i}}function wm(i){var s=i.alternate;s!==null&&(i.alternate=null,wm(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[xi],delete s[wo],delete s[ru],delete s[QS],delete s[JS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function xm(i){return i.tag===5||i.tag===3||i.tag===4}function km(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||xm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function $u(i,s,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?c.nodeType===8?c.parentNode.insertBefore(i,s):c.insertBefore(i,s):(c.nodeType===8?(s=c.parentNode,s.insertBefore(i,c)):(s=c,s.appendChild(i)),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=Wa));else if(f!==4&&(i=i.child,i!==null))for($u(i,s,c),i=i.sibling;i!==null;)$u(i,s,c),i=i.sibling}function Wu(i,s,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?c.insertBefore(i,s):c.appendChild(i);else if(f!==4&&(i=i.child,i!==null))for(Wu(i,s,c),i=i.sibling;i!==null;)Wu(i,s,c),i=i.sibling}var sn=null,fi=!1;function pr(i,s,c){for(c=c.child;c!==null;)Em(i,s,c),c=c.sibling}function Em(i,s,c){if(Xe&&typeof Xe.onCommitFiberUnmount=="function")try{Xe.onCommitFiberUnmount(Ke,c)}catch{}switch(c.tag){case 5:dn||Fs(c,s);case 6:var f=sn,_=fi;sn=null,pr(i,s,c),sn=f,fi=_,sn!==null&&(fi?(i=sn,c=c.stateNode,i.nodeType===8?i.parentNode.removeChild(c):i.removeChild(c)):sn.removeChild(c.stateNode));break;case 18:sn!==null&&(fi?(i=sn,c=c.stateNode,i.nodeType===8?iu(i.parentNode,c):i.nodeType===1&&iu(i,c),uo(i)):iu(sn,c.stateNode));break;case 4:f=sn,_=fi,sn=c.stateNode.containerInfo,fi=!0,pr(i,s,c),sn=f,fi=_;break;case 0:case 11:case 14:case 15:if(!dn&&(f=c.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){_=f=f.next;do{var b=_,x=b.destroy;b=b.tag,x!==void 0&&((b&2)!==0||(b&4)!==0)&&Uu(c,s,x),_=_.next}while(_!==f)}pr(i,s,c);break;case 1:if(!dn&&(Fs(c,s),f=c.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=c.memoizedProps,f.state=c.memoizedState,f.componentWillUnmount()}catch(L){Tt(c,s,L)}pr(i,s,c);break;case 21:pr(i,s,c);break;case 22:c.mode&1?(dn=(f=dn)||c.memoizedState!==null,pr(i,s,c),dn=f):pr(i,s,c);break;default:pr(i,s,c)}}function Cm(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var c=i.stateNode;c===null&&(c=i.stateNode=new mw),s.forEach(function(f){var _=Ew.bind(null,i,f);c.has(f)||(c.add(f),f.then(_,_))})}}function pi(i,s){var c=s.deletions;if(c!==null)for(var f=0;f<c.length;f++){var _=c[f];try{var b=i,x=s,L=x;e:for(;L!==null;){switch(L.tag){case 5:sn=L.stateNode,fi=!1;break e;case 3:sn=L.stateNode.containerInfo,fi=!0;break e;case 4:sn=L.stateNode.containerInfo,fi=!0;break e}L=L.return}if(sn===null)throw Error(n(160));Em(b,x,_),sn=null,fi=!1;var j=_.alternate;j!==null&&(j.return=null),_.return=null}catch(J){Tt(_,s,J)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Nm(s,i),s=s.sibling}function Nm(i,s){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(pi(s,i),Ci(i),f&4){try{Oo(3,i,i.return),fl(3,i)}catch(Te){Tt(i,i.return,Te)}try{Oo(5,i,i.return)}catch(Te){Tt(i,i.return,Te)}}break;case 1:pi(s,i),Ci(i),f&512&&c!==null&&Fs(c,c.return);break;case 5:if(pi(s,i),Ci(i),f&512&&c!==null&&Fs(c,c.return),i.flags&32){var _=i.stateNode;try{Qe(_,"")}catch(Te){Tt(i,i.return,Te)}}if(f&4&&(_=i.stateNode,_!=null)){var b=i.memoizedProps,x=c!==null?c.memoizedProps:b,L=i.type,j=i.updateQueue;if(i.updateQueue=null,j!==null)try{L==="input"&&b.type==="radio"&&b.name!=null&&et(_,b),Vn(L,x);var J=Vn(L,b);for(x=0;x<j.length;x+=2){var le=j[x],ce=j[x+1];le==="style"?li(_,ce):le==="dangerouslySetInnerHTML"?We(_,ce):le==="children"?Qe(_,ce):T(_,le,ce,J)}switch(L){case"input":Pn(_,b);break;case"textarea":qn(_,b);break;case"select":var oe=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!b.multiple;var we=b.value;we!=null?yi(_,!!b.multiple,we,!1):oe!==!!b.multiple&&(b.defaultValue!=null?yi(_,!!b.multiple,b.defaultValue,!0):yi(_,!!b.multiple,b.multiple?[]:"",!1))}_[wo]=b}catch(Te){Tt(i,i.return,Te)}}break;case 6:if(pi(s,i),Ci(i),f&4){if(i.stateNode===null)throw Error(n(162));_=i.stateNode,b=i.memoizedProps;try{_.nodeValue=b}catch(Te){Tt(i,i.return,Te)}}break;case 3:if(pi(s,i),Ci(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{uo(s.containerInfo)}catch(Te){Tt(i,i.return,Te)}break;case 4:pi(s,i),Ci(i);break;case 13:pi(s,i),Ci(i),_=i.child,_.flags&8192&&(b=_.memoizedState!==null,_.stateNode.isHidden=b,!b||_.alternate!==null&&_.alternate.memoizedState!==null||(Vu=St())),f&4&&Cm(i);break;case 22:if(le=c!==null&&c.memoizedState!==null,i.mode&1?(dn=(J=dn)||le,pi(s,i),dn=J):pi(s,i),Ci(i),f&8192){if(J=i.memoizedState!==null,(i.stateNode.isHidden=J)&&!le&&(i.mode&1)!==0)for(Ce=i,le=i.child;le!==null;){for(ce=Ce=le;Ce!==null;){switch(oe=Ce,we=oe.child,oe.tag){case 0:case 11:case 14:case 15:Oo(4,oe,oe.return);break;case 1:Fs(oe,oe.return);var Ne=oe.stateNode;if(typeof Ne.componentWillUnmount=="function"){f=oe,c=oe.return;try{s=f,Ne.props=s.memoizedProps,Ne.state=s.memoizedState,Ne.componentWillUnmount()}catch(Te){Tt(f,c,Te)}}break;case 5:Fs(oe,oe.return);break;case 22:if(oe.memoizedState!==null){Mm(ce);continue}}we!==null?(we.return=oe,Ce=we):Mm(ce)}le=le.sibling}e:for(le=null,ce=i;;){if(ce.tag===5){if(le===null){le=ce;try{_=ce.stateNode,J?(b=_.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(L=ce.stateNode,j=ce.memoizedProps.style,x=j!=null&&j.hasOwnProperty("display")?j.display:null,L.style.display=En("display",x))}catch(Te){Tt(i,i.return,Te)}}}else if(ce.tag===6){if(le===null)try{ce.stateNode.nodeValue=J?"":ce.memoizedProps}catch(Te){Tt(i,i.return,Te)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===i)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===i)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===i)break e;le===ce&&(le=null),ce=ce.return}le===ce&&(le=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:pi(s,i),Ci(i),f&4&&Cm(i);break;case 21:break;default:pi(s,i),Ci(i)}}function Ci(i){var s=i.flags;if(s&2){try{e:{for(var c=i.return;c!==null;){if(xm(c)){var f=c;break e}c=c.return}throw Error(n(160))}switch(f.tag){case 5:var _=f.stateNode;f.flags&32&&(Qe(_,""),f.flags&=-33);var b=km(i);Wu(i,b,_);break;case 3:case 4:var x=f.stateNode.containerInfo,L=km(i);$u(i,L,x);break;default:throw Error(n(161))}}catch(j){Tt(i,i.return,j)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function _w(i,s,c){Ce=i,Tm(i)}function Tm(i,s,c){for(var f=(i.mode&1)!==0;Ce!==null;){var _=Ce,b=_.child;if(_.tag===22&&f){var x=_.memoizedState!==null||dl;if(!x){var L=_.alternate,j=L!==null&&L.memoizedState!==null||dn;L=dl;var J=dn;if(dl=x,(dn=j)&&!J)for(Ce=_;Ce!==null;)x=Ce,j=x.child,x.tag===22&&x.memoizedState!==null?Am(_):j!==null?(j.return=x,Ce=j):Am(_);for(;b!==null;)Ce=b,Tm(b),b=b.sibling;Ce=_,dl=L,dn=J}Rm(i)}else(_.subtreeFlags&8772)!==0&&b!==null?(b.return=_,Ce=b):Rm(i)}}function Rm(i){for(;Ce!==null;){var s=Ce;if((s.flags&8772)!==0){var c=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:dn||fl(5,s);break;case 1:var f=s.stateNode;if(s.flags&4&&!dn)if(c===null)f.componentDidMount();else{var _=s.elementType===s.type?c.memoizedProps:di(s.type,c.memoizedProps);f.componentDidUpdate(_,c.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var b=s.updateQueue;b!==null&&Mp(s,b,f);break;case 3:var x=s.updateQueue;if(x!==null){if(c=null,s.child!==null)switch(s.child.tag){case 5:c=s.child.stateNode;break;case 1:c=s.child.stateNode}Mp(s,x,c)}break;case 5:var L=s.stateNode;if(c===null&&s.flags&4){c=L;var j=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":j.autoFocus&&c.focus();break;case"img":j.src&&(c.src=j.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var J=s.alternate;if(J!==null){var le=J.memoizedState;if(le!==null){var ce=le.dehydrated;ce!==null&&uo(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}dn||s.flags&512&&Hu(s)}catch(oe){Tt(s,s.return,oe)}}if(s===i){Ce=null;break}if(c=s.sibling,c!==null){c.return=s.return,Ce=c;break}Ce=s.return}}function Mm(i){for(;Ce!==null;){var s=Ce;if(s===i){Ce=null;break}var c=s.sibling;if(c!==null){c.return=s.return,Ce=c;break}Ce=s.return}}function Am(i){for(;Ce!==null;){var s=Ce;try{switch(s.tag){case 0:case 11:case 15:var c=s.return;try{fl(4,s)}catch(j){Tt(s,c,j)}break;case 1:var f=s.stateNode;if(typeof f.componentDidMount=="function"){var _=s.return;try{f.componentDidMount()}catch(j){Tt(s,_,j)}}var b=s.return;try{Hu(s)}catch(j){Tt(s,b,j)}break;case 5:var x=s.return;try{Hu(s)}catch(j){Tt(s,x,j)}}}catch(j){Tt(s,s.return,j)}if(s===i){Ce=null;break}var L=s.sibling;if(L!==null){L.return=s.return,Ce=L;break}Ce=s.return}}var vw=Math.ceil,pl=A.ReactCurrentDispatcher,Ku=A.ReactCurrentOwner,Jn=A.ReactCurrentBatchConfig,it=0,Xt=null,Bt=null,on=0,jn=0,zs=cr(0),Wt=0,Do=null,qr=0,ml=0,qu=0,Io=null,Rn=null,Vu=0,js=1/0,Gi=null,gl=!1,Gu=null,mr=null,_l=!1,gr=null,vl=0,Po=0,Yu=null,yl=-1,bl=0;function yn(){return(it&6)!==0?St():yl!==-1?yl:yl=St()}function _r(i){return(i.mode&1)===0?1:(it&2)!==0&&on!==0?on&-on:tw.transition!==null?(bl===0&&(bl=Ra()),bl):(i=nt,i!==0||(i=window.event,i=i===void 0?16:Of(i.type)),i)}function mi(i,s,c,f){if(50<Po)throw Po=0,Yu=null,Error(n(185));rr(i,c,f),((it&2)===0||i!==Xt)&&(i===Xt&&((it&2)===0&&(ml|=c),Wt===4&&vr(i,on)),Mn(i,f),c===1&&it===0&&(s.mode&1)===0&&(js=St()+500,Ga&&hr()))}function Mn(i,s){var c=i.callbackNode;Lc(i,s);var f=Pr(i,i===Xt?on:0);if(f===0)c!==null&&ci(c),i.callbackNode=null,i.callbackPriority=0;else if(s=f&-f,i.callbackPriority!==s){if(c!=null&&ci(c),s===1)i.tag===0?ew(Om.bind(null,i)):vp(Om.bind(null,i)),XS(function(){(it&6)===0&&hr()}),c=null;else{switch(He(f)){case 1:c=ro;break;case 4:c=Dr;break;case 16:c=vs;break;case 536870912:c=Ae;break;default:c=vs}c=Um(c,Lm.bind(null,i))}i.callbackPriority=s,i.callbackNode=c}}function Lm(i,s){if(yl=-1,bl=0,(it&6)!==0)throw Error(n(327));var c=i.callbackNode;if(Us()&&i.callbackNode!==c)return null;var f=Pr(i,i===Xt?on:0);if(f===0)return null;if((f&30)!==0||(f&i.expiredLanes)!==0||s)s=Sl(i,f);else{s=f;var _=it;it|=2;var b=Im();(Xt!==i||on!==s)&&(Gi=null,js=St()+500,Gr(i,s));do try{Sw();break}catch(L){Dm(i,L)}while(!0);fu(),pl.current=b,it=_,Bt!==null?s=0:(Xt=null,on=0,s=Wt)}if(s!==0){if(s===2&&(_=so(i),_!==0&&(f=_,s=Xu(i,_))),s===1)throw c=Do,Gr(i,0),vr(i,f),Mn(i,St()),c;if(s===6)vr(i,f);else{if(_=i.current.alternate,(f&30)===0&&!yw(_)&&(s=Sl(i,f),s===2&&(b=so(i),b!==0&&(f=b,s=Xu(i,b))),s===1))throw c=Do,Gr(i,0),vr(i,f),Mn(i,St()),c;switch(i.finishedWork=_,i.finishedLanes=f,s){case 0:case 1:throw Error(n(345));case 2:Yr(i,Rn,Gi);break;case 3:if(vr(i,f),(f&130023424)===f&&(s=Vu+500-St(),10<s)){if(Pr(i,0)!==0)break;if(_=i.suspendedLanes,(_&f)!==f){yn(),i.pingedLanes|=i.suspendedLanes&_;break}i.timeoutHandle=nu(Yr.bind(null,i,Rn,Gi),s);break}Yr(i,Rn,Gi);break;case 4:if(vr(i,f),(f&4194240)===f)break;for(s=i.eventTimes,_=-1;0<f;){var x=31-wt(f);b=1<<x,x=s[x],x>_&&(_=x),f&=~b}if(f=_,f=St()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*vw(f/1960))-f,10<f){i.timeoutHandle=nu(Yr.bind(null,i,Rn,Gi),f);break}Yr(i,Rn,Gi);break;case 5:Yr(i,Rn,Gi);break;default:throw Error(n(329))}}}return Mn(i,St()),i.callbackNode===c?Lm.bind(null,i):null}function Xu(i,s){var c=Io;return i.current.memoizedState.isDehydrated&&(Gr(i,s).flags|=256),i=Sl(i,s),i!==2&&(s=Rn,Rn=c,s!==null&&Zu(s)),i}function Zu(i){Rn===null?Rn=i:Rn.push.apply(Rn,i)}function yw(i){for(var s=i;;){if(s.flags&16384){var c=s.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var f=0;f<c.length;f++){var _=c[f],b=_.getSnapshot;_=_.value;try{if(!ui(b(),_))return!1}catch{return!1}}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function vr(i,s){for(s&=~qu,s&=~ml,i.suspendedLanes|=s,i.pingedLanes&=~s,i=i.expirationTimes;0<s;){var c=31-wt(s),f=1<<c;i[c]=-1,s&=~f}}function Om(i){if((it&6)!==0)throw Error(n(327));Us();var s=Pr(i,0);if((s&1)===0)return Mn(i,St()),null;var c=Sl(i,s);if(i.tag!==0&&c===2){var f=so(i);f!==0&&(s=f,c=Xu(i,f))}if(c===1)throw c=Do,Gr(i,0),vr(i,s),Mn(i,St()),c;if(c===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=s,Yr(i,Rn,Gi),Mn(i,St()),null}function Qu(i,s){var c=it;it|=1;try{return i(s)}finally{it=c,it===0&&(js=St()+500,Ga&&hr())}}function Vr(i){gr!==null&&gr.tag===0&&(it&6)===0&&Us();var s=it;it|=1;var c=Jn.transition,f=nt;try{if(Jn.transition=null,nt=1,i)return i()}finally{nt=f,Jn.transition=c,it=s,(it&6)===0&&hr()}}function Ju(){jn=zs.current,mt(zs)}function Gr(i,s){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;if(c!==-1&&(i.timeoutHandle=-1,YS(c)),Bt!==null)for(c=Bt.return;c!==null;){var f=c;switch(lu(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&qa();break;case 3:Ps(),mt(Cn),mt(cn),Su();break;case 5:yu(f);break;case 4:Ps();break;case 13:mt(xt);break;case 19:mt(xt);break;case 10:pu(f.type._context);break;case 22:case 23:Ju()}c=c.return}if(Xt=i,Bt=i=yr(i.current,null),on=jn=s,Wt=0,Do=null,qu=ml=qr=0,Rn=Io=null,$r!==null){for(s=0;s<$r.length;s++)if(c=$r[s],f=c.interleaved,f!==null){c.interleaved=null;var _=f.next,b=c.pending;if(b!==null){var x=b.next;b.next=_,f.next=x}c.pending=f}$r=null}return i}function Dm(i,s){do{var c=Bt;try{if(fu(),rl.current=ll,sl){for(var f=kt.memoizedState;f!==null;){var _=f.queue;_!==null&&(_.pending=null),f=f.next}sl=!1}if(Kr=0,Yt=$t=kt=null,To=!1,Ro=0,Ku.current=null,c===null||c.return===null){Wt=1,Do=s,Bt=null;break}e:{var b=i,x=c.return,L=c,j=s;if(s=on,L.flags|=32768,j!==null&&typeof j=="object"&&typeof j.then=="function"){var J=j,le=L,ce=le.tag;if((le.mode&1)===0&&(ce===0||ce===11||ce===15)){var oe=le.alternate;oe?(le.updateQueue=oe.updateQueue,le.memoizedState=oe.memoizedState,le.lanes=oe.lanes):(le.updateQueue=null,le.memoizedState=null)}var we=sm(x);if(we!==null){we.flags&=-257,om(we,x,L,b,s),we.mode&1&&rm(b,J,s),s=we,j=J;var Ne=s.updateQueue;if(Ne===null){var Te=new Set;Te.add(j),s.updateQueue=Te}else Ne.add(j);break e}else{if((s&1)===0){rm(b,J,s),eh();break e}j=Error(n(426))}}else if(vt&&L.mode&1){var Ot=sm(x);if(Ot!==null){(Ot.flags&65536)===0&&(Ot.flags|=256),om(Ot,x,L,b,s),hu(Bs(j,L));break e}}b=j=Bs(j,L),Wt!==4&&(Wt=2),Io===null?Io=[b]:Io.push(b),b=x;do{switch(b.tag){case 3:b.flags|=65536,s&=-s,b.lanes|=s;var G=nm(b,j,s);Rp(b,G);break e;case 1:L=j;var $=b.type,X=b.stateNode;if((b.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||X!==null&&typeof X.componentDidCatch=="function"&&(mr===null||!mr.has(X)))){b.flags|=65536,s&=-s,b.lanes|=s;var de=im(b,L,s);Rp(b,de);break e}}b=b.return}while(b!==null)}Bm(c)}catch(Me){s=Me,Bt===c&&c!==null&&(Bt=c=c.return);continue}break}while(!0)}function Im(){var i=pl.current;return pl.current=ll,i===null?ll:i}function eh(){(Wt===0||Wt===3||Wt===2)&&(Wt=4),Xt===null||(qr&268435455)===0&&(ml&268435455)===0||vr(Xt,on)}function Sl(i,s){var c=it;it|=2;var f=Im();(Xt!==i||on!==s)&&(Gi=null,Gr(i,s));do try{bw();break}catch(_){Dm(i,_)}while(!0);if(fu(),it=c,pl.current=f,Bt!==null)throw Error(n(261));return Xt=null,on=0,Wt}function bw(){for(;Bt!==null;)Pm(Bt)}function Sw(){for(;Bt!==null&&!Na();)Pm(Bt)}function Pm(i){var s=jm(i.alternate,i,jn);i.memoizedProps=i.pendingProps,s===null?Bm(i):Bt=s,Ku.current=null}function Bm(i){var s=i;do{var c=s.alternate;if(i=s.return,(s.flags&32768)===0){if(c=fw(c,s,jn),c!==null){Bt=c;return}}else{if(c=pw(c,s),c!==null){c.flags&=32767,Bt=c;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Wt=6,Bt=null;return}}if(s=s.sibling,s!==null){Bt=s;return}Bt=s=i}while(s!==null);Wt===0&&(Wt=5)}function Yr(i,s,c){var f=nt,_=Jn.transition;try{Jn.transition=null,nt=1,ww(i,s,c,f)}finally{Jn.transition=_,nt=f}return null}function ww(i,s,c,f){do Us();while(gr!==null);if((it&6)!==0)throw Error(n(327));c=i.finishedWork;var _=i.finishedLanes;if(c===null)return null;if(i.finishedWork=null,i.finishedLanes=0,c===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var b=c.lanes|c.childLanes;if(Gn(i,b),i===Xt&&(Bt=Xt=null,on=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||_l||(_l=!0,Um(vs,function(){return Us(),null})),b=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||b){b=Jn.transition,Jn.transition=null;var x=nt;nt=1;var L=it;it|=4,Ku.current=null,gw(i,c),Nm(c,i),HS(eu),La=!!Jc,eu=Jc=null,i.current=c,_w(c),Ta(),it=L,nt=x,Jn.transition=b}else i.current=c;if(_l&&(_l=!1,gr=i,vl=_),b=i.pendingLanes,b===0&&(mr=null),At(c.stateNode),Mn(i,St()),s!==null)for(f=i.onRecoverableError,c=0;c<s.length;c++)_=s[c],f(_.value,{componentStack:_.stack,digest:_.digest});if(gl)throw gl=!1,i=Gu,Gu=null,i;return(vl&1)!==0&&i.tag!==0&&Us(),b=i.pendingLanes,(b&1)!==0?i===Yu?Po++:(Po=0,Yu=i):Po=0,hr(),null}function Us(){if(gr!==null){var i=He(vl),s=Jn.transition,c=nt;try{if(Jn.transition=null,nt=16>i?16:i,gr===null)var f=!1;else{if(i=gr,gr=null,vl=0,(it&6)!==0)throw Error(n(331));var _=it;for(it|=4,Ce=i.current;Ce!==null;){var b=Ce,x=b.child;if((Ce.flags&16)!==0){var L=b.deletions;if(L!==null){for(var j=0;j<L.length;j++){var J=L[j];for(Ce=J;Ce!==null;){var le=Ce;switch(le.tag){case 0:case 11:case 15:Oo(8,le,b)}var ce=le.child;if(ce!==null)ce.return=le,Ce=ce;else for(;Ce!==null;){le=Ce;var oe=le.sibling,we=le.return;if(wm(le),le===J){Ce=null;break}if(oe!==null){oe.return=we,Ce=oe;break}Ce=we}}}var Ne=b.alternate;if(Ne!==null){var Te=Ne.child;if(Te!==null){Ne.child=null;do{var Ot=Te.sibling;Te.sibling=null,Te=Ot}while(Te!==null)}}Ce=b}}if((b.subtreeFlags&2064)!==0&&x!==null)x.return=b,Ce=x;else e:for(;Ce!==null;){if(b=Ce,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:Oo(9,b,b.return)}var G=b.sibling;if(G!==null){G.return=b.return,Ce=G;break e}Ce=b.return}}var $=i.current;for(Ce=$;Ce!==null;){x=Ce;var X=x.child;if((x.subtreeFlags&2064)!==0&&X!==null)X.return=x,Ce=X;else e:for(x=$;Ce!==null;){if(L=Ce,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:fl(9,L)}}catch(Me){Tt(L,L.return,Me)}if(L===x){Ce=null;break e}var de=L.sibling;if(de!==null){de.return=L.return,Ce=de;break e}Ce=L.return}}if(it=_,hr(),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(Ke,i)}catch{}f=!0}return f}finally{nt=c,Jn.transition=s}}return!1}function Fm(i,s,c){s=Bs(c,s),s=nm(i,s,1),i=fr(i,s,1),s=yn(),i!==null&&(rr(i,1,s),Mn(i,s))}function Tt(i,s,c){if(i.tag===3)Fm(i,i,c);else for(;s!==null;){if(s.tag===3){Fm(s,i,c);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(mr===null||!mr.has(f))){i=Bs(c,i),i=im(s,i,1),s=fr(s,i,1),i=yn(),s!==null&&(rr(s,1,i),Mn(s,i));break}}s=s.return}}function xw(i,s,c){var f=i.pingCache;f!==null&&f.delete(s),s=yn(),i.pingedLanes|=i.suspendedLanes&c,Xt===i&&(on&c)===c&&(Wt===4||Wt===3&&(on&130023424)===on&&500>St()-Vu?Gr(i,0):qu|=c),Mn(i,s)}function zm(i,s){s===0&&((i.mode&1)===0?s=1:(s=Ir,Ir<<=1,(Ir&130023424)===0&&(Ir=4194304)));var c=yn();i=Ki(i,s),i!==null&&(rr(i,s,c),Mn(i,c))}function kw(i){var s=i.memoizedState,c=0;s!==null&&(c=s.retryLane),zm(i,c)}function Ew(i,s){var c=0;switch(i.tag){case 13:var f=i.stateNode,_=i.memoizedState;_!==null&&(c=_.retryLane);break;case 19:f=i.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(s),zm(i,c)}var jm;jm=function(i,s,c){if(i!==null)if(i.memoizedProps!==s.pendingProps||Cn.current)Tn=!0;else{if((i.lanes&c)===0&&(s.flags&128)===0)return Tn=!1,dw(i,s,c);Tn=(i.flags&131072)!==0}else Tn=!1,vt&&(s.flags&1048576)!==0&&yp(s,Xa,s.index);switch(s.lanes=0,s.tag){case 2:var f=s.type;hl(i,s),i=s.pendingProps;var _=Rs(s,cn.current);Is(s,c),_=ku(null,s,f,i,_,c);var b=Eu();return s.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Nn(f)?(b=!0,Va(s)):b=!1,s.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_u(s),_.updater=cl,s.stateNode=_,_._reactInternals=s,Au(s,f,i,c),s=Iu(null,s,f,!0,b,c)):(s.tag=0,vt&&b&&au(s),vn(null,s,_,c),s=s.child),s;case 16:f=s.elementType;e:{switch(hl(i,s),i=s.pendingProps,_=f._init,f=_(f._payload),s.type=f,_=s.tag=Nw(f),i=di(f,i),_){case 0:s=Du(null,s,f,i,c);break e;case 1:s=dm(null,s,f,i,c);break e;case 11:s=am(null,s,f,i,c);break e;case 14:s=lm(null,s,f,di(f.type,i),c);break e}throw Error(n(306,f,""))}return s;case 0:return f=s.type,_=s.pendingProps,_=s.elementType===f?_:di(f,_),Du(i,s,f,_,c);case 1:return f=s.type,_=s.pendingProps,_=s.elementType===f?_:di(f,_),dm(i,s,f,_,c);case 3:e:{if(fm(s),i===null)throw Error(n(387));f=s.pendingProps,b=s.memoizedState,_=b.element,Tp(i,s),nl(s,f,null,c);var x=s.memoizedState;if(f=x.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){_=Bs(Error(n(423)),s),s=pm(i,s,f,c,_);break e}else if(f!==_){_=Bs(Error(n(424)),s),s=pm(i,s,f,c,_);break e}else for(zn=lr(s.stateNode.containerInfo.firstChild),Fn=s,vt=!0,hi=null,c=Cp(s,null,f,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ls(),f===_){s=Vi(i,s,c);break e}vn(i,s,f,c)}s=s.child}return s;case 5:return Ap(s),i===null&&uu(s),f=s.type,_=s.pendingProps,b=i!==null?i.memoizedProps:null,x=_.children,tu(f,_)?x=null:b!==null&&tu(f,b)&&(s.flags|=32),hm(i,s),vn(i,s,x,c),s.child;case 6:return i===null&&uu(s),null;case 13:return mm(i,s,c);case 4:return vu(s,s.stateNode.containerInfo),f=s.pendingProps,i===null?s.child=Os(s,null,f,c):vn(i,s,f,c),s.child;case 11:return f=s.type,_=s.pendingProps,_=s.elementType===f?_:di(f,_),am(i,s,f,_,c);case 7:return vn(i,s,s.pendingProps,c),s.child;case 8:return vn(i,s,s.pendingProps.children,c),s.child;case 12:return vn(i,s,s.pendingProps.children,c),s.child;case 10:e:{if(f=s.type._context,_=s.pendingProps,b=s.memoizedProps,x=_.value,dt(Ja,f._currentValue),f._currentValue=x,b!==null)if(ui(b.value,x)){if(b.children===_.children&&!Cn.current){s=Vi(i,s,c);break e}}else for(b=s.child,b!==null&&(b.return=s);b!==null;){var L=b.dependencies;if(L!==null){x=b.child;for(var j=L.firstContext;j!==null;){if(j.context===f){if(b.tag===1){j=qi(-1,c&-c),j.tag=2;var J=b.updateQueue;if(J!==null){J=J.shared;var le=J.pending;le===null?j.next=j:(j.next=le.next,le.next=j),J.pending=j}}b.lanes|=c,j=b.alternate,j!==null&&(j.lanes|=c),mu(b.return,c,s),L.lanes|=c;break}j=j.next}}else if(b.tag===10)x=b.type===s.type?null:b.child;else if(b.tag===18){if(x=b.return,x===null)throw Error(n(341));x.lanes|=c,L=x.alternate,L!==null&&(L.lanes|=c),mu(x,c,s),x=b.sibling}else x=b.child;if(x!==null)x.return=b;else for(x=b;x!==null;){if(x===s){x=null;break}if(b=x.sibling,b!==null){b.return=x.return,x=b;break}x=x.return}b=x}vn(i,s,_.children,c),s=s.child}return s;case 9:return _=s.type,f=s.pendingProps.children,Is(s,c),_=Zn(_),f=f(_),s.flags|=1,vn(i,s,f,c),s.child;case 14:return f=s.type,_=di(f,s.pendingProps),_=di(f.type,_),lm(i,s,f,_,c);case 15:return cm(i,s,s.type,s.pendingProps,c);case 17:return f=s.type,_=s.pendingProps,_=s.elementType===f?_:di(f,_),hl(i,s),s.tag=1,Nn(f)?(i=!0,Va(s)):i=!1,Is(s,c),em(s,f,_),Au(s,f,_,c),Iu(null,s,f,!0,i,c);case 19:return _m(i,s,c);case 22:return um(i,s,c)}throw Error(n(156,s.tag))};function Um(i,s){return Ca(i,s)}function Cw(i,s,c,f){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(i,s,c,f){return new Cw(i,s,c,f)}function th(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Nw(i){if(typeof i=="function")return th(i)?1:0;if(i!=null){if(i=i.$$typeof,i===U)return 11;if(i===F)return 14}return 2}function yr(i,s){var c=i.alternate;return c===null?(c=ei(i.tag,s,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=s,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&14680064,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,s=i.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c}function wl(i,s,c,f,_,b){var x=2;if(f=i,typeof i=="function")th(i)&&(x=1);else if(typeof i=="string")x=5;else e:switch(i){case ne:return Xr(c.children,_,b,s);case Z:x=8,_|=8;break;case ee:return i=ei(12,c,s,_|2),i.elementType=ee,i.lanes=b,i;case O:return i=ei(13,c,s,_),i.elementType=O,i.lanes=b,i;case q:return i=ei(19,c,s,_),i.elementType=q,i.lanes=b,i;case ie:return xl(c,_,b,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case W:x=10;break e;case H:x=9;break e;case U:x=11;break e;case F:x=14;break e;case Q:x=16,f=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return s=ei(x,c,s,_),s.elementType=i,s.type=f,s.lanes=b,s}function Xr(i,s,c,f){return i=ei(7,i,f,s),i.lanes=c,i}function xl(i,s,c,f){return i=ei(22,i,f,s),i.elementType=ie,i.lanes=c,i.stateNode={isHidden:!1},i}function nh(i,s,c){return i=ei(6,i,null,s),i.lanes=c,i}function ih(i,s,c){return s=ei(4,i.children!==null?i.children:[],i.key,s),s.lanes=c,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function Tw(i,s,c,f,_){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ir(0),this.expirationTimes=ir(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ir(0),this.identifierPrefix=f,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function rh(i,s,c,f,_,b,x,L,j){return i=new Tw(i,s,c,L,j),s===1?(s=1,b===!0&&(s|=8)):s=0,b=ei(3,null,null,s),i.current=b,b.stateNode=i,b.memoizedState={element:f,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},_u(b),i}function Rw(i,s,c){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:f==null?null:""+f,children:i,containerInfo:s,implementation:c}}function Hm(i){if(!i)return ur;i=i._reactInternals;e:{if(ji(i)!==i||i.tag!==1)throw Error(n(170));var s=i;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Nn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(i.tag===1){var c=i.type;if(Nn(c))return gp(i,c,s)}return s}function $m(i,s,c,f,_,b,x,L,j){return i=rh(c,f,!0,i,_,b,x,L,j),i.context=Hm(null),c=i.current,f=yn(),_=_r(c),b=qi(f,_),b.callback=s??null,fr(c,b,_),i.current.lanes=_,rr(i,_,f),Mn(i,f),i}function kl(i,s,c,f){var _=s.current,b=yn(),x=_r(_);return c=Hm(c),s.context===null?s.context=c:s.pendingContext=c,s=qi(b,x),s.payload={element:i},f=f===void 0?null:f,f!==null&&(s.callback=f),i=fr(_,s,x),i!==null&&(mi(i,_,x,b),tl(i,_,x)),x}function El(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Wm(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<s?c:s}}function sh(i,s){Wm(i,s),(i=i.alternate)&&Wm(i,s)}function Mw(){return null}var Km=typeof reportError=="function"?reportError:function(i){console.error(i)};function oh(i){this._internalRoot=i}Cl.prototype.render=oh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(n(409));kl(i,s,null,null)},Cl.prototype.unmount=oh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;Vr(function(){kl(null,i,null,null)}),s[Ui]=null}};function Cl(i){this._internalRoot=i}Cl.prototype.unstable_scheduleHydration=function(i){if(i){var s=Br();i={blockedOn:null,target:i,priority:s};for(var c=0;c<Gt.length&&s!==0&&s<Gt[c].priority;c++);Gt.splice(c,0,i),c===0&&Af(i)}};function ah(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Nl(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function qm(){}function Aw(i,s,c,f,_){if(_){if(typeof f=="function"){var b=f;f=function(){var J=El(x);b.call(J)}}var x=$m(s,f,i,0,null,!1,!1,"",qm);return i._reactRootContainer=x,i[Ui]=x.current,bo(i.nodeType===8?i.parentNode:i),Vr(),x}for(;_=i.lastChild;)i.removeChild(_);if(typeof f=="function"){var L=f;f=function(){var J=El(j);L.call(J)}}var j=rh(i,0,!1,null,null,!1,!1,"",qm);return i._reactRootContainer=j,i[Ui]=j.current,bo(i.nodeType===8?i.parentNode:i),Vr(function(){kl(s,j,c,f)}),j}function Tl(i,s,c,f,_){var b=c._reactRootContainer;if(b){var x=b;if(typeof _=="function"){var L=_;_=function(){var j=El(x);L.call(j)}}kl(s,x,i,_)}else x=Aw(c,s,i,_,f);return El(x)}ao=function(i){switch(i.tag){case 3:var s=i.stateNode;if(s.current.memoizedState.isDehydrated){var c=nr(s.pendingLanes);c!==0&&(oo(s,c|1),Mn(s,St()),(it&6)===0&&(js=St()+500,hr()))}break;case 13:Vr(function(){var f=Ki(i,1);if(f!==null){var _=yn();mi(f,i,1,_)}}),sh(i,1)}},Lt=function(i){if(i.tag===13){var s=Ki(i,134217728);if(s!==null){var c=yn();mi(s,i,134217728,c)}sh(i,134217728)}},ot=function(i){if(i.tag===13){var s=_r(i),c=Ki(i,s);if(c!==null){var f=yn();mi(c,i,s,f)}sh(i,s)}},Br=function(){return nt},wi=function(i,s){var c=nt;try{return nt=i,s()}finally{nt=c}},gs=function(i,s,c){switch(s){case"input":if(Pn(i,c),s=c.name,c.type==="radio"&&s!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<c.length;s++){var f=c[s];if(f!==i&&f.form===i.form){var _=Ka(f);if(!_)throw Error(n(90));It(f),Pn(f,_)}}}break;case"textarea":qn(i,c);break;case"select":s=c.value,s!=null&&yi(i,!!c.multiple,s,!1)}},_e=Qu,ze=Vr;var Lw={usingClientEntryPoint:!1,Events:[xo,Ns,Ka,B,re,Qu]},Bo={findFiberByHostInstance:zr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ow={bundleType:Bo.bundleType,version:Bo.version,rendererPackageName:Bo.rendererPackageName,rendererConfig:Bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ka(i),i===null?null:i.stateNode},findFiberByHostInstance:Bo.findFiberByHostInstance||Mw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rl.isDisabled&&Rl.supportsFiber)try{Ke=Rl.inject(Ow),Xe=Rl}catch{}}return An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lw,An.createPortal=function(i,s){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ah(s))throw Error(n(200));return Rw(i,s,null,c)},An.createRoot=function(i,s){if(!ah(i))throw Error(n(299));var c=!1,f="",_=Km;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onRecoverableError!==void 0&&(_=s.onRecoverableError)),s=rh(i,1,!1,null,null,c,!1,f,_),i[Ui]=s.current,bo(i.nodeType===8?i.parentNode:i),new oh(s)},An.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=ka(s),i=i===null?null:i.stateNode,i},An.flushSync=function(i){return Vr(i)},An.hydrate=function(i,s,c){if(!Nl(s))throw Error(n(200));return Tl(null,i,s,!0,c)},An.hydrateRoot=function(i,s,c){if(!ah(i))throw Error(n(405));var f=c!=null&&c.hydratedSources||null,_=!1,b="",x=Km;if(c!=null&&(c.unstable_strictMode===!0&&(_=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onRecoverableError!==void 0&&(x=c.onRecoverableError)),s=$m(s,null,i,1,c??null,_,!1,b,x),i[Ui]=s.current,bo(i),f)for(i=0;i<f.length;i++)c=f[i],_=c._getVersion,_=_(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,_]:s.mutableSourceEagerHydrationData.push(c,_);return new Cl(s)},An.render=function(i,s,c){if(!Nl(s))throw Error(n(200));return Tl(null,i,s,!1,c)},An.unmountComponentAtNode=function(i){if(!Nl(i))throw Error(n(40));return i._reactRootContainer?(Vr(function(){Tl(null,null,i,!1,function(){i._reactRootContainer=null,i[Ui]=null})}),!0):!1},An.unstable_batchedUpdates=Qu,An.unstable_renderSubtreeIntoContainer=function(i,s,c,f){if(!Nl(c))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return Tl(i,s,c,!1,f)},An.version="18.3.1-next-f1338f8080-20240426",An}var eg;function yv(){if(eg)return uh.exports;eg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),uh.exports=jw(),uh.exports}var tg;function Uw(){if(tg)return Ml;tg=1;var e=yv();return Ml.createRoot=e.createRoot,Ml.hydrateRoot=e.hydrateRoot,Ml}var Hw=Uw(),bv={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ng=rs.createContext&&rs.createContext(bv),$w=["attr","size","title"];function Ww(e,t){if(e==null)return{};var n,r,o=Kw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Kw(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ec(){return ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ec.apply(null,arguments)}function ig(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function tc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ig(Object(n),!0).forEach(function(r){qw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ig(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qw(e,t,n){return(t=Vw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vw(e){var t=Gw(e,"string");return typeof t=="symbol"?t:t+""}function Gw(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sv(e){return e&&e.map((t,n)=>rs.createElement(t.tag,tc({key:n},t.attr),Sv(t.child)))}function Ye(e){return t=>rs.createElement(Yw,ec({attr:tc({},e.attr)},t),Sv(e.child))}function Yw(e){var t=n=>{var r=e.attr,o=e.size,a=e.title,l=Ww(e,$w),u=o||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),rs.createElement("svg",ec({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,l,{className:d,style:tc(tc({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&rs.createElement("title",null,a),e.children)};return ng!==void 0?rs.createElement(ng.Consumer,null,n=>t(n)):t(bv)}function wv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}function ls(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}function xv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"path",attr:{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"},child:[]}]})(e)}function Xw(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 9.9-1"},child:[]}]})(e)}function nc(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}function Vd(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"4 17 10 11 4 5"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"20",y2:"19"},child:[]}]})(e)}function rg(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"6"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"2"},child:[]}]})(e)}function Gd(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"},child:[]}]})(e)}function ic(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}function Zw(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"22",y1:"2",x2:"11",y2:"13"},child:[]},{tag:"polygon",attr:{points:"22 2 15 22 11 13 2 9 22 2"},child:[]}]})(e)}function kv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"23 4 23 10 17 10"},child:[]},{tag:"polyline",attr:{points:"1 20 1 14 7 14"},child:[]},{tag:"path",attr:{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"},child:[]}]})(e)}function Tr(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function Qw(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"5 3 19 12 5 21 5 3"},child:[]}]})(e)}function sg(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"},child:[]}]})(e)}function Jw(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"},child:[]},{tag:"path",attr:{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"},child:[]},{tag:"polyline",attr:{points:"3.27 6.96 12 12.01 20.73 6.96"},child:[]},{tag:"line",attr:{x1:"12",y1:"22.08",x2:"12",y2:"12"},child:[]}]})(e)}function e0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"1"},child:[]},{tag:"circle",attr:{cx:"19",cy:"12",r:"1"},child:[]},{tag:"circle",attr:{cx:"5",cy:"12",r:"1"},child:[]}]})(e)}function Vh(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},child:[]}]})(e)}function Ev(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(e)}function t0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 10 0v4"},child:[]}]})(e)}function Gh(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function n0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"},child:[]}]})(e)}function i0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"2",y1:"12",x2:"22",y2:"12"},child:[]},{tag:"path",attr:{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"},child:[]}]})(e)}function og(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"},child:[]}]})(e)}function la(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"},child:[]}]})(e)}function Cv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"},child:[]},{tag:"polyline",attr:{points:"13 2 13 9 20 9"},child:[]}]})(e)}function ag(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 20h9"},child:[]},{tag:"path",attr:{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"},child:[]}]})(e)}function Nv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"},child:[]}]})(e)}function Tv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function _c(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"4",y:"4",width:"16",height:"16",rx:"2",ry:"2"},child:[]},{tag:"rect",attr:{x:"9",y:"9",width:"6",height:"6"},child:[]},{tag:"line",attr:{x1:"9",y1:"1",x2:"9",y2:"4"},child:[]},{tag:"line",attr:{x1:"15",y1:"1",x2:"15",y2:"4"},child:[]},{tag:"line",attr:{x1:"9",y1:"20",x2:"9",y2:"23"},child:[]},{tag:"line",attr:{x1:"15",y1:"20",x2:"15",y2:"23"},child:[]},{tag:"line",attr:{x1:"20",y1:"9",x2:"23",y2:"9"},child:[]},{tag:"line",attr:{x1:"20",y1:"14",x2:"23",y2:"14"},child:[]},{tag:"line",attr:{x1:"1",y1:"9",x2:"4",y2:"9"},child:[]},{tag:"line",attr:{x1:"1",y1:"14",x2:"4",y2:"14"},child:[]}]})(e)}function Rv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},child:[]}]})(e)}function Yd(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"18 15 12 9 6 15"},child:[]}]})(e)}function vc(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(e)}function Zs(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(e)}function Mv(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(e)}function r0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"},child:[]},{tag:"polyline",attr:{points:"22 4 12 14.01 9 11.01"},child:[]}]})(e)}function s0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"},child:[]},{tag:"path",attr:{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"},child:[]}]})(e)}function o0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"5"},child:[]},{tag:"polyline",attr:{points:"5 12 12 5 19 12"},child:[]}]})(e)}function a0(e){return Ye({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"polyline",attr:{points:"19 12 12 19 5 12"},child:[]}]})(e)}function ns({trigger:e,open:t,onOpenChange:n,children:r,align:o="right",fit:a=!1,direction:l="down"}){const u=K.useRef(null);return K.useEffect(()=>{if(!t)return;const d=g=>{u.current&&!u.current.contains(g.target)&&n(!1)},h=g=>{g.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",d),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",h)}},[t,n]),m.jsxs("div",{className:`dropdown ${o} ${a?"fit":""} ${l==="up"?"dd-up":""}`,ref:u,children:[m.jsxs("button",{type:"button",className:"chip",onClick:()=>n(!t),"aria-expanded":t,children:[e,m.jsx(Zs,{className:`dd-caret ${t?"up":""}`})]}),t&&m.jsx("div",{className:"dd-menu",children:r})]})}function ss({active:e,disabled:t=!1,title:n,onClick:r,children:o}){return m.jsx("button",{type:"button",className:`dd-item ${e?"active":""}`,disabled:t,title:n,onClick:r,children:o})}const Av="pi-web-ui:lang",l0={cancel:"取消",ok:"确定",save:"保存",close:"关闭",loading:"加载中…",connected:"已连接",connecting:"连接中…",reconnecting:"重连中…",language:"语言",langZh:"中文",langEn:"English",githubRepo:"GitHub 仓库(xing-shuyin/pi-web-ui)",copy:"复制",viewSwitch:"视图切换",chat:"对话",terminal:"终端",selectModel:"选择模型",availableModels:"可用模型",noModels:"暂无可用模型(请先配置 API 密钥)",reasoning:"推理",vision:"识图",refreshModels:"刷新模型列表",manageModels:"⚙ 管理模型(新增 / 修改)",manageModelsTitle:"管理模型",thinkingLevel:"思考强度",thinking:"思考",thinkingChip:"思考:{level}",sound:"声音",newChat:"新对话",more:"更多",newChatTip:"新建对话(每个浏览器独立保存会话)","thinking.off":"关闭","thinking.minimal":"极简","thinking.low":"低","thinking.medium":"中","thinking.high":"高","thinking.xhigh":"极高","thinking.max":"最大",thinkingUnsupported:"当前模型不支持该级别,已按模型能力就近生效",context:"上下文",contextUsage:"上下文用量",cumulativeCost:"累计成本",sessionMessages:"会话消息数",messages:"消息",pluginStatus:"插件状态",working:"工作中",queued:"排队",enterPath:"输入路径,Enter 切换",cwdTip:"工作目录:{path}(点击切换)",folderRef:"文件夹引用:{path}",refOnly:"仅引用:{path}",attachContent:"附加内容:{path}",attachLines:"附加选中行:{path}(第 {start}-{end} 行)",attachImage:"图片:{name}",attachFile:"文件:{name}",removeAttachment:"移除附件",attachHint:"将随下一条消息发送",uploadFile:"添加文件(图片/文本/任意文件,也可直接拖入或粘贴截图)",dropHereToAttach:"松开以添加文件",imageNotSupported:"当前模型不支持识图,图片可能不会被模型看到",imageLoadFailed:"图片读取失败:{name}",fileLoadFailed:"文件读取失败:{name}",fileTooLarge:"文件过大已跳过(>{size}MB):{name}",foldersNotSupported:"不支持直接拖入文件夹,请展开后选择文件",followUpQueued:"⏳ {n} 条跟进消息排队中",steeringQueued:"⏳ {n} 条转向消息排队中",placeholderStreaming:"智能体正在工作中…(消息可排队发送)",placeholderIdle:"给 pi 发送消息 — Enter 发送,/ 查看命令",placeholderConnecting:"正在连接服务器…",stopAgent:"停止智能体",stop:"停止",interrupt:"中断",interruptTip:`停止整个智能体运行(模型生成 + 工具调用)
|
|
41
|
-
同时清理 AI 在后台启动的服务,释放被占用的端口
|
|
42
|
-
只停某条命令?用命令卡片上的「停止」(对话继续)`,stopBash:"停止",stopBashTip:"停止正在运行的 bash 命令(对话继续)",supplement:"补充",supplementTip:"当前回复完成后立即发送",sendTip:"发送(Enter)",slashCommands:"命令",slashMenuHint:"↑↓ 选择 · Enter/Tab 补全",slashHelpTitle:"pi 命令",slashHelpHint:"输入 / 随时打开命令列表",slashLoading:"命令列表加载中…(连接服务器后可用)",slashBuiltin:"内置",slashExtension:"扩展",slashPrompt:"模板",slashSkill:"技能",slashCopied:"已复制上一条助手回复",slashCopyFailed:"复制失败,请手动复制",slashCopyEmpty:"还没有可复制的助手回复",recentProjects:"最近项目",runningConversations:"运行的对话",historySessions:"历史对话",openHistory:"历史对话",openFiles:"文件列表",streaming:"进行中…",noHistory:"还没有历史对话",current:"当前",messageCount:"{n} 条消息",tuiTip:"pi 终端(TUI)中的对话",emptyChat:"空对话",editReask:"编辑重问",editReaskTip:"修改此问题,并从这里重新提问(会新建一个分支对话,原对话保留)",reaskFromHere:"从此处重新提问",editPlaceholder:"修改问题内容…",editHint:"⌘/Ctrl+Enter 提交 · Esc 取消",expandMsg:"展开",collapseMsg:"收起",toolCalls:"工具调用",bashRuns:"终端运行",images:"图片",update:"更新",updateTip:"检查并更新 pi-web-ui",currentVersion:"当前版本",latestVersion:"最新版本",checkingUpdate:"检查中…",checkUpdate:"检查更新",upToDate:"已是最新版本",updateAvailable:"发现新版本 v{version}",updateJustPublished:"v{version} 刚刚发布,npm 缓存可能尚未同步——若未检测到新版本,请稍后重新检查",updateNow:"立即更新",confirmUpdate:"确认更新(覆盖全局安装)",updateSuccess:"✅ 已更新,正在重启…",updateFailed:"更新失败:{detail}",restartHint:"重启:pi-web-ui server restart",rootDir:"根目录",noFiles:"暂无文件",filesTruncated:"目录过大,列表已截断,仅显示前 2000 项",linkFolderTip:"链接文件夹路径到对话",attachInlineTip:"附加内容到对话",referenceTip:"仅引用路径(AI 按需读取)",previewFile:"预览",downloadFile:"下载文件",downloadFailed:"下载失败:{error}",selectLinesHint:"点击选择行;拖拽或 Shift+点击选择范围",selectedRange:"已选 {n} 行(第 {start}-{end} 行)",fileLines:"{n} 行",selectAll:"全选",clearSelection:"清除",addToChat:"添加到对话",addedToChat:"已添加",previewTruncated:"⚠ 文件过大,仅预览前 512KB",previewLinesTruncated:"… 文件行数过多,仅显示前 {n} 行",binaryFile:"🔣 二进制文件,已显示前 4KB 十六进制",binaryHexTruncated:"(文件更大,可下载完整文件)",previewNotSupported:"该类型文件不支持预览(仅图片 / 视频 / 文本)",emptyFile:"(空文件)",pluginRequest:"插件请求",noOptions:"(无选项)",inputPlaceholder:"输入内容",soundHeader:"声音提示",enableSound:"启用声音",preview:"试听",volume:"音量","sound.question":"问卷弹出","sound.question.desc":"ask_user_question 出现时","sound.done":"回复结束","sound.done.desc":"智能体完成一轮回答时","sound.start":"回复开始","sound.start.desc":"智能体开始新一轮时","sound.error":"出错","sound.error.desc":"出现错误提示时",setupTitle:"未检测到 pi agent 配置",setupDesc:"pi-web-ui 需要 pi 的配置目录(~/.pi/agent)和至少一个 API 密钥才能运行智能体。pi 内置了 openai、anthropic、deepseek 等服务商——选一个填密钥即可,全程无需打开终端。",installFailed:"✖ pi agent 安装失败:",retryInstall:"重试安装",skip:"跳过",installDone:"✅ pi agent CLI 已安装。选择服务商并填入 API 密钥即可开始对话:",provider:"服务商",configured:"已配置",providerKeyReady:"该服务商已配置密钥,可直接使用或更换新密钥。",apiKey:"API 密钥",saving:"保存中…",saveAndStart:"保存并开始使用",recheck:"重新检测",installing:"正在安装 pi agent CLI…",autoInstall:"自动安装 pi agent",attachment:"附件",plugin:"插件",unknown:"未知",thinkingWait:"正在思考",exitCode:"退出码 {code}",cancelled:"已取消",truncated:"… 内容过长,当前视图已截断",outputTruncated:"… 输出过长,当前视图已截断",refOnlyShort:"仅引用",folderRefShort:"文件夹 · 仅引用",inlineLines:"内联 · {n} 行",inlineLinesRange:"行 {start}-{end}",image:"🖼 图片",folderNotExpanded:"文件夹,未展开内容 —— 智能体会按需浏览目录",fileNotExpanded:"文件较大({size}),未展开内容 —— 智能体会按需读取","role.user":"你","role.assistant":"pi","role.tool":"工具","role.bash":"终端","role.branch":"分支摘要","role.compaction":"上下文已压缩",welcomeTitle:"pi 编码智能体",welcomeSub:"检查、编辑、运行 —— 随时待命",directory:"目录",clickToFill:"点击填入输入框",waitingResponse:"正在等待模型响应…",backToBottom:"回到底部",questionNavTitle:"问题列表",questionNavTip:"本对话的全部问题,悬浮展开,点击跳转","ex.understand":"了解这个项目","ex.understand.prompt":"介绍一下这个项目:整体结构、主要模块和如何运行?","ex.debug":"排查一个问题","ex.debug.prompt":"帮我排查一个 bug,请先说明问题现象,我会补充细节。","ex.test":"编写测试","ex.test.prompt":"为项目的核心模块编写单元测试。","ex.review":"代码审查","ex.review.prompt":"审查最近改动的代码,指出潜在问题和改进建议。",error:"出错",done:"完成",running:"执行中…",toolQueued:"排队中",copyArgs:"复制参数",errorOutput:"错误输出",output:"输出",waitingOutput:"等待输出…",toolDoneWaitingModel:"已结束 · 等模型",waitingModel:"等待模型响应…",thinkingNow:"思考中",thinkingPreview:"思考:{preview}",commands:"命令",newCommand:"新建命令",newTerminal:"新建终端",name:"名称",command:"命令",cwdHint:"(${pwd} = 当前工作目录)",noCommands:"还没有命令,点 + 添加一个",clickToRun:"点击运行",edit:"编辑",delete:"删除",confirmQ:"确认?",builtinTerminal:"内置终端",termEmptySub:"点击左侧命令运行,或点右侧 + 新建终端",noTerminal:"暂无终端",exited:"(已退出{code})",closeTerminal:"关闭终端",rerun:"重新读取 .pi/commands.json",terminalTitle:"终端 {n}",exampleName:"例如:启动开发服务器",exampleCommand:"例如:npm run dev",editProvider:"编辑服务商",builtinProviders:"内置服务商",hintKeyOnly:"只需填入 API 密钥",configuredBadge:"✓ 已配置",keyReady:"密钥已就绪",pasteKey:"粘贴 API 密钥…",savingKey:"保存中",saveKey:"保存密钥",customProviders:"自定义服务商",customDesc:"用于 Ollama / vLLM / 兼容 OpenAI 的代理等,写入 pi 的 models.json,保存后热重载、立即生效。",noCustomProviders:"还没有自定义服务商",modelsCount:"{n} 个模型",addProvider:"新增服务商",providerId:"服务商 ID",providerIdHint:"(必填,如 ollama / my-proxy)",displayName:"显示名",displayNamePh:"我的代理",apiType:"API 类型",baseUrlHint:"(OpenAI 兼容端点)",apiKeyHint:"sk-…(可留空,用 auth.json 的密钥)",authHeader:"自动添加 Authorization 请求头",modelsTitle:"模型",modelIdReq:"模型 ID(必填)",text:"文本",textImage:"文本+图片",contextWindow:"上下文",maxOutput:"最大输出",removeModel:"移除模型",addModel:"添加模型",deleteProviderConfirm:"删除服务商 {id} 及其 {n} 个模型?",goalBarTitle:"目标",goalBarPlaceholder:"设定一个目标,agent 完成后自动审查…",goalBarSet:"开始",goalBarClear:"取消",goalBarLocked:"锁定:应用到后续所有回合",goalBarUnlocked:"仅本回合(改完自动清除)",goalBarReviewModel:"审查模型",goalBarUseMainModel:"使用主模型",goalBarMaxRounds:"最大轮数",goalBarMaxRoundsTip:"最大审查重改轮数;0 或不填 = 不限(持续改到通过)",goalBarUnlimitedShort:"不限",goalBarReviewing:"审查中…",goalBarRound:"第 {n} 轮",goalBarActive:"目标生效中",goalBarPassed:"已通过",goalBarFailed:"未通过",goalBarStatusPending:"等待生成…",goalWizardBtn:"AI 提炼",goalWizardTip:"让 AI 通过问卷调研细化需求,收敛为目标",goalWizardRunning:"目标调研中",goalWizardAnswer:"回答",goalWizardCard:"目标调研",settings:"设置",settingsTitle:"设置",settingsDesc:"修改立即生效:系统提示词、技能与插件开关会重建当前会话(回复进行中则自动延迟到回复结束后应用)。",settingsSystemPrompt:"系统提示词",settingsPromptMode:"模式",promptModeAppend:"追加",promptModeReplace:"替换",promptAppendHint:"追加模式:自定义内容拼接到默认系统提示词末尾(推荐,保留默认行为约束)。",promptReplaceHint:"替换模式:完全用自定义内容替换系统提示词(项目上下文与技能段仍会自动附加)。",promptPlaceholder:"输入自定义系统提示词…(失焦后自动应用)",settingsSkills:"技能",settingsExtensions:"插件",settingsPresets:"预设",settingsEnabled:"已启用",settingsDisabled:"已禁用",presetNamePlaceholder:"预设名称…",saveAsPreset:"保存为预设",applyPreset:"应用",deletePreset:"删除预设",noSkills:"暂无技能",noExtensions:"暂无插件",noPresets:"暂无预设(先调整上面的设置,再保存为预设组合)",loadingSession:"正在加载会话…",connectingServer:"正在连接 pi-web-ui 服务器…"},c0={cancel:"Cancel",ok:"OK",save:"Save",close:"Close",loading:"Loading…",connected:"Connected",connecting:"Connecting…",reconnecting:"Reconnecting…",language:"Language",langZh:"中文",langEn:"English",githubRepo:"GitHub repository (xing-shuyin/pi-web-ui)",copy:"Copy",viewSwitch:"Switch view",chat:"Chat",terminal:"Terminal",selectModel:"Select model",availableModels:"Available models",noModels:"No models available (configure an API key first)",reasoning:"reasoning",vision:"vision",refreshModels:"Refresh model list",manageModels:"⚙ Manage models (add / edit)",manageModelsTitle:"Manage models",thinkingLevel:"Thinking level",thinking:"Thinking",thinkingChip:"Thinking: {level}",sound:"Sound",newChat:"New chat",more:"More",newChatTip:"New chat (sessions are saved per browser)","thinking.off":"Off","thinking.minimal":"Minimal","thinking.low":"Low","thinking.medium":"Medium","thinking.high":"High","thinking.xhigh":"Extra high","thinking.max":"Max",thinkingUnsupported:"Not supported by this model — snapped to the nearest supported level",context:"Context",contextUsage:"Context usage",cumulativeCost:"Cumulative cost",sessionMessages:"Session messages",messages:"messages",pluginStatus:"Plugin status",working:"Working",queued:"queued",enterPath:"Type a path, Enter to switch",cwdTip:"Working directory: {path} (click to switch)",folderRef:"Folder reference: {path}",refOnly:"Reference only: {path}",attachContent:"Attached content: {path}",attachLines:"Attached selected lines: {path} (lines {start}-{end})",attachImage:"Image: {name}",attachFile:"File: {name}",removeAttachment:"Remove attachment",attachHint:"Will be sent with the next message",uploadFile:"Add files (images / text / any file — or drag in / paste a screenshot)",dropHereToAttach:"Release to attach file",imageNotSupported:"The current model doesn't support vision — the image may be ignored",imageLoadFailed:"Couldn't read image: {name}",fileLoadFailed:"Couldn't read file: {name}",fileTooLarge:"File too large, skipped (> {size}MB): {name}",foldersNotSupported:"Folders can't be dropped directly — expand and pick files instead",followUpQueued:"⏳ {n} follow-up message(s) queued",steeringQueued:"⏳ {n} steering message(s) queued",placeholderStreaming:"The agent is working… (messages will queue)",placeholderIdle:"Message pi — Enter to send, / for commands",placeholderConnecting:"Connecting to server…",stopAgent:"Stop agent",stop:"Stop",interrupt:"Interrupt",interruptTip:`Stop the whole agent run (generation + tool calls)
|
|
43
|
-
Also kills background servers the AI started (frees ports)
|
|
44
|
-
To stop only one command, use the 停止 button on its card (conversation continues)`,stopBash:"Stop",stopBashTip:"Stop the running bash command (conversation continues)",supplement:"Follow-up",supplementTip:"Send immediately after the current reply finishes",sendTip:"Send (Enter)",slashCommands:"Commands",slashMenuHint:"↑↓ select · Enter/Tab complete",slashHelpTitle:"pi commands",slashHelpHint:"Type / anytime to open the command list",slashLoading:"Loading commands… (available once connected)",slashBuiltin:"Builtin",slashExtension:"Extension",slashPrompt:"Template",slashSkill:"Skill",slashCopied:"Copied the last assistant reply",slashCopyFailed:"Copy failed — please copy manually",slashCopyEmpty:"No assistant reply to copy yet",recentProjects:"Recent projects",runningConversations:"Running chats",historySessions:"History",openHistory:"History",openFiles:"Files",streaming:"Streaming…",noHistory:"No previous chats",current:"Current",messageCount:"{n} messages",tuiTip:"Chat in the pi terminal (TUI)",emptyChat:"Empty chat",editReask:"Edit & re-ask",editReaskTip:"Edit this question and re-ask from here (forks a new conversation; the original is kept)",reaskFromHere:"Re-ask from here",editPlaceholder:"Edit the question…",editHint:"⌘/Ctrl+Enter to submit · Esc to cancel",expandMsg:"Expand",collapseMsg:"Collapse",toolCalls:"tool calls",bashRuns:"bash runs",images:"images",update:"Update",updateTip:"Check & update pi-web-ui",currentVersion:"Current version",latestVersion:"Latest version",checkingUpdate:"Checking…",checkUpdate:"Check for updates",upToDate:"You're up to date",updateAvailable:"New version v{version} available",updateJustPublished:"v{version} was just published — npm cache may lag; if the new version isn't detected yet, re-check in a moment",updateNow:"Update now",confirmUpdate:"Confirm (replaces global install)",updateSuccess:"✅ Updated — restarting…",updateFailed:"Update failed: {detail}",restartHint:"Restart: pi-web-ui server restart",rootDir:"Root",noFiles:"No files",filesTruncated:"Directory too large — list truncated (first 2000 shown)",linkFolderTip:"Link folder path to chat",attachInlineTip:"Attach content to chat",referenceTip:"Reference path only (AI reads on demand)",previewFile:"Preview",downloadFile:"Download file",downloadFailed:"Download failed: {error}",selectLinesHint:"Click a line to select; drag or Shift+click for a range",selectedRange:"Selected {n} lines (lines {start}-{end})",fileLines:"{n} lines",selectAll:"Select all",clearSelection:"Clear",addToChat:"Add to chat",addedToChat:"Added",previewTruncated:"⚠ File too large — previewing the first 512KB",previewLinesTruncated:"… too many lines — showing the first {n}",binaryFile:"🔣 Binary file — first 4KB shown as hex",binaryHexTruncated:" (file larger — download for the full file)",previewNotSupported:"This file type can't be previewed (only images / videos / text)",emptyFile:"(empty file)",pluginRequest:"Plugin request",noOptions:"(no options)",inputPlaceholder:"Enter content",soundHeader:"Sound notifications",enableSound:"Enable sound",preview:"Preview",volume:"Volume","sound.question":"Question popup","sound.question.desc":"When ask_user_question appears","sound.done":"Reply finished","sound.done.desc":"When the agent finishes a turn","sound.start":"Reply started","sound.start.desc":"When the agent starts a new turn","sound.error":"Error","sound.error.desc":"When an error notice appears",setupTitle:"pi agent config not detected",setupDesc:"pi-web-ui needs pi's config directory (~/.pi/agent) and at least one API key to run the agent. pi has built-in providers such as openai, anthropic, and deepseek — just pick one and enter a key, no terminal needed.",installFailed:"✖ pi agent installation failed:",retryInstall:"Retry install",skip:"Skip",installDone:"✅ pi agent CLI installed. Pick a provider and enter an API key to start chatting:",provider:"Provider",configured:"configured",providerKeyReady:"This provider already has a key — use it or replace it.",apiKey:"API key",saving:"Saving…",saveAndStart:"Save and start using",recheck:"Recheck",installing:"Installing pi agent CLI…",autoInstall:"Auto-install pi agent",attachment:"Attachment",plugin:"plugin",unknown:"unknown",thinkingWait:"Thinking",exitCode:"Exit code {code}",cancelled:"Cancelled",truncated:"… content too long, truncated in this view",outputTruncated:"… output too long, truncated in this view",refOnlyShort:"Reference only",folderRefShort:"Folder · reference only",inlineLines:"Inline · {n} lines",inlineLinesRange:"Lines {start}-{end}",image:"🖼 Image",folderNotExpanded:"Folder — content not expanded, the agent will browse it as needed",fileNotExpanded:"Large file ({size}) — content not expanded, the agent will read it as needed","role.user":"You","role.assistant":"pi","role.tool":"Tool","role.bash":"Terminal","role.branch":"Branch summary","role.compaction":"Context compacted",welcomeTitle:"pi coding agent",welcomeSub:"Inspect, edit, run — always ready",directory:"Directory",clickToFill:"Click to fill input",waitingResponse:"Waiting for model response…",backToBottom:"Back to bottom",questionNavTitle:"Questions",questionNavTip:"All questions in this conversation — hover to expand, click to jump","ex.understand":"Understand this project","ex.understand.prompt":"Introduce this project: overall structure, main modules, and how to run it?","ex.debug":"Debug an issue","ex.debug.prompt":"Help me debug a bug — describe the symptom first, and I'll add details.","ex.test":"Write tests","ex.test.prompt":"Write unit tests for the core modules.","ex.review":"Code review","ex.review.prompt":"Review the recently changed code and point out potential issues and improvements.",error:"Error",done:"Done",running:"Running…",toolQueued:"Queued",copyArgs:"Copy args",errorOutput:"Error output",output:"Output",waitingOutput:"Waiting for output…",toolDoneWaitingModel:"Done · waiting on model",waitingModel:"Waiting for model response…",thinkingNow:"Thinking",thinkingPreview:"Thinking: {preview}",commands:"Commands",newCommand:"New command",newTerminal:"New terminal",name:"Name",command:"Command",cwdHint:"(${pwd} = current working directory)",noCommands:"No commands yet — click + to add one",clickToRun:"Click to run",edit:"Edit",delete:"Delete",confirmQ:"Confirm?",builtinTerminal:"Built-in terminal",termEmptySub:"Click a command on the left to run it, or + on the right for a new terminal",noTerminal:"No terminals",exited:"(exited{code})",closeTerminal:"Close terminal",rerun:"Reload .pi/commands.json",terminalTitle:"Terminal {n}",exampleName:"e.g. start dev server",exampleCommand:"e.g. npm run dev",editProvider:"Edit provider",builtinProviders:"Built-in providers",hintKeyOnly:"Just enter an API key",configuredBadge:"✓ Configured",keyReady:"Key ready",pasteKey:"Paste API key…",savingKey:"Saving",saveKey:"Save key",customProviders:"Custom providers",customDesc:"For Ollama / vLLM / OpenAI-compatible proxies, etc. Written to pi's models.json — hot-reloaded immediately.",noCustomProviders:"No custom providers yet",modelsCount:"{n} models",addProvider:"Add provider",providerId:"Provider ID",providerIdHint:"(required, e.g. ollama / my-proxy)",displayName:"Display name",displayNamePh:"My proxy",apiType:"API type",baseUrlHint:"(OpenAI-compatible endpoint)",apiKeyHint:"sk-… (optional — uses the auth.json key)",authHeader:"Auto-add Authorization header",modelsTitle:"Models",modelIdReq:"Model ID (required)",text:"Text",textImage:"Text+image",contextWindow:"Context",maxOutput:"Max output",removeModel:"Remove model",addModel:"Add model",deleteProviderConfirm:"Delete provider {id} and its {n} models?",goalBarTitle:"Goal",goalBarPlaceholder:"Set a goal; the agent's output is auto-reviewed…",goalBarSet:"Start",goalBarClear:"Cancel",goalBarLocked:"Locked: applies to every later turn",goalBarUnlocked:"This turn only (cleared afterwards)",goalBarReviewModel:"Review model",goalBarUseMainModel:"Use the main model",goalBarMaxRounds:"Max rounds",goalBarMaxRoundsTip:"Max review-revision rounds; 0 or empty = unlimited (keep revising until it passes)",goalBarUnlimitedShort:"Unlimited",goalBarReviewing:"Reviewing…",goalBarRound:"Round {n}",goalBarActive:"Goal active",goalBarPassed:"Passed",goalBarFailed:"Failed",goalBarStatusPending:"Waiting to generate…",goalWizardBtn:"AI Scrape",goalWizardTip:"Let AI refine the requirement into a goal via a Q&A survey",goalWizardRunning:"Scoping the goal",goalWizardAnswer:"Answer",goalWizardCard:"Goal survey",settings:"Settings",settingsTitle:"Settings",settingsDesc:"Changes apply immediately: system prompt, skill and extension toggles rebuild the current session (deferred until the current reply finishes if it's streaming).",settingsSystemPrompt:"System prompt",settingsPromptMode:"Mode",promptModeAppend:"Append",promptModeReplace:"Replace",promptAppendHint:"Append mode: your text is appended to the end of the default system prompt (recommended — keeps the default behavior constraints).",promptReplaceHint:"Replace mode: your text fully replaces the system prompt (project context and skills are still appended automatically).",promptPlaceholder:"Type a custom system prompt… (applied on blur)",settingsSkills:"Skills",settingsExtensions:"Extensions",settingsPresets:"Presets",settingsEnabled:"Enabled",settingsDisabled:"Disabled",presetNamePlaceholder:"Preset name…",saveAsPreset:"Save as preset",applyPreset:"Apply",deletePreset:"Delete preset",noSkills:"No skills",noExtensions:"No extensions",noPresets:"No presets yet (tune the settings above, then save them as a preset)",loadingSession:"Loading session…",connectingServer:"Connecting to pi-web-ui server…"},Lv=K.createContext(null);function u0(){try{const e=localStorage.getItem(Av);if(e==="zh"||e==="en")return e}catch{}return"zh"}function h0({children:e}){const[t,n]=K.useState(u0),r=K.useCallback(l=>{n(l);try{localStorage.setItem(Av,l)}catch{}},[]),o=K.useCallback((l,u)=>{let d=c0[l];if(t==="zh"&&(d=l0[l]),u)for(const[h,g]of Object.entries(u))d=d.replaceAll(`{${h}}`,String(g));return d},[t]);K.useEffect(()=>{document.documentElement.lang=t==="zh"?"zh-CN":"en"},[t]);const a=K.useMemo(()=>({locale:t,setLocale:r,t:o}),[t,r,o]);return m.jsx(Lv.Provider,{value:a,children:e})}function Xd(){const e=K.useContext(Lv);if(!e)throw new Error("useI18n must be used within LanguageProvider");return e}function bt(){return Xd().t}const d0=["off","minimal","low","medium","high","xhigh","max"];function Ov({chat:e,send:t,onManageModels:n,compact:r=!1}){const o=bt(),a=e.state,l=a==null?void 0:a.model,u=l?`${l.provider}/${l.id}`:null,[d,h]=K.useState(!1),[g,p]=K.useState(!1),[v,y]=K.useState(!1),S=a!=null&&a.availableThinkingLevels&&a.availableThinkingLevels.length>0?new Set(a.availableThinkingLevels):null,w=d0.map(k=>({value:k,label:o(`thinking.${k}`),supported:S?S.has(k):!0})),E=k=>{var R;return((R=w.find(T=>T.value===k))==null?void 0:R.label)??k};return K.useEffect(()=>{d&&e.models.length===0&&!v&&(y(!0),t({type:"list_models"}))},[d,e.models.length,v,t]),K.useEffect(()=>{e.models.length>0&&y(!1)},[e.models.length]),m.jsxs(m.Fragment,{children:[m.jsxs(ns,{trigger:m.jsxs(m.Fragment,{children:[m.jsx(_c,{}),m.jsx("span",{className:"chip-model",children:l?l.name:o("selectModel")}),!r&&(l==null?void 0:l.vision)&&m.jsx("span",{className:"chip-vision",title:o("vision"),children:"🖼"}),!r&&l&&m.jsx("span",{className:"chip-sub",children:l.provider})]}),open:d,onOpenChange:h,children:[m.jsx("div",{className:"dd-header",children:o("availableModels")}),(v||e.modelsLoading)&&m.jsx("div",{className:"dd-loading",children:o("loading")}),e.models.length===0&&!v&&!e.modelsLoading&&m.jsx("div",{className:"dd-loading",children:o("noModels")}),e.models.map(k=>m.jsx(ss,{active:u===k.id,onClick:()=>{u!==k.id&&t({type:"set_model",modelId:k.id}),h(!1)},children:m.jsxs("span",{className:"dd-model-cell",children:[m.jsx("span",{className:"dd-model-name",children:k.name}),m.jsxs("span",{className:"dd-model-meta",children:[m.jsx("span",{className:"dd-model-provider",children:k.provider}),(k.reasoning||k.vision)&&m.jsxs("span",{className:"dd-model-badges",children:[k.reasoning&&m.jsx("span",{className:"dd-model-badge",children:o("reasoning")}),k.vision&&m.jsx("span",{className:"dd-model-badge",children:o("vision")})]})]})]})},k.id)),m.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>t({type:"list_models"}),children:o("refreshModels")}),m.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>{h(!1),n()},children:o("manageModels")})]}),m.jsxs(ns,{trigger:m.jsxs(m.Fragment,{children:[m.jsx(wv,{}),m.jsx("span",{className:"chip-sub",children:o("thinkingChip",{level:a?E(a.thinkingLevel):"—"})})]}),open:g,onOpenChange:p,children:[m.jsx("div",{className:"dd-header",children:o("thinkingLevel")}),w.map(k=>m.jsx(ss,{active:(a==null?void 0:a.thinkingLevel)===k.value,disabled:!k.supported,title:k.supported?void 0:o("thinkingUnsupported"),onClick:()=>{(a==null?void 0:a.thinkingLevel)!==k.value&&t({type:"set_thinking",level:k.value}),p(!1)},children:k.label},k.value))]})]})}const f0=[{kind:"question",labelKey:"sound.question",descKey:"sound.question.desc"},{kind:"done",labelKey:"sound.done",descKey:"sound.done.desc"},{kind:"start",labelKey:"sound.start",descKey:"sound.start.desc"},{kind:"error",labelKey:"sound.error",descKey:"sound.error.desc"}];function lg({settings:e,onChange:t,onPreview:n}){const r=bt(),o=a=>t({...e,...a});return m.jsxs("div",{className:"sound-menu",children:[m.jsx("div",{className:"dd-header",children:r("soundHeader")}),m.jsxs("label",{className:"sound-row sound-master",children:[m.jsxs("span",{className:"sound-label",children:[m.jsx(xv,{className:"sound-icon"}),m.jsx("span",{children:r("enableSound")})]}),m.jsx("input",{type:"checkbox",checked:e.enabled,onChange:a=>o({enabled:a.target.checked})})]}),f0.map(({kind:a,labelKey:l,descKey:u})=>m.jsxs("label",{className:`sound-row ${e.enabled?"":"disabled"}`,children:[m.jsxs("span",{className:"sound-label",children:[m.jsx("span",{className:"sound-name",children:r(l)}),m.jsx("span",{className:"sound-desc",children:r(u)})]}),m.jsxs("span",{className:"sound-right",children:[m.jsx("button",{type:"button",className:"sound-preview",title:r("preview"),disabled:!e.enabled,onClick:d=>{d.preventDefault(),n(a)},children:r("preview")}),m.jsx("input",{type:"checkbox",checked:e[a],disabled:!e.enabled,onChange:d=>o({[a]:d.target.checked})})]})]},a)),m.jsxs("div",{className:`sound-volume ${e.enabled?"":"disabled"}`,children:[m.jsx("span",{className:"sound-name",children:r("volume")}),m.jsx("input",{type:"range",min:0,max:100,step:5,value:e.volume,disabled:!e.enabled,onChange:a=>o({volume:Number(a.target.value)})}),m.jsxs("span",{className:"sound-vol-num",children:[e.volume,"%"]})]})]})}function p0({chat:e,send:t,view:n,onViewChange:r,onOpenPanel:o,onManageModels:a,onOpenSettings:l,sound:u,onSoundChange:d,onSoundPreview:h}){var U;const{locale:g,setLocale:p,t:v}=Xd(),y=e.state,[S,w]=K.useState(!1),[E,k]=K.useState(!1),[R,T]=K.useState(!1),[A,V]=K.useState(!1),[D,ne]=K.useState(!1),Z=[{value:"zh",label:v("langZh")},{value:"en",label:v("langEn")}],ee=e.ready?v("connected"):e.status==="closed"?v("reconnecting"):v("connecting"),W=e.ready?"ok":"busy",H=()=>{var O,q,F,Q;return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"dd-update",children:[m.jsxs("div",{className:"dd-row",children:[m.jsx("span",{children:v("currentVersion")}),m.jsxs("b",{children:["v",((O=e.update)==null?void 0:O.current)??"…"]})]}),m.jsxs("div",{className:"dd-row",children:[m.jsx("span",{children:v("latestVersion")}),m.jsx("b",{children:e.update===null?v("checkingUpdate"):e.update.error?e.update.error:e.update.latest?`v${e.update.latest}`:v("checkingUpdate")})]}),((q=e.update)==null?void 0:q.pendingRestart)&&m.jsx("div",{className:"dd-note ok",children:v("updateSuccess")}),e.update&&!e.update.pendingRestart&&e.update.upToDate&&m.jsx("div",{className:"dd-note ok",children:v("upToDate")}),e.update&&!e.update.pendingRestart&&!e.update.upToDate&&e.update.latest&&m.jsx("div",{className:"dd-note warn",children:v("updateAvailable",{version:e.update.latest})}),((F=e.update)==null?void 0:F.latestPublishedAt)&&Date.now()-new Date(e.update.latestPublishedAt).getTime()<30*6e4&&m.jsx("div",{className:"dd-note warn",children:v("updateJustPublished",{version:e.update.latest??""})}),e.updateResult&&!e.updateResult.ok&&m.jsx("div",{className:"dd-note err",children:v("updateFailed",{detail:e.updateResult.detail})}),((Q=e.update)==null?void 0:Q.pendingRestart)&&m.jsx("div",{className:"dd-note",children:v("restartHint")})]}),m.jsxs("div",{className:"dd-actions",children:[m.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>t({type:"check_update"}),children:e.update===null?v("checkingUpdate"):v("checkUpdate")}),e.update&&!e.update.pendingRestart&&!e.update.upToDate&&e.update.latest&&m.jsx("button",{type:"button",className:`dd-refresh accent ${D?"armed":""}`,onClick:()=>{if(!D){ne(!0);return}ne(!1),T(!1),V(!1),t({type:"update_app"})},children:v(D?"confirmUpdate":"updateNow")})]})]})};return m.jsxs("header",{className:"topbar",children:[m.jsxs("div",{className:"brand",children:[m.jsx("button",{type:"button",className:"panel-toggle",title:v("openHistory"),onClick:()=>o("left"),children:m.jsx(Ev,{})}),m.jsx("span",{className:"brand-logo",children:"π"}),m.jsx("span",{className:"brand-name",children:"pi-web-ui"}),m.jsx("span",{className:`conn-dot ${W}`,title:ee}),m.jsx("span",{className:"conn-label",children:ee})]}),m.jsxs("div",{className:"topbar-actions",children:[(y==null?void 0:y.isStreaming)&&m.jsxs("button",{type:"button",className:"btn interrupt active","data-tip":v("interruptTip"),onClick:()=>t({type:"abort"}),children:[m.jsx(Gd,{}),m.jsx("span",{children:v("interrupt")})]}),m.jsxs("div",{className:"view-switch",role:"tablist","aria-label":v("viewSwitch"),children:[m.jsxs("button",{type:"button",role:"tab","aria-selected":n==="chat",className:n==="chat"?"active":"",onClick:()=>r("chat"),children:[m.jsx(Vh,{}),m.jsx("span",{children:v("chat")})]}),m.jsxs("button",{type:"button",role:"tab","aria-selected":n==="terminal",className:n==="terminal"?"active":"",onClick:()=>r("terminal"),children:[m.jsx(Vd,{}),m.jsx("span",{children:v("terminal")})]})]}),m.jsxs("div",{className:"topbar-desktop",children:[m.jsx(Ov,{chat:e,send:t,onManageModels:a}),m.jsxs("button",{type:"button",className:"chip",title:v("settingsTitle"),onClick:l,children:[m.jsx(ic,{}),m.jsx("span",{className:"chip-sub",children:v("settings")})]}),m.jsx(ns,{trigger:m.jsxs(m.Fragment,{children:[m.jsx(xv,{}),m.jsx("span",{className:"chip-sub",children:v("sound")})]}),open:S,onOpenChange:w,children:m.jsx(lg,{settings:u,onChange:d,onPreview:h})}),m.jsxs(ns,{trigger:m.jsxs(m.Fragment,{children:[m.jsx(i0,{}),m.jsx("span",{className:"chip-sub",children:g==="zh"?v("langZh"):"EN"})]}),open:E,onOpenChange:k,children:[m.jsx("div",{className:"dd-header",children:v("language")}),Z.map(O=>m.jsx(ss,{active:g===O.value,onClick:()=>{p(O.value),k(!1)},children:O.label},O.value))]}),m.jsxs(ns,{trigger:m.jsxs(m.Fragment,{children:[m.jsx(Tv,{}),m.jsxs("span",{className:"chip-sub",children:["v",((U=e.update)==null?void 0:U.current)??"…"]}),e.update&&!e.update.upToDate&&!e.update.pendingRestart&&m.jsx("span",{className:"update-dot",title:v("updateAvailable",{version:e.update.latest??""})})]}),open:R,onOpenChange:O=>{T(O),ne(!1),O&&t({type:"check_update"})},fit:!0,children:[m.jsx("div",{className:"dd-header",children:v("update")}),H()]}),m.jsx("a",{className:"chip github",href:"https://github.com/xing-shuyin/pi-web-ui",target:"_blank",rel:"noreferrer noopener",title:v("githubRepo"),children:m.jsx(og,{})})]}),m.jsxs("button",{type:"button",className:"chip newchat","data-tip":v("newChatTip"),onClick:()=>t({type:"new_chat"}),children:[m.jsx(Tr,{}),m.jsx("span",{children:v("newChat")})]}),m.jsx("div",{className:"topbar-more",children:m.jsxs(ns,{trigger:m.jsxs(m.Fragment,{children:[m.jsx(e0,{}),m.jsx("span",{className:"chip-sub",children:v("more")}),e.update&&!e.update.upToDate&&!e.update.pendingRestart&&m.jsx("span",{className:"update-dot"})]}),open:A,onOpenChange:O=>{V(O),ne(!1),O&&t({type:"check_update"})},children:[m.jsx("div",{className:"dd-header",children:v("sound")}),m.jsx("div",{className:"dd-header",children:v("settings")}),m.jsxs(ss,{onClick:()=>{V(!1),l()},children:[m.jsx(ic,{})," ",v("settingsTitle")]}),m.jsx(lg,{settings:u,onChange:d,onPreview:h}),m.jsx("div",{className:"dd-header",children:v("language")}),Z.map(O=>m.jsx(ss,{active:g===O.value,onClick:()=>p(O.value),children:O.label},O.value)),m.jsx("div",{className:"dd-header",children:v("update")}),H(),m.jsxs("a",{className:"dd-refresh dd-more-link",href:"https://github.com/xing-shuyin/pi-web-ui",target:"_blank",rel:"noreferrer noopener",children:[m.jsx(og,{})," ",v("githubRepo")]})]})}),m.jsx("button",{type:"button",className:"panel-toggle",title:v("openFiles"),onClick:()=>o("right"),children:m.jsx(la,{})})]})]})}function cg(e){const t=new Date(e),n=new Date;return t.toDateString()===n.toDateString()?`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`:`${t.getMonth()+1}/${t.getDate()}`}function m0({chat:e,send:t}){var h,g;const n=bt(),r=(h=e.state)==null?void 0:h.sessionFile,o=(g=e.state)==null?void 0:g.cwd,a=e.sessions,l=e.projects,u=p=>{const v=p.name||p.firstMessage.trim();return v.length>0?v:n("emptyChat")},d=p=>p.split(/[\\/]/).pop()||p;return m.jsxs("aside",{className:"panel panel-left",children:[l.length>0&&m.jsxs("div",{className:"panel-projects",children:[m.jsx("div",{className:"panel-section-title",children:n("recentProjects")}),m.jsx("div",{className:"projects-scroll",children:l.map(p=>{const v=o===p.path;return m.jsxs("button",{type:"button",className:`project-item ${v?"active":""}`,title:p.path,onClick:()=>{v||t({type:"set_cwd",path:p.path})},children:[m.jsx(la,{className:"project-icon"}),m.jsxs("span",{className:"project-info",children:[m.jsx("span",{className:"project-name",children:d(p.path)}),m.jsx("span",{className:"project-path",children:p.path})]}),m.jsx("span",{className:"project-time",children:cg(p.lastUsed)})]},p.path)})})]}),e.conversations.length>0&&m.jsxs("div",{className:"panel-convs",children:[m.jsx("div",{className:"panel-section-title",children:n("runningConversations")}),e.conversations.map(p=>{const v=e.activeConversationId===p.id;return m.jsxs("button",{type:"button",className:`session-item ${v?"active":""}`,title:p.title,onClick:()=>{v||t({type:"switch_conversation",id:p.id})},children:[m.jsx(Vh,{className:"session-icon"}),m.jsxs("span",{className:"session-info",children:[m.jsx("span",{className:"session-title",children:p.title}),m.jsx("span",{className:"session-sub",children:v?n("current"):n("messageCount",{n:p.messageCount})})]}),p.isStreaming&&m.jsx("span",{className:"conv-streaming",title:n("streaming")})]},p.id)}),m.jsx("div",{className:"panel-section-divider"})]}),m.jsxs("div",{className:"panel-sessions",children:[m.jsx("div",{className:"panel-section-title",children:n("historySessions")}),m.jsxs("div",{className:"sessions-scroll",children:[a.length===0&&m.jsx("div",{className:"panel-empty",children:n("noHistory")}),a.map(p=>{const v=r===p.path;return m.jsxs("button",{type:"button",className:`session-item ${v?"active":""}`,title:p.path,onClick:()=>{v||t({type:"switch_session",path:p.path})},children:[m.jsx(Vh,{className:"session-icon"}),m.jsxs("span",{className:"session-info",children:[m.jsx("span",{className:"session-title",children:u(p)}),m.jsxs("span",{className:"session-sub",children:[v?n("current"):n("messageCount",{n:p.messageCount}),p.source==="tui"&&m.jsx("span",{className:"session-src",title:n("tuiTip"),children:"TUI"})]})]}),m.jsx("span",{className:"session-time",children:cg(p.modified)})]},p.path)})]})]})]})}function Dv(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const ug=2e5,g0=2e5,_0={goal:null,reviewModel:null,maxRounds:3,locked:!0,reviewing:!1,round:0,status:"",verdict:"pending",wizard:{active:!1,draft:"",model:null,step:0,maxSteps:6,status:""}};function v0(){const e=new Map,t=new Map;return{write(n,r){const o=e.get(n);if(o){o.write(r);return}const a=t.get(n)??"",l=a.length+r.length>g0?r:a+r;t.set(n,l)},register(n,r){e.set(n,r);const o=t.get(n);if(o){try{r.write(o)}catch{}t.delete(n)}return()=>{e.get(n)===r&&e.delete(n),t.delete(n)}},clear(){e.clear(),t.clear()}}}function y0(e,t){const n=new Set;for(const o of t.messages)o.role==="toolResult"&&o.toolCallId&&n.add(o.toolCallId),o.role==="bashExecution"&&n.add(`bash-${o.id}`);let r=!1;for(const o of e.keys())n.has(o)&&(e.delete(o),r=!0);return r?new Map(e):e}function b0(e,t){let n=!1;for(const r of e.keys())t.messages.some(a=>a.role==="toolResult"&&a.toolCallId===r)&&(e.delete(r),n=!0);return n?new Map(e):e}function S0(e,t){switch(t.type){case"status":return{...e,status:t.status,ready:t.status==="open"?e.ready:!1,terminals:t.status==="open"?e.terminals:[]};case"ready":return{...e,serverVersion:t.serverVersion,ready:!0};case"snapshot":return{...e,ready:!0,state:t.state,activeConversationId:t.state.conversationId,liveOutputs:y0(e.liveOutputs,t.state),toolStatuses:b0(e.toolStatuses,t.state)};case"tool_delta":{const n=e.liveOutputs.get(t.toolCallId),r=((n==null?void 0:n.text)??"")+t.delta,o=r.length>ug?r.slice(0,ug):r,a=new Map(e.liveOutputs);return a.set(t.toolCallId,{toolName:t.toolName,text:o}),{...e,liveOutputs:a}}case"tool_status":return{...e,toolStatuses:new Map(e.toolStatuses).set(t.status.toolCallId,t.status)};case"notice":return{...e,notices:[...e.notices,t.notice].slice(-6)};case"dismiss_notice":return{...e,notices:e.notices.filter(n=>n.id!==t.id)};case"sessions":return{...e,sessions:t.sessions};case"conversations":return{...e,conversations:t.conversations,activeConversationId:t.activeId};case"projects":return{...e,projects:t.projects};case"files":return{...e,files:t.files};case"file_changed":return{...e,fileChanged:{path:t.path}};case"file_content":return{...e,fileContent:t.content};case"models":return{...e,models:t.models,modelsLoading:t.loading};case"models_config":return{...e,modelsConfig:t.providers};case"providers_status":return{...e,providers:t.providers};case"install_result":return{...e,installResult:t.result};case"path_completions":return{...e,pathCompletions:t.completions};case"update_status":return{...e,update:t.status};case"update_result":return{...e,updateResult:t.result};case"widgets":return{...e,widgets:t.widgets};case"statuses":return{...e,statuses:t.statuses};case"dialog":return{...e,dialog:t.dialog};case"commands":return{...e,commands:t.commands,commandsPath:t.path};case"slash_commands":return{...e,slashCommands:t.commands};case"goal_status":return{...e,goal:t.status};case"settings":return{...e,settings:t.settings};case"terminal_add":return{...e,terminals:[...e.terminals,t.meta]};case"terminal_remove":return{...e,terminals:e.terminals.filter(n=>n.id!==t.id)};case"terminal_exit":return{...e,terminals:e.terminals.map(n=>n.id===t.terminalId?{...n,running:!1,exitCode:t.exitCode}:n)};case"terminal_restart":return{...e,terminals:e.terminals.map(n=>n.id===t.terminalId?{...n,running:!0,exitCode:null}:n)};default:return e}}const hg="pi-web-client-id";function Zd(){let e=localStorage.getItem(hg);return e||(e=Dv(),localStorage.setItem(hg,e)),e}function w0(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws`}function x0(){const[e,t]=K.useReducer(S0,{status:"connecting",ready:!1,state:null,liveOutputs:new Map,toolStatuses:new Map,notices:[],sessions:[],conversations:[],activeConversationId:"",projects:[],files:null,fileChanged:null,fileContent:null,models:[],modelsLoading:!1,modelsConfig:[],providers:[],installResult:null,pathCompletions:[],update:null,updateResult:null,widgets:[],statuses:[],dialog:null,commands:[],commandsPath:"",slashCommands:[],terminals:[],goal:_0,settings:null}),n=K.useRef(null),r=K.useRef(v0()),o=K.useRef(0),a=K.useRef(null),l=K.useRef(!0),u=K.useRef(0),d=K.useRef(0),h=K.useCallback((R,T)=>{const A=++d.current;t({type:"notice",notice:{id:A,level:R,text:T}}),setTimeout(()=>t({type:"dismiss_notice",id:A}),R==="error"?12e3:7e3)},[]),g=K.useCallback(R=>{const T=n.current;return T&&T.readyState===WebSocket.OPEN?(T.send(JSON.stringify(R)),!0):!1},[]),p=K.useCallback(()=>{if(!l.current)return;t({type:"status",status:"connecting"});const R=new WebSocket(w0());n.current=R,R.onopen=()=>{n.current===R&&(t({type:"status",status:"open"}),o.current=0,u.current=Date.now(),R.send(JSON.stringify({type:"hello",clientId:Zd()})))},R.onmessage=T=>{if(n.current!==R)return;u.current=Date.now();let A;try{A=JSON.parse(T.data)}catch{return}switch(A.type){case"ready":t({type:"ready",serverVersion:A.serverVersion}),R.send(JSON.stringify({type:"get_state"})),R.send(JSON.stringify({type:"list_sessions"})),R.send(JSON.stringify({type:"list_projects"})),R.send(JSON.stringify({type:"list_files"})),R.send(JSON.stringify({type:"list_models"})),R.send(JSON.stringify({type:"list_commands"})),R.send(JSON.stringify({type:"get_commands"})),R.send(JSON.stringify({type:"check_update"}));break;case"snapshot":t({type:"snapshot",state:A.state});break;case"tool_delta":t({type:"tool_delta",toolCallId:A.toolCallId,toolName:A.toolName,delta:A.delta});break;case"tool_status":t({type:"tool_status",status:A});break;case"notice":{const V=++d.current;t({type:"notice",notice:{id:V,level:A.level,text:A.text}}),setTimeout(()=>t({type:"dismiss_notice",id:V}),A.level==="error"?12e3:7e3);break}case"sessions":t({type:"sessions",sessions:A.sessions});break;case"conversations":t({type:"conversations",conversations:A.conversations,activeId:A.activeId});break;case"projects":t({type:"projects",projects:A.projects});break;case"files":t({type:"files",files:A});break;case"file_changed":t({type:"file_changed",path:A.path});break;case"file_content":t({type:"file_content",content:A});break;case"models":t({type:"models",models:A.models,loading:!1});break;case"models_config":t({type:"models_config",providers:A.providers});break;case"providers_status":t({type:"providers_status",providers:A.providers});break;case"install_result":t({type:"install_result",result:A});break;case"path_completions":t({type:"path_completions",completions:A.completions});break;case"update_status":t({type:"update_status",status:A});break;case"update_result":t({type:"update_result",result:A});break;case"widgets":t({type:"widgets",widgets:A.widgets});break;case"statuses":t({type:"statuses",statuses:A.statuses});break;case"dialog":t({type:"dialog",dialog:{id:A.id,kind:A.kind,title:A.title,args:A.args}});break;case"dialog_closed":t({type:"dialog",dialog:null});break;case"terminal_output":r.current.write(A.terminalId,A.data);break;case"terminal_exit":t({type:"terminal_exit",terminalId:A.terminalId,exitCode:A.exitCode});break;case"commands":t({type:"commands",commands:A.commands,path:A.path});break;case"slash_commands":t({type:"slash_commands",commands:A.commands});break;case"goal_status":t({type:"goal_status",status:A.status});break;case"settings_state":t({type:"settings",settings:A.settings});break}},R.onclose=()=>{if(n.current===R&&(n.current=null),r.current.clear(),!l.current)return;t({type:"status",status:"closed"});const T=Math.min(1e3*2**o.current,1e4);o.current+=1,a.current=setTimeout(()=>{a.current=null,p()},T)},R.onerror=()=>{R.close()}},[]);K.useEffect(()=>{l.current=!0,p();const R=setInterval(()=>{if(!l.current)return;const T=n.current;T&&T.readyState===WebSocket.OPEN&&Date.now()-u.current>3e4&&T.close()},5e3);return()=>{var T;l.current=!1,clearInterval(R),a.current&&(clearTimeout(a.current),a.current=null),(T=n.current)==null||T.close(),n.current=null}},[p]);const v=K.useCallback(R=>t({type:"dismiss_notice",id:R}),[]),y=K.useCallback(R=>t({type:"terminal_add",meta:R}),[]),S=K.useCallback(R=>t({type:"terminal_remove",id:R}),[]),w=K.useCallback(R=>t({type:"terminal_restart",terminalId:R}),[]),E=K.useCallback((R,T)=>r.current.register(R,T),[]),k=K.useRef({chat:e,send:g,pushNotice:h,dismissNotice:v,terminal:{create:y,close:S,register:E,restart:w}});return k.current={chat:e,send:g,pushNotice:h,dismissNotice:v,terminal:{create:y,close:S,register:E,restart:w}},k.current}const k0=200*1024*1024,E0=/windows/i.test(navigator.userAgent),C0=/[<>:"/\\|?*\u0000-\u001f]/g,N0=/[. ]+$/,T0=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i;function R0(e){const t=e.replace(C0,"_").replace(N0,"");return t?T0.test(t)?`_${t}`:t:"_"}function dg(e,t=!0){return`/api/file?${new URLSearchParams({clientId:Zd(),path:e,...t?{download:"1"}:{}})}`}async function M0(e,t){const n=E0?R0(t):t;try{const r=await fetch(dg(e));if(!r.ok)return{ok:!1,cancelled:!1,error:await r.text().catch(()=>"")||(r.status===404?"文件不存在":`HTTP ${r.status}`)};if(Number(r.headers.get("content-length")??"0")>k0)return window.location.assign(dg(e)),{ok:!0};const a=await r.blob();return window.showSaveFilePicker&&window.isSecureContext?A0(a,n):Yh(a,n)}catch(r){return{ok:!1,cancelled:!1,error:r instanceof Error?r.message:String(r)}}}async function A0(e,t){let n;const r=window.showSaveFilePicker;if(!r)return Yh(e,t);try{n=await r({suggestedName:t})}catch(o){return o instanceof DOMException&&o.name==="AbortError"?{ok:!1,cancelled:!0}:Yh(e,t)}try{const o=await n.createWritable();return await o.write(e),await o.close(),{ok:!0}}catch(o){return{ok:!1,cancelled:!1,error:o instanceof Error?o.message:String(o)}}}function Yh(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");return r.href=n,r.download=t,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),{ok:!0}}function L0({chat:e,send:t,onAttach:n,onPreview:r,onNotice:o}){var R;const a=bt(),[l,u]=K.useState(""),[d,h]=K.useState(!1),g=e.files,p=1e4,v=K.useRef(0),y=K.useRef(void 0),S=K.useCallback((T,A)=>{const V=++v.current;u(T),A!=null&&A.silent||h(!0),t({type:"list_files",path:T===""?void 0:T})||v.current===V&&h(!1)},[t]);K.useEffect(()=>{g&&g.path===l&&h(!1)},[g,l]),K.useEffect(()=>{var V;const T=(V=e.state)==null?void 0:V.cwd;if(T!==y.current){y.current=T,S("",{silent:!0});return}const A=setInterval(()=>{document.visibilityState!=="hidden"&&S(l,{silent:!0})},p);return()=>clearInterval(A)},[(R=e.state)==null?void 0:R.cwd,l,S]),K.useEffect(()=>{const T=e.fileChanged;T&&T.path===l&&S(l,{silent:!0})},[e.fileChanged,l,S]);const w=T=>S(T),E=()=>{(g==null?void 0:g.parent)!==null&&(g==null?void 0:g.parent)!==void 0&&S(g.parent)},k=l.split("/").filter(Boolean);return m.jsxs("aside",{className:"panel panel-right",children:[m.jsxs("div",{className:"panel-crumbs",children:[m.jsx("button",{type:"button",className:`crumb ${l===""?"active":""}`,onClick:()=>S(""),children:a("rootDir")}),k.map((T,A)=>{const V=k.slice(0,A+1).join("/");return m.jsxs("span",{className:"crumb-seg",children:[m.jsx(vc,{}),m.jsx("button",{type:"button",className:`crumb ${V===l?"active":""}`,onClick:()=>S(V),children:T})]},V)})]}),m.jsxs("div",{className:"panel-body",children:[d&&m.jsx("div",{className:"panel-empty",children:a("loading")}),!d&&g&&g.path===l&&m.jsxs(m.Fragment,{children:[g.path!==""&&m.jsxs("button",{type:"button",className:"file-item dir",onClick:E,children:[m.jsx(la,{className:"file-icon"}),m.jsx("span",{className:"file-name",children:".."})]}),g.entries.map(T=>T.type==="dir"?m.jsxs("div",{className:"file-item dir",children:[m.jsxs("button",{type:"button",className:"file-dir-main",onClick:()=>w(T.path),children:[m.jsx(la,{className:"file-icon"}),m.jsx("span",{className:"file-name",children:T.name})]}),m.jsx("button",{type:"button",className:"file-attach ref","data-tip":a("linkFolderTip"),onClick:()=>n(T.path,T.name,"reference",!0),children:m.jsx(Gh,{})})]},T.path):m.jsxs("div",{className:"file-item file",children:[m.jsxs("button",{type:"button",className:"file-name",title:`${T.path} — ${a("previewFile")}`,onClick:()=>r(T.path,T.name),children:[m.jsx(Cv,{className:"file-icon"}),m.jsx("span",{className:"file-name-text",children:T.name})]}),m.jsx("button",{type:"button",className:"file-attach download","data-tip":a("downloadFile"),onClick:()=>{M0(T.path,T.name).then(A=>{A.ok||A.cancelled||o("error",a("downloadFailed",{error:A.error}))})},children:m.jsx(Tv,{})}),m.jsx("button",{type:"button",className:"file-attach inline","data-tip":a("attachInlineTip"),onClick:()=>n(T.path,T.name,"inline"),children:m.jsx(Tr,{})}),m.jsx("button",{type:"button",className:"file-attach ref","data-tip":a("referenceTip"),onClick:()=>n(T.path,T.name,"reference"),children:m.jsx(Gh,{})})]},T.path)),g.truncated&&m.jsx("div",{className:"panel-empty files-truncated",children:a("filesTruncated")})]}),!d&&!g&&m.jsx("div",{className:"panel-empty",children:a("noFiles")})]}),e.widgets.filter(T=>T.lines.length>0).length>0&&m.jsx("div",{className:"panel-widgets",children:e.widgets.filter(T=>T.lines.length>0).map(T=>m.jsxs("div",{className:"widget",children:[m.jsx("div",{className:"widget-title",children:T.key}),m.jsx("pre",{className:"widget-lines",children:T.lines.join(`
|
|
45
|
-
`)})]},T.key))})]})}var O0=yv();function D0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const I0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,B0={};function fg(e,t){return(B0.jsx?P0:I0).test(e)}const F0=/[ \t\n\f\r]/g;function z0(e){return typeof e=="object"?e.type==="text"?pg(e.value):!1:pg(e)}function pg(e){return e.replace(F0,"")===""}class ma{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ma.prototype.normal={};ma.prototype.property={};ma.prototype.space=void 0;function Iv(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new ma(n,r,t)}function Xh(e){return e.toLowerCase()}class Dn{constructor(t,n){this.attribute=n,this.property=t}}Dn.prototype.attribute="";Dn.prototype.booleanish=!1;Dn.prototype.boolean=!1;Dn.prototype.commaOrSpaceSeparated=!1;Dn.prototype.commaSeparated=!1;Dn.prototype.defined=!1;Dn.prototype.mustUseProperty=!1;Dn.prototype.number=!1;Dn.prototype.overloadedBoolean=!1;Dn.prototype.property="";Dn.prototype.spaceSeparated=!1;Dn.prototype.space=void 0;let j0=0;const $e=ds(),Ft=ds(),Zh=ds(),ue=ds(),ct=ds(),os=ds(),$n=ds();function ds(){return 2**++j0}const Qh=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Ft,commaOrSpaceSeparated:$n,commaSeparated:os,number:ue,overloadedBoolean:Zh,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),fh=Object.keys(Qh);class Qd extends Dn{constructor(t,n,r,o){let a=-1;if(super(t,n),mg(this,"space",o),typeof r=="number")for(;++a<fh.length;){const l=fh[a];mg(this,fh[a],(r&Qh[l])===Qh[l])}}}Qd.prototype.defined=!0;function mg(e,t,n){n&&(e[t]=n)}function Qs(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const a=new Qd(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Xh(r)]=r,n[Xh(a.attribute)]=r}return new ma(t,n,e.space)}const Pv=Qs({properties:{ariaActiveDescendant:null,ariaAtomic:Ft,ariaAutoComplete:null,ariaBusy:Ft,ariaChecked:Ft,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Ft,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Ft,ariaFlowTo:ct,ariaGrabbed:Ft,ariaHasPopup:null,ariaHidden:Ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:ue,ariaLive:null,ariaModal:Ft,ariaMultiLine:Ft,ariaMultiSelectable:Ft,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:Ft,ariaReadOnly:Ft,ariaRelevant:null,ariaRequired:Ft,ariaRoleDescription:ct,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:Ft,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Bv(e,t){return t in e?e[t]:t}function Fv(e,t){return Bv(e,t.toLowerCase())}const U0=Qs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:os,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alpha:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:ct,autoFocus:$e,autoPlay:$e,blocking:ct,capture:null,charSet:null,checked:$e,cite:null,className:ct,closedBy:null,colorSpace:null,cols:ue,colSpan:ue,command:null,commandFor:null,content:null,contentEditable:Ft,controls:$e,controlsList:ct,coords:ue|os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:Zh,draggable:Ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:ct,height:ue,hidden:Zh,high:ue,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:ct,itemRef:ct,itemScope:$e,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$e,optimum:ue,pattern:null,ping:ct,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:ct,required:$e,reversed:$e,rows:ue,rowSpan:ue,sandbox:ct,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootCustomElementRegistry:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shadowRootSerializable:$e,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:Ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:Ft,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:Ft,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:$e,disablePictureInPicture:$e,disableRemotePlayback:$e,exportParts:os,part:ct,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:Fv}),H0=Qs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:$n,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:os,g2:os,glyphName:os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:$n,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$n,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$n,rev:$n,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$n,requiredFeatures:$n,requiredFonts:$n,requiredFormats:$n,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:$n,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$n,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$n,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Bv}),zv=Qs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),jv=Qs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fv}),Uv=Qs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$0={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},W0=/[A-Z]/g,gg=/-[a-z]/g,K0=/^data[-\w.:]+$/i;function q0(e,t){const n=Xh(t);let r=t,o=Dn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&K0.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(gg,G0);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!gg.test(a)){let l=a.replace(W0,V0);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Qd}return new o(r,t)}function V0(e){return"-"+e.toLowerCase()}function G0(e){return e.charAt(1).toUpperCase()}const Y0=Iv([Pv,U0,zv,jv,Uv],"html"),Jd=Iv([Pv,H0,zv,jv,Uv],"svg");function X0(e){return e.join(" ").trim()}var Hs={},ph,_g;function Z0(){if(_g)return ph;_g=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
46
|
-
`,h="/",g="*",p="",v="comment",y="declaration";function S(E,k){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];k=k||{};var R=1,T=1;function A(q){var F=q.match(t);F&&(R+=F.length);var Q=q.lastIndexOf(d);T=~Q?q.length-Q:T+q.length}function V(){var q={line:R,column:T};return function(F){return F.position=new D(q),ee(),F}}function D(q){this.start=q,this.end={line:R,column:T},this.source=k.source}D.prototype.content=E;function ne(q){var F=new Error(k.source+":"+R+":"+T+": "+q);if(F.reason=q,F.filename=k.source,F.line=R,F.column=T,F.source=E,!k.silent)throw F}function Z(q){var F=q.exec(E);if(F){var Q=F[0];return A(Q),E=E.slice(Q.length),F}}function ee(){Z(n)}function W(q){var F;for(q=q||[];F=H();)F!==!1&&q.push(F);return q}function H(){var q=V();if(!(h!=E.charAt(0)||g!=E.charAt(1))){for(var F=2;p!=E.charAt(F)&&(g!=E.charAt(F)||h!=E.charAt(F+1));)++F;if(F+=2,p===E.charAt(F-1))return ne("End of comment missing");var Q=E.slice(2,F-2);return T+=2,A(Q),E=E.slice(F),T+=2,q({type:v,comment:Q})}}function U(){var q=V(),F=Z(r);if(F){if(H(),!Z(o))return ne("property missing ':'");var Q=Z(a),ie=q({type:y,property:w(F[0].replace(e,p)),value:Q?w(Q[0].replace(e,p)):p});return Z(l),ie}}function O(){var q=[];W(q);for(var F;F=U();)F!==!1&&(q.push(F),W(q));return q}return ee(),O()}function w(E){return E?E.replace(u,p):p}return ph=S,ph}var vg;function Q0(){if(vg)return Hs;vg=1;var e=Hs&&Hs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.default=n;const t=e(Z0());function n(r,o){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:g}=d;u?o(h,g,d):g&&(a=a||{},a[h]=g)}),a}return Hs}var zo={},yg;function J0(){if(yg)return zo;yg=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,g){return g.toUpperCase()},u=function(h,g){return"".concat(g,"-")},d=function(h,g){return g===void 0&&(g={}),a(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(o,u):h=h.replace(r,u),h.replace(t,l))};return zo.camelCase=d,zo}var jo,bg;function ex(){if(bg)return jo;bg=1;var e=jo&&jo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Q0()),n=J0();function r(o,a){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,jo=r,jo}var tx=ex();const nx=gc(tx),Hv=$v("end"),ef=$v("start");function $v(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ix(e){const t=ef(e),n=Hv(e);if(t&&n)return{start:t,end:n}}function ra(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Sg(e.position):"start"in e||"end"in e?Sg(e):"line"in e||"column"in e?Jh(e):""}function Jh(e){return wg(e&&e.line)+":"+wg(e&&e.column)}function Sg(e){return Jh(e&&e.start)+"-"+Jh(e&&e.end)}function wg(e){return e&&typeof e=="number"?e:1}class mn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?o=t:!a.cause&&t&&(l=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=u?u.line:void 0,this.name=ra(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const tf={}.hasOwnProperty,rx=new Map,sx=/[A-Z]/g,ox=new Set(["table","tbody","thead","tfoot","tr"]),ax=new Set(["td","th"]),Wv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lx(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=gx(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mx(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Jd:Y0,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Kv(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function Kv(e,t,n){if(t.type==="element")return cx(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ux(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return dx(e,t,n);if(t.type==="mdxjsEsm")return hx(e,t);if(t.type==="root")return fx(e,t,n);if(t.type==="text")return px(e,t)}function cx(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Jd,e.schema=o),e.ancestors.push(t);const a=Vv(e,t.tagName,!1),l=_x(e,t);let u=rf(e,t);return ox.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!z0(d):!0})),qv(e,l,a,t),nf(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function ux(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ca(e,t.position)}function hx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ca(e,t.position)}function dx(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Jd,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:Vv(e,t.name,!0),l=vx(e,t),u=rf(e,t);return qv(e,l,a,t),nf(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function fx(e,t,n){const r={};return nf(r,rf(e,t)),e.create(t,e.Fragment,r,n)}function px(e,t){return t.value}function qv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mx(e,t,n){return r;function r(o,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function gx(e,t){return n;function n(r,o,a,l){const u=Array.isArray(a.children),d=ef(r);return t(o,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function _x(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&tf.call(t.properties,o)){const a=yx(e,o,t.properties[o]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&ax.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vx(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else ca(e,t.position);else{const o=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else ca(e,t.position);else a=r.value===null?!0:r.value;n[o]=a}return n}function rf(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:rx;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const h=o.get(d)||0;l=d+"-"+h,o.set(d,h+1)}}const u=Kv(e,a,l);u!==void 0&&n.push(u)}return n}function yx(e,t,n){const r=q0(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?D0(n):X0(n)),r.property==="style"){let o=typeof n=="object"?n:bx(e,String(n));return e.stylePropertyNameCase==="css"&&(o=Sx(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?$0[r.property]||r.property:r.attribute,n]}}function bx(e,t){try{return nx(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Wv+"#cannot-parse-style-attribute",o}}function Vv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const u=fg(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=fg(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return tf.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);ca(e)}function ca(e,t){const n=new mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Wv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Sx(e){const t={};let n;for(n in e)tf.call(e,n)&&(t[wx(n)]=e[n]);return t}function wx(e){let t=e.replace(sx,xx);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function xx(e){return"-"+e.toLowerCase()}const mh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},kx={};function sf(e,t){const n=kx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Gv(e,r,o)}function Gv(e,t,n){if(Ex(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return xg(e.children,t,n)}return Array.isArray(e)?xg(e,t,n):""}function xg(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Gv(e[o],t,n);return r.join("")}function Ex(e){return!!(e&&typeof e=="object")}const kg=document.createElement("i");function of(e){const t="&"+e+";";kg.innerHTML=t;const n=kg.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wn(e,t,n,r){const o=e.length;let a=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function ri(e,t){return e.length>0?(Wn(e,e.length,0,t),e):t}const Eg={}.hasOwnProperty;function Yv(e){const t={};let n=-1;for(;++n<e.length;)Cx(t,e[n]);return t}function Cx(e,t){let n;for(n in t){const o=(Eg.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Eg.call(o,l)||(o[l]=[]);const u=a[l];Nx(o[l],Array.isArray(u)?u:u?[u]:[])}}}function Nx(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Wn(e,0,0,r)}function Xv(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function _i(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const wn=Rr(/[A-Za-z]/),pn=Rr(/[\dA-Za-z]/),Tx=Rr(/[#-'*+\--9=?A-Z^-~]/);function rc(e){return e!==null&&(e<32||e===127)}const ed=Rr(/\d/),Rx=Rr(/[\dA-Fa-f]/),Mx=Rr(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function ut(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const yc=Rr(new RegExp("\\p{P}|\\p{S}","u")),cs=Rr(/\s/);function Rr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Js(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&pn(e.charCodeAt(n+1))&&pn(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),o=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function tt(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Ze(d)?(e.enter(n),u(d)):t(d)}function u(d){return Ze(d)&&a++<o?(e.consume(d),u):(e.exit(n),t(d))}}const Ax={tokenize:Lx};function Lx(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),tt(e,t,"linePrefix")}function o(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Ie(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const Ox={tokenize:Dx},Cg={tokenize:Ix};function Dx(e){const t=this,n=[];let r=0,o,a,l;return u;function u(T){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,h)(T)}return h(T)}function d(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&R();const A=t.events.length;let V=A,D;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){D=t.events[V][1].end;break}k(r);let ne=A;for(;ne<t.events.length;)t.events[ne][1].end={...D},ne++;return Wn(t.events,V+1,0,t.events.slice(A)),t.events.length=ne,h(T)}return u(T)}function h(T){if(r===n.length){if(!o)return v(T);if(o.currentConstruct&&o.currentConstruct.concrete)return S(T);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Cg,g,p)(T)}function g(T){return o&&R(),k(r),v(T)}function p(T){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(T)}function v(T){return t.containerState={},e.attempt(Cg,y,S)(T)}function y(T){return r++,n.push([t.currentConstruct,t.containerState]),v(T)}function S(T){if(T===null){o&&R(),k(0),e.consume(T);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),w(T)}function w(T){if(T===null){E(e.exit("chunkFlow"),!0),k(0),e.consume(T);return}return Ie(T)?(e.consume(T),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(T),w)}function E(T,A){const V=t.sliceStream(T);if(A&&V.push(null),T.previous=a,a&&(a.next=T),a=T,o.defineSkip(T.start),o.write(V),t.parser.lazy[T.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<l&&(!o.events[D][1].end||o.events[D][1].end.offset>l))return;const ne=t.events.length;let Z=ne,ee,W;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(ee){W=t.events[Z][1].end;break}ee=!0}for(k(r),D=ne;D<t.events.length;)t.events[D][1].end={...W},D++;Wn(t.events,Z+1,0,t.events.slice(ne)),t.events.length=D}}function k(T){let A=n.length;for(;A-- >T;){const V=n[A];t.containerState=V[1],V[0].exit.call(t,e)}n.length=T}function R(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Ix(e,t,n){return tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ys(e){if(e===null||ut(e)||cs(e))return 1;if(yc(e))return 2}function bc(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const td={name:"attention",resolveAll:Px,tokenize:Bx};function Px(e,t){let n=-1,r,o,a,l,u,d,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},v={...e[n][1].start};Ng(p,-d),Ng(v,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=ri(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=ri(h,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=ri(h,bc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=ri(h,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=ri(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Wn(e,r-1,n-r+3,h),n=r+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Bx(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Ys(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const h=e.exit("attentionSequence"),g=Ys(d),p=!g||g===2&&o||n.includes(d),v=!o||o===2&&g||n.includes(r);return h._open=!!(a===42?p:p&&(o||!v)),h._close=!!(a===42?v:v&&(g||!p)),t(d)}}function Ng(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Fx={name:"autolink",tokenize:zx};function zx(e,t,n){let r=0;return o;function o(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(y){return wn(y)?(e.consume(y),l):y===64?n(y):h(y)}function l(y){return y===43||y===45||y===46||pn(y)?(r=1,u(y)):h(y)}function u(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||pn(y))&&r++<32?(e.consume(y),u):(r=0,h(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||rc(y)?n(y):(e.consume(y),d)}function h(y){return y===64?(e.consume(y),g):Tx(y)?(e.consume(y),h):n(y)}function g(y){return pn(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,g):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||pn(y))&&r++<63){const S=y===45?v:p;return e.consume(y),S}return n(y)}}const ga={partial:!0,tokenize:jx};function jx(e,t,n){return r;function r(a){return Ze(a)?tt(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Ie(a)?t(a):n(a)}}const Zv={continuation:{tokenize:Hx},exit:$x,name:"blockQuote",tokenize:Ux};function Ux(e,t,n){const r=this;return o;function o(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Ze(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Hx(e,t,n){const r=this;return o;function o(l){return Ze(l)?tt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Zv,t,n)(l)}}function $x(e){e.exit("blockQuote")}const Qv={name:"characterEscape",tokenize:Wx};function Wx(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return Mx(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Jv={name:"characterReference",tokenize:Kx};function Kx(e,t,n){const r=this;let o=0,a,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=pn,g(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=Rx,g):(e.enter("characterReferenceValue"),a=7,l=ed,g(p))}function g(p){if(p===59&&o){const v=e.exit("characterReferenceValue");return l===pn&&!of(r.sliceSerialize(v))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&o++<a?(e.consume(p),g):n(p)}}const Tg={partial:!0,tokenize:Vx},Rg={concrete:!0,name:"codeFenced",tokenize:qx};function qx(e,t,n){const r=this,o={partial:!0,tokenize:V};let a=0,l=0,u;return d;function d(D){return h(D)}function h(D){const ne=r.events[r.events.length-1];return a=ne&&ne[1].type==="linePrefix"?ne[2].sliceSerialize(ne[1],!0).length:0,u=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(D)}function g(D){return D===u?(l++,e.consume(D),g):l<3?n(D):(e.exit("codeFencedFenceSequence"),Ze(D)?tt(e,p,"whitespace")(D):p(D))}function p(D){return D===null||Ie(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(Tg,w,A)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Ie(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):Ze(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,y,"whitespace")(D)):D===96&&D===u?n(D):(e.consume(D),v)}function y(D){return D===null||Ie(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||Ie(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===u?n(D):(e.consume(D),S)}function w(D){return e.attempt(o,A,E)(D)}function E(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),k}function k(D){return a>0&&Ze(D)?tt(e,R,"linePrefix",a+1)(D):R(D)}function R(D){return D===null||Ie(D)?e.check(Tg,w,A)(D):(e.enter("codeFlowValue"),T(D))}function T(D){return D===null||Ie(D)?(e.exit("codeFlowValue"),R(D)):(e.consume(D),T)}function A(D){return e.exit("codeFenced"),t(D)}function V(D,ne,Z){let ee=0;return W;function W(F){return D.enter("lineEnding"),D.consume(F),D.exit("lineEnding"),H}function H(F){return D.enter("codeFencedFence"),Ze(F)?tt(D,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):U(F)}function U(F){return F===u?(D.enter("codeFencedFenceSequence"),O(F)):Z(F)}function O(F){return F===u?(ee++,D.consume(F),O):ee>=l?(D.exit("codeFencedFenceSequence"),Ze(F)?tt(D,q,"whitespace")(F):q(F)):Z(F)}function q(F){return F===null||Ie(F)?(D.exit("codeFencedFence"),ne(F)):Z(F)}}}function Vx(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gh={name:"codeIndented",tokenize:Yx},Gx={partial:!0,tokenize:Xx};function Yx(e,t,n){const r=this;return o;function o(h){return e.enter("codeIndented"),tt(e,a,"linePrefix",5)(h)}function a(h){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):Ie(h)?e.attempt(Gx,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||Ie(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function Xx(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):tt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Ie(l)?o(l):n(l)}}const Zx={name:"codeText",previous:Jx,resolve:Qx,tokenize:e1};function Qx(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function Jx(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function e1(e,t,n){let r=0,o,a;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(a=e.enter("codeTextSequence"),o=0,g(p)):Ie(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Ie(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function g(p){return p===96?(e.consume(p),o++,g):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",h(p))}}class t1{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Uo(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Uo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Uo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Uo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Uo(this.left,n.reverse())}}}function Uo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ey(e){const t={};let n=-1,r,o,a,l,u,d,h;const g=new t1(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,n1(g,n)),n=t[n],h=!0);else if(r[1]._container){for(a=n,o=void 0;a--;)if(l=g.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(g.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(r[1].end={...g.get(o)[1].start},u=g.slice(o,n),u.unshift(r),g.splice(o,n-o+1,u))}}return Wn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function n1(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],h={};let g,p,v=-1,y=n,S=0,w=0;const E=[w];for(;y;){for(;e.get(++o)[1]!==y;);a.push(o),y._tokenizer||(g=r.sliceStream(y),y.next||g.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++v<u.length;)u[v][0]==="exit"&&u[v-1][0]==="enter"&&u[v][1].type===u[v-1][1].type&&u[v][1].start.line!==u[v][1].end.line&&(w=v+1,E.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):E.pop(),v=E.length;v--;){const k=u.slice(E[v],E[v+1]),R=a.pop();d.push([R,R+k.length-1]),e.splice(R,2,k)}for(d.reverse(),v=-1;++v<d.length;)h[S+d[v][0]]=S+d[v][1],S+=d[v][1]-d[v][0]-1;return h}const i1={resolve:s1,tokenize:o1},r1={partial:!0,tokenize:a1};function s1(e){return ey(e),e}function o1(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(u)}function o(u){return u===null?a(u):Ie(u)?e.check(r1,l,a)(u):(e.consume(u),o)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function a1(e,t,n){const r=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),tt(e,a,"linePrefix")}function a(l){if(l===null||Ie(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function ty(e,t,n,r,o,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let g=0;return p;function p(k){return k===60?(e.enter(r),e.enter(o),e.enter(a),e.consume(k),e.exit(a),v):k===null||k===32||k===41||rc(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function v(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(u),v(k)):k===null||k===60||Ie(k)?n(k):(e.consume(k),k===92?S:y)}function S(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function w(k){return!g&&(k===null||k===41||ut(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):g<h&&k===40?(e.consume(k),g++,w):k===41?(e.consume(k),g--,w):k===null||k===32||k===40||rc(k)?n(k):(e.consume(k),k===92?E:w)}function E(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function ny(e,t,n,r,o,a){const l=this;let u=0,d;return h;function h(y){return e.enter(r),e.enter(o),e.consume(y),e.exit(o),e.enter(a),g}function g(y){return u>999||y===null||y===91||y===93&&!d||y===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(a),e.enter(o),e.consume(y),e.exit(o),e.exit(r),t):Ie(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Ie(y)||u++>999?(e.exit("chunkString"),g(y)):(e.consume(y),d||(d=!Ze(y)),y===92?v:p)}function v(y){return y===91||y===92||y===93?(e.consume(y),u++,p):p(y)}}function iy(e,t,n,r,o,a){let l;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(o),e.consume(v),e.exit(o),l=v===40?41:v,d):n(v)}function d(v){return v===l?(e.enter(o),e.consume(v),e.exit(o),e.exit(r),t):(e.enter(a),h(v))}function h(v){return v===l?(e.exit(a),d(l)):v===null?n(v):Ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),tt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||Ie(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?p:g)}function p(v){return v===l||v===92?(e.consume(v),g):g(v)}}function sa(e,t){let n;return r;function r(o){return Ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Ze(o)?tt(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const l1={name:"definition",tokenize:u1},c1={partial:!0,tokenize:h1};function u1(e,t,n){const r=this;let o;return a;function a(y){return e.enter("definition"),l(y)}function l(y){return ny.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return o=_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):n(y)}function d(y){return ut(y)?sa(e,h)(y):h(y)}function h(y){return ty(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(c1,p,p)(y)}function p(y){return Ze(y)?tt(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Ie(y)?(e.exit("definition"),r.parser.defined.push(o),t(y)):n(y)}}function h1(e,t,n){return r;function r(u){return ut(u)?sa(e,o)(u):n(u)}function o(u){return iy(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Ze(u)?tt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Ie(u)?t(u):n(u)}}const d1={name:"hardBreakEscape",tokenize:f1};function f1(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Ie(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const p1={name:"headingAtx",resolve:m1,tokenize:g1};function m1(e,t){let n=e.length-2,r=3,o,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Wn(e,r,n-r+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function g1(e,t,n){let r=0;return o;function o(g){return e.enter("atxHeading"),a(g)}function a(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&r++<6?(e.consume(g),l):g===null||ut(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),d(g)):g===null||Ie(g)?(e.exit("atxHeading"),t(g)):Ze(g)?tt(e,u,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function d(g){return g===35?(e.consume(g),d):(e.exit("atxHeadingSequence"),u(g))}function h(g){return g===null||g===35||ut(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),h)}}const _1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mg=["pre","script","style","textarea"],v1={concrete:!0,name:"htmlFlow",resolveTo:S1,tokenize:w1},y1={partial:!0,tokenize:k1},b1={partial:!0,tokenize:x1};function S1(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function w1(e,t,n){const r=this;let o,a,l,u,d;return h;function h(N){return g(N)}function g(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),p}function p(N){return N===33?(e.consume(N),v):N===47?(e.consume(N),a=!0,w):N===63?(e.consume(N),o=3,r.interrupt?t:C):wn(N)?(e.consume(N),l=String.fromCharCode(N),E):n(N)}function v(N){return N===45?(e.consume(N),o=2,y):N===91?(e.consume(N),o=5,u=0,S):wn(N)?(e.consume(N),o=4,r.interrupt?t:C):n(N)}function y(N){return N===45?(e.consume(N),r.interrupt?t:C):n(N)}function S(N){const ae="CDATA[";return N===ae.charCodeAt(u++)?(e.consume(N),u===ae.length?r.interrupt?t:U:S):n(N)}function w(N){return wn(N)?(e.consume(N),l=String.fromCharCode(N),E):n(N)}function E(N){if(N===null||N===47||N===62||ut(N)){const ae=N===47,ye=l.toLowerCase();return!ae&&!a&&Mg.includes(ye)?(o=1,r.interrupt?t(N):U(N)):_1.includes(l.toLowerCase())?(o=6,ae?(e.consume(N),k):r.interrupt?t(N):U(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?R(N):T(N))}return N===45||pn(N)?(e.consume(N),l+=String.fromCharCode(N),E):n(N)}function k(N){return N===62?(e.consume(N),r.interrupt?t:U):n(N)}function R(N){return Ze(N)?(e.consume(N),R):W(N)}function T(N){return N===47?(e.consume(N),W):N===58||N===95||wn(N)?(e.consume(N),A):Ze(N)?(e.consume(N),T):W(N)}function A(N){return N===45||N===46||N===58||N===95||pn(N)?(e.consume(N),A):V(N)}function V(N){return N===61?(e.consume(N),D):Ze(N)?(e.consume(N),V):T(N)}function D(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),d=N,ne):Ze(N)?(e.consume(N),D):Z(N)}function ne(N){return N===d?(e.consume(N),d=null,ee):N===null||Ie(N)?n(N):(e.consume(N),ne)}function Z(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ut(N)?V(N):(e.consume(N),Z)}function ee(N){return N===47||N===62||Ze(N)?T(N):n(N)}function W(N){return N===62?(e.consume(N),H):n(N)}function H(N){return N===null||Ie(N)?U(N):Ze(N)?(e.consume(N),H):n(N)}function U(N){return N===45&&o===2?(e.consume(N),Q):N===60&&o===1?(e.consume(N),ie):N===62&&o===4?(e.consume(N),I):N===63&&o===3?(e.consume(N),C):N===93&&o===5?(e.consume(N),Y):Ie(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(y1,P,O)(N)):N===null||Ie(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),U)}function O(N){return e.check(b1,q,P)(N)}function q(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),F}function F(N){return N===null||Ie(N)?O(N):(e.enter("htmlFlowData"),U(N))}function Q(N){return N===45?(e.consume(N),C):U(N)}function ie(N){return N===47?(e.consume(N),l="",M):U(N)}function M(N){if(N===62){const ae=l.toLowerCase();return Mg.includes(ae)?(e.consume(N),I):U(N)}return wn(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),M):U(N)}function Y(N){return N===93?(e.consume(N),C):U(N)}function C(N){return N===62?(e.consume(N),I):N===45&&o===2?(e.consume(N),C):U(N)}function I(N){return N===null||Ie(N)?(e.exit("htmlFlowData"),P(N)):(e.consume(N),I)}function P(N){return e.exit("htmlFlow"),t(N)}}function x1(e,t,n){const r=this;return o;function o(l){return Ie(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function k1(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ga,t,n)}}const E1={name:"htmlText",tokenize:C1};function C1(e,t,n){const r=this;let o,a,l;return u;function u(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),V):C===63?(e.consume(C),T):wn(C)?(e.consume(C),Z):n(C)}function h(C){return C===45?(e.consume(C),g):C===91?(e.consume(C),a=0,S):wn(C)?(e.consume(C),R):n(C)}function g(C){return C===45?(e.consume(C),y):n(C)}function p(C){return C===null?n(C):C===45?(e.consume(C),v):Ie(C)?(l=p,ie(C)):(e.consume(C),p)}function v(C){return C===45?(e.consume(C),y):p(C)}function y(C){return C===62?Q(C):C===45?v(C):p(C)}function S(C){const I="CDATA[";return C===I.charCodeAt(a++)?(e.consume(C),a===I.length?w:S):n(C)}function w(C){return C===null?n(C):C===93?(e.consume(C),E):Ie(C)?(l=w,ie(C)):(e.consume(C),w)}function E(C){return C===93?(e.consume(C),k):w(C)}function k(C){return C===62?Q(C):C===93?(e.consume(C),k):w(C)}function R(C){return C===null||C===62?Q(C):Ie(C)?(l=R,ie(C)):(e.consume(C),R)}function T(C){return C===null?n(C):C===63?(e.consume(C),A):Ie(C)?(l=T,ie(C)):(e.consume(C),T)}function A(C){return C===62?Q(C):T(C)}function V(C){return wn(C)?(e.consume(C),D):n(C)}function D(C){return C===45||pn(C)?(e.consume(C),D):ne(C)}function ne(C){return Ie(C)?(l=ne,ie(C)):Ze(C)?(e.consume(C),ne):Q(C)}function Z(C){return C===45||pn(C)?(e.consume(C),Z):C===47||C===62||ut(C)?ee(C):n(C)}function ee(C){return C===47?(e.consume(C),Q):C===58||C===95||wn(C)?(e.consume(C),W):Ie(C)?(l=ee,ie(C)):Ze(C)?(e.consume(C),ee):Q(C)}function W(C){return C===45||C===46||C===58||C===95||pn(C)?(e.consume(C),W):H(C)}function H(C){return C===61?(e.consume(C),U):Ie(C)?(l=H,ie(C)):Ze(C)?(e.consume(C),H):ee(C)}function U(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),o=C,O):Ie(C)?(l=U,ie(C)):Ze(C)?(e.consume(C),U):(e.consume(C),q)}function O(C){return C===o?(e.consume(C),o=void 0,F):C===null?n(C):Ie(C)?(l=O,ie(C)):(e.consume(C),O)}function q(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||ut(C)?ee(C):(e.consume(C),q)}function F(C){return C===47||C===62||ut(C)?ee(C):n(C)}function Q(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function ie(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),M}function M(C){return Ze(C)?tt(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):Y(C)}function Y(C){return e.enter("htmlTextData"),l(C)}}const af={name:"labelEnd",resolveAll:M1,resolveTo:A1,tokenize:L1},N1={tokenize:O1},T1={tokenize:D1},R1={tokenize:I1};function M1(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&Wn(e,0,e.length,n),e}function A1(e,t){let n=e.length,r=0,o,a,l,u;for(;n--;)if(o=e[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=ri(u,e.slice(a+1,a+r+3)),u=ri(u,[["enter",g,t]]),u=ri(u,bc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=ri(u,[["exit",g,t],e[l-2],e[l-1],["exit",h,t]]),u=ri(u,e.slice(l+1)),u=ri(u,[["exit",d,t]]),Wn(e,a,e.length,u),e}function L1(e,t,n){const r=this;let o=r.events.length,a,l;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){a=r.events[o][1];break}return u;function u(v){return a?a._inactive?p(v):(l=r.parser.defined.includes(_i(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),d):n(v)}function d(v){return v===40?e.attempt(N1,g,l?g:p)(v):v===91?e.attempt(T1,g,l?h:p)(v):l?g(v):p(v)}function h(v){return e.attempt(R1,g,p)(v)}function g(v){return t(v)}function p(v){return a._balanced=!0,n(v)}}function O1(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),o}function o(p){return ut(p)?sa(e,a)(p):a(p)}function a(p){return p===41?g(p):ty(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return ut(p)?sa(e,d)(p):g(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?iy(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function h(p){return ut(p)?sa(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function D1(e,t,n){const r=this;return o;function o(u){return ny.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function I1(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const P1={name:"labelStartImage",resolveAll:af.resolveAll,tokenize:B1};function B1(e,t,n){const r=this;return o;function o(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const F1={name:"labelStartLink",resolveAll:af.resolveAll,tokenize:z1};function z1(e,t,n){const r=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const _h={name:"lineEnding",tokenize:j1};function j1(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,t,"linePrefix")}}const ql={name:"thematicBreak",tokenize:U1};function U1(e,t,n){let r=0,o;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return o=h,u(h)}function u(h){return h===o?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Ie(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===o?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),Ze(h)?tt(e,u,"whitespace")(h):u(h))}}const On={continuation:{tokenize:K1},exit:V1,name:"list",tokenize:W1},H1={partial:!0,tokenize:G1},$1={partial:!0,tokenize:q1};function W1(e,t,n){const r=this,o=r.events[r.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return u;function u(y){const S=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:ed(y)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(ql,n,h)(y):h(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return ed(y)&&++l<10?(e.consume(y),d):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):n(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(ga,r.interrupt?n:g,e.attempt(H1,v,p))}function g(y){return r.containerState.initialBlankLine=!0,a++,v(y)}function p(y){return Ze(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function K1(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ga,o,a);function o(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Ze(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($1,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,tt(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function q1(e,t,n){const r=this;return tt(e,o,"listItemIndent",r.containerState.size+1);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function V1(e){e.exit(this.containerState.type)}function G1(e,t,n){const r=this;return tt(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=r.events[r.events.length-1];return!Ze(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Ag={name:"setextUnderline",resolveTo:Y1,tokenize:X1};function Y1(e,t){let n=e.length,r,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function X1(e,t,n){const r=this;let o;return a;function a(h){let g=r.events.length,p;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){p=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),o=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===o?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),Ze(h)?tt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ie(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const Z1={tokenize:Q1};function Q1(e){const t=this,n=e.attempt(ga,r,e.attempt(this.parser.constructs.flowInitial,o,tt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(i1,o)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const J1={resolveAll:sy()},ek=ry("string"),tk=ry("text");function ry(e){return{resolveAll:sy(e==="text"?nk:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],a=n.attempt(o,l,u);return l;function l(g){return h(g)?a(g):u(g)}function u(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),d}function d(g){return h(g)?(n.exit("data"),a(g)):(n.consume(g),d)}function h(g){if(g===null)return!0;const p=o[g];let v=-1;if(p)for(;++v<p.length;){const y=p[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function sy(e){return t;function t(n,r){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(n,r):n}}function nk(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let a=o.length,l=-1,u=0,d;for(;a--;){const h=o[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)d=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const ik={42:On,43:On,45:On,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,62:Zv},rk={91:l1},sk={[-2]:gh,[-1]:gh,32:gh},ok={35:p1,42:ql,45:[Ag,ql],60:v1,61:Ag,95:ql,96:Rg,126:Rg},ak={38:Jv,92:Qv},lk={[-5]:_h,[-4]:_h,[-3]:_h,33:P1,38:Jv,42:td,60:[Fx,E1],91:F1,92:[d1,Qv],93:af,95:td,96:Zx},ck={null:[td,J1]},uk={null:[42,95]},hk={null:[]},dk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:uk,contentInitial:rk,disable:hk,document:ik,flow:ok,flowInitial:sk,insideSpan:ck,string:ak,text:lk},Symbol.toStringTag,{value:"Module"}));function fk(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let l=[],u=[];const d={attempt:ne(V),check:ne(D),consume:R,enter:T,exit:A,interrupt:ne(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:p};let g=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function p(H){return l=ri(l,H),E(),l[l.length-1]!==null?[]:(Z(t,0),h.events=bc(a,h.events,h),h.events)}function v(H,U){return mk(y(H),U)}function y(H){return pk(l,H)}function S(){const{_bufferIndex:H,_index:U,line:O,column:q,offset:F}=r;return{_bufferIndex:H,_index:U,line:O,column:q,offset:F}}function w(H){o[H.line]=H.column,W()}function E(){let H;for(;r._index<l.length;){const U=l[r._index];if(typeof U=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<U.length;)k(U.charCodeAt(r._bufferIndex));else k(U)}}function k(H){g=g(H)}function R(H){Ie(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,W()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=H}function T(H,U){const O=U||{};return O.type=H,O.start=S(),h.events.push(["enter",O,h]),u.push(O),O}function A(H){const U=u.pop();return U.end=S(),h.events.push(["exit",U,h]),U}function V(H,U){Z(H,U.from)}function D(H,U){U.restore()}function ne(H,U){return O;function O(q,F,Q){let ie,M,Y,C;return Array.isArray(q)?P(q):"tokenize"in q?P([q]):I(q);function I(z){return pe;function pe(ve){const be=ve!==null&&z[ve],Be=ve!==null&&z.null,st=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(Be)?Be:Be?[Be]:[]];return P(st)(ve)}}function P(z){return ie=z,M=0,z.length===0?Q:N(z[M])}function N(z){return pe;function pe(ve){return C=ee(),Y=z,z.partial||(h.currentConstruct=z),z.name&&h.parser.constructs.disable.null.includes(z.name)?ye():z.tokenize.call(U?Object.assign(Object.create(h),U):h,d,ae,ye)(ve)}}function ae(z){return H(Y,C),F}function ye(z){return C.restore(),++M<ie.length?N(ie[M]):Q}}}function Z(H,U){H.resolveAll&&!a.includes(H)&&a.push(H),H.resolve&&Wn(h.events,U,h.events.length-U,H.resolve(h.events.slice(U),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function ee(){const H=S(),U=h.previous,O=h.currentConstruct,q=h.events.length,F=Array.from(u);return{from:q,restore:Q};function Q(){r=H,h.previous=U,h.currentConstruct=O,h.events.length=q,u=F,W()}}function W(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function pk(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,a)];else{if(l=e.slice(n,o),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function mk(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
47
|
-
`;break}case-3:{l=`\r
|
|
48
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,r.push(l)}return r.join("")}function gk(e){const r={constructs:Yv([dk,...(e||{}).extensions||[]]),content:o(Ax),defined:[],document:o(Ox),flow:o(Z1),lazy:{},string:o(ek),text:o(tk)};return r;function o(a){return l;function l(u){return fk(r,a,u)}}}function _k(e){for(;!ey(e););return e}const Lg=/[\0\t\n\r]/g;function vk(){let e=1,t="",n=!0,r;return o;function o(a,l,u){const d=[];let h,g,p,v,y;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(Lg.lastIndex=p,h=Lg.exec(a),v=h&&h.index!==void 0?h.index:a.length,y=a.charCodeAt(v),!h){t=a.slice(p);break}if(y===10&&p===v&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<v&&(d.push(a.slice(p,v)),e+=v-p),y){case 0:{d.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,d.push(-2);e++<g;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=v+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const yk=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bk(e){return e.replace(yk,Sk)}function Sk(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return Xv(n.slice(a?2:1),a?16:10)}return of(n)||e}const oy={}.hasOwnProperty;function wk(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),xk(n)(_k(gk(n).document().write(vk()(e,t,!0))))}function xk(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(vi),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:a(Pi),blockQuote:a(Be),characterEscape:ee,characterReference:ee,codeFenced:a(st),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(st,l),codeText:a(It,l),codeTextData:ee,data:ee,codeFlowValue:ee,definition:a(Re),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(In),hardBreakEscape:a(et),hardBreakTrailing:a(et),htmlFlow:a(Pn,l),htmlFlowData:ee,htmlText:a(Pn,l),htmlTextData:ee,image:a(Kn),label:l,link:a(vi),listItem:a(yi),listItemValue:v,listOrdered:a(oi,p),listUnordered:a(oi),paragraph:a(Mr),reference:N,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Pi),strong:a(Ar),thematicBreak:a(Lr)},exit:{atxHeading:d(),atxHeadingSequence:V,autolink:d(),autolinkEmail:be,autolinkProtocol:ve,blockQuote:d(),characterEscapeValue:W,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:z,characterReference:pe,codeFenced:d(E),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:S,codeFlowValue:W,codeIndented:d(k),codeText:d(F),codeTextData:W,data:W,definition:d(),definitionDestinationString:A,definitionLabelString:R,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(U),hardBreakTrailing:d(U),htmlFlow:d(O),htmlFlowData:W,htmlText:d(q),htmlTextData:W,image:d(ie),label:Y,labelText:M,lineEnding:H,link:d(Q),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ae,resourceDestinationString:C,resourceTitleString:I,resource:P,setextHeading:d(Z),setextHeadingLineSequence:ne,setextHeadingText:D,strong:d(),thematicBreak:d()}};ay(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let fe={type:"root",children:[]};const Pe={stack:[fe],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:g,data:n},We=[];let Qe=-1;for(;++Qe<te.length;)if(te[Qe][1].type==="listOrdered"||te[Qe][1].type==="listUnordered")if(te[Qe][0]==="enter")We.push(Qe);else{const Ut=We.pop();Qe=o(te,Ut,Qe)}for(Qe=-1;++Qe<te.length;){const Ut=t[te[Qe][0]];oy.call(Ut,te[Qe][1].type)&&Ut[te[Qe][1].type].call(Object.assign({sliceSerialize:te[Qe][2].sliceSerialize},Pe),te[Qe][1])}if(Pe.tokenStack.length>0){const Ut=Pe.tokenStack[Pe.tokenStack.length-1];(Ut[1]||Og).call(Pe,void 0,Ut[0])}for(fe.position={start:Sr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Sr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<t.transforms.length;)fe=t.transforms[Qe](fe)||fe;return fe}function o(te,fe,Pe){let We=fe-1,Qe=-1,Ut=!1,ai,En,li,Bi;for(;++We<=Pe;){const Ht=te[We];switch(Ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ht[0]==="enter"?Qe++:Qe--,Bi=void 0;break}case"lineEndingBlank":{Ht[0]==="enter"&&(ai&&!Bi&&!Qe&&!li&&(li=We),Bi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bi=void 0}if(!Qe&&Ht[0]==="enter"&&Ht[1].type==="listItemPrefix"||Qe===-1&&Ht[0]==="exit"&&(Ht[1].type==="listUnordered"||Ht[1].type==="listOrdered")){if(ai){let Vn=We;for(En=void 0;Vn--;){const rn=te[Vn];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;En&&(te[En][1].type="lineEndingBlank",Ut=!0),rn[1].type="lineEnding",En=Vn}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}li&&(!En||li<En)&&(ai._spread=!0),ai.end=Object.assign({},En?te[En][1].start:Ht[1].end),te.splice(En||We,0,["exit",ai,Ht[2]]),We++,Pe++}if(Ht[1].type==="listItemPrefix"){const Vn={type:"listItem",_spread:!1,start:Object.assign({},Ht[1].start),end:void 0};ai=Vn,te.splice(We,0,["enter",Vn,Ht[2]]),We++,Pe++,li=void 0,Bi=!0}}}return te[fe][1]._spread=Ut,Pe}function a(te,fe){return Pe;function Pe(We){u.call(this,te(We),We),fe&&fe.call(this,We)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(te,fe,Pe){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([fe,Pe||void 0]),te.position={start:Sr(fe.start),end:void 0}}function d(te){return fe;function fe(Pe){te&&te.call(this,Pe),h.call(this,Pe)}}function h(te,fe){const Pe=this.stack.pop(),We=this.tokenStack.pop();if(We)We[0].type!==te.type&&(fe?fe.call(this,te,We[0]):(We[1]||Og).call(this,te,We[0]));else throw new Error("Cannot close `"+te.type+"` ("+ra({start:te.start,end:te.end})+"): it’s not open");Pe.position.end=Sr(te.end)}function g(){return sf(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(te){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function y(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=te}function S(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=te}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.value=te.replace(/(\r?\n|\r)$/g,"")}function R(te){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=fe,Pe.identifier=_i(this.sliceSerialize(te)).toLowerCase()}function T(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.title=te}function A(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.url=te}function V(te){const fe=this.stack[this.stack.length-1];if(!fe.depth){const Pe=this.sliceSerialize(te).length;fe.depth=Pe}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function ne(te){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(te){const Pe=this.stack[this.stack.length-1].children;let We=Pe[Pe.length-1];(!We||We.type!=="text")&&(We=qn(),We.position={start:Sr(te.start),end:void 0},Pe.push(We)),this.stack.push(We)}function W(te){const fe=this.stack.pop();fe.value+=this.sliceSerialize(te),fe.position.end=Sr(te.end)}function H(te){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=fe.children[fe.children.length-1];Pe.position.end=Sr(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(ee.call(this,te),W.call(this,te))}function U(){this.data.atHardBreak=!0}function O(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.value=te}function q(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.value=te}function F(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.value=te}function Q(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=fe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ie(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=fe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function M(te){const fe=this.sliceSerialize(te),Pe=this.stack[this.stack.length-2];Pe.label=bk(fe),Pe.identifier=_i(fe).toLowerCase()}function Y(){const te=this.stack[this.stack.length-1],fe=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const We=te.children;Pe.children=We}else Pe.alt=fe}function C(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.url=te}function I(){const te=this.resume(),fe=this.stack[this.stack.length-1];fe.title=te}function P(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ae(te){const fe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=fe,Pe.identifier=_i(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function ye(te){this.data.characterReferenceType=te.type}function z(te){const fe=this.sliceSerialize(te),Pe=this.data.characterReferenceType;let We;Pe?(We=Xv(fe,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):We=of(fe);const Qe=this.stack[this.stack.length-1];Qe.value+=We}function pe(te){const fe=this.stack.pop();fe.position.end=Sr(te.end)}function ve(te){W.call(this,te);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(te)}function be(te){W.call(this,te);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(te)}function Be(){return{type:"blockquote",children:[]}}function st(){return{type:"code",lang:null,meta:null,value:""}}function It(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function In(){return{type:"emphasis",children:[]}}function Pi(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function Pn(){return{type:"html",value:""}}function Kn(){return{type:"image",title:null,url:"",alt:null}}function vi(){return{type:"link",title:null,url:"",children:[]}}function oi(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function yi(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Mr(){return{type:"paragraph",children:[]}}function Ar(){return{type:"strong",children:[]}}function qn(){return{type:"text",value:""}}function Lr(){return{type:"thematicBreak"}}}function Sr(e){return{line:e.line,column:e.column,offset:e.offset}}function ay(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ay(e,r):kk(e,r)}}function kk(e,t){let n;for(n in t)if(oy.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Og(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ra({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ra({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ra({start:t.start,end:t.end})+") is still open")}function Ek(e){const t=this;t.parser=n;function n(r){return wk(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ck(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Nk(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
49
|
-
`}]}function Tk(e,t){const n=t.value?t.value+`
|
|
50
|
-
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Rk(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mk(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ak(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Js(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function Lk(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ok(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ly(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function Dk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ly(e,t);const o={src:Js(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function Ik(e,t){const n={src:Js(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Pk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Bk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ly(e,t);const o={href:Js(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Fk(e,t){const n={href:Js(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zk(e,t,n){const r=e.all(t),o=n?jk(n):cy(t),a={},l=[];if(typeof t.checked=="boolean"){const g=r[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const g=r[u];(o||u!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
51
|
-
`}),g.type==="element"&&g.tagName==="p"&&!o?l.push(...g.children):l.push(g)}const d=r[r.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
52
|
-
`});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function jk(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=cy(n[r])}return t}function cy(e){const t=e.spread;return t??e.children.length>1}function Uk(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const l=r[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Hk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $k(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Wk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kk(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=ef(t.children[1]),d=Hv(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),o.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function qk(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<u;){const p=t.children[d],v={},y=l?l[d]:void 0;y&&(v.align=y);let S={type:"element",tagName:a,properties:v,children:[]};p&&(S.children=e.all(p),e.patch(p,S),S=e.applyData(p,S)),h.push(S)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function Vk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Dg=9,Ig=32;function Gk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const a=[];for(;r;)a.push(Pg(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(Pg(t.slice(o),o>0,!1)),a.join("")}function Pg(e,t,n){let r=0,o=e.length;if(t){let a=e.codePointAt(r);for(;a===Dg||a===Ig;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(o-1);for(;a===Dg||a===Ig;)o--,a=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function Yk(e,t){const n={type:"text",value:Gk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Xk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Zk={blockquote:Ck,break:Nk,code:Tk,delete:Rk,emphasis:Mk,footnoteReference:Ak,heading:Lk,html:Ok,imageReference:Dk,image:Ik,inlineCode:Pk,linkReference:Bk,link:Fk,listItem:zk,list:Uk,paragraph:Hk,root:$k,strong:Wk,table:Kk,tableCell:Vk,tableRow:qk,text:Yk,thematicBreak:Xk,toml:Al,yaml:Al,definition:Al,footnoteDefinition:Al};function Al(){}const uy=-1,Sc=0,oa=1,sc=2,lf=3,cf=4,uf=5,hf=6,hy=7,dy=8,fy=typeof self=="object"?self:globalThis,Bg=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new fy[e](t)},Qk=(e,t)=>{const n=(o,a)=>(e.set(a,o),o),r=o=>{if(e.has(o))return e.get(o);const[a,l]=t[o];switch(a){case Sc:case uy:return n(l,o);case oa:{const u=n([],o);for(const d of l)u.push(r(d));return u}case sc:{const u=n({},o);for(const[d,h]of l)u[r(d)]=r(h);return u}case lf:return n(new Date(l),o);case cf:{const{source:u,flags:d}=l;return n(new RegExp(u,d),o)}case uf:{const u=n(new Map,o);for(const[d,h]of l)u.set(r(d),r(h));return u}case hf:{const u=n(new Set,o);for(const d of l)u.add(r(d));return u}case hy:{const{name:u,message:d}=l;return n(typeof fy[u]=="function"?Bg(u,d):new Error(d),o)}case dy:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(Bg(a,l),o)};return r},Fg=e=>Qk(new Map,e)(0),Jr="",{toString:Jk}={},{keys:eE}=Object,Ho=e=>{const t=typeof e;if(t!=="object"||!e)return[Sc,t];const n=Jk.call(e).slice(8,-1);switch(n){case"Array":return[oa,Jr];case"Object":return[sc,Jr];case"Date":return[lf,Jr];case"RegExp":return[cf,Jr];case"Map":return[uf,Jr];case"Set":return[hf,Jr];case"DataView":return[oa,n]}return n.includes("Array")?[oa,n]:e instanceof Error?[hy,e.name||"Error"]:[sc,n]},Ll=([e,t])=>e===Sc&&(t==="function"||t==="symbol"),tE=(e,t,n,r)=>{const o=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=Ho(l);switch(u){case Sc:{let g=l;switch(d){case"bigint":u=dy,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return o([uy],l)}return o([u,g],l)}case oa:{if(d){let v=l;return d==="DataView"?v=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(l)),o([d,[...v]],l)}const g=[],p=o([u,g],l);for(const v of l)g.push(a(v));return p}case sc:{if(d)switch(d){case"BigInt":return o([d,l.toString()],l);case"Boolean":case"Number":case"String":return o([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const g=[],p=o([u,g],l);for(const v of eE(l))(e||!Ll(Ho(l[v])))&&g.push([a(v),a(l[v])]);return p}case lf:return o([u,isNaN(l.getTime())?Jr:l.toISOString()],l);case cf:{const{source:g,flags:p}=l;return o([u,{source:g,flags:p}],l)}case uf:{const g=[],p=o([u,g],l);for(const[v,y]of l)(e||!(Ll(Ho(v))||Ll(Ho(y))))&&g.push([a(v),a(y)]);return p}case hf:{const g=[],p=o([u,g],l);for(const v of l)(e||!Ll(Ho(v)))&&g.push(a(v));return p}}const{message:h}=l;return o([u,{name:d,message:h}],l)};return a},zg=(e,{json:t,lossy:n}={})=>{const r=[];return tE(!(t||n),!!t,new Map,r)(e),r},oc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fg(zg(e,t)):structuredClone(e):(e,t)=>Fg(zg(e,t));function nE(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function iE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nE,r=e.options.footnoteBackLabel||iE,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const g=e.all(h),p=String(h.identifier).toUpperCase(),v=Js(p.toLowerCase());let y=0;const S=[],w=e.footnoteCounts.get(p);for(;w!==void 0&&++y<=w;){S.length>0&&S.push({type:"text",value:" "});let R=typeof n=="string"?n:n(d,y);typeof R=="string"&&(R={type:"text",value:R}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,y),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const R=E.children[E.children.length-1];R&&R.type==="text"?R.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else g.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(h,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...oc(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
53
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
54
|
-
`}]}}const _a=(function(e){if(e==null)return lE;if(typeof e=="function")return wc(e);if(typeof e=="object")return Array.isArray(e)?sE(e):oE(e);if(typeof e=="string")return aE(e);throw new Error("Expected function, string, or object as test")});function sE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=_a(e[n]);return wc(r);function r(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function oE(e){const t=e;return wc(n);function n(r){const o=r;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function aE(e){return wc(t);function t(n){return n&&n.type===e}}function wc(e){return t;function t(n,r,o){return!!(cE(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function lE(){return!0}function cE(e){return e!==null&&typeof e=="object"&&"type"in e}const py=[],uE=!0,nd=!1,hE="skip";function my(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const a=_a(o),l=r?-1:1;u(e,void 0,[])();function u(d,h,g){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(d.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=py,S,w,E;if((!t||a(d,h,g[g.length-1]||void 0))&&(y=dE(n(d,g)),y[0]===nd))return y;if("children"in d&&d.children){const k=d;if(k.children&&y[0]!==hE)for(w=(r?k.children.length:-1)+l,E=g.concat(k);w>-1&&w<k.children.length;){const R=k.children[w];if(S=u(R,w,E)(),S[0]===nd)return S;w=typeof S[1]=="number"?S[1]:w+l}}return y}}}function dE(e){return Array.isArray(e)?e:typeof e=="number"?[uE,e]:e==null?py:[e]}function xc(e,t,n,r){let o,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,o=n):(a=t,l=n,o=r),my(e,a,u,o);function u(d,h){const g=h[h.length-1],p=g?g.children.indexOf(d):void 0;return l(d,p,g)}}const id={}.hasOwnProperty,fE={};function pE(e,t){const n=t||fE,r=new Map,o=new Map,a=new Map,l={...Zk,...n.handlers},u={all:h,applyData:gE,definitionById:r,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:mE,wrap:vE};return xc(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?r:o,v=String(g.identifier).toUpperCase();p.has(v)||p.set(v,g)}}),u;function d(g,p){const v=g.type,y=u.handlers[v];if(id.call(u.handlers,v)&&y)return y(u,g,p);if(u.options.passThrough&&u.options.passThrough.includes(v)){if("children"in g){const{children:w,...E}=g,k=oc(E);return k.children=u.all(g),k}return oc(g)}return(u.options.unknownHandler||_E)(u,g,p)}function h(g){const p=[];if("children"in g){const v=g.children;let y=-1;for(;++y<v.length;){const S=u.one(v[y],g);if(S){if(y&&v[y-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=jg(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=jg(w.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function mE(e,t){e.position&&(t.position=ix(e))}function gE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,oc(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function _E(e,t){const n=t.data||{},r="value"in t&&!(id.call(n,"hProperties")||id.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
55
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
56
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
57
|
-
`}),n}function jg(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ug(e,t){const n=pE(e,t),r=n.one(e,void 0),o=rE(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
58
|
-
`},o),a}function yE(e,t){return e&&"run"in e?async function(n,r){const o=Ug(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ug(n,{file:r,...e||t})}}function Hg(e){if(e)throw e}var vh,$g;function bE(){if($g)return vh;$g=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!p)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},l=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},u=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(r)return r(h,g).value}else return;return h[g]};return vh=function d(){var h,g,p,v,y,S,w=arguments[0],E=1,k=arguments.length,R=!1;for(typeof w=="boolean"&&(R=w,w=arguments[1]||{},E=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});E<k;++E)if(h=arguments[E],h!=null)for(g in h)p=u(w,g),v=u(h,g),w!==v&&(R&&v&&(a(v)||(y=o(v)))?(y?(y=!1,S=p&&o(p)?p:[]):S=p&&a(p)?p:{},l(w,{name:g,newValue:d(R,S,v)})):typeof v<"u"&&l(w,{name:g,newValue:v}));return w},vh}var SE=bE();const yh=gc(SE);function rd(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function wE(){const e=[],t={run:n,use:r};return t;function n(...o){let a=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...o);function u(d,...h){const g=e[++a];let p=-1;if(d){l(d);return}for(;++p<o.length;)(h[p]===null||h[p]===void 0)&&(h[p]=o[p]);o=h,g?xE(g,u)(...h):l(null,...h)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function xE(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(o);try{d=e.apply(this,l)}catch(h){const g=h;if(u&&n)throw g;return o(g)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,o):d instanceof Error?o(d):a(d))}function o(l,...u){n||(n=!0,t(l,...u))}function a(l){o(null,l)}}const Ai={basename:kE,dirname:EE,extname:CE,join:NE,sep:"/"};function kE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');va(e);let n=0,r=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else r<0&&(a=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else l<0&&(a=!0,l=o+1),u>-1&&(e.codePointAt(o)===t.codePointAt(u--)?u<0&&(r=o):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function EE(e){if(va(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function CE(e){va(e);let t=e.length,n=-1,r=0,o=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function NE(...e){let t=-1,n;for(;++t<e.length;)va(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":TE(n)}function TE(e){va(e);const t=e.codePointAt(0)===47;let n=RE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function RE(e,t){let n="",r=0,o=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(o===l-1||a===1))if(o!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",r=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function va(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ME={cwd:AE};function AE(){return"/"}function sd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function LE(e){if(typeof e=="string")e=new URL(e);else if(!sd(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return OE(e)}function OE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const bh=["history","path","basename","stem","extname","dirname"];class gy{constructor(t){let n;t?sd(t)?n={path:t}:typeof t=="string"||DE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ME.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<bh.length;){const a=bh[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)bh.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Ai.basename(this.path):void 0}set basename(t){wh(t,"basename"),Sh(t,"basename"),this.path=Ai.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ai.dirname(this.path):void 0}set dirname(t){Wg(this.basename,"dirname"),this.path=Ai.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ai.extname(this.path):void 0}set extname(t){if(Sh(t,"extname"),Wg(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ai.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sd(t)&&(t=LE(t)),wh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ai.basename(this.path,this.extname):void 0}set stem(t){wh(t,"stem"),Sh(t,"stem"),this.path=Ai.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new mn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Sh(e,t){if(e&&e.includes(Ai.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ai.sep+"`")}function wh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Wg(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function DE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const IE=(function(e){const r=this.constructor.prototype,o=r[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),PE={}.hasOwnProperty;class df extends IE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wE()}copy(){const t=new df;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(yh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Eh("data",this.frozen),this.namespace[t]=n,this):PE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Eh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ol(t),r=this.parser||this.Parser;return xh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),xh("process",this.parser||this.Parser),kh("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const u=Ol(t),d=r.parse(u);r.run(d,u,function(g,p,v){if(g||!p||!v)return h(g);const y=p,S=r.stringify(y,v);zE(S)?v.value=S:v.result=S,h(g,v)});function h(g,p){g||!p?l(g):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),xh("processSync",this.parser||this.Parser),kh("processSync",this.compiler||this.Compiler),this.process(t,o),qg("processSync","process",n),r;function o(a,l){n=!0,Hg(a),r=l}}run(t,n,r){Kg(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const d=Ol(n);o.run(t,d,h);function h(g,p,v){const y=p||t;g?u(g):l?l(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,o;return this.run(t,n,a),qg("runSync","run",r),o;function a(l,u){Hg(l),o=u,r=!0}}stringify(t,n){this.freeze();const r=Ol(n),o=this.compiler||this.Compiler;return kh("stringify",o),Kg(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Eh("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...p]=h;d(g,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(h.plugins),h.settings&&(o.settings=yh(!0,o.settings,h.settings))}function u(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const p=h[g];a(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,g){let p=-1,v=-1;for(;++p<r.length;)if(r[p][0]===h){v=p;break}if(v===-1)r.push([h,...g]);else if(g.length>0){let[y,...S]=g;const w=r[v][1];rd(w)&&rd(y)&&(y=yh(!0,w,y)),r[v]=[h,y,...S]}}}}const BE=new df().freeze();function xh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function kh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Eh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Kg(e){if(!rd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qg(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ol(e){return FE(e)?e:new gy(e)}function FE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zE(e){return typeof e=="string"||jE(e)}function jE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vg=[],Gg={allowDangerousHtml:!0},HE=/^(https?|ircs?|mailto|xmpp)$/i,$E=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function WE(e){const t=KE(e),n=qE(e);return VE(t.runSync(t.parse(n),n),e)}function KE(e){const t=e.rehypePlugins||Vg,n=e.remarkPlugins||Vg,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gg}:Gg;return BE().use(Ek).use(n).use(yE,r).use(t)}function qE(e){const t=e.children||"",n=new gy;return typeof t=="string"&&(n.value=t),n}function VE(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||GE;for(const g of $E)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+UE+g.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),xc(e,h),lx(e,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function h(g,p,v){if(g.type==="raw"&&v&&typeof p=="number")return l?v.children.splice(p,1):v.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let y;for(y in mh)if(Object.hasOwn(mh,y)&&Object.hasOwn(g.properties,y)){const S=g.properties[y],w=mh[y];(w===null||w.includes(g.tagName))&&(g.properties[y]=d(String(S||""),y,g))}}if(g.type==="element"){let y=n?!n.includes(g.tagName):a?a.includes(g.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(g,p,v)),y&&v&&typeof p=="number")return u&&g.children?v.children.splice(p,1,...g.children):v.children.splice(p,1),p}}}function GE(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||HE.test(e.slice(0,t))?e:""}function Yg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function YE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XE(e,t,n){const o=_a((n||{}).ignore||[]),a=ZE(t);let l=-1;for(;++l<a.length;)my(e,"text",u);function u(h,g){let p=-1,v;for(;++p<g.length;){const y=g[p],S=v?v.children:void 0;if(o(y,S?S.indexOf(y):void 0,v))return;v=y}if(v)return d(h,g)}function d(h,g){const p=g[g.length-1],v=a[l][0],y=a[l][1];let S=0;const E=p.children.indexOf(h);let k=!1,R=[];v.lastIndex=0;let T=v.exec(h.value);for(;T;){const A=T.index,V={index:T.index,input:T.input,stack:[...g,h]};let D=y(...T,V);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=A+1:(S!==A&&R.push({type:"text",value:h.value.slice(S,A)}),Array.isArray(D)?R.push(...D):D&&R.push(D),S=A+T[0].length,k=!0),!v.global)break;T=v.exec(h.value)}return k?(S<h.value.length&&R.push({type:"text",value:h.value.slice(S)}),p.children.splice(E,1,...R)):R=[h],E+R.length}}function ZE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([QE(o[0]),JE(o[1])])}return t}function QE(e){return typeof e=="string"?new RegExp(YE(e),"g"):e}function JE(e){return typeof e=="function"?e:function(){return e}}const Ch="phrasing",Nh=["autolink","link","image","label"];function eC(){return{transforms:[aC],enter:{literalAutolink:nC,literalAutolinkEmail:Th,literalAutolinkHttp:Th,literalAutolinkWww:Th},exit:{literalAutolink:oC,literalAutolinkEmail:sC,literalAutolinkHttp:iC,literalAutolinkWww:rC}}}function tC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ch,notInConstruct:Nh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ch,notInConstruct:Nh},{character:":",before:"[ps]",after:"\\/",inConstruct:Ch,notInConstruct:Nh}]}}function nC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Th(e){this.config.enter.autolinkProtocol.call(this,e)}function iC(e){this.config.exit.autolinkProtocol.call(this,e)}function rC(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function sC(e){this.config.exit.autolinkEmail.call(this,e)}function oC(e){this.exit(e)}function aC(e){XE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),cC]],{ignore:["link","linkReference"]})}function lC(e,t,n,r,o){let a="";if(!_y(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!uC(n)))return!1;const l=hC(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function cC(e,t,n,r){return!_y(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function uC(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function hC(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=Yg(e,"(");let a=Yg(e,")");for(;r!==-1&&o>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function _y(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||cs(n)||yc(n))&&(!t||n!==47)}vy.peek=bC;function dC(){this.buffer()}function fC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pC(){this.buffer()}function mC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gC(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_i(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _C(e){this.exit(e)}function vC(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_i(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yC(e){this.exit(e)}function bC(){return"["}function vy(e,t,n,r){const o=n.createTracker(r);let a=o.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=o.move("]"),a}function SC(){return{enter:{gfmFootnoteCallString:dC,gfmFootnoteCall:fC,gfmFootnoteDefinitionLabelString:pC,gfmFootnoteDefinition:mC},exit:{gfmFootnoteCallString:gC,gfmFootnoteCall:_C,gfmFootnoteDefinitionLabelString:vC,gfmFootnoteDefinition:yC}}}function wC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:vy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,a,l){const u=a.createTracker(l);let d=u.move("[^");const h=a.enter("footnoteDefinition"),g=a.enter("label");return d+=u.move(a.safe(a.associationId(r),{before:d,after:"]"})),g(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((t?`
|
|
59
|
-
`:" ")+a.indentLines(a.containerFlow(r,u.current()),t?yy:xC))),h(),d}}function xC(e,t,n){return t===0?e:yy(e,t,n)}function yy(e,t,n){return(n?"":" ")+e}const kC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];by.peek=RC;function EC(){return{canContainEols:["delete"],enter:{strikethrough:NC},exit:{strikethrough:TC}}}function CC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kC}],handlers:{delete:by}}}function NC(e){this.enter({type:"delete",children:[]},e)}function TC(e){this.exit(e)}function by(e,t,n,r){const o=n.createTracker(r),a=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),a(),l}function RC(){return"~"}function MC(e){return e.length}function AC(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||MC,a=[],l=[],u=[],d=[];let h=0,g=-1;for(;++g<e.length;){const w=[],E=[];let k=-1;for(e[g].length>h&&(h=e[g].length);++k<e[g].length;){const R=LC(e[g][k]);if(n.alignDelimiters!==!1){const T=o(R);E[k]=T,(d[k]===void 0||T>d[k])&&(d[k]=T)}w.push(R)}l[g]=w,u[g]=E}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)a[p]=Xg(r[p]);else{const w=Xg(r);for(;++p<h;)a[p]=w}p=-1;const v=[],y=[];for(;++p<h;){const w=a[p];let E="",k="";w===99?(E=":",k=":"):w===108?E=":":w===114&&(k=":");let R=n.alignDelimiters===!1?1:Math.max(1,d[p]-E.length-k.length);const T=E+"-".repeat(R)+k;n.alignDelimiters!==!1&&(R=E.length+R+k.length,R>d[p]&&(d[p]=R),y[p]=R),v[p]=T}l.splice(1,0,v),u.splice(1,0,y),g=-1;const S=[];for(;++g<l.length;){const w=l[g],E=u[g];p=-1;const k=[];for(;++p<h;){const R=w[p]||"";let T="",A="";if(n.alignDelimiters!==!1){const V=d[p]-(E[p]||0),D=a[p];D===114?T=" ".repeat(V):D===99?V%2?(T=" ".repeat(V/2+.5),A=" ".repeat(V/2-.5)):(T=" ".repeat(V/2),A=T):A=" ".repeat(V)}n.delimiterStart!==!1&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||p)&&k.push(" "),n.alignDelimiters!==!1&&k.push(T),k.push(R),n.alignDelimiters!==!1&&k.push(A),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
60
|
-
`)}function LC(e){return e==null?"":String(e)}function Xg(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function OC(e,t,n,r){const o=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),DC);return o(),l}function DC(e,t,n){return">"+(n?"":" ")+e}function IC(e,t){return Zg(e,t.inConstruct,!0)&&!Zg(e,t.notInConstruct,!1)}function Zg(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Qg(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
61
|
-
`&&IC(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
62
|
-
`}function PC(e,t){const n=String(e);let r=n.indexOf(t),o=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++a>l&&(l=a):a=1,o=r+t.length,r=n.indexOf(t,o);return l}function BC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function FC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zC(e,t,n,r){const o=FC(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(BC(e,n)){const p=n.enter("codeIndented"),v=n.indentLines(a,jC);return p(),v}const u=n.createTracker(r),d=o.repeat(Math.max(PC(a,o)+1,3)),h=n.enter("codeFenced");let g=u.move(d);if(e.lang){const p=n.enter(`codeFencedLang${l}`);g+=u.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);g+=u.move(" "),g+=u.move(n.safe(e.meta,{before:g,after:`
|
|
63
|
-
`,encode:["`"],...u.current()})),p()}return g+=u.move(`
|
|
64
|
-
`),a&&(g+=u.move(a+`
|
|
65
|
-
`)),g+=u.move(d),h(),g}function jC(e,t,n){return(n?"":" ")+e}function ff(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function UC(e,t,n,r){const o=ff(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
66
|
-
`,...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+o),h+=d.move(n.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),u()),l(),h}function HC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ua(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ac(e,t,n){const r=Ys(e),o=Ys(t);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Sy.peek=$C;function Sy(e,t,n,r){const o=HC(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(o);let d=l.move(n.containerPhrasing(e,{after:o,before:u,...l.current()}));const h=d.charCodeAt(0),g=ac(r.before.charCodeAt(r.before.length-1),h,o);g.inside&&(d=ua(h)+d.slice(1));const p=d.charCodeAt(d.length-1),v=ac(r.after.charCodeAt(0),p,o);v.inside&&(d=d.slice(0,-1)+ua(p));const y=l.move(o);return a(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+d+y}function $C(e,t,n){return n.options.emphasis||"*"}function WC(e,t){let n=!1;return xc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,nd}),!!((!e.depth||e.depth<3)&&sf(e)&&(t.options.setext||n))}function KC(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(WC(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),v=n.containerPhrasing(e,{...a.current(),before:`
|
|
67
|
-
`,after:`
|
|
68
|
-
`});return p(),g(),v+`
|
|
69
|
-
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
70
|
-
`))+1))}const l="#".repeat(o),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
71
|
-
`,...a.current()});return/^[\t ]/.test(h)&&(h=ua(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),u(),h}wy.peek=qC;function wy(e){return e.value||""}function qC(){return"<"}xy.peek=VC;function xy(e,t,n,r){const o=ff(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+o),h+=d.move(n.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),u()),h+=d.move(")"),l(),h}function VC(){return"!"}ky.peek=GC;function ky(e,t,n,r){const o=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");const h=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=g,a(),o==="full"||!h||h!==p?d+=u.move(p+"]"):o==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function GC(){return"!"}Ey.peek=YC;function Ey(e,t,n){let r=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return o+r+o}function YC(){return"`"}function Cy(e,t){const n=sf(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ny.peek=XC;function Ny(e,t,n,r){const o=ff(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,d;if(Cy(e,n)){const g=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=g,p}u=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=l.move(" "+o),h+=l.move(n.safe(e.title,{before:h,after:o,...l.current()})),h+=l.move(o),d()),h+=l.move(")"),u(),h}function XC(e,t,n){return Cy(e,n)?"<":"["}Ty.peek=ZC;function Ty(e,t,n,r){const o=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=g,a(),o==="full"||!h||h!==p?d+=u.move(p+"]"):o==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function ZC(){return"["}function pf(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function QC(e){const t=pf(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function JC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ry(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function eN(e,t,n,r){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?JC(n):pf(n);const u=e.ordered?l==="."?")":".":QC(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),Ry(n)===l&&g){let p=-1;for(;++p<e.children.length;){const v=e.children[p];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,o(),h}function tN(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function nN(e,t,n,r){const o=tN(n);let a=n.bulletCurrent||pf(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,u.current()),g);return d(),h;function g(p,v,y){return v?(y?"":" ".repeat(l))+p:(y?a:a+" ".repeat(l-a.length))+p}}function iN(e,t,n,r){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),o(),l}const rN=_a(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sN(e,t,n,r){return(e.children.some(function(l){return rN(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}My.peek=aN;function My(e,t,n,r){const o=oN(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(o+o);let d=l.move(n.containerPhrasing(e,{after:o,before:u,...l.current()}));const h=d.charCodeAt(0),g=ac(r.before.charCodeAt(r.before.length-1),h,o);g.inside&&(d=ua(h)+d.slice(1));const p=d.charCodeAt(d.length-1),v=ac(r.after.charCodeAt(0),p,o);v.inside&&(d=d.slice(0,-1)+ua(p));const y=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+d+y}function aN(e,t,n){return n.options.strong||"*"}function lN(e,t,n,r){return n.safe(e.value,r)}function cN(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function uN(e,t,n){const r=(Ry(n)+(n.options.ruleSpaces?" ":"")).repeat(cN(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ay={blockquote:OC,break:Qg,code:zC,definition:UC,emphasis:Sy,hardBreak:Qg,heading:KC,html:wy,image:xy,imageReference:ky,inlineCode:Ey,link:Ny,linkReference:Ty,list:eN,listItem:nN,paragraph:iN,root:sN,strong:My,text:lN,thematicBreak:uN};function hN(){return{enter:{table:dN,tableData:Jg,tableHeader:Jg,tableRow:pN},exit:{codeText:mN,table:fN,tableData:Rh,tableHeader:Rh,tableRow:Rh}}}function dN(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function fN(e){this.exit(e),this.data.inTable=void 0}function pN(e){this.enter({type:"tableRow",children:[]},e)}function Rh(e){this.exit(e)}function Jg(e){this.enter({type:"tableCell",children:[]},e)}function mN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gN));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gN(e,t){return t==="|"?t:e}function _N(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
72
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:l,tableCell:d,tableRow:u}};function l(y,S,w,E){return h(g(y,w,E),y.align)}function u(y,S,w,E){const k=p(y,w,E),R=h([k]);return R.slice(0,R.indexOf(`
|
|
73
|
-
`))}function d(y,S,w,E){const k=w.enter("tableCell"),R=w.enter("phrasing"),T=w.containerPhrasing(y,{...E,before:a,after:a});return R(),k(),T}function h(y,S){return AC(y,{align:S,alignDelimiters:r,padding:n,stringLength:o})}function g(y,S,w){const E=y.children;let k=-1;const R=[],T=S.enter("table");for(;++k<E.length;)R[k]=p(E[k],S,w);return T(),R}function p(y,S,w){const E=y.children;let k=-1;const R=[],T=S.enter("tableRow");for(;++k<E.length;)R[k]=d(E[k],y,S,w);return T(),R}function v(y,S,w){let E=Ay.inlineCode(y,S,w);return w.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function vN(){return{exit:{taskListCheckValueChecked:e_,taskListCheckValueUnchecked:e_,paragraph:bN}}}function yN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SN}}}function e_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function bN(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let a=-1,l;for(;++a<o.length;){const u=o[a];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function SN(e,t,n,r){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let d=Ay.listItem(e,t,n,{...r,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(g){return g+l}}function wN(){return[eC(),SC(),EC(),hN(),vN()]}function xN(e){return{extensions:[tC(),wC(e),CC(),_N(e),yN()]}}const kN={tokenize:MN,partial:!0},Ly={tokenize:AN,partial:!0},Oy={tokenize:LN,partial:!0},Dy={tokenize:ON,partial:!0},EN={tokenize:DN,partial:!0},Iy={name:"wwwAutolink",tokenize:TN,previous:By},Py={name:"protocolAutolink",tokenize:RN,previous:Fy},Zi={name:"emailAutolink",tokenize:NN,previous:zy},Ii={};function CN(){return{text:Ii}}let Zr=48;for(;Zr<123;)Ii[Zr]=Zi,Zr++,Zr===58?Zr=65:Zr===91&&(Zr=97);Ii[43]=Zi;Ii[45]=Zi;Ii[46]=Zi;Ii[95]=Zi;Ii[72]=[Zi,Py];Ii[104]=[Zi,Py];Ii[87]=[Zi,Iy];Ii[119]=[Zi,Iy];function NN(e,t,n){const r=this;let o,a;return l;function l(p){return!od(p)||!zy.call(r,r.previous)||mf(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return od(p)?(e.consume(p),u):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(EN,g,h)(p):p===45||p===95||pn(p)?(a=!0,e.consume(p),d):g(p)}function h(p){return e.consume(p),o=!0,d}function g(p){return a&&o&&wn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function TN(e,t,n){const r=this;return o;function o(l){return l!==87&&l!==119||!By.call(r,r.previous)||mf(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kN,e.attempt(Ly,e.attempt(Oy,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function RN(e,t,n){const r=this;let o="",a=!1;return l;function l(p){return(p===72||p===104)&&Fy.call(r,r.previous)&&!mf(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(wn(p)&&o.length<5)return o+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),a?h:(a=!0,d)):n(p)}function h(p){return p===null||rc(p)||ut(p)||cs(p)||yc(p)?n(p):e.attempt(Ly,e.attempt(Oy,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function MN(e,t,n){let r=0;return o;function o(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),o):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function AN(e,t,n){let r,o,a;return l;function l(h){return h===46||h===95?e.check(Dy,d,u)(h):h===null||ut(h)||cs(h)||h!==45&&yc(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?r=!0:(o=r,r=void 0),e.consume(h),l}function d(h){return o||r||!a?n(h):t(h)}}function LN(e,t){let n=0,r=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Dy,t,a)(l):l===null||ut(l)||cs(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&r++,e.consume(l),o}}function ON(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),o):u===60||u===null||ut(u)||cs(u)?t(u):n(u)}function o(u){return u===null||u===40||u===91||ut(u)||cs(u)?t(u):r(u)}function a(u){return wn(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):wn(u)?(e.consume(u),l):n(u)}}function DN(e,t,n){return r;function r(a){return e.consume(a),o}function o(a){return pn(a)?n(a):t(a)}}function By(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ut(e)}function Fy(e){return!wn(e)}function zy(e){return!(e===47||od(e))}function od(e){return e===43||e===45||e===46||e===95||pn(e)}function mf(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const IN={tokenize:$N,partial:!0};function PN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jN,continuation:{tokenize:UN},exit:HN}},text:{91:{name:"gfmFootnoteCall",tokenize:zN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BN,resolveTo:FN}}}}function BN(e,t,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const d=r.events[o][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return n(d);const h=_i(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function FN(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function zN(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(a>999||p===93&&!l||p===null||p===91||ut(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(_i(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return ut(p)||(l=!0),a++,e.consume(p),p===92?g:h}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function jN(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(S)}function g(S){if(l>999||S===93&&!u||S===null||S===91||ut(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=_i(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return ut(S)||(u=!0),l++,e.consume(S),S===92?p:g}function p(S){return S===91||S===92||S===93?(e.consume(S),l++,g):g(S)}function v(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),o.includes(a)||o.push(a),tt(e,y,"gfmFootnoteDefinitionWhitespace")):n(S)}function y(S){return t(S)}}function UN(e,t,n){return e.check(ga,t,e.attempt(IN,t,n))}function HN(e){e.exit("gfmFootnoteDefinition")}function $N(e,t,n){const r=this;return tt(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function WN(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},v=[["enter",g,u],["enter",l[h][1],u],["exit",l[h][1],u],["enter",p,u]],y=u.parser.constructs.insideSpan.null;y&&Wn(v,v.length,0,bc(y,l.slice(h+1,d),u)),Wn(v,v.length,0,[["exit",p,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",g,u]]),Wn(l,h-1,d-h+3,v),d=h+v.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,u,d){const h=this.previous,g=this.events;let p=0;return v;function v(S){return h===126&&g[g.length-1][1].type!=="characterEscape"?d(S):(l.enter("strikethroughSequenceTemporary"),y(S))}function y(S){const w=Ys(h);if(S===126)return p>1?d(S):(l.consume(S),p++,y);if(p<2&&!n)return d(S);const E=l.exit("strikethroughSequenceTemporary"),k=Ys(S);return E._open=!k||k===2&&!!w,E._close=!w||w===2&&!!k,u(S)}}}class KN{constructor(){this.map=[]}add(t,n,r){qN(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const a of o)t.push(a);o=r.pop()}this.map.length=0}}function qN(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function VN(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function GN(){return{flow:{null:{name:"table",tokenize:YN,resolveAll:XN}}}}function YN(e,t,n){const r=this;let o=0,a=0,l;return u;function u(W){let H=r.events.length-1;for(;H>-1;){const q=r.events[H][1].type;if(q==="lineEnding"||q==="linePrefix")H--;else break}const U=H>-1?r.events[H][1].type:null,O=U==="tableHead"||U==="tableRow"?D:d;return O===D&&r.parser.lazy[r.now().line]?n(W):O(W)}function d(W){return e.enter("tableHead"),e.enter("tableRow"),h(W)}function h(W){return W===124||(l=!0,a+=1),g(W)}function g(W){return W===null?n(W):Ie(W)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),y):n(W):Ze(W)?tt(e,g,"whitespace")(W):(a+=1,l&&(l=!1,o+=1),W===124?(e.enter("tableCellDivider"),e.consume(W),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),p(W)))}function p(W){return W===null||W===124||ut(W)?(e.exit("data"),g(W)):(e.consume(W),W===92?v:p)}function v(W){return W===92||W===124?(e.consume(W),p):p(W)}function y(W){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(W):(e.enter("tableDelimiterRow"),l=!1,Ze(W)?tt(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):S(W))}function S(W){return W===45||W===58?E(W):W===124?(l=!0,e.enter("tableCellDivider"),e.consume(W),e.exit("tableCellDivider"),w):V(W)}function w(W){return Ze(W)?tt(e,E,"whitespace")(W):E(W)}function E(W){return W===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(W),e.exit("tableDelimiterMarker"),k):W===45?(a+=1,k(W)):W===null||Ie(W)?A(W):V(W)}function k(W){return W===45?(e.enter("tableDelimiterFiller"),R(W)):V(W)}function R(W){return W===45?(e.consume(W),R):W===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(W),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(W))}function T(W){return Ze(W)?tt(e,A,"whitespace")(W):A(W)}function A(W){return W===124?S(W):W===null||Ie(W)?!l||o!==a?V(W):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(W)):V(W)}function V(W){return n(W)}function D(W){return e.enter("tableRow"),ne(W)}function ne(W){return W===124?(e.enter("tableCellDivider"),e.consume(W),e.exit("tableCellDivider"),ne):W===null||Ie(W)?(e.exit("tableRow"),t(W)):Ze(W)?tt(e,ne,"whitespace")(W):(e.enter("data"),Z(W))}function Z(W){return W===null||W===124||ut(W)?(e.exit("data"),ne(W)):(e.consume(W),W===92?ee:Z)}function ee(W){return W===92||W===124?(e.consume(W),Z):Z(W)}}function XN(e,t){let n=-1,r=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,g,p;const v=new KN;for(;++n<e.length;){const y=e[n],S=y[1];y[0]==="enter"?S.type==="tableHead"?(u=!1,d!==0&&(t_(v,t,d,h,g),g=void 0,d=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",g,t]])),o=S.type==="tableDelimiterRow"?2:g?3:1):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=Dl(v,t,a,o,void 0,p),a=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],p=Dl(v,t,a,o,void 0,p)),a=l,l=[a[1],n,0,0])):S.type==="tableHead"?(u=!0,d=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],p=Dl(v,t,a,o,n,p)):l[1]!==0&&(p=Dl(v,t,l,o,n,p)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&t_(v,t,d,h,g),v.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=VN(t.events,n))}return e}function Dl(e,t,n,r,o,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Ks(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Ks(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=Ks(t.events,n[2]),g=Ks(t.events,n[3]),p={type:u,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const v=t.events[n[2]],y=t.events[n[3]];if(v[1].end=Object.assign({},y[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return o!==void 0&&(a.end=Object.assign({},Ks(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function t_(e,t,n,r,o){const a=[],l=Ks(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ks(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ZN={name:"tasklistCheck",tokenize:JN};function QN(){return{text:{91:ZN}}}function JN(e,t,n){const r=this;return o;function o(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return ut(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(d)}function u(d){return Ie(d)?t(d):Ze(d)?e.check({tokenize:eT},t,n)(d):n(d)}}function eT(e,t,n){return tt(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function tT(e){return Yv([CN(),PN(),WN(e),GN(),QN()])}const nT={};function iT(e){const t=this,n=e||nT,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(tT(n)),a.push(wN()),l.push(xN(n))}const n_=(function(e,t,n){const r=_a(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),fs=(function(e){if(e==null)return oT;if(typeof e=="string")return sT(e);if(typeof e=="object")return rT(e);if(typeof e=="function")return gf(e);throw new Error("Expected function, string, or array as `test`")});function rT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fs(e[n]);return gf(r);function r(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function sT(e){return gf(t);function t(n){return n.tagName===e}}function gf(e){return t;function t(n,r,o){return!!(aT(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function oT(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function aT(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const i_=/\n/g,r_=/[\t ]+/g,ad=fs("br"),s_=fs(mT),lT=fs("p"),o_=fs("tr"),cT=fs(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",pT,gT]),jy=fs(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function uT(e,t){const n=t||{},r="children"in e?e.children:[],o=jy(e),a=$y(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...Hy(e,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<r.length;)l.push(...Uy(r[u],e,{whitespace:a,breakBefore:u?void 0:o,breakAfter:u<r.length-1?ad(r[u+1]):o}));const d=[];let h;for(u=-1;++u<l.length;){const g=l[u];typeof g=="number"?h!==void 0&&g>h&&(h=g):g&&(h!==void 0&&h>-1&&d.push(`
|
|
74
|
-
`.repeat(h)||" "),h=-1,d.push(g))}return d.join("")}function Uy(e,t,n){return e.type==="element"?hT(e,t,n):e.type==="text"?n.whitespace==="normal"?Hy(e,n):dT(e):[]}function hT(e,t,n){const r=$y(e,n),o=e.children||[];let a=-1,l=[];if(cT(e))return l;let u,d;for(ad(e)||o_(e)&&n_(t,e,o_)?d=`
|
|
75
|
-
`:lT(e)?(u=2,d=2):jy(e)&&(u=1,d=1);++a<o.length;)l=l.concat(Uy(o[a],e,{whitespace:r,breakBefore:a?void 0:u,breakAfter:a<o.length-1?ad(o[a+1]):d}));return s_(e)&&n_(t,e,s_)&&l.push(" "),u&&l.unshift(u),d&&l.push(d),l}function Hy(e,t){const n=String(e.value),r=[],o=[];let a=0;for(;a<=n.length;){i_.lastIndex=a;const d=i_.exec(n),h=d&&"index"in d?d.index:n.length;r.push(fT(n.slice(a,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),a=h+1}let l=-1,u;for(;++l<r.length;)r[l].charCodeAt(r[l].length-1)===8203||l<r.length-1&&r[l+1].charCodeAt(0)===8203?(o.push(r[l]),u=void 0):r[l]?(typeof u=="number"&&o.push(u),o.push(r[l]),u=0):(l===0||l===r.length-1)&&o.push(0);return o}function dT(e){return[String(e.value)]}function fT(e,t,n){const r=[];let o=0,a;for(;o<e.length;){r_.lastIndex=o;const l=r_.exec(e);a=l?l.index:e.length,!o&&!a&&l&&!t&&r.push(""),o!==a&&r.push(e.slice(o,a)),o=l?a+l[0].length:a}return o!==a&&!n&&r.push(""),r.join(" ")}function $y(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function pT(e){return!!(e.properties||{}).hidden}function mT(e){return e.tagName==="td"||e.tagName==="th"}function gT(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function _T(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},y=t.optional(o)+e.IDENT_RE+"\\s*\\(",S=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],E=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:w,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:E},V={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[V,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],ne={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:D.concat([{begin:/\(/,end:/\)/,keywords:A,contains:D.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(ne,Z,V,D,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",u]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function vT(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=_T(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function yT(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,o]};o.contains.push(u);const d={match:/\\"/},h={className:"string",begin:/'/,end:/'/},g={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},v=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=e.SHEBANG({binary:`(${v.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],E=["true","false"],k={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],V=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:w,literal:E,built_in:[...R,...T,"set","shopt",...A,...V]},contains:[y,e.SHEBANG(),S,p,a,l,k,u,d,h,g,n]}}function bT(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},y=t.optional(o)+e.IDENT_RE+"\\s*\\(",E={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},k=[p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:E,contains:k.concat([{begin:/\(/,end:/\)/,keywords:E,contains:k.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:E,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:E,relevance:0},{begin:y,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:E,disableAutodetect:!0,illegal:"</",contains:[].concat(R,T,k,[p,{begin:e.IDENT_RE+"::",keywords:E},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:h,keywords:E}}}function ST(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},y=t.optional(o)+e.IDENT_RE+"\\s*\\(",S=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],E=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:w,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:E},V={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[V,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],ne={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:D.concat([{begin:/\(/,end:/\)/,keywords:A,contains:D.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:y,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(ne,Z,V,D,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",u]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function wT(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],l={keyword:o.concat(a),built_in:t,literal:r},u=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(g,{illegal:/\n/}),v={className:"subst",begin:/\{/,end:/\}/,keywords:l},y=e.inherit(v,{illegal:/\n/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,y]},w={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},E=e.inherit(w,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});v.contains=[w,S,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],y.contains=[E,S,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const k={variants:[h,w,S,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},R={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},k,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,R,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,R,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,R],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[k,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},A]}}const xT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ET=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],CT=[...kT,...ET],NT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),TT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),RT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),MT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function AT(e){const t=e.regex,n=xT(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",a=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",u=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+TT.join("|")+")"},{begin:":(:)?("+RT.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+MT.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:NT.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+CT.join("|")+")\\b"}]}}function LT(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function OT(e){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}function DT(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function IT(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},u={begin:/\[/,end:/\]/,contains:[r,a,o,l,n,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,g=/'[^']*'/,p=t.either(d,h,g),v=t.concat(p,"(\\s*\\.\\s*",p,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[r,u,a,o,l,n]}}]}}var qs="[0-9](_*[0-9])*",Il=`\\.(${qs})`,Pl="[0-9a-fA-F](_*[0-9a-fA-F])*",a_={className:"number",variants:[{begin:`(\\b(${qs})((${Il})|\\.)?|(${Il}))[eE][+-]?(${qs})[fFdD]?\\b`},{begin:`\\b(${qs})((${Il})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Il})[fFdD]?\\b`},{begin:`\\b(${qs})[fFdD]\\b`},{begin:`\\b0[xX]((${Pl})\\.?|(${Pl})?\\.(${Pl}))[pP][+-]?(${qs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Pl})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Wy(e,t,n){return n===-1?"":e.replace(t,r=>Wy(e,t,n-1))}function PT(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Wy("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},g={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[g,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a_,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},a_,h]}}const l_="[A-Za-z$_][0-9A-Za-z$_]*",BT=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],FT=["true","false","null","undefined","NaN","Infinity"],Ky=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],qy=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vy=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jT=[].concat(Vy,Ky,qy);function UT(e){const t=e.regex,n=(M,{after:Y})=>{const C="</"+M[0].slice(1);return M.input.indexOf(C,Y)!==-1},r=l_,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,Y)=>{const C=M[0].length+M.index,I=M.input[C];if(I==="<"||I===","){Y.ignoreMatch();return}I===">"&&(n(M,{after:C})||Y.ignoreMatch());let P;const N=M.input.substring(C);if(P=N.match(/^\s*=/)){Y.ignoreMatch();return}if((P=N.match(/^\s+extends\s+/))&&P.index===0){Y.ignoreMatch();return}}},u={$pattern:l_,keyword:BT,literal:FT,built_in:jT,"variable.language":zT},d="[0-9](_?[0-9])*",h=`\\.(${d})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},R={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,S,w,E,{match:/\$\d+/},p];v.contains=T.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(T)});const A=[].concat(R,v.contains),V=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:V},ne={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Z={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ky,...qy]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},H={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(M){return t.concat("(?!",M.join("|"),")")}const O={match:t.concat(/\b/,U([...Vy,"super","import"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ie={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,S,w,E,R,{match:/\$\d+/},p,Z,{scope:"attr",match:r+t.lookahead(":"),relevance:0},ie,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:Q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:a},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},O,H,ne,F,{match:/\$[(.]/}]}}function HT(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Vs="[0-9](_*[0-9])*",Bl=`\\.(${Vs})`,Fl="[0-9a-fA-F](_*[0-9a-fA-F])*",$T={className:"number",variants:[{begin:`(\\b(${Vs})((${Bl})|\\.)?|(${Bl}))[eE][+-]?(${Vs})[fFdD]?\\b`},{begin:`\\b(${Vs})((${Bl})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Bl})[fFdD]?\\b`},{begin:`\\b(${Vs})[fFdD]\\b`},{begin:`\\b0[xX]((${Fl})\\.?|(${Fl})?\\.(${Fl}))[pP][+-]?(${Vs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Fl})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function WT(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,o]}]};o.contains.push(l);const u={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},d={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(l,{className:"string"}),"self"]}]},h=$T,g=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=p;return v.variants[1].contains=[p],p.variants[1].contains=[v],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,g,n,r,u,d,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,g],relevance:0},e.C_LINE_COMMENT_MODE,g,u,d,l,e.C_NUMBER_MODE]},g]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},u,d]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
76
|
-
`},h]}}const KT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),qT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],VT=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],GT=[...qT,...VT],YT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Gy=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Yy=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),XT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),ZT=Gy.concat(Yy).sort().reverse();function QT(e){const t=KT(e),n=ZT,r="and or not only",o="[\\w-]+",a="("+o+"|@\\{"+o+"\\})",l=[],u=[],d=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},h=function(T,A,V){return{className:T,begin:A,relevance:V}},g={$pattern:/[a-z-]+/,keyword:r,attribute:YT.join(" ")},p={begin:"\\(",end:"\\)",contains:u,keywords:g,relevance:0};u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d("'"),d('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,h("variable","@@?"+o,10),h("variable","@\\{"+o+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const v=u.concat({begin:/\{/,end:/\}/,contains:l}),y={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(u)},S={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+XT.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:u}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:g,returnEnd:!0,contains:u,relevance:0}},E={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},k={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,h("keyword","all\\b"),h("variable","@\\{"+o+"\\}"),{begin:"\\b("+GT.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",a,0),h("selector-id","#"+a),h("selector-class","\\."+a,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Gy.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Yy.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},t.FUNCTION_DISPATCH]},R={begin:o+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[k]};return l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,w,E,R,S,k,y,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function JT(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function e2(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,o,a,l]}}function t2(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(h,{contains:[]}),v=e.inherit(g,{contains:[]});h.contains.push(v),g.contains.push(p);let y=[n,d];return[h,g,p,v].forEach(k=>{k.contains=k.contains.concat(y)}),y=y.concat(h,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},n,a,h,g,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},o,r,d,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function n2(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,u={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},d={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:u,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function i2(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:n.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},l={begin:/->\{/,end:/\}/},u={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[u]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[e.BACKSLASH_ESCAPE,a,d],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(w,E,k="\\1")=>{const R=k==="\\1"?k:t.concat(k,E);return t.concat(t.concat("(?:",w,")"),E,/(?:\\.|[^\\\/])*?/,R,/(?:\\.|[^\\\/])*?/,k,r)},y=(w,E,k)=>t.concat(t.concat("(?:",w,")"),E,/(?:\\.|[^\\\/])*?/,k,r),S=[d,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:g,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:v("s|tr|y",t.either(...p,{capture:!0}))},{begin:v("s|tr|y","\\(","\\)")},{begin:v("s|tr|y","\\[","\\]")},{begin:v("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:y("(?:m|qr)?",/\//,/\//)},{begin:y("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:y("m|qr",/\(/,/\)/)},{begin:y("m|qr",/\[/,/\]/)},{begin:y("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,u]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,u,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=S,l.contains=S,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:S}}function r2(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),l={scope:"variable",match:"\\$+"+r},u={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),g=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(d)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(q,F)=>{F.data._beginMatch=q[1]||q[2]},"on:end":(q,F)=>{F.data._beginMatch!==q[1]&&F.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
77
|
-
]`,S={scope:"string",variants:[g,h,p,v]},w={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],k=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],R=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],A={keyword:k,literal:(q=>{const F=[];return q.forEach(Q=>{F.push(Q),Q.toLowerCase()===Q?F.push(Q.toUpperCase()):F.push(Q.toLowerCase())}),F})(E),built_in:R},V=q=>q.map(F=>F.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,t.concat(y,"+"),t.concat("(?!",V(R).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},ne=t.concat(r,"\\b(?!\\()"),Z={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),ne],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),ne],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ee={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},W={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[ee,l,Z,e.C_BLOCK_COMMENT_MODE,S,w,D]},H={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",V(k).join("\\b|"),"|",V(R).join("\\b|"),"\\b)"),r,t.concat(y,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[W]};W.contains.push(H);const U=[ee,Z,e.C_BLOCK_COMMENT_MODE,S,w,D],O={begin:t.concat(/#\[\s*\\?/,t.either(o,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",variants:[{match:o},{match:a}]}]};return{case_insensitive:!1,keywords:A,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},u,{scope:"variable.language",match:/\$this\b/},l,H,Z,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},D,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:A,contains:["self",O,l,Z,e.C_BLOCK_COMMENT_MODE,S,w]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},S,w]}}function s2(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function o2(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function a2(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},g={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,g,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",y=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,S=`\\b|${r.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${y}))[eE][+-]?(${v})[jJ]?(?=${S})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${v})[jJ](?=${S})`}]},E={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,w,p,e.HASH_COMMENT_MODE]}]};return h.contains=[p,w,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,E,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,k,p]}]}}function l2(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function c2(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function u2(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),l={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},u={className:"doctag",begin:"@[A-Za-z]+"},d={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[u]}),e.COMMENT("^=begin","^=end",{contains:[u],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:l},p={className:"string",contains:[e.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,g]})]}]},v="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${v})(\\.(${y}))?([eE][+-]?(${y})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:l}]},D=[p,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:l},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:l},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:l},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,g],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(d,h),relevance:0}].concat(d,h);g.contains=D,w.contains=D;const W=[{begin:/^\s*=>/,starts:{end:"$",contains:D}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:l,contains:D}}];return h.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:l,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(W).concat(h).concat(D)}}function h2(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),o=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,t.lookahead(/\s*\(/))},l="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:g,keyword:u,literal:d,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+l},{begin:"\\b0o([0-7_]+)"+l},{begin:"\\b0x([A-Fa-f0-9_]+)"+l},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+l}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:g}},{className:"punctuation",begin:"->"},a]}}const d2=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),f2=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],p2=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],m2=[...f2,...p2],g2=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),_2=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),v2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),y2=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function b2(e){const t=d2(e),n=v2,r=_2,o="@[a-z-]+",a="and or not only",u={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+m2.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},u,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+y2.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,u,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:g2.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},u,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function S2(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function w2(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],l=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],v=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],y=g,S=[...h,...d].filter(V=>!g.includes(V)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},E={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:t.concat(/\b/,t.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function R(V){return t.concat(/\b/,t.either(...V.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:R(v),relevance:0};function A(V,{exceptions:D,when:ne}={}){const Z=ne;return D=D||[],V.map(ee=>ee.match(/\|\d+$/)||D.includes(ee)?ee:Z(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(S,{when:V=>V.length<3}),literal:a,type:u,built_in:p},contains:[{scope:"type",match:R(l)},T,k,w,r,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,E]}}function Xy(e){return e?typeof e=="string"?e:e.source:null}function $o(e){return lt("(?=",e,")")}function lt(...e){return e.map(n=>Xy(n)).join("")}function x2(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Sn(...e){return"("+(x2(e).capture?"":"?:")+e.map(r=>Xy(r)).join("|")+")"}const _f=e=>lt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),k2=["Protocol","Type"].map(_f),c_=["init","self"].map(_f),E2=["Any","Self"],Mh=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],u_=["false","nil","true"],C2=["assignment","associativity","higherThan","left","lowerThan","none","right"],N2=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],h_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Zy=Sn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Qy=Sn(Zy,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ah=lt(Zy,Qy,"*"),Jy=Sn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),lc=Sn(Jy,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ri=lt(Jy,lc,"*"),zl=lt(/[A-Z]/,lc,"*"),T2=["attached","autoclosure",lt(/convention\(/,Sn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",lt(/objc\(/,Ri,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],R2=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function M2(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,Sn(...k2,...c_)],className:{2:"keyword"}},a={match:lt(/\./,Sn(...Mh)),relevance:0},l=Mh.filter(et=>typeof et=="string").concat(["_|0"]),u=Mh.filter(et=>typeof et!="string").concat(E2).map(_f),d={variants:[{className:"keyword",match:Sn(...u,...c_)}]},h={$pattern:Sn(/\b\w+/,/#\w+/),keyword:l.concat(N2),literal:u_},g=[o,a,d],p={match:lt(/\./,Sn(...h_)),relevance:0},v={className:"built_in",match:lt(/\b/,Sn(...h_),/(?=\()/)},y=[p,v],S={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:Ah},{match:`\\.(\\.|${Qy})+`}]},E=[S,w],k="([0-9]_*)+",R="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${R})(\\.(${R}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(et="")=>({className:"subst",variants:[{match:lt(/\\/,et,/[0\\tnr"']/)},{match:lt(/\\/,et,/u\{[0-9a-fA-F]{1,8}\}/)}]}),V=(et="")=>({className:"subst",match:lt(/\\/,et,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(et="")=>({className:"subst",label:"interpol",begin:lt(/\\/,et,/\(/),end:/\)/}),ne=(et="")=>({begin:lt(et,/"""/),end:lt(/"""/,et),contains:[A(et),V(et),D(et)]}),Z=(et="")=>({begin:lt(et,/"/),end:lt(/"/,et),contains:[A(et),D(et)]}),ee={className:"string",variants:[ne(),ne("#"),ne("##"),ne("###"),Z(),Z("#"),Z("##"),Z("###")]},W=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],H={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:W},U=et=>{const Pn=lt(et,/\//),Kn=lt(/\//,et);return{begin:Pn,end:Kn,contains:[...W,{scope:"comment",begin:`#(?!.*${Kn})`,end:/$/}]}},O={scope:"regexp",variants:[U("###"),U("##"),U("#"),H]},q={match:lt(/`/,Ri,/`/)},F={className:"variable",match:/\$\d+/},Q={className:"variable",match:`\\$${lc}+`},ie=[q,F,Q],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:R2,contains:[...E,T,ee]}]}},Y={scope:"keyword",match:lt(/@/,Sn(...T2),$o(Sn(/\(/,/\s+/)))},C={scope:"meta",match:lt(/@/,Ri)},I=[M,Y,C],P={match:$o(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:lt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,lc,"+")},{className:"type",match:zl,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:lt(/\s+&\s+/,$o(zl)),relevance:0}]},N={begin:/</,end:/>/,keywords:h,contains:[...r,...g,...I,S,P]};P.contains.push(N);const ae={match:lt(Ri,/\s*:/),keywords:"_|0",relevance:0},ye={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",ae,...r,O,...g,...y,...E,T,ee,...ie,...I,P]},z={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,P]},pe={begin:Sn($o(lt(Ri,/\s*:/)),$o(lt(Ri,/\s+/,Ri,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ri}]},ve={begin:/\(/,end:/\)/,keywords:h,contains:[pe,...r,...g,...E,T,ee,...I,P,ye],endsParent:!0,illegal:/["']/},be={match:[/(func|macro)/,/\s+/,Sn(q.match,Ri,Ah)],className:{1:"keyword",3:"title.function"},contains:[z,ve,t],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[z,ve,t],illegal:/\[|%/},st={match:[/operator/,/\s+/,Ah],className:{1:"keyword",3:"title"}},It={begin:[/precedencegroup/,/\s+/,zl],className:{1:"keyword",3:"title"},contains:[P],keywords:[...C2,...u_],end:/}/},Re={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},In={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Pi={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ri,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[z,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:zl},...g],relevance:0}]};for(const et of ee.variants){const Pn=et.contains.find(vi=>vi.label==="interpol");Pn.keywords=h;const Kn=[...g,...y,...E,T,ee,...ie];Pn.contains=[...Kn,{begin:/\(/,end:/\)/,contains:["self",...Kn]}]}return{name:"Swift",keywords:h,contains:[...r,be,Be,Re,In,Pi,st,It,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},O,...g,...y,...E,T,ee,...ie,...I,P,ye]}}const cc="[A-Za-z$_][0-9A-Za-z$_]*",eb=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tb=["true","false","null","undefined","NaN","Infinity"],nb=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ib=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ob=[].concat(rb,nb,ib);function A2(e){const t=e.regex,n=(M,{after:Y})=>{const C="</"+M[0].slice(1);return M.input.indexOf(C,Y)!==-1},r=cc,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,Y)=>{const C=M[0].length+M.index,I=M.input[C];if(I==="<"||I===","){Y.ignoreMatch();return}I===">"&&(n(M,{after:C})||Y.ignoreMatch());let P;const N=M.input.substring(C);if(P=N.match(/^\s*=/)){Y.ignoreMatch();return}if((P=N.match(/^\s+extends\s+/))&&P.index===0){Y.ignoreMatch();return}}},u={$pattern:cc,keyword:eb,literal:tb,built_in:ob,"variable.language":sb},d="[0-9](_?[0-9])*",h=`\\.(${d})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},R={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,S,w,E,{match:/\$\d+/},p];v.contains=T.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(T)});const A=[].concat(R,v.contains),V=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:V},ne={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Z={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nb,...ib]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},H={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(M){return t.concat("(?!",M.join("|"),")")}const O={match:t.concat(/\b/,U([...rb,"super","import"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ie={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,S,w,E,R,{match:/\$\d+/},p,Z,{scope:"attr",match:r+t.lookahead(":"),relevance:0},ie,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:Q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:a},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},O,H,ne,F,{match:/\$[(.]/}]}}function L2(e){const t=e.regex,n=A2(e),r=cc,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},l={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:cc,keyword:eb.concat(d),literal:tb,built_in:ob.concat(o),"variable.language":sb},g={className:"meta",begin:"@"+r},p=(w,E,k)=>{const R=w.contains.findIndex(T=>T.label===E);if(R===-1)throw new Error("can not find mode to replace");w.contains.splice(R,1,k)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(g);const v=n.contains.find(w=>w.scope==="attr"),y=Object.assign({},v,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,v,y]),n.contains=n.contains.concat([g,a,l,y]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",u);const S=n.contains.find(w=>w.label==="func.def");return S.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function O2(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,l=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,u=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:t.concat(/# */,t.either(a,o),/ *#/)},{begin:t.concat(/# */,u,/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,t.either(a,o),/ +/,t.either(l,u),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},g={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),v=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,d,h,g,p,v,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[v]}]}}function D2(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},l={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},u={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,l,o,e.QUOTE_STRING_MODE,d,h,u]}}function I2(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},l=e.inherit(a,{begin:/\(/,end:/\)/}),u=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,d,u,l,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,l,d,u]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function P2(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},l={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},u=e.inherit(l,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},S={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},v,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,w,a,l],k=[...E];return k.pop(),k.push(u),y.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}const B2={arduino:vT,bash:yT,c:bT,cpp:ST,csharp:wT,css:AT,diff:LT,go:OT,graphql:DT,ini:IT,java:PT,javascript:UT,json:HT,kotlin:WT,less:QT,lua:JT,makefile:e2,markdown:t2,objectivec:n2,perl:i2,php:r2,"php-template":s2,plaintext:o2,python:a2,"python-repl":l2,r:c2,ruby:u2,rust:h2,scss:b2,shell:S2,sql:w2,swift:M2,typescript:L2,vbnet:O2,wasm:D2,xml:I2,yaml:P2};var Lh,d_;function F2(){if(d_)return Lh;d_=1;function e(B){return B instanceof Map?B.clear=B.delete=B.set=function(){throw new Error("map is read-only")}:B instanceof Set&&(B.add=B.clear=B.delete=function(){throw new Error("set is read-only")}),Object.freeze(B),Object.getOwnPropertyNames(B).forEach(re=>{const _e=B[re],ze=typeof _e;(ze==="object"||ze==="function")&&!Object.isFrozen(_e)&&e(_e)}),B}class t{constructor(re){re.data===void 0&&(re.data={}),this.data=re.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(B){return B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(B,...re){const _e=Object.create(null);for(const ze in B)_e[ze]=B[ze];return re.forEach(function(ze){for(const ft in ze)_e[ft]=ze[ft]}),_e}const o="</span>",a=B=>!!B.scope,l=(B,{prefix:re})=>{if(B.startsWith("language:"))return B.replace("language:","language-");if(B.includes(".")){const _e=B.split(".");return[`${re}${_e.shift()}`,..._e.map((ze,ft)=>`${ze}${"_".repeat(ft+1)}`)].join(" ")}return`${re}${B}`};class u{constructor(re,_e){this.buffer="",this.classPrefix=_e.classPrefix,re.walk(this)}addText(re){this.buffer+=n(re)}openNode(re){if(!a(re))return;const _e=l(re.scope,{prefix:this.classPrefix});this.span(_e)}closeNode(re){a(re)&&(this.buffer+=o)}value(){return this.buffer}span(re){this.buffer+=`<span class="${re}">`}}const d=(B={})=>{const re={children:[]};return Object.assign(re,B),re};class h{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(re){this.top.children.push(re)}openNode(re){const _e=d({scope:re});this.add(_e),this.stack.push(_e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(re){return this.constructor._walk(re,this.rootNode)}static _walk(re,_e){return typeof _e=="string"?re.addText(_e):_e.children&&(re.openNode(_e),_e.children.forEach(ze=>this._walk(re,ze)),re.closeNode(_e)),re}static _collapse(re){typeof re!="string"&&re.children&&(re.children.every(_e=>typeof _e=="string")?re.children=[re.children.join("")]:re.children.forEach(_e=>{h._collapse(_e)}))}}class g extends h{constructor(re){super(),this.options=re}addText(re){re!==""&&this.add(re)}startScope(re){this.openNode(re)}endScope(){this.closeNode()}__addSublanguage(re,_e){const ze=re.root;_e&&(ze.scope=`language:${_e}`),this.add(ze)}toHTML(){return new u(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(B){return B?typeof B=="string"?B:B.source:null}function v(B){return w("(?=",B,")")}function y(B){return w("(?:",B,")*")}function S(B){return w("(?:",B,")?")}function w(...B){return B.map(_e=>p(_e)).join("")}function E(B){const re=B[B.length-1];return typeof re=="object"&&re.constructor===Object?(B.splice(B.length-1,1),re):{}}function k(...B){return"("+(E(B).capture?"":"?:")+B.map(ze=>p(ze)).join("|")+")"}function R(B){return new RegExp(B.toString()+"|").exec("").length-1}function T(B,re){const _e=B&&B.exec(re);return _e&&_e.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function V(B,{joinWith:re}){let _e=0;return B.map(ze=>{_e+=1;const ft=_e;let _t=p(ze),ke="";for(;_t.length>0;){const xe=A.exec(_t);if(!xe){ke+=_t;break}ke+=_t.substring(0,xe.index),_t=_t.substring(xe.index+xe[0].length),xe[0][0]==="\\"&&xe[1]?ke+="\\"+String(Number(xe[1])+ft):(ke+=xe[0],xe[0]==="("&&_e++)}return ke}).map(ze=>`(${ze})`).join(re)}const D=/\b\B/,ne="[a-zA-Z]\\w*",Z="[a-zA-Z_]\\w*",ee="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",H="\\b(0b[01]+)",U="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",O=(B={})=>{const re=/^#![ ]*\//;return B.binary&&(B.begin=w(re,/.*\b/,B.binary,/\b.*/)),r({scope:"meta",begin:re,end:/$/,relevance:0,"on:begin":(_e,ze)=>{_e.index!==0&&ze.ignoreMatch()}},B)},q={begin:"\\\\[\\s\\S]",relevance:0},F={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[q]},Q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[q]},ie={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},M=function(B,re,_e={}){const ze=r({scope:"comment",begin:B,end:re,contains:[]},_e);ze.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ft=k("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ze.contains.push({begin:w(/[ ]+/,"(",ft,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ze},Y=M("//","$"),C=M("/\\*","\\*/"),I=M("#","$"),P={scope:"number",begin:ee,relevance:0},N={scope:"number",begin:W,relevance:0},ae={scope:"number",begin:H,relevance:0},ye={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[q,{begin:/\[/,end:/\]/,relevance:0,contains:[q]}]},z={scope:"title",begin:ne,relevance:0},pe={scope:"title",begin:Z,relevance:0},ve={begin:"\\.\\s*"+Z,relevance:0};var Be=Object.freeze({__proto__:null,APOS_STRING_MODE:F,BACKSLASH_ESCAPE:q,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:H,COMMENT:M,C_BLOCK_COMMENT_MODE:C,C_LINE_COMMENT_MODE:Y,C_NUMBER_MODE:N,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(B){return Object.assign(B,{"on:begin":(re,_e)=>{_e.data._beginMatch=re[1]},"on:end":(re,_e)=>{_e.data._beginMatch!==re[1]&&_e.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:ne,MATCH_NOTHING_RE:D,METHOD_GUARD:ve,NUMBER_MODE:P,NUMBER_RE:ee,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:Q,REGEXP_MODE:ye,RE_STARTERS_RE:U,SHEBANG:O,TITLE_MODE:z,UNDERSCORE_IDENT_RE:Z,UNDERSCORE_TITLE_MODE:pe});function st(B,re){B.input[B.index-1]==="."&&re.ignoreMatch()}function It(B,re){B.className!==void 0&&(B.scope=B.className,delete B.className)}function Re(B,re){re&&B.beginKeywords&&(B.begin="\\b("+B.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",B.__beforeBegin=st,B.keywords=B.keywords||B.beginKeywords,delete B.beginKeywords,B.relevance===void 0&&(B.relevance=0))}function In(B,re){Array.isArray(B.illegal)&&(B.illegal=k(...B.illegal))}function Pi(B,re){if(B.match){if(B.begin||B.end)throw new Error("begin & end are not supported with match");B.begin=B.match,delete B.match}}function et(B,re){B.relevance===void 0&&(B.relevance=1)}const Pn=(B,re)=>{if(!B.beforeMatch)return;if(B.starts)throw new Error("beforeMatch cannot be used with starts");const _e=Object.assign({},B);Object.keys(B).forEach(ze=>{delete B[ze]}),B.keywords=_e.keywords,B.begin=w(_e.beforeMatch,v(_e.begin)),B.starts={relevance:0,contains:[Object.assign(_e,{endsParent:!0})]},B.relevance=0,delete _e.beforeMatch},Kn=["of","and","for","in","not","or","if","then","parent","list","value"],vi="keyword";function oi(B,re,_e=vi){const ze=Object.create(null);return typeof B=="string"?ft(_e,B.split(" ")):Array.isArray(B)?ft(_e,B):Object.keys(B).forEach(function(_t){Object.assign(ze,oi(B[_t],re,_t))}),ze;function ft(_t,ke){re&&(ke=ke.map(xe=>xe.toLowerCase())),ke.forEach(function(xe){const Le=xe.split("|");ze[Le[0]]=[_t,yi(Le[0],Le[1])]})}}function yi(B,re){return re?Number(re):Mr(B)?0:1}function Mr(B){return Kn.includes(B.toLowerCase())}const Ar={},qn=B=>{console.error(B)},Lr=(B,...re)=>{console.log(`WARN: ${B}`,...re)},te=(B,re)=>{Ar[`${B}/${re}`]||(console.log(`Deprecated as of ${B}. ${re}`),Ar[`${B}/${re}`]=!0)},fe=new Error;function Pe(B,re,{key:_e}){let ze=0;const ft=B[_e],_t={},ke={};for(let xe=1;xe<=re.length;xe++)ke[xe+ze]=ft[xe],_t[xe+ze]=!0,ze+=R(re[xe-1]);B[_e]=ke,B[_e]._emit=_t,B[_e]._multi=!0}function We(B){if(Array.isArray(B.begin)){if(B.skip||B.excludeBegin||B.returnBegin)throw qn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),fe;if(typeof B.beginScope!="object"||B.beginScope===null)throw qn("beginScope must be object"),fe;Pe(B,B.begin,{key:"beginScope"}),B.begin=V(B.begin,{joinWith:""})}}function Qe(B){if(Array.isArray(B.end)){if(B.skip||B.excludeEnd||B.returnEnd)throw qn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),fe;if(typeof B.endScope!="object"||B.endScope===null)throw qn("endScope must be object"),fe;Pe(B,B.end,{key:"endScope"}),B.end=V(B.end,{joinWith:""})}}function Ut(B){B.scope&&typeof B.scope=="object"&&B.scope!==null&&(B.beginScope=B.scope,delete B.scope)}function ai(B){Ut(B),typeof B.beginScope=="string"&&(B.beginScope={_wrap:B.beginScope}),typeof B.endScope=="string"&&(B.endScope={_wrap:B.endScope}),We(B),Qe(B)}function En(B){function re(ke,xe){return new RegExp(p(ke),"m"+(B.case_insensitive?"i":"")+(B.unicodeRegex?"u":"")+(xe?"g":""))}class _e{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(xe,Le){Le.position=this.position++,this.matchIndexes[this.matchAt]=Le,this.regexes.push([Le,xe]),this.matchAt+=R(xe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const xe=this.regexes.map(Le=>Le[1]);this.matcherRe=re(V(xe,{joinWith:"|"}),!0),this.lastIndex=0}exec(xe){this.matcherRe.lastIndex=this.lastIndex;const Le=this.matcherRe.exec(xe);if(!Le)return null;const Pt=Le.findIndex((bi,tr)=>tr>0&&bi!==void 0),ht=this.matchIndexes[Pt];return Le.splice(0,Pt),Object.assign(Le,ht)}}class ze{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(xe){if(this.multiRegexes[xe])return this.multiRegexes[xe];const Le=new _e;return this.rules.slice(xe).forEach(([Pt,ht])=>Le.addRule(Pt,ht)),Le.compile(),this.multiRegexes[xe]=Le,Le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(xe,Le){this.rules.push([xe,Le]),Le.type==="begin"&&this.count++}exec(xe){const Le=this.getMatcher(this.regexIndex);Le.lastIndex=this.lastIndex;let Pt=Le.exec(xe);if(this.resumingScanAtSamePosition()&&!(Pt&&Pt.index===this.lastIndex)){const ht=this.getMatcher(0);ht.lastIndex=this.lastIndex+1,Pt=ht.exec(xe)}return Pt&&(this.regexIndex+=Pt.position+1,this.regexIndex===this.count&&this.considerAll()),Pt}}function ft(ke){const xe=new ze;return ke.contains.forEach(Le=>xe.addRule(Le.begin,{rule:Le,type:"begin"})),ke.terminatorEnd&&xe.addRule(ke.terminatorEnd,{type:"end"}),ke.illegal&&xe.addRule(ke.illegal,{type:"illegal"}),xe}function _t(ke,xe){const Le=ke;if(ke.isCompiled)return Le;[It,Pi,ai,Pn].forEach(ht=>ht(ke,xe)),B.compilerExtensions.forEach(ht=>ht(ke,xe)),ke.__beforeBegin=null,[Re,In,et].forEach(ht=>ht(ke,xe)),ke.isCompiled=!0;let Pt=null;return typeof ke.keywords=="object"&&ke.keywords.$pattern&&(ke.keywords=Object.assign({},ke.keywords),Pt=ke.keywords.$pattern,delete ke.keywords.$pattern),Pt=Pt||/\w+/,ke.keywords&&(ke.keywords=oi(ke.keywords,B.case_insensitive)),Le.keywordPatternRe=re(Pt,!0),xe&&(ke.begin||(ke.begin=/\B|\b/),Le.beginRe=re(Le.begin),!ke.end&&!ke.endsWithParent&&(ke.end=/\B|\b/),ke.end&&(Le.endRe=re(Le.end)),Le.terminatorEnd=p(Le.end)||"",ke.endsWithParent&&xe.terminatorEnd&&(Le.terminatorEnd+=(ke.end?"|":"")+xe.terminatorEnd)),ke.illegal&&(Le.illegalRe=re(ke.illegal)),ke.contains||(ke.contains=[]),ke.contains=[].concat(...ke.contains.map(function(ht){return Bi(ht==="self"?ke:ht)})),ke.contains.forEach(function(ht){_t(ht,Le)}),ke.starts&&_t(ke.starts,xe),Le.matcher=ft(Le),Le}if(B.compilerExtensions||(B.compilerExtensions=[]),B.contains&&B.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return B.classNameAliases=r(B.classNameAliases||{}),_t(B)}function li(B){return B?B.endsWithParent||li(B.starts):!1}function Bi(B){return B.variants&&!B.cachedVariants&&(B.cachedVariants=B.variants.map(function(re){return r(B,{variants:null},re)})),B.cachedVariants?B.cachedVariants:li(B)?r(B,{starts:B.starts?r(B.starts):null}):Object.isFrozen(B)?r(B):B}var Ht="11.11.1";class Vn extends Error{constructor(re,_e){super(re),this.name="HTMLInjectionError",this.html=_e}}const rn=n,ms=r,gs=Symbol("nomatch"),er=7,Fi=function(B){const re=Object.create(null),_e=Object.create(null),ze=[];let ft=!0;const _t="Could not find the language '{}', did you forget to load/include a language module?",ke={disableAutodetect:!0,name:"Plain text",contains:[]};let xe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Le(he){return xe.noHighlightRe.test(he)}function Pt(he){let Ae=he.className+" ";Ae+=he.parentNode?he.parentNode.className:"";const Ke=xe.languageDetectRe.exec(Ae);if(Ke){const Xe=ci(Ke[1]);return Xe||(Lr(_t.replace("{}",Ke[1])),Lr("Falling back to no-highlight mode for this block.",he)),Xe?Ke[1]:"no-highlight"}return Ae.split(/\s+/).find(Xe=>Le(Xe)||ci(Xe))}function ht(he,Ae,Ke){let Xe="",At="";typeof Ae=="object"?(Xe=he,Ke=Ae.ignoreIllegals,At=Ae.language):(te("10.7.0","highlight(lang, code, ...args) has been deprecated."),te("10.7.0",`Please use highlight(code, options) instead.
|
|
78
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),At=he,Xe=Ae),Ke===void 0&&(Ke=!0);const wt={code:Xe,language:At};Dr("before:highlight",wt);const Si=wt.result?wt.result:bi(wt.language,wt.code,Ke);return Si.code=wt.code,Dr("after:highlight",Si),Si}function bi(he,Ae,Ke,Xe){const At=Object.create(null);function wt(ge,Ee){return ge.keywords[Ee]}function Si(){if(!He.keywords){Lt.addText(ot);return}let ge=0;He.keywordPatternRe.lastIndex=0;let Ee=He.keywordPatternRe.exec(ot),Fe="";for(;Ee;){Fe+=ot.substring(ge,Ee.index);const Je=Gn.case_insensitive?Ee[0].toLowerCase():Ee[0],Nt=wt(He,Je);if(Nt){const[Gt,Oc]=Nt;if(Lt.addText(Fe),Fe="",At[Je]=(At[Je]||0)+1,At[Je]<=er&&(Br+=Oc),Gt.startsWith("_"))Fe+=Ee[0];else{const Ma=Gn.classNameAliases[Gt]||Gt;_n(Ee[0],Ma)}}else Fe+=Ee[0];ge=He.keywordPatternRe.lastIndex,Ee=He.keywordPatternRe.exec(ot)}Fe+=ot.substring(ge),Lt.addText(Fe)}function ys(){if(ot==="")return;let ge=null;if(typeof He.subLanguage=="string"){if(!re[He.subLanguage]){Lt.addText(ot);return}ge=bi(He.subLanguage,ot,!0,ao[He.subLanguage]),ao[He.subLanguage]=ge._top}else ge=Or(ot,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(Br+=ge.relevance),Lt.__addSublanguage(ge._emitter,ge.language)}function gn(){He.subLanguage!=null?ys():Si(),ot=""}function _n(ge,Ee){ge!==""&&(Lt.startScope(Ee),Lt.addText(ge),Lt.endScope())}function Ir(ge,Ee){let Fe=1;const Je=Ee.length-1;for(;Fe<=Je;){if(!ge._emit[Fe]){Fe++;continue}const Nt=Gn.classNameAliases[ge[Fe]]||ge[Fe],Gt=Ee[Fe];Nt?_n(Gt,Nt):(ot=Gt,Si(),ot=""),Fe++}}function nr(ge,Ee){return ge.scope&&typeof ge.scope=="string"&&Lt.openNode(Gn.classNameAliases[ge.scope]||ge.scope),ge.beginScope&&(ge.beginScope._wrap?(_n(ot,Gn.classNameAliases[ge.beginScope._wrap]||ge.beginScope._wrap),ot=""):ge.beginScope._multi&&(Ir(ge.beginScope,Ee),ot="")),He=Object.create(ge,{parent:{value:He}}),He}function Pr(ge,Ee,Fe){let Je=T(ge.endRe,Fe);if(Je){if(ge["on:end"]){const Nt=new t(ge);ge["on:end"](Ee,Nt),Nt.isMatchIgnored&&(Je=!1)}if(Je){for(;ge.endsParent&&ge.parent;)ge=ge.parent;return ge}}if(ge.endsWithParent)return Pr(ge.parent,Ee,Fe)}function Ac(ge){return He.matcher.regexIndex===0?(ot+=ge[0],1):(sr=!0,0)}function Lc(ge){const Ee=ge[0],Fe=ge.rule,Je=new t(Fe),Nt=[Fe.__beforeBegin,Fe["on:begin"]];for(const Gt of Nt)if(Gt&&(Gt(ge,Je),Je.isMatchIgnored))return Ac(Ee);return Fe.skip?ot+=Ee:(Fe.excludeBegin&&(ot+=Ee),gn(),!Fe.returnBegin&&!Fe.excludeBegin&&(ot=Ee)),nr(Fe,ge),Fe.returnBegin?0:Ee.length}function so(ge){const Ee=ge[0],Fe=Ae.substring(ge.index),Je=Pr(He,ge,Fe);if(!Je)return gs;const Nt=He;He.endScope&&He.endScope._wrap?(gn(),_n(Ee,He.endScope._wrap)):He.endScope&&He.endScope._multi?(gn(),Ir(He.endScope,ge)):Nt.skip?ot+=Ee:(Nt.returnEnd||Nt.excludeEnd||(ot+=Ee),gn(),Nt.excludeEnd&&(ot=Ee));do He.scope&&Lt.closeNode(),!He.skip&&!He.subLanguage&&(Br+=He.relevance),He=He.parent;while(He!==Je.parent);return Je.starts&&nr(Je.starts,ge),Nt.returnEnd?0:Ee.length}function Ra(){const ge=[];for(let Ee=He;Ee!==Gn;Ee=Ee.parent)Ee.scope&&ge.unshift(Ee.scope);ge.forEach(Ee=>Lt.openNode(Ee))}let ir={};function rr(ge,Ee){const Fe=Ee&&Ee[0];if(ot+=ge,Fe==null)return gn(),0;if(ir.type==="begin"&&Ee.type==="end"&&ir.index===Ee.index&&Fe===""){if(ot+=Ae.slice(Ee.index,Ee.index+1),!ft){const Je=new Error(`0 width match regex (${he})`);throw Je.languageName=he,Je.badRule=ir.rule,Je}return 1}if(ir=Ee,Ee.type==="begin")return Lc(Ee);if(Ee.type==="illegal"&&!Ke){const Je=new Error('Illegal lexeme "'+Fe+'" for mode "'+(He.scope||"<unnamed>")+'"');throw Je.mode=He,Je}else if(Ee.type==="end"){const Je=so(Ee);if(Je!==gs)return Je}if(Ee.type==="illegal"&&Fe==="")return ot+=`
|
|
79
|
-
`,1;if(Fr>1e5&&Fr>Ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ot+=Fe,Fe.length}const Gn=ci(he);if(!Gn)throw qn(_t.replace("{}",he)),new Error('Unknown language: "'+he+'"');const oo=En(Gn);let nt="",He=Xe||oo;const ao={},Lt=new xe.__emitter(xe);Ra();let ot="",Br=0,wi=0,Fr=0,sr=!1;try{if(Gn.__emitTokens)Gn.__emitTokens(Ae,Lt);else{for(He.matcher.considerAll();;){Fr++,sr?sr=!1:He.matcher.considerAll(),He.matcher.lastIndex=wi;const ge=He.matcher.exec(Ae);if(!ge)break;const Ee=Ae.substring(wi,ge.index),Fe=rr(Ee,ge);wi=ge.index+Fe}rr(Ae.substring(wi))}return Lt.finalize(),nt=Lt.toHTML(),{language:he,value:nt,relevance:Br,illegal:!1,_emitter:Lt,_top:He}}catch(ge){if(ge.message&&ge.message.includes("Illegal"))return{language:he,value:rn(Ae),illegal:!0,relevance:0,_illegalBy:{message:ge.message,index:wi,context:Ae.slice(wi-100,wi+100),mode:ge.mode,resultSoFar:nt},_emitter:Lt};if(ft)return{language:he,value:rn(Ae),illegal:!1,relevance:0,errorRaised:ge,_emitter:Lt,_top:He};throw ge}}function tr(he){const Ae={value:rn(he),illegal:!1,relevance:0,_top:ke,_emitter:new xe.__emitter(xe)};return Ae._emitter.addText(he),Ae}function Or(he,Ae){Ae=Ae||xe.languages||Object.keys(re);const Ke=tr(he),Xe=Ae.filter(ci).filter(Ta).map(gn=>bi(gn,he,!1));Xe.unshift(Ke);const At=Xe.sort((gn,_n)=>{if(gn.relevance!==_n.relevance)return _n.relevance-gn.relevance;if(gn.language&&_n.language){if(ci(gn.language).supersetOf===_n.language)return 1;if(ci(_n.language).supersetOf===gn.language)return-1}return 0}),[wt,Si]=At,ys=wt;return ys.secondBest=Si,ys}function Tc(he,Ae,Ke){const Xe=Ae&&_e[Ae]||Ke;he.classList.add("hljs"),he.classList.add(`language-${Xe}`)}function no(he){let Ae=null;const Ke=Pt(he);if(Le(Ke))return;if(Dr("before:highlightElement",{el:he,language:Ke}),he.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",he);return}if(he.children.length>0&&(xe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(he)),xe.throwUnescapedHTML))throw new Vn("One of your code blocks includes unescaped HTML.",he.innerHTML);Ae=he;const Xe=Ae.textContent,At=Ke?ht(Xe,{language:Ke,ignoreIllegals:!0}):Or(Xe);he.innerHTML=At.value,he.dataset.highlighted="yes",Tc(he,Ke,At.language),he.result={language:At.language,re:At.relevance,relevance:At.relevance},At.secondBest&&(he.secondBest={language:At.secondBest.language,relevance:At.secondBest.relevance}),Dr("after:highlightElement",{el:he,result:At,text:Xe})}function Rc(he){xe=ms(xe,he)}const ji=()=>{_s(),te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function xa(){_s(),te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let io=!1;function _s(){function he(){_s()}if(document.readyState==="loading"){io||window.addEventListener("DOMContentLoaded",he,!1),io=!0;return}document.querySelectorAll(xe.cssSelector).forEach(no)}function ka(he,Ae){let Ke=null;try{Ke=Ae(B)}catch(Xe){if(qn("Language definition for '{}' could not be registered.".replace("{}",he)),ft)qn(Xe);else throw Xe;Ke=ke}Ke.name||(Ke.name=he),re[he]=Ke,Ke.rawDefinition=Ae.bind(null,B),Ke.aliases&&Na(Ke.aliases,{languageName:he})}function Ea(he){delete re[he];for(const Ae of Object.keys(_e))_e[Ae]===he&&delete _e[Ae]}function Ca(){return Object.keys(re)}function ci(he){return he=(he||"").toLowerCase(),re[he]||re[_e[he]]}function Na(he,{languageName:Ae}){typeof he=="string"&&(he=[he]),he.forEach(Ke=>{_e[Ke.toLowerCase()]=Ae})}function Ta(he){const Ae=ci(he);return Ae&&!Ae.disableAutodetect}function St(he){he["before:highlightBlock"]&&!he["before:highlightElement"]&&(he["before:highlightElement"]=Ae=>{he["before:highlightBlock"](Object.assign({block:Ae.el},Ae))}),he["after:highlightBlock"]&&!he["after:highlightElement"]&&(he["after:highlightElement"]=Ae=>{he["after:highlightBlock"](Object.assign({block:Ae.el},Ae))})}function Mc(he){St(he),ze.push(he)}function ro(he){const Ae=ze.indexOf(he);Ae!==-1&&ze.splice(Ae,1)}function Dr(he,Ae){const Ke=he;ze.forEach(function(Xe){Xe[Ke]&&Xe[Ke](Ae)})}function vs(he){return te("10.7.0","highlightBlock will be removed entirely in v12.0"),te("10.7.0","Please use highlightElement now."),no(he)}Object.assign(B,{highlight:ht,highlightAuto:Or,highlightAll:_s,highlightElement:no,highlightBlock:vs,configure:Rc,initHighlighting:ji,initHighlightingOnLoad:xa,registerLanguage:ka,unregisterLanguage:Ea,listLanguages:Ca,getLanguage:ci,registerAliases:Na,autoDetection:Ta,inherit:ms,addPlugin:Mc,removePlugin:ro}),B.debugMode=function(){ft=!1},B.safeMode=function(){ft=!0},B.versionString=Ht,B.regex={concat:w,lookahead:v,either:k,optional:S,anyNumberOfTimes:y};for(const he in Be)typeof Be[he]=="object"&&e(Be[he]);return Object.assign(B,Be),B},zi=Fi({});return zi.newInstance=()=>Fi({}),Lh=zi,zi.HighlightJS=zi,zi.default=zi,Lh}var z2=F2();const j2=gc(z2),f_={},U2="hljs-";function H2(e){const t=j2.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:o,register:a,registerAlias:l,registered:u};function n(d,h,g){const p=g||f_,v=typeof p.prefix=="string"?p.prefix:U2;if(!t.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");t.configure({__emitter:$2,classPrefix:v});const y=t.highlight(h,{ignoreIllegals:!0,language:d});if(y.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:y.errorRaised});const S=y._emitter.root,w=S.data;return w.language=y.language,w.relevance=y.relevance,S}function r(d,h){const p=(h||f_).subset||o();let v=-1,y=0,S;for(;++v<p.length;){const w=p[v];if(!t.getLanguage(w))continue;const E=n(w,d,h);E.data&&E.data.relevance!==void 0&&E.data.relevance>y&&(y=E.data.relevance,S=E)}return S||{type:"root",children:[],data:{language:void 0,relevance:y}}}function o(){return t.listLanguages()}function a(d,h){if(typeof d=="string")t.registerLanguage(d,h);else{let g;for(g in d)Object.hasOwn(d,g)&&t.registerLanguage(g,d[g])}}function l(d,h){if(typeof d=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:d});else{let g;for(g in d)if(Object.hasOwn(d,g)){const p=d[g];t.registerAliases(typeof p=="string"?p:[...p],{languageName:g})}}}function u(d){return!!t.getLanguage(d)}}class $2{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],o=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:o}):r.children.push(...o)}openNode(t){const n=this,r=t.split(".").map(function(l,u){return u?l+"_".repeat(u):n.options.classPrefix+l}),o=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const W2={};function K2(e){const t=e||W2,n=t.aliases,r=t.detect||!1,o=t.languages||B2,a=t.plainText,l=t.prefix,u=t.subset;let d="hljs";const h=H2(o);if(n&&h.registerAlias(n),l){const g=l.indexOf("-");d=g===-1?l:l.slice(0,g)}return function(g,p){xc(g,"element",function(v,y,S){if(v.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const w=q2(v);if(w===!1||!w&&!r||w&&a&&a.includes(w))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(d)||v.properties.className.unshift(d);const E=uT(v,{whitespace:"pre"});let k;try{k=w?h.highlight(w,E,{prefix:l}):h.highlightAuto(E,{prefix:l,subset:u})}catch(R){const T=R;if(w&&/Unknown language/.test(T.message)){p.message("Cannot highlight as `"+w+"`, it’s not registered",{ancestors:[S,v],cause:T,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!w&&k.data&&k.data.language&&v.properties.className.push("language-"+k.data.language),k.children.length>0&&(v.children=k.children)})}}function q2(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const o=String(t[n]);if(o==="no-highlight"||o==="nohighlight")return!1;!r&&o.slice(0,5)==="lang-"&&(r=o.slice(5)),!r&&o.slice(0,9)==="language-"&&(r=o.slice(9))}return r}const V2=K.memo(function({text:t}){const n=bt(),[r,o]=K.useState(!1);return t?m.jsx("button",{type:"button",className:"copy-btn",title:n("copy"),onClick:()=>{navigator.clipboard.writeText(t).then(()=>{o(!0),setTimeout(()=>o(!1),1200)})},children:r?m.jsx(Mv,{}):m.jsx(Rv,{})}):null}),vf=K.memo(function({text:t}){return m.jsx("div",{className:"md",children:m.jsx(WE,{remarkPlugins:[iT],rehypePlugins:[[K2,{detect:!0,ignoreMissing:!0}]],components:{pre:({children:n,...r})=>m.jsxs("div",{className:"codeblock",children:[m.jsx(V2,{text:ld(n)}),m.jsx("pre",{...r,children:n})]})},children:t})})});function ld(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(ld).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return ld(t==null?void 0:t.children)}return""}function G2({thinking:e,streaming:t}){const n=bt(),[r,o]=K.useState(t),a=e.split(`
|
|
80
|
-
`)[0].slice(0,80);return m.jsxs("div",{className:`thinking ${r?"open":""} ${t?"live":""}`,children:[m.jsxs("button",{type:"button",className:"thinking-toggle",onClick:()=>o(l=>!l),children:[r?m.jsx(Zs,{}):m.jsx(vc,{}),m.jsx(_c,{className:"thinking-icon"}),m.jsx("span",{className:"thinking-label",children:t?m.jsxs("span",{className:"thinking-live-label",children:[n("thinkingNow"),m.jsx("span",{className:"dots"})]}):r?n("thinking"):n("thinkingPreview",{preview:a})})]}),r&&m.jsx("div",{className:"thinking-body",children:e})]})}const Y2={bash:"$",read:"📄",write:"✍️",edit:"✏️",grep:"🔍",find:"🧭",ls:"📂"};function X2(e){return Y2[e]??"🛠"}const Z2=K.memo(function({block:t,view:n,onKillBash:r}){var A,V,D,ne;const o=bt(),[a,l]=K.useState(!0),[u,d]=K.useState(!1),h=!n.result&&n.streaming&&!n.status,g=t.name==="bash"&&h,p=n.result!==void 0,v=!n.result&&!!n.status,y=((A=n.result)==null?void 0:A.isError)??((V=n.status)==null?void 0:V.isError)??!1,S=n.result?n.result.content.map(Z=>Z.type==="text"?Z.text:"").join(""):n.liveOutput??"",w=y?"err":p?"ok":h||v?"run":"idle";let E=o(y?"error":p?"done":h?"running":v?"toolDoneWaitingModel":"toolQueued");const k=v&&((D=n.status)==null?void 0:D.durationMs)!==void 0?J2(n.status.durationMs):"";v&&k&&(E=`${E} · ${k}`);const R=v&&((ne=n.status)==null?void 0:ne.exitCode)!==void 0?`exit ${n.status.exitCode}`:"",T=()=>{t.argumentsText&&(navigator.clipboard.writeText(t.argumentsText),d(!0),setTimeout(()=>d(!1),1200))};return m.jsxs("div",{className:`toolcall ${w}`,children:[m.jsxs("div",{className:"toolcall-head",children:[m.jsx("span",{className:"toolcall-icon",children:X2(t.name)}),m.jsx("span",{className:"toolcall-name",children:t.name}),m.jsxs("span",{className:"toolcall-status",children:[E,R&&m.jsx("em",{className:"toolcall-exit",children:R})]}),m.jsx("span",{className:"toolcall-spacer"}),g&&r&&m.jsxs("button",{type:"button",className:"toolcall-kill",title:o("stopBashTip"),onClick:r,children:[m.jsx(Gd,{}),m.jsx("span",{children:o("stopBash")})]}),m.jsx("button",{type:"button",className:"toolcall-copy",title:o("copyArgs"),onClick:T,children:u?m.jsx(r0,{}):m.jsx(Rv,{})}),m.jsx("button",{type:"button",className:"toolcall-toggle",onClick:()=>l(Z=>!Z),children:a?m.jsx(Zs,{}):m.jsx(vc,{})})]}),a&&m.jsxs("div",{className:"toolcall-body",children:[t.argumentsText&&m.jsx("div",{className:"toolcall-args",children:t.name==="bash"&&t.argumentsText.startsWith("{")?m.jsx(Q2,{args:t.argumentsText}):m.jsx("pre",{children:t.argumentsText})}),S.length>0&&m.jsxs("div",{className:"toolcall-output",children:[m.jsxs("div",{className:"toolcall-output-label",children:[o(y?"errorOutput":"output"),(h||v)&&m.jsx("span",{className:"cursor"})]}),m.jsx("pre",{children:S})]}),h&&S.length===0&&m.jsxs("div",{className:"toolcall-waiting",children:[m.jsx("span",{className:"cursor"})," ",o("waitingOutput")]}),v&&S.length===0&&m.jsxs("div",{className:"toolcall-waiting",children:[m.jsx("span",{className:"cursor"})," ",o("waitingModel")]})]})]})});function Q2({args:e}){let t=null;try{t=JSON.parse(e)}catch{return m.jsx("pre",{children:e})}return typeof t.command!="string"?m.jsx("pre",{children:e}):m.jsxs("div",{className:"termline",children:[m.jsx(Vd,{className:"termline-icon"}),m.jsx("code",{children:t.command}),typeof t.timeout=="number"&&m.jsxs("span",{className:"termline-timeout",children:["⏱ ",t.timeout,"s"]})]})}function J2(e){if(e===void 0)return"";const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60),r=Math.round(t%60);return`${n}m ${String(r).padStart(2,"0")}s`}const eR=/^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;function yf(e){var n;const t=e.match(eR);return t?{name:t[1],location:t[2],content:t[3],userMessage:((n=t[4])==null?void 0:n.trim())||void 0}:null}function ha(e){return e.type==="text"&&typeof e.text=="string"?e:null}function ab(e){return e.type==="thinking"&&typeof e.thinking=="string"?e:null}function lb(e){return e.type==="toolCall"&&typeof e.id=="string"&&typeof e.name=="string"?e:null}function cb(e){return e.type==="image"&&typeof e.dataUrl=="string"?e:null}function ub(e){return e.type==="bash"&&typeof e.command=="string"?e:null}const p_=K.memo(function({message:t,toolResults:n,liveOutputs:r,toolStatuses:o,streaming:a,isLast:l,onEdit:u,onKillBash:d,onCollapse:h,qnIndex:g,qnActive:p,onJump:v}){const y=bt(),[S,w]=K.useState(!1),[E,k]=K.useState("");if(t.role==="toolResult")return null;const R=t.role==="custom"&&t.customType==="file",T=t.content.map(U=>{var O;return((O=ha(U))==null?void 0:O.text)??""}).filter(Boolean).join(`
|
|
81
|
-
`),A=t.role==="user"?yf(T):null,V=A?A.userMessage??`skill:${A.name}`:T.split(`
|
|
82
|
-
`).join(" ").trim(),D=a&&l&&t.content.length===0,ne=t.role==="user"&&!a&&!D&&!!u,Z=()=>{k(A?`/skill:${A.name}${A.userMessage?` ${A.userMessage}`:""}`:t.content.map(U=>{var O;return((O=ha(U))==null?void 0:O.text)??""}).filter(Boolean).join(`
|
|
83
|
-
`)),w(!0)},ee=()=>{const U=E.trim();U&&(u==null||u(t.id,U),w(!1))},W=t.role==="custom"&&(t.customType==="goal-review"||t.customType==="goal-wizard"),H=t.role==="custom"&&t.customType==="goal-wizard";return m.jsxs("div",{className:`msg msg-${t.role}${W?" msg-goal-review":""}`,"data-role":t.role,"data-msg-id":t.id,children:[m.jsxs("div",{className:"msg-meta",children:[m.jsx("span",{className:"msg-role",children:t.role==="custom"?H?y("goalWizardCard"):W?y("goalBarTitle"):t.customType==="file"?y("attachment"):`${y("plugin")} · ${t.customType??y("unknown")}`:hb(t.role,y)}),t.model&&m.jsx("span",{className:"msg-model",children:t.model}),t.timestamp&&m.jsx("span",{className:"msg-time",children:rR(t.timestamp)}),h&&m.jsxs("button",{type:"button",className:"msg-collapse-btn",title:y("collapseMsg"),onClick:()=>h(t.id),children:[m.jsx(Yd,{})," ",y("collapseMsg")]}),g!==void 0&&v&&m.jsxs("button",{type:"button",className:`qn-tag ${p?"active":""}`,title:`${g+1}. ${V}`,"aria-label":`${g+1}. ${V}`,onClick:()=>v(t.id),children:[m.jsx("span",{className:"qn-tag-bar"}),m.jsx("span",{className:"qn-tag-idx",children:g+1})]})]}),m.jsx("div",{className:"msg-body",children:S?m.jsxs("div",{className:"msg-editor",children:[m.jsx("textarea",{className:"msg-editor-input",value:E,autoFocus:!0,placeholder:y("editPlaceholder"),rows:Math.max(2,Math.min(10,E.split(`
|
|
84
|
-
`).length+1)),onChange:U=>k(U.target.value),onKeyDown:U=>{U.key==="Enter"&&(U.metaKey||U.ctrlKey)?(U.preventDefault(),ee()):U.key==="Escape"&&w(!1)}}),m.jsxs("div",{className:"msg-editor-actions",children:[m.jsx("span",{className:"msg-editor-hint",children:y("editHint")}),m.jsx("button",{type:"button",className:"chip",onClick:()=>w(!1),children:y("cancel")}),m.jsxs("button",{type:"button",className:"chip primary",disabled:!E.trim(),title:y("reaskFromHere"),onClick:ee,children:[m.jsx(ag,{})," ",y("reaskFromHere")]})]})]}):m.jsxs(m.Fragment,{children:[t.errorMessage&&m.jsx("div",{className:"msg-error",children:t.errorMessage}),R?m.jsx(tR,{message:t}):A?m.jsxs(m.Fragment,{children:[m.jsx(iR,{block:A}),A.userMessage&&m.jsx("div",{className:"msg-text",children:m.jsx(vf,{text:A.userMessage})}),t.content.map((U,O)=>U.type==="text"?null:m.jsx(g_,{block:U,toolResults:n,liveOutputs:r,toolStatuses:o,streaming:a,isLast:l,onKillBash:d},`${t.id}-${O}`))]}):t.content.map((U,O)=>m.jsx(g_,{block:U,toolResults:n,liveOutputs:r,toolStatuses:o,streaming:a,isLast:l,onKillBash:d},`${t.id}-${O}`)),D&&m.jsxs("div",{className:"thinking-wait",children:[y("thinkingWait"),m.jsx("span",{className:"dot"})]}),a&&l&&!D&&m.jsx("span",{className:"stream-cursor"})]})}),ne&&!S&&m.jsx("div",{className:"msg-actions",children:m.jsxs("button",{type:"button",className:"msg-action",title:y("editReaskTip"),onClick:Z,children:[m.jsx(ag,{})," ",y("editReask")]})})]})});function tR({message:e}){const t=bt(),[n,r]=K.useState(!1),o=e.details??{},a=o.name??o.path??t("attachment"),l=o.type==="folder",u=o.mode==="reference",d=e.content.filter(v=>v.type==="text").map(v=>v.text).join(`
|
|
85
|
-
`),h=nR(d),g=e.content.find(v=>v.type==="image"),p=h.split(`
|
|
86
|
-
`).length;return m.jsxs("div",{className:`attachcard ${u?"reference":""}`,children:[m.jsxs("button",{type:"button",className:"attachcard-head",onClick:()=>r(v=>!v),children:[m.jsx("span",{className:"attachcard-icon",children:l?"📁":"📎"}),m.jsx("span",{className:"attachcard-name",children:a}),o.path&&m.jsx("span",{className:"attachcard-path",children:o.path}),m.jsx("span",{className:`attachcard-mode ${o.mode==="lines"?"lines":u?"ref":"inline"}`,children:u?l?t("folderRefShort"):`${t("refOnlyShort")} · ${m_(o.size)}`:g?t("image"):o.mode==="lines"?t("inlineLinesRange",{start:o.startLine??1,end:o.endLine??o.lines??1}):t("inlineLines",{n:o.lines??p})}),!u&&(n?m.jsx(Zs,{}):m.jsx(vc,{}))]}),!u&&n&&(g!=null&&g.dataUrl?m.jsx("div",{className:"attachcard-image",children:m.jsx("img",{src:g.dataUrl,alt:a})}):m.jsx("pre",{className:"attachcard-content",children:h})),u&&m.jsx("div",{className:"attachcard-refnote",children:l?t("folderNotExpanded"):t("fileNotExpanded",{size:m_(o.size)})})]})}function m_(e){return e===void 0?"":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function nR(e){const t=e.match(/^\s*<file path="[^"]*"(?:\s+lines="[^"]*")?>\s*```\s*\n?([\s\S]*?)\n?```\s*<\/file>\s*$/);return t?t[1].trim():e.trim()}function iR({block:e}){const t=bt(),[n,r]=K.useState(!1);return m.jsxs("div",{className:`skillcard${n?" expanded":""}`,children:[m.jsxs("button",{type:"button",className:"skillcard-head",onClick:()=>r(o=>!o),title:e.location,children:[m.jsx("span",{className:"skillcard-icon",children:m.jsx(s0,{})}),m.jsx("span",{className:"skillcard-name",children:e.name}),m.jsx("span",{className:"skillcard-path",children:e.location}),m.jsxs("span",{className:"skillcard-action",children:[n?m.jsx(Yd,{}):m.jsx(Zs,{}),t(n?"collapseMsg":"expandMsg")]})]}),n&&m.jsx("div",{className:"skillcard-body",children:m.jsx(vf,{text:e.content})})]})}function g_({block:e,toolResults:t,liveOutputs:n,toolStatuses:r,streaming:o,isLast:a,onKillBash:l}){const u=bt(),d=ha(e);if(d)return m.jsxs("div",{className:"msg-text",children:[m.jsx(vf,{text:d.text}),d.truncated&&m.jsx("div",{className:"trunc-note",children:u("truncated")})]});const h=ab(e);if(h)return m.jsx(G2,{thinking:h.thinking,streaming:o&&a});const g=lb(e);if(g){const y=t.get(g.id),S=n.get(g.id),w={result:y,liveOutput:S==null?void 0:S.text,streaming:o,status:r.get(g.id)};return m.jsx(Z2,{block:g,view:w,onKillBash:l})}const p=cb(e);if(p&&p.dataUrl)return m.jsx("div",{className:"msg-image",children:m.jsx("img",{src:p.dataUrl,alt:"attachment"})});const v=ub(e);return v?m.jsxs("div",{className:"bashblock",children:[m.jsxs("div",{className:"bashblock-command",children:[m.jsx("span",{className:"bashblock-prompt",children:"$"}),m.jsx("code",{children:v.command}),v.exitCode!==void 0&&m.jsx("span",{className:`bashblock-exit ${v.exitCode===0?"ok":"err"}`,children:u("exitCode",{code:v.exitCode})}),v.cancelled&&m.jsx("span",{className:"bashblock-exit err",children:u("cancelled")})]}),v.output&&m.jsx("pre",{className:"bashblock-output",children:v.output}),v.truncated&&m.jsx("div",{className:"trunc-note",children:u("outputTruncated")})]}):null}function hb(e,t){switch(e){case"user":return t("role.user");case"assistant":return t("role.assistant");case"toolResult":return t("role.tool");case"bashExecution":return t("role.bash");case"branchSummary":return t("role.branch");case"compactionSummary":return t("role.compaction");default:return e}}function rR(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0");return`${n}:${r}`}const sR=K.memo(function({message:t,onExpand:n}){const r=bt();let o="";for(const p of t.content){const v=ha(p);if(v&&v.text.trim()){const y=yf(v.text);y?o=`skill:${y.name}`+(y.userMessage?` · ${y.userMessage.replace(/\s+/g," ").trim()}`:""):o=v.text.replace(/\s+/g," ").trim();break}}if(!o&&t.role==="custom"&&t.customType==="file"){const p=t.details??{};o=p.name??p.path??""}o.length>90&&(o=`${o.slice(0,90)}…`);let l=0,u=0,d=0,h=0;for(const p of t.content)ab(p)?l++:lb(p)?u++:ub(p)?d++:cb(p)&&h++;const g=[];return l&&g.push(`${r("thinking")} ${l}`),u&&g.push(`${r("toolCalls")} ${u}`),d&&g.push(`${r("bashRuns")} ${d}`),h&&g.push(`${r("images")} ${h}`),m.jsxs("button",{type:"button",className:"msg-collapsed","data-msg-id":t.id,title:`${r("expandMsg")} · ${o||g.join(" · ")||t.role}`,onClick:()=>n(t.id),children:[m.jsx("span",{className:`msg-collapsed-role role-${t.role}`,children:t.role==="custom"&&t.customType==="file"?r("attachment"):hb(t.role,r)}),m.jsxs("span",{className:"msg-collapsed-body",children:[o&&m.jsx("span",{className:"msg-collapsed-preview",children:o}),g.length>0&&m.jsx("span",{className:"msg-collapsed-chips",children:g.map((p,v)=>m.jsx("span",{className:"msg-collapsed-chip",children:p},v))})]}),t.timestamp?m.jsx("span",{className:"msg-collapsed-time",children:oR(t.timestamp)}):null,m.jsxs("span",{className:"msg-collapsed-action",children:[m.jsx(Zs,{})," ",r("expandMsg")]})]})});function oR(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0");return`${n}:${r}`}const __=new Map,aR=15,lR=30;function v_(e){return e.content.some(t=>t.type==="toolCall")}const cR=[{key:"ex.understand",icon:"🔍"},{key:"ex.debug",icon:"🐛"},{key:"ex.test",icon:"🧪"},{key:"ex.review",icon:"🧹"}];function uR(e){return cR.map(({key:t,icon:n})=>({icon:n,text:e(t),prompt:e(`${t}.prompt`)}))}function hR({state:e,liveOutputs:t,toolStatuses:n,onEdit:r,onKillBash:o}){const a=bt(),l=K.useRef(null),[u,d]=K.useState(!0),h=K.useRef(!0),[g,p]=K.useState(()=>new Set),v=e.streamingMessage?[...e.messages,e.streamingMessage]:e.messages,y=K.useMemo(()=>{const M=new Map;for(const Y of e.messages)Y.role==="toolResult"&&Y.toolCallId&&M.set(Y.toolCallId,Y);return M},[e.messages]),S=v.length>0?v[v.length-1].id:null,w=e.messages.length>lR?Math.max(0,e.messages.length-aR):0,E=K.useMemo(()=>{const M=[];for(const Y of e.messages){if(Y.role!=="user")continue;const C=Y.content.map(N=>{var ae;return((ae=ha(N))==null?void 0:ae.text)??""}).filter(Boolean).join(" "),I=yf(C),P=I?I.userMessage??`skill:${I.name}`:C.trim();P&&M.push({id:Y.id,text:P})}return M},[e.messages]),k=K.useMemo(()=>{const M=new Map;return E.forEach((Y,C)=>M.set(Y.id,C)),M},[E]),[R,T]=K.useState(-1),A=K.useRef(-1),V=K.useRef(E);K.useEffect(()=>{V.current=E},[E]);const D=K.useCallback(()=>{const M=l.current,Y=V.current;if(!M||Y.length===0)return;const C=M.getBoundingClientRect().top,I=140;let P=-1;for(let N=0;N<Y.length;N++){const ae=M.querySelector(`[data-msg-id="${Y[N].id}"]`);if(ae)if(ae.getBoundingClientRect().top<=C+I)P=N;else break}P!==A.current&&(A.current=P,T(P))},[]);K.useEffect(()=>{D()},[E,D]);const ne=K.useCallback(M=>{p(Y=>Y.has(M)?Y:new Set(Y).add(M))},[]),Z=K.useCallback(M=>{p(Y=>{if(!Y.has(M))return Y;const C=new Set(Y);return C.delete(M),C})},[]),ee=K.useCallback(M=>{const Y=e.messages.findIndex(I=>I.id===M);Y>=0&&Y<w&&!g.has(M)&&O0.flushSync(()=>ne(M));const C=V.current.findIndex(I=>I.id===M);A.current=C,T(C),requestAnimationFrame(()=>{var P,N;const I=(P=l.current)==null?void 0:P.querySelector(`[data-msg-id="${M}"]`);I&&((N=l.current)==null||N.querySelectorAll(".msg-flash").forEach(ae=>ae.classList.remove("msg-flash")),I.scrollIntoView({block:"start"}),I.classList.remove("msg-flash"),I.offsetWidth,I.classList.add("msg-flash"))})},[e.messages,w,g,ne]),W=K.useCallback(()=>{const M=l.current;if(!M)return;const Y=M.scrollHeight-M.scrollTop-M.clientHeight<80;h.current=Y,d(Y),D()},[D]);K.useEffect(()=>{const M=l.current;M&&h.current&&(M.scrollTop=M.scrollHeight)},[v,e.isStreaming,t]);const H=K.useCallback(()=>{const M=l.current;M&&(M.scrollTop=M.scrollHeight),h.current=!0,d(!0)},[]),U=K.useRef(null);K.useEffect(()=>{const M=U.current,Y=l.current;if(!M||!Y)return;const C=I=>{I.preventDefault();const P=M.querySelector(".qn-list");if(P&&P.contains(I.target)&&P.scrollHeight>P.clientHeight){P.scrollTop+=I.deltaY;return}Y.scrollTop+=I.deltaY};return M.addEventListener("wheel",C,{passive:!1}),()=>M.removeEventListener("wheel",C)},[]);const[O,q]=K.useState(0);K.useEffect(()=>{const M=()=>{var Y;return q(((Y=l.current)==null?void 0:Y.clientHeight)??0)};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);const F=E.length,Q=K.useMemo(()=>F===0?27:Math.max(4,Math.min(27,Math.floor(((O||600)-16)/F)-3)),[F,O]),ie=Q<20;return m.jsxs("div",{className:"messages-wrap",children:[m.jsxs("div",{className:"messages",ref:l,onScroll:W,children:[e.messages.length===0&&!e.streamingMessage&&m.jsxs("div",{className:"empty-state",children:[m.jsx("div",{className:"empty-logo-wrap",children:m.jsx("div",{className:"empty-logo",children:"π"})}),m.jsx("h2",{className:"empty-title",children:a("welcomeTitle")}),m.jsx("p",{className:"empty-sub",children:a("welcomeSub")}),m.jsxs("div",{className:"empty-cwd",children:[m.jsx("span",{className:"empty-cwd-label",children:a("directory")}),m.jsx("span",{className:"empty-cwd-path",children:e.cwd})]}),m.jsx("div",{className:"empty-examples",children:uR(a).map(M=>m.jsxs("button",{type:"button",className:"empty-example",title:a("clickToFill"),onClick:()=>window.dispatchEvent(new CustomEvent("pi-web:fill",{detail:M.prompt})),children:[m.jsx("span",{className:"empty-example-icon",children:M.icon}),m.jsx("span",{className:"empty-example-text",children:M.text})]},M.prompt))})]}),e.messages.map((M,Y)=>{const C=Y<w,I=C&&g.has(M.id);if(C&&!I)return M.role==="toolResult"?null:m.jsx(sR,{message:M,onExpand:ne},M.id);const P=M.role==="user"?k.get(M.id):void 0;return m.jsx(p_,{message:M,qnIndex:P,qnActive:P!==void 0?P===R:void 0,onJump:ee,toolResults:y,liveOutputs:v_(M)?t:__,toolStatuses:n,streaming:e.isStreaming,onKillBash:o,isLast:M.id===S,onEdit:r,onCollapse:I?Z:void 0},M.id)}),e.streamingMessage&&m.jsx(p_,{message:e.streamingMessage,toolResults:y,liveOutputs:v_(e.streamingMessage)?t:__,toolStatuses:n,streaming:!0,isLast:!0,onEdit:r,onKillBash:o},e.streamingMessage.id),e.isStreaming&&v.length===0&&m.jsx("div",{className:"streaming-wait",children:a("waitingResponse")})]}),!u&&m.jsxs("button",{type:"button",className:"scroll-bottom",onClick:H,children:[m.jsx(a0,{})," ",a("backToBottom")]}),E.length>0&&m.jsxs("div",{className:`qn-rail ${ie?"many":""}`,ref:U,"aria-label":a("questionNavTitle"),style:{"--rail-gap":`${Q}px`},children:[E.map((M,Y)=>m.jsx("button",{type:"button",className:`qn-bar ${Y===R?"active":""}`,"aria-label":`${Y+1}. ${M.text}`,onClick:()=>ee(M.id),children:m.jsxs("span",{className:"qn-bar-text",children:[Y+1,". ",M.text]})},M.id)),ie&&m.jsx("div",{className:"qn-list",children:E.map((M,Y)=>m.jsxs("button",{type:"button",className:`qn-list-item ${Y===R?"active":""}`,"aria-label":`${Y+1}. ${M.text}`,onClick:()=>ee(M.id),children:[m.jsx("span",{className:"qn-list-idx",children:Y+1}),m.jsx("span",{className:"qn-list-text",children:M.text})]},M.id))})]})]})}const dR=1568,fR=2*1024*1024;function Vl(e){return e.startsWith("image/")&&e!=="image/svg+xml"&&e!=="image/svg"}async function pR(e){if(!e.type.startsWith("image/"))return null;let t;try{t=await createImageBitmap(e,{imageOrientation:"from-image"})}catch{return null}try{const n=Math.min(1,dR/Math.max(t.width,t.height)),r=Math.max(1,Math.round(t.width*n)),o=Math.max(1,Math.round(t.height*n)),a=e.type==="image/jpeg"||e.type==="image/jpg"?[["image/jpeg",.85],["image/jpeg",.6],["image/webp",.8]]:[["image/png",1],["image/jpeg",.85],["image/jpeg",.6]];let l=null;for(const[u,d]of a){const h=document.createElement("canvas");h.width=r,h.height=o;const g=h.getContext("2d");if(!g)continue;u!=="image/png"&&(g.fillStyle="#ffffff",g.fillRect(0,0,r,o)),g.drawImage(t,0,0,r,o);const p=h.toDataURL(u,d),v=p.match(/^data:([^;]+);base64,/),y=v?v[1]:u,S=p.replace(/^data:[^;]*;base64,/,""),w=Math.floor(S.length*3/4);if(l={data:S,mimeType:y,name:e.name,size:w},w<=fR)return l}return l}finally{t.close()}}function mR({chat:e,send:t,attachments:n,onRemoveAttachment:r,onAddImageFiles:o,onAddLocalFiles:a,onNotice:l,onSent:u,onManageModels:d}){const h=bt(),{locale:g}=Xd(),p=z=>g==="en"&&z.descriptionEn?z.descriptionEn:z.description??"",v=z=>g==="en"&&z.argumentHintEn?z.argumentHintEn:z.argumentHint??"",[y,S]=K.useState(""),[w,E]=K.useState(!1),[k,R]=K.useState(null),[T,A]=K.useState(0),[V,D]=K.useState(!1),[ne,Z]=K.useState(void 0),ee=K.useRef(null),W=K.useRef(null),H=K.useRef(null),U={builtin:h("slashBuiltin"),extension:h("slashExtension"),prompt:h("slashPrompt"),skill:h("slashSkill")},O=z=>{const pe=z.match(/^\/([^\s]*)$/);if(pe&&e.ready){const ve=pe[1].toLowerCase(),be=e.slashCommands.filter(Be=>Be.name.toLowerCase().startsWith(ve));R(be.length>0?be:null),A(0)}else R(null)};K.useEffect(()=>{var pe;const z=(pe=H.current)==null?void 0:pe.querySelector(".slash-item.active");z==null||z.scrollIntoView({block:"nearest"})},[T,k]);const q=z=>{var st;const pe=k??[],ve=z??pe[T%Math.max(pe.length,1)];if(!ve){R(null);return}const be=y.match(/^\/([^\s]*)([\s\S]*)$/),Be=be?be[2]:"";S(`/${ve.name} ${Be}`),R(null),(st=ee.current)==null||st.focus()},F=async()=>{var be;const pe=[...((be=e.state)==null?void 0:be.messages)??[]].reverse().find(Be=>Be.role==="assistant"&&Be.content.some(st=>st.type==="text"&&st.text)),ve=pe==null?void 0:pe.content.filter(Be=>Be.type==="text").map(Be=>Be.text).join(`
|
|
87
|
-
`);if(!ve){l("warning",h("slashCopyEmpty"));return}try{await navigator.clipboard.writeText(ve),l("info",h("slashCopied"))}catch{l("error",h("slashCopyFailed"))}},Q=z=>{if(!z||z.length===0){l("warning",h("foldersNotSupported"));return}const pe=Array.from(z).filter(be=>Vl(be.type)),ve=Array.from(z).filter(be=>!Vl(be.type));pe.length>0&&o(pe),ve.length>0&&a(ve)},ie=z=>{var be;const pe=(be=z.clipboardData)==null?void 0:be.items;if(!pe)return;const ve=[];for(const Be of pe)if(Be.kind==="file"&&Vl(Be.type)){const st=Be.getAsFile();st&&ve.push(st)}ve.length!==0&&(z.preventDefault(),o(ve))},M=e.state,Y=(M==null?void 0:M.isStreaming)??!1,C=e.ready,I=M?M.queue.steering+M.queue.followUp:0,P=K.useRef(y);K.useEffect(()=>{P.current=y},[y]),K.useEffect(()=>{O(P.current)},[e.slashCommands]),K.useEffect(()=>{const z=pe=>{var be;const ve=pe.detail;S(ve),(be=ee.current)==null||be.focus()};return window.addEventListener("pi-web:fill",z),()=>window.removeEventListener("pi-web:fill",z)},[]),K.useEffect(()=>{if(!V)return;const z=pe=>{pe.key==="Escape"&&D(!1)};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[V]),K.useEffect(()=>{const z=ee.current;if(!z)return;z.style.height="auto";const pe=z.scrollHeight>220;z.style.height=`${Math.min(z.scrollHeight,220)}px`,z.style.overflowY=pe?"auto":"hidden"},[y]);const N=()=>{var ve,be,Be,st,It;const z=y.trim(),pe=n.some(Re=>Re.imageData||Re.fileData);if(!(!C||!z&&!pe)){if(z==="/help"){const Re=(be=(ve=ee.current)==null?void 0:ve.closest(".inputbox"))==null?void 0:be.getBoundingClientRect();Z(Re==null?void 0:Re.width),D(!0),S(""),(Be=ee.current)==null||Be.focus();return}if(z==="/copy"){S(""),(st=ee.current)==null||st.focus(),F();return}t({type:"prompt",text:z,attachments:n.map(Re=>Re.imageData?{path:"",imageData:Re.imageData,mimeType:Re.mimeType,name:Re.name}:Re.fileData?{path:"",fileData:Re.fileData,mimeType:Re.mimeType,name:Re.name,size:Re.size}:{path:Re.path,mode:Re.mode,...Re.lines?{lines:Re.lines}:{}})})&&(S(""),u(),(It=ee.current)==null||It.focus())}},ae=z=>{if(!z.nativeEvent.isComposing){if(k&&k.length>0)switch(z.key){case"ArrowDown":z.preventDefault(),A(pe=>(pe+1)%k.length);return;case"ArrowUp":z.preventDefault(),A(pe=>(pe-1+k.length)%k.length);return;case"Tab":case"Enter":z.preventDefault(),q();return;case"Escape":z.preventDefault(),R(null);return}z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),N())}},ye=()=>m.jsx("div",{className:"inputbox-actions",children:Y?m.jsxs(m.Fragment,{children:[y.trim()!==""&&m.jsxs("button",{type:"button",className:"btn supplement",title:h("supplementTip"),onClick:N,children:[m.jsx(Zw,{})," ",h("supplement")]}),m.jsx("button",{type:"button",className:"btn stop",title:h("stopAgent"),onClick:()=>t({type:"abort"}),children:m.jsx(Gd,{})})]}):m.jsx("button",{type:"button",className:"btn send",title:h("sendTip"),disabled:!C||!y.trim()&&!n.some(z=>z.imageData||z.fileData),onClick:N,children:m.jsx(o0,{})})});return m.jsxs("div",{className:`inputbar${w?" drop-active":""}`,onDragOver:z=>{z.preventDefault(),z.stopPropagation(),E(!0)},onDragLeave:z=>{z.currentTarget.contains(z.relatedTarget)||E(!1)},onDrop:z=>{var pe;z.preventDefault(),z.stopPropagation(),E(!1),Q(((pe=z.dataTransfer)==null?void 0:pe.files)??null)},children:[w&&m.jsx("div",{className:"drop-overlay",children:m.jsxs("span",{children:["📎 ",h("dropHereToAttach")]})}),n.length>0&&m.jsxs("div",{className:"attach-row",children:[n.map(z=>m.jsxs("span",{className:`attach-chip ${z.imageData?"image":z.fileData?"file":z.mode}`,title:z.imageData?h("attachImage",{name:z.name}):z.fileData?h("attachFile",{name:z.name}):z.isDir?h("folderRef",{path:z.path}):z.mode==="reference"?h("refOnly",{path:z.path}):z.mode==="lines"&&z.lines?h("attachLines",{path:z.path,start:z.lines.start,end:z.lines.end}):h("attachContent",{path:z.path}),children:[z.imageData?"🖼":z.fileData?"📄":z.isDir?"📁":z.mode==="reference"?"🔗":"📎"," ",z.name,z.mode==="lines"&&z.lines&&m.jsxs("span",{className:"attach-range",children:["L",z.lines.start,"-",z.lines.end]}),m.jsx("button",{type:"button",className:"attach-remove",title:h("removeAttachment"),onClick:()=>r(z.key??z.path),children:"×"})]},z.key??`${z.path}|${z.mode}|${z.lines?`${z.lines.start}-${z.lines.end}`:""}`)),m.jsx("span",{className:"attach-hint",children:h("attachHint")})]}),Y&&I>0&&M&&m.jsxs("div",{className:"queue-hint",children:[M.queue.followUp>0&&m.jsx("span",{children:h("followUpQueued",{n:M.queue.followUp})}),M.queue.steering>0&&m.jsx("span",{children:h("steeringQueued",{n:M.queue.steering})})]}),k&&k.length>0&&m.jsxs("div",{className:"slash-menu",role:"listbox",ref:H,"aria-label":h("slashCommands"),children:[m.jsxs("div",{className:"slash-menu-hint",children:[m.jsx("span",{children:h("slashMenuHint")}),m.jsx("span",{className:"slash-menu-close",onClick:()=>R(null),children:"Esc"})]}),k.map((z,pe)=>m.jsxs("button",{type:"button",className:`slash-item${pe===T?" active":""}`,onMouseEnter:()=>A(pe),onClick:()=>q(z),children:[m.jsxs("span",{className:"slash-name",children:["/",z.name]}),m.jsx("span",{className:`slash-source ${z.source}`,children:U[z.source]}),m.jsxs("span",{className:"slash-desc",children:[p(z),z.argumentHint&&m.jsx("span",{className:"slash-hint",children:v(z)})]})]},z.name))]}),V&&m.jsx("div",{className:"modal-backdrop",onClick:()=>D(!1),children:m.jsxs("div",{className:"slash-help",style:ne?{width:ne}:void 0,onClick:z=>z.stopPropagation(),children:[m.jsxs("div",{className:"slash-help-head",children:[m.jsxs("span",{children:["⚡ ",h("slashHelpTitle")]}),m.jsx("button",{type:"button",className:"btn",onClick:()=>D(!1),children:h("close")})]}),m.jsx("div",{className:"slash-help-body",children:e.slashCommands.length===0?m.jsx("div",{className:"slash-help-empty",children:h("slashLoading")}):e.slashCommands.map(z=>m.jsxs("div",{className:"slash-help-row",children:[m.jsxs("span",{className:"slash-help-cmd",children:["/",z.name]}),m.jsx("span",{className:`slash-source ${z.source}`,children:U[z.source]}),m.jsxs("span",{className:"slash-help-desc",children:[p(z),z.argumentHint&&m.jsx("span",{className:"slash-hint",children:v(z)})]})]},z.name))})]})}),m.jsxs("div",{className:"inputbox",children:[m.jsx("input",{ref:W,type:"file",multiple:!0,hidden:!0,onChange:z=>{Q(z.target.files),z.target.value=""}}),m.jsxs("div",{className:"inputbox-row",children:[m.jsx("button",{type:"button",className:"btn attach-img",title:h("uploadFile"),disabled:!C,onClick:()=>{var z;return(z=W.current)==null?void 0:z.click()},children:m.jsx(sg,{})}),m.jsx("textarea",{ref:ee,value:y,rows:1,placeholder:h(C?Y?"placeholderStreaming":"placeholderIdle":"placeholderConnecting"),disabled:!C,onChange:z=>{S(z.target.value),O(z.target.value)},onKeyDown:ae,onPaste:ie}),ye()]}),m.jsxs("div",{className:"input-tools",children:[m.jsx("div",{className:"input-tools-left",children:m.jsx(Ov,{chat:e,send:t,onManageModels:d,compact:!0})}),m.jsxs("div",{className:"input-tools-right",children:[m.jsx("button",{type:"button",className:"btn attach-img",title:h("uploadFile"),disabled:!C,onClick:()=>{var z;return(z=W.current)==null?void 0:z.click()},children:m.jsx(sg,{})}),ye()]})]})]})]})}function gR({chat:e,send:t}){var ne,Z,ee,W,H,U;const n=bt(),r=e.goal,o=r.goal!==null,[a,l]=K.useState(""),[u,d]=K.useState(r.reviewModel??""),[h,g]=K.useState(r.maxRounds),[p,v]=K.useState(r.locked),[y,S]=K.useState(!1),[w,E]=K.useState(!1),[k,R]=K.useState(!0);K.useEffect(()=>{d(r.reviewModel??""),g(r.maxRounds||0),v(r.locked)},[r.goal,r.reviewModel,r.maxRounds,r.locked]),K.useEffect(()=>{y&&e.models.length===0&&!w&&(E(!0),t({type:"list_models"}))},[y,e.models.length,w,t]),K.useEffect(()=>{e.models.length>0&&E(!1)},[e.models.length]);const T=()=>{var O;return u?((O=e.models.find(q=>q.id===u))==null?void 0:O.name)??u:n("goalBarUseMainModel")},A=()=>{const O=a.trim();O&&(t({type:"set_goal",goal:O,...u?{reviewModel:u}:{},maxRounds:h,locked:p}),l(""),R(!1))},V=()=>{const O=a.trim();O&&(t({type:"start_goal_wizard",text:O,...u?{wizardModel:u}:{},maxRounds:h,locked:p}),l(""),R(!1))},D=((ne=r.wizard)==null?void 0:ne.active)??!1;return D?m.jsx("div",{className:`goalbar goalbar-active ${D?"wizard":""}`,children:m.jsxs("div",{className:"goalbar-active-row",children:[m.jsx("span",{className:"goalbar-icon",children:m.jsx("span",{className:"goalbar-spin",children:"🔍"})}),m.jsxs("span",{className:"goalbar-text",title:((Z=r.wizard)==null?void 0:Z.draft)??"",children:[n("goalWizardRunning"),": ",(ee=r.wizard)==null?void 0:ee.draft]}),m.jsxs("span",{className:"goalbar-chip reviewing",children:[n("goalBarRound",{n:(((W=r.wizard)==null?void 0:W.step)??0)+1})," ","/ ",((H=r.wizard)==null?void 0:H.maxSteps)??6]}),m.jsx("span",{className:"goalbar-detail",children:((U=r.wizard)==null?void 0:U.status)||n("goalBarReviewing")}),m.jsx("button",{type:"button",className:"goalbar-x",title:n("goalBarClear"),onClick:()=>{t({type:"clear_goal"}),R(!0)},children:m.jsx(ls,{})})]})}):o?m.jsx("div",{className:`goalbar goalbar-active ${r.reviewing?"reviewing":""}`,children:m.jsxs("div",{className:"goalbar-active-row",children:[m.jsx("span",{className:"goalbar-icon",children:r.reviewing?m.jsx("span",{className:"goalbar-spin",children:"◌"}):"🎯"}),m.jsx("span",{className:"goalbar-text",title:r.goal??"",children:r.goal}),r.reviewing?m.jsxs("span",{className:"goalbar-chip reviewing",children:[n("goalBarReviewing")," ",n("goalBarRound",{n:r.round})]}):m.jsx("span",{className:`goalbar-chip ${r.verdict==="pass"?"pass":r.verdict==="fail"?"fail":""}`,children:r.verdict==="pass"?n("goalBarPassed"):r.verdict==="fail"?n("goalBarFailed"):`${n("goalBarRound",{n:r.round||1})} · ${r.locked?n("goalBarLocked"):n("goalBarUnlocked")}`}),m.jsx("span",{className:"goalbar-detail",children:r.status}),m.jsx("button",{type:"button",className:"goalbar-x",title:n("goalBarClear"),disabled:r.reviewing,onClick:()=>{t({type:"clear_goal"}),R(!0)},children:m.jsx(ls,{})})]})}):k?m.jsx("div",{className:"goalbar goalbar-collapsed",children:m.jsxs("button",{type:"button",className:"goalbar-hint",title:n("goalBarPlaceholder"),onClick:()=>R(!1),children:[m.jsx(rg,{})," ",m.jsx("span",{children:n("goalBarTitle")})]})}):m.jsxs("div",{className:"goalbar",children:[m.jsxs("div",{className:"goalbar-row",children:[m.jsx("span",{className:"goalbar-icon",children:m.jsx(rg,{})}),m.jsx("input",{className:"goalbar-input",value:a,placeholder:n("goalBarPlaceholder"),onChange:O=>l(O.target.value),onKeyDown:O=>{O.key==="Enter"&&A()}}),m.jsx("button",{type:"button",className:"goalbar-btn",disabled:!a.trim(),onClick:A,children:n("goalBarSet")}),m.jsxs("button",{type:"button",className:"goalbar-btn wizard",disabled:!a.trim(),title:n("goalWizardTip"),onClick:V,children:["🔍 ",n("goalWizardBtn")]}),m.jsx("button",{type:"button",className:"goalbar-icon-btn",title:n(p?"goalBarLocked":"goalBarUnlocked"),onClick:()=>v(O=>(t({type:"set_goal_prefs",locked:!O}),!O)),children:p?m.jsx(t0,{}):m.jsx(Xw,{})}),m.jsx("button",{type:"button",className:"goalbar-icon-btn",title:n("goalBarClear"),onClick:()=>R(!0),children:m.jsx(Yd,{})})]}),m.jsxs("div",{className:"goalbar-opts",children:[m.jsxs(ns,{trigger:m.jsxs("span",{className:"goalbar-opt",children:[n("goalBarReviewModel"),": ",m.jsx("b",{children:T()})]}),open:y,onOpenChange:S,direction:"up",children:[m.jsx("div",{className:"dd-header",children:n("goalBarReviewModel")}),(w||e.modelsLoading)&&m.jsx("div",{className:"dd-loading",children:n("loading")}),e.models.length===0&&!w&&!e.modelsLoading&&m.jsx("div",{className:"dd-loading",children:n("noModels")}),m.jsx(ss,{active:u==="",onClick:()=>{d(""),S(!1),t({type:"set_goal_prefs",reviewModel:""})},children:n("goalBarUseMainModel")}),e.models.map(O=>m.jsx(ss,{active:u===O.id,onClick:()=>{d(O.id),S(!1),t({type:"set_goal_prefs",reviewModel:O.id})},children:m.jsxs("span",{className:"dd-model-cell",children:[m.jsx("span",{className:"dd-model-name",children:O.name}),m.jsx("span",{className:"dd-model-meta",children:m.jsx("span",{className:"dd-model-provider",children:O.provider})})]})},O.id)),m.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>t({type:"list_models"}),children:n("refreshModels")})]}),m.jsxs("label",{className:"goalbar-round",title:n("goalBarMaxRoundsTip"),children:[m.jsx("span",{children:n("goalBarMaxRounds")}),m.jsx("input",{type:"number",min:0,step:1,value:h,placeholder:n("goalBarUnlimitedShort"),onChange:O=>{const q=parseInt(O.target.value,10);if(Number.isNaN(q)||q<0){g(0);return}g(q)},onBlur:()=>t({type:"set_goal_prefs",maxRounds:h}),onKeyDown:O=>{O.key==="Enter"&&(t({type:"set_goal_prefs",maxRounds:h}),O.target.blur())}})]}),m.jsx("span",{className:"goalbar-lock-hint",children:n(p?"goalBarLocked":"goalBarUnlocked")})]})]})}function _R({chat:e,send:t}){const n=bt(),r=e.state,[o,a]=K.useState(!1),[l,u]=K.useState(""),[d,h]=K.useState(0),g=K.useRef(null),p=e.pathCompletions;if(K.useEffect(()=>{if(!o)return;const Z=setTimeout(()=>{t({type:"complete_path",path:l})},150);return()=>clearTimeout(Z)},[l,o,t]),K.useEffect(()=>h(0),[p]),K.useEffect(()=>{const Z=document.querySelector(`.status-completions .pc-item[data-idx="${d}"]`);Z==null||Z.scrollIntoView({block:"nearest"})},[d]),!r)return null;const v=r.stats,y=e.ready?"ok":"busy",S=e.ready?n("connected"):n("connecting"),w=v.contextUsage,E=w.tokens!==null&&w.percent!==null?`${y_(w.tokens)} / ${y_(w.contextWindow)}`:"—",k=w.percent??null,R=k===null?"":k>=80?"warn":k>=50?"mid":"ok",T=r.queue.steering+r.queue.followUp,A=()=>{u(r.cwd),a(!0)},V=(Z,ee)=>{var H;const W=Z.includes("\\")?"\\":"/";u(ee?`${Z}${W}`:Z),h(0),(H=g.current)==null||H.focus()},D=Z=>{const ee=Z.trim();ee&&ee!==r.cwd&&t({type:"set_cwd",path:ee}),a(!1)},ne=Z=>{if(Z.key==="ArrowDown")Z.preventDefault(),h(ee=>Math.min(ee+1,p.length-1));else if(Z.key==="ArrowUp")Z.preventDefault(),h(ee=>Math.max(ee-1,0));else if(Z.key==="Tab"&&p.length>0){Z.preventDefault();const ee=p[Math.min(d,p.length-1)];V(ee.path,ee.type==="dir")}else if(Z.key==="Enter"&&!Z.nativeEvent.isComposing){const ee=l.trim();if(ee.endsWith("/")||ee.endsWith("\\"))D(ee);else if(p.some(W=>W.path===ee))D(ee);else if(p.length>0&&p[d]){Z.preventDefault();const W=p[d];V(W.path,W.type==="dir")}else D(ee)}else Z.key==="Escape"&&(p.length>0?(Z.stopPropagation(),t({type:"complete_path",path:""})):a(!1))};return m.jsxs("footer",{className:"statusbar",children:[m.jsx("span",{className:`status-dot ${y}`,title:S}),m.jsx("span",{className:"status-item",children:S}),m.jsx("span",{className:"status-sep",children:"·"}),m.jsxs("span",{className:"status-item status-ctx",title:n("contextUsage"),children:[n("context"),m.jsx("span",{className:`ctx-bar ${R}`,children:k!==null&&m.jsx("span",{className:"ctx-bar-fill",style:{width:`${Math.min(k,100)}%`}})}),E]}),m.jsx("span",{className:"status-sep",children:"·"}),m.jsxs("span",{className:"status-item",title:n("cumulativeCost"),children:["$",vR(v.cost)]}),m.jsx("span",{className:"status-sep",children:"·"}),m.jsxs("span",{className:"status-item",title:n("sessionMessages"),children:[n("messages")," ",v.totalMessages]}),e.statuses.length>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"status-sep",children:"·"}),m.jsx("span",{className:"status-item ext-status",title:n("pluginStatus"),children:e.statuses.map(Z=>Z.text).join(" · ")})]}),r.isStreaming&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"status-sep",children:"·"}),m.jsxs("span",{className:"status-item working",children:[m.jsx("span",{className:"working-spin"}),n("working"),T>0&&m.jsxs("span",{className:"status-queue",children:["⏳ ",T," ",n("queued")]})]})]}),o?m.jsxs("div",{className:"status-cwd-wrap",children:[m.jsx("input",{ref:g,className:"status-cwd-input",value:l,autoFocus:!0,placeholder:n("enterPath"),onChange:Z=>u(Z.target.value),onKeyDown:ne,onBlur:()=>a(!1)}),p.length>0&&m.jsx("ul",{className:"status-completions",onMouseDown:Z=>Z.preventDefault(),children:p.map((Z,ee)=>m.jsx("li",{children:m.jsxs("button",{type:"button","data-idx":ee,className:`pc-item ${ee===d?"sel":""}`,onMouseEnter:()=>h(ee),onClick:()=>V(Z.path,Z.type==="dir"),children:[m.jsx("span",{className:"pc-icon",children:Z.type==="dir"?m.jsx(la,{}):m.jsx(Cv,{})}),m.jsxs("span",{className:"pc-body",children:[m.jsx("span",{className:"pc-name",children:Z.name}),m.jsx("span",{className:"pc-path",children:Z.path})]})]})},Z.path))})]}):m.jsxs("button",{type:"button",className:"status-item status-cwd",title:n("cwdTip",{path:r.cwd}),onClick:A,children:["📁 ",r.cwd]})]})}function y_(e){return e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:String(e)}function vR(e){return e<=0?"0":e<1e-4?"<0.0001":e.toFixed(4).replace(/\.?0+$/,"")}function yR({dialog:e,send:t}){const n=bt(),[r,o]=K.useState(""),[a,l]=K.useState(0),u=g=>{t({type:"dialog_response",id:e.id,value:g})};K.useEffect(()=>{o(""),l(0);const g=p=>{p.key==="Escape"&&u(null)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e.id]);const d=Array.isArray(e.args[0])?e.args[0]:[],h=typeof e.args[0]=="string"?e.args[0]:"";return m.jsx("div",{className:"dialog-overlay",onMouseDown:g=>{g.target===g.currentTarget&&u(null)},children:m.jsxs("div",{className:"dialog",children:[m.jsx("div",{className:"dialog-title",children:e.title||n("pluginRequest")}),e.kind==="select"&&m.jsxs("div",{className:"dialog-options",children:[d.map((g,p)=>m.jsx("button",{type:"button",className:`dialog-option ${p===a?"sel":""}`,onMouseEnter:()=>l(p),onClick:()=>u(g),children:g},p)),d.length===0&&m.jsx("div",{className:"dialog-hint",children:n("noOptions")})]}),e.kind==="confirm"&&m.jsxs("div",{className:"dialog-body",children:[m.jsx("p",{children:h}),m.jsxs("div",{className:"dialog-actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:()=>u(!1),children:n("cancel")}),m.jsx("button",{type:"button",className:"btn primary",onClick:()=>u(!0),children:n("ok")})]})]}),e.kind==="input"&&m.jsxs("div",{className:"dialog-body",children:[m.jsx("input",{className:"dialog-input",value:r,placeholder:h||n("inputPlaceholder"),autoFocus:!0,onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.nativeEvent.isComposing&&u(r)}}),m.jsxs("div",{className:"dialog-actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:()=>u(null),children:n("cancel")}),m.jsx("button",{type:"button",className:"btn primary",onClick:()=>u(r),children:n("ok")})]})]})]})})}/**
|
|
88
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
89
|
-
* @license MIT
|
|
90
|
-
*
|
|
91
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
92
|
-
* @license MIT
|
|
93
|
-
*
|
|
94
|
-
* Originally forked from (with the author's permission):
|
|
95
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
96
|
-
* http://bellard.org/jslinux/
|
|
97
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
98
|
-
*/var db=Object.defineProperty,bR=Object.getOwnPropertyDescriptor,SR=(e,t)=>{for(var n in t)db(e,n,{get:t[n],enumerable:!0})},Mt=(e,t,n,r)=>{for(var o=r>1?void 0:r?bR(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=(r?l(t,n,o):l(o))||o);return r&&o&&db(t,n,o),o},Se=(e,t)=>(n,r)=>t(n,r,e),b_="Terminal input",cd={get:()=>b_,set:e=>b_=e},S_="Too much output to announce, navigate to rows manually to read",ud={get:()=>S_,set:e=>S_=e};function wR(e){return e.replace(/\r?\n/g,"\r")}function xR(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function kR(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function ER(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");fb(o,t,n,r)}}function fb(e,t,n,r){e=wR(e),e=xR(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function pb(e,t,n){let r=n.getBoundingClientRect(),o=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function w_(e,t,n,r,o){pb(e,t,n),o&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Er(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function kc(e,t=0,n=e.length){let r="";for(let o=t;o<n;++o){let a=e[o];a>65535?(a-=65536,r+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):r+=String.fromCharCode(a)}return r}var CR=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,o=0;if(this._interim){let a=e.charCodeAt(o++);56320<=a&&a<=57343?t[r++]=(this._interim-55296)*1024+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0}for(let a=o;a<n;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=n)return this._interim=l,r;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[r++]=(l-55296)*1024+u-56320+65536:(t[r++]=l,t[r++]=u);continue}l!==65279&&(t[r++]=l)}return r}},NR=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,o,a,l,u,d=0,h=0;if(this.interim[0]){let v=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let S=0,w;for(;(w=this.interim[++S]&63)&&S<4;)y<<=6,y|=w;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=E-S;for(;h<k;){if(h>=n)return 0;if(w=e[h++],(w&192)!==128){h--,v=!0;break}else this.interim[S++]=w,y<<=6,y|=w&63}v||(E===2?y<128?h--:t[r++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(t[r++]=y):y<65536||y>1114111||(t[r++]=y)),this.interim.fill(0)}let g=n-4,p=h;for(;p<n;){for(;p<g&&!((o=e[p])&128)&&!((a=e[p+1])&128)&&!((l=e[p+2])&128)&&!((u=e[p+3])&128);)t[r++]=o,t[r++]=a,t[r++]=l,t[r++]=u,p+=4;if(o=e[p++],o<128)t[r++]=o;else if((o&224)===192){if(p>=n)return this.interim[0]=o,r;if(a=e[p++],(a&192)!==128){p--;continue}if(d=(o&31)<<6|a&63,d<128){p--;continue}t[r++]=d}else if((o&240)===224){if(p>=n)return this.interim[0]=o,r;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=n)return this.interim[0]=o,this.interim[1]=a,r;if(l=e[p++],(l&192)!==128){p--;continue}if(d=(o&15)<<12|(a&63)<<6|l&63,d<2048||d>=55296&&d<=57343||d===65279)continue;t[r++]=d}else if((o&248)===240){if(p>=n)return this.interim[0]=o,r;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=n)return this.interim[0]=o,this.interim[1]=a,r;if(l=e[p++],(l&192)!==128){p--;continue}if(p>=n)return this.interim[0]=o,this.interim[1]=a,this.interim[2]=l,r;if(u=e[p++],(u&192)!==128){p--;continue}if(d=(o&7)<<18|(a&63)<<12|(l&63)<<6|u&63,d<65536||d>1114111)continue;t[r++]=d}}return r}},mb="",Cr=" ",ya=class gb{constructor(){this.fg=0,this.bg=0,this.extended=new uc}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new gb;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}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}},uc=class _b{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new _b(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},si=class vb extends ya{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new uc,this.combinedData=""}static fromCharData(t){let n=new vb;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Er(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(r-55296)*1024+o-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},x_="di$target",hd="di$dependencies",Oh=new Map;function TR(e){return e[hd]||[]}function nn(e){if(Oh.has(e))return Oh.get(e);let t=function(n,r,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");RR(t,n,o)};return t._id=e,Oh.set(e,t),t}function RR(e,t,n){t[x_]===t?t[hd].push({id:e,index:n}):(t[hd]=[{id:e,index:n}],t[x_]=t)}var xn=nn("BufferService"),yb=nn("CoreMouseService"),ps=nn("CoreService"),MR=nn("CharsetService"),bf=nn("InstantiationService"),bb=nn("LogService"),kn=nn("OptionsService"),Sb=nn("OscLinkService"),AR=nn("UnicodeService"),ba=nn("DecorationService"),dd=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var g;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],o=this._optionsService.rawOptions.linkHandler,a=new si,l=n.getTrimmedLength(),u=-1,d=-1,h=!1;for(let p=0;p<l;p++)if(!(d===-1&&!n.hasContent(p))){if(n.loadCell(p,a),a.hasExtendedAttrs()&&a.extended.urlId)if(d===-1){d=p,u=a.extended.urlId;continue}else h=a.extended.urlId!==u;else d!==-1&&(h=!0);if(h||d!==-1&&p===l-1){let v=(g=this._oscLinkService.getLinkData(u))==null?void 0:g.uri;if(v){let y={start:{x:d+1,y:e},end:{x:p+(!h&&p===l-1?1:0),y:e}},S=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{let w=new URL(v);["http:","https:"].includes(w.protocol)||(S=!0)}catch{S=!0}S||r.push({text:v,range:y,activate:(w,E)=>o?o.activate(w,E,y):LR(w,E),hover:(w,E)=>{var k;return(k=o==null?void 0:o.hover)==null?void 0:k.call(o,w,E,y)},leave:(w,E)=>{var k;return(k=o==null?void 0:o.leave)==null?void 0:k.call(o,w,E,y)}})}h=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=p,u=a.extended.urlId):(d=-1,u=-1)}}t(r)}};dd=Mt([Se(0,xn),Se(1,kn),Se(2,Sb)],dd);function LR(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
99
|
-
|
|
100
|
-
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Ec=nn("CharSizeService"),Qi=nn("CoreBrowserService"),Sf=nn("MouseService"),Ji=nn("RenderService"),OR=nn("SelectionService"),wb=nn("CharacterJoinerService"),eo=nn("ThemeService"),xb=nn("LinkProviderService"),DR=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?k_.isErrorNoTelemetry(e)?new k_(e.message+`
|
|
101
|
-
|
|
102
|
-
`+e.stack):new Error(e.message+`
|
|
103
|
-
|
|
104
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},IR=new DR;function Gl(e){PR(e)||IR.onUnexpectedError(e)}var fd="Canceled";function PR(e){return e instanceof BR?!0:e instanceof Error&&e.name===fd&&e.message===fd}var BR=class extends Error{constructor(){super(fd),this.name=this.message}};function FR(e){return new Error(`Illegal argument: ${e}`)}var k_=class pd extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof pd)return t;let n=new pd;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},md=class kb extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,kb.prototype)}};function Un(e,t=0){return e[e.length-(1+t)]}var zR;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function r(a){return a>0}e.isGreaterThan=r;function o(a){return a===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(zR||(zR={}));function jR(e,t){let n=this,r=!1,o;return function(){return r||(r=!0,t||(o=e.apply(n,arguments))),o}}var Eb;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*o(A){yield A}e.single=o;function a(A){return t(A)?A:o(A)}e.wrap=a;function l(A){return A||n}e.from=l;function*u(A){for(let V=A.length-1;V>=0;V--)yield A[V]}e.reverse=u;function d(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=d;function h(A){return A[Symbol.iterator]().next().value}e.first=h;function g(A,V){let D=0;for(let ne of A)if(V(ne,D++))return!0;return!1}e.some=g;function p(A,V){for(let D of A)if(V(D))return D}e.find=p;function*v(A,V){for(let D of A)V(D)&&(yield D)}e.filter=v;function*y(A,V){let D=0;for(let ne of A)yield V(ne,D++)}e.map=y;function*S(A,V){let D=0;for(let ne of A)yield*V(ne,D++)}e.flatMap=S;function*w(...A){for(let V of A)yield*V}e.concat=w;function E(A,V,D){let ne=D;for(let Z of A)ne=V(ne,Z);return ne}e.reduce=E;function*k(A,V,D=A.length){for(V<0&&(V+=A.length),D<0?D+=A.length:D>A.length&&(D=A.length);V<D;V++)yield A[V]}e.slice=k;function R(A,V=Number.POSITIVE_INFINITY){let D=[];if(V===0)return[D,A];let ne=A[Symbol.iterator]();for(let Z=0;Z<V;Z++){let ee=ne.next();if(ee.done)return[D,e.empty()];D.push(ee.value)}return[D,{[Symbol.iterator](){return ne}}]}e.consume=R;async function T(A){let V=[];for await(let D of A)V.push(D);return Promise.resolve(V)}e.asyncToArray=T})(Eb||(Eb={}));function us(e){if(Eb.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function UR(...e){return yt(()=>us(e))}function yt(e){return{dispose:jR(()=>{e()})}}var Cb=class Nb{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{us(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Nb.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};Cb.DISABLE_DISPOSED_WARNING=!1;var Nr=Cb,Ve=class{constructor(){this._store=new Nr,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)}};Ve.None=Object.freeze({dispose(){}});var Xs=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.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}},Xi=typeof window=="object"?window:globalThis,gd=class _d{constructor(t){this.element=t,this.next=_d.Undefined,this.prev=_d.Undefined}};gd.Undefined=new gd(void 0);var Et=gd,E_=class{constructor(){this._first=Et.Undefined,this._last=Et.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Et.Undefined}clear(){let e=this._first;for(;e!==Et.Undefined;){let t=e.next;e.prev=Et.Undefined,e.next=Et.Undefined,e=t}this._first=Et.Undefined,this._last=Et.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Et(e);if(this._first===Et.Undefined)this._first=n,this._last=n;else if(t){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Et.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Et.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Et.Undefined&&e.next!==Et.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Et.Undefined&&e.next===Et.Undefined?(this._first=Et.Undefined,this._last=Et.Undefined):e.next===Et.Undefined?(this._last=this._last.prev,this._last.next=Et.Undefined):e.prev===Et.Undefined&&(this._first=this._first.next,this._first.prev=Et.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Et.Undefined;)yield e.element,e=e.next}},HR=globalThis.performance&&typeof globalThis.performance.now=="function",$R=class Tb{static create(t){return new Tb(t)}constructor(t){this._now=HR&&t===!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}},ln;(e=>{e.None=()=>Ve.None;function t(U,O){return p(U,()=>{},0,void 0,!0,void 0,O)}e.defer=t;function n(U){return(O,q=null,F)=>{let Q=!1,ie;return ie=U(M=>{if(!Q)return ie?ie.dispose():Q=!0,O.call(q,M)},null,F),Q&&ie.dispose(),ie}}e.once=n;function r(U,O,q){return h((F,Q=null,ie)=>U(M=>F.call(Q,O(M)),null,ie),q)}e.map=r;function o(U,O,q){return h((F,Q=null,ie)=>U(M=>{O(M),F.call(Q,M)},null,ie),q)}e.forEach=o;function a(U,O,q){return h((F,Q=null,ie)=>U(M=>O(M)&&F.call(Q,M),null,ie),q)}e.filter=a;function l(U){return U}e.signal=l;function u(...U){return(O,q=null,F)=>{let Q=UR(...U.map(ie=>ie(M=>O.call(q,M))));return g(Q,F)}}e.any=u;function d(U,O,q,F){let Q=q;return r(U,ie=>(Q=O(Q,ie),Q),F)}e.reduce=d;function h(U,O){let q,F={onWillAddFirstListener(){q=U(Q.fire,Q)},onDidRemoveLastListener(){q==null||q.dispose()}},Q=new me(F);return O==null||O.add(Q),Q.event}function g(U,O){return O instanceof Array?O.push(U):O&&O.add(U),U}function p(U,O,q=100,F=!1,Q=!1,ie,M){let Y,C,I,P=0,N,ae={leakWarningThreshold:ie,onWillAddFirstListener(){Y=U(z=>{P++,C=O(C,z),F&&!I&&(ye.fire(C),C=void 0),N=()=>{let pe=C;C=void 0,I=void 0,(!F||P>1)&&ye.fire(pe),P=0},typeof q=="number"?(clearTimeout(I),I=setTimeout(N,q)):I===void 0&&(I=0,queueMicrotask(N))})},onWillRemoveListener(){Q&&P>0&&(N==null||N())},onDidRemoveLastListener(){N=void 0,Y.dispose()}},ye=new me(ae);return M==null||M.add(ye),ye.event}e.debounce=p;function v(U,O=0,q){return e.debounce(U,(F,Q)=>F?(F.push(Q),F):[Q],O,void 0,!0,void 0,q)}e.accumulate=v;function y(U,O=(F,Q)=>F===Q,q){let F=!0,Q;return a(U,ie=>{let M=F||!O(ie,Q);return F=!1,Q=ie,M},q)}e.latch=y;function S(U,O,q){return[e.filter(U,O,q),e.filter(U,F=>!O(F),q)]}e.split=S;function w(U,O=!1,q=[],F){let Q=q.slice(),ie=U(C=>{Q?Q.push(C):Y.fire(C)});F&&F.add(ie);let M=()=>{Q==null||Q.forEach(C=>Y.fire(C)),Q=null},Y=new me({onWillAddFirstListener(){ie||(ie=U(C=>Y.fire(C)),F&&F.add(ie))},onDidAddFirstListener(){Q&&(O?setTimeout(M):M())},onDidRemoveLastListener(){ie&&ie.dispose(),ie=null}});return F&&F.add(Y),Y.event}e.buffer=w;function E(U,O){return(q,F,Q)=>{let ie=O(new R);return U(function(M){let Y=ie.evaluate(M);Y!==k&&q.call(F,Y)},void 0,Q)}}e.chain=E;let k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(q=>(O(q),q)),this}filter(O){return this.steps.push(q=>O(q)?q:k),this}reduce(O,q){let F=q;return this.steps.push(Q=>(F=O(F,Q),F)),this}latch(O=(q,F)=>q===F){let q=!0,F;return this.steps.push(Q=>{let ie=q||!O(Q,F);return q=!1,F=Q,ie?Q:k}),this}evaluate(O){for(let q of this.steps)if(O=q(O),O===k)break;return O}}function T(U,O,q=F=>F){let F=(...Y)=>M.fire(q(...Y)),Q=()=>U.on(O,F),ie=()=>U.removeListener(O,F),M=new me({onWillAddFirstListener:Q,onDidRemoveLastListener:ie});return M.event}e.fromNodeEventEmitter=T;function A(U,O,q=F=>F){let F=(...Y)=>M.fire(q(...Y)),Q=()=>U.addEventListener(O,F),ie=()=>U.removeEventListener(O,F),M=new me({onWillAddFirstListener:Q,onDidRemoveLastListener:ie});return M.event}e.fromDOMEventEmitter=A;function V(U){return new Promise(O=>n(U)(O))}e.toPromise=V;function D(U){let O=new me;return U.then(q=>{O.fire(q)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}e.fromPromise=D;function ne(U,O){return U(q=>O.fire(q))}e.forward=ne;function Z(U,O,q){return O(q),U(F=>O(F))}e.runAndSubscribe=Z;class ee{constructor(O,q){this._observable=O,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new me(F),q&&q.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,q){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(U,O){return new ee(U,O).emitter.event}e.fromObservable=W;function H(U){return(O,q,F)=>{let Q=0,ie=!1,M={beginUpdate(){Q++},endUpdate(){Q--,Q===0&&(U.reportChanges(),ie&&(ie=!1,O.call(q)))},handlePossibleChange(){},handleChange(){ie=!0}};U.addObserver(M),U.reportChanges();let Y={dispose(){U.removeObserver(M)}};return F instanceof Nr?F.add(Y):Array.isArray(F)&&F.push(Y),Y}}e.fromObservableLight=H})(ln||(ln={}));var vd=class yd{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${yd._idPool++}`,yd.all.add(this)}start(t){this._stopWatch=new $R,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};vd.all=new Set,vd._idPool=0;var WR=vd,KR=-1,Rb=class Mb{constructor(t,n,r=(Mb._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[a,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(a);let d=new GR(u,a);this._errorHandler(d)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,o]of this._stacks)(!t||n<o)&&(t=[r,o],n=o);return t}};Rb._idPool=1;var qR=Rb,VR=class Ab{constructor(t){this.value=t}static create(){let t=new Error;return new Ab(t.stack??"")}print(){console.warn(this.value.split(`
|
|
105
|
-
`).slice(2).join(`
|
|
106
|
-
`))}},GR=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},YR=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},XR=0,Dh=class{constructor(e){this.value=e,this.id=XR++}},ZR=2,QR,me=class{constructor(e){var t,n,r,o;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new qR((e==null?void 0:e.onListenerError)??Gl,((n=this._options)==null?void 0:n.leakWarningThreshold)??KR):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new WR(this._options._profName):void 0,this._deliveryQueue=(o=this._options)==null?void 0:o.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var l,u,d,h,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let p=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(p);let v=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new YR(`${p}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Gl)(y),Ve.None}if(this._disposed)return Ve.None;t&&(e=e.bind(t));let r=new Dh(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=VR.create(),o=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Dh?(this._deliveryQueue??(this._deliveryQueue=new JR),this._listeners=[this._listeners,r]):this._listeners.push(r):((d=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||d.call(u,this),this._listeners=r,(g=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||g.call(h,this)),this._size++;let a=yt(()=>{o==null||o(),this._removeListener(r)});return n instanceof Nr?n.add(a):Array.isArray(n)&&n.push(a),a}),this._event}_removeListener(e){var o,a,l,u;if((a=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||a.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||u.call(l,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*ZR<=t.length){let d=0;for(let h=0;h<t.length;h++)t[h]?t[d++]=t[h]:r&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=d}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||Gl;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,o;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof Dh)this._deliver(this._listeners,e);else{let a=this._deliveryQueue;a.enqueue(this,e,this._listeners.length),this._deliverQueue(a)}(o=this._perfMon)==null||o.stop()}hasListeners(){return this._size>0}},JR=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},bd=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new me,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new me,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};bd.INSTANCE=new bd;var wf=bd;function eM(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}wf.INSTANCE.onDidChangeZoomLevel;function tM(e){return wf.INSTANCE.getZoomFactor(e)}wf.INSTANCE.onDidChangeFullscreen;var to=typeof navigator=="object"?navigator.userAgent:"",Sd=to.indexOf("Firefox")>=0,nM=to.indexOf("AppleWebKit")>=0,xf=to.indexOf("Chrome")>=0,iM=!xf&&to.indexOf("Safari")>=0;to.indexOf("Electron/")>=0;to.indexOf("Android")>=0;var Ih=!1;if(typeof Xi.matchMedia=="function"){let e=Xi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Xi.matchMedia("(display-mode: fullscreen)");Ih=e.matches,eM(Xi,e,({matches:n})=>{Ih&&t.matches||(Ih=n)})}var Gs="en",wd=!1,xd=!1,Yl=!1,Lb=!1,jl,Xl=Gs,C_=Gs,rM,gi,as=globalThis,an,gv;typeof as.vscode<"u"&&typeof as.vscode.process<"u"?an=as.vscode.process:typeof process<"u"&&typeof((gv=process==null?void 0:process.versions)==null?void 0:gv.node)=="string"&&(an=process);var _v,sM=typeof((_v=an==null?void 0:an.versions)==null?void 0:_v.electron)=="string",oM=sM&&(an==null?void 0:an.type)==="renderer",vv;if(typeof an=="object"){wd=an.platform==="win32",xd=an.platform==="darwin",Yl=an.platform==="linux",Yl&&an.env.SNAP&&an.env.SNAP_REVISION,an.env.CI||an.env.BUILD_ARTIFACTSTAGINGDIRECTORY,jl=Gs,Xl=Gs;let e=an.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);jl=t.userLocale,C_=t.osLocale,Xl=t.resolvedLanguage||Gs,rM=(vv=t.languagePack)==null?void 0:vv.translationsConfigFile}catch{}Lb=!0}else typeof navigator=="object"&&!oM?(gi=navigator.userAgent,wd=gi.indexOf("Windows")>=0,xd=gi.indexOf("Macintosh")>=0,(gi.indexOf("Macintosh")>=0||gi.indexOf("iPad")>=0||gi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Yl=gi.indexOf("Linux")>=0,(gi==null?void 0:gi.indexOf("Mobi"))>=0,Xl=globalThis._VSCODE_NLS_LANGUAGE||Gs,jl=navigator.language.toLowerCase(),C_=jl):console.error("Unable to resolve platform.");var Ob=wd,Oi=xd,aM=Yl,N_=Lb,Di=gi,wr=Xl,lM;(e=>{function t(){return wr}e.value=t;function n(){return wr.length===2?wr==="en":wr.length>=3?wr[0]==="e"&&wr[1]==="n"&&wr[2]==="-":!1}e.isDefaultVariant=n;function r(){return wr==="en"}e.isDefault=r})(lM||(lM={}));var cM=typeof as.postMessage=="function"&&!as.importScripts;(()=>{if(cM){let e=[];as.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,o=e.length;r<o;r++){let a=e[r];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),a.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),as.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var uM=!!(Di&&Di.indexOf("Chrome")>=0);Di&&Di.indexOf("Firefox")>=0;!uM&&Di&&Di.indexOf("Safari")>=0;Di&&Di.indexOf("Edg/")>=0;Di&&Di.indexOf("Android")>=0;var $s=typeof navigator=="object"?navigator:{};N_||document.queryCommandSupported&&document.queryCommandSupported("copy")||$s&&$s.clipboard&&$s.clipboard.writeText,N_||$s&&$s.clipboard&&$s.clipboard.readText;var kf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Ph=new kf,T_=new kf,R_=new kf,hM=new Array(230),Db;(e=>{function t(u){return Ph.keyCodeToStr(u)}e.toString=t;function n(u){return Ph.strToKeyCode(u)}e.fromString=n;function r(u){return T_.keyCodeToStr(u)}e.toUserSettingsUS=r;function o(u){return R_.keyCodeToStr(u)}e.toUserSettingsGeneral=o;function a(u){return T_.strToKeyCode(u)||R_.strToKeyCode(u)}e.fromUserSettings=a;function l(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ph.keyCodeToStr(u)}e.toElectronAccelerator=l})(Db||(Db={}));var dM=class Ib{constructor(t,n,r,o,a){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=o,this.keyCode=a}equals(t){return t instanceof Ib&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${n}${r}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new fM([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},fM=class{constructor(e){if(e.length===0)throw FR("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function pM(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return Db.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Sd)switch(t){case 59:return 85;case 60:if(aM)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Oi)return 57;break}else if(nM&&(Oi&&t===93||!Oi&&t===92))return 57;return hM[t]||0}var mM=Oi?256:2048,gM=512,_M=1024,vM=Oi?2048:256,M_=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=pM(t),this.code=t.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(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=mM),this.altKey&&(t|=gM),this.shiftKey&&(t|=_M),this.metaKey&&(t|=vM),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new dM(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},A_=new WeakMap;function yM(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var bM=class{static getSameOriginWindowChain(e){let t=A_.get(e);if(!t){t=[],A_.set(e,t);let n=e,r;do r=yM(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,o=this.getSameOriginWindowChain(e);for(let a of o){let l=a.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,r+=(l==null?void 0:l.scrollX)??0,l===t||!a.iframeElement)break;let u=a.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},Ul=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=bM.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},L_=class{constructor(e,t=0,n=0){var o;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(xf){let a=navigator.userAgent.match(/Chrome\/(\d+)/);r=(a?parseInt(a[1]):123)<=122}if(e){let a=e,l=e,u=((o=e.view)==null?void 0:o.devicePixelRatio)||1;if(typeof a.wheelDeltaY<"u")r?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.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 d=e;d.deltaMode===d.DOM_DELTA_LINE?Sd&&!Oi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")iM&&Ob?this.deltaX=-(a.wheelDeltaX/120):r?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.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 d=e;d.deltaMode===d.DOM_DELTA_LINE?Sd&&!Oi?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*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Pb=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),SM;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof wM?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ln.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Pb})})(SM||(SM={}));var wM=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?Pb:(this._emitter||(this._emitter=new me),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Ef=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new md("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new md("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},xM=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new md("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=yt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},kM;(e=>{async function t(r){let o,a=await Promise.all(r.map(l=>l.then(u=>u,u=>{o||(o=u)})));if(typeof o<"u")throw o;return a}e.settled=t;function n(r){return new Promise(async(o,a)=>{try{await r(o,a)}catch(l){a(l)}})}e.withAsyncBody=n})(kM||(kM={}));var O_=class ni{static fromArray(t){return new ni(n=>{n.emitMany(t)})}static fromPromise(t){return new ni(async n=>{n.emitMany(await t)})}static fromPromises(t){return new ni(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new ni(async n=>{await Promise.all(t.map(async r=>{for await(let o of r)n.emitOne(o)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new me,queueMicrotask(async()=>{let r={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(r)),this.resolve()}catch(o){this.reject(o)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await ln.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new ni(async r=>{for await(let o of t)r.emitOne(n(o))})}map(t){return ni.map(this,t)}static filter(t,n){return new ni(async r=>{for await(let o of t)n(o)&&r.emitOne(o)})}filter(t){return ni.filter(this,t)}static coalesce(t){return ni.filter(t,n=>!!n)}coalesce(){return ni.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return ni.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};O_.EMPTY=O_.fromArray([]);var{getWindow:Li,getWindowId:EM,onDidRegisterWindow:CM}=(function(){let e=new Map,t={window:Xi,disposables:new Nr};e.set(Xi.vscodeWindowId,t);let n=new me,r=new me,o=new me;function a(l,u){return(typeof l=="number"?e.get(l):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:r.event,registerWindow(l){if(e.has(l.vscodeWindowId))return Ve.None;let u=new Nr,d={window:l,disposables:u.add(new Nr)};return e.set(l.vscodeWindowId,d),u.add(yt(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),u.add(Ue(l,Qt.BEFORE_UNLOAD,()=>{o.fire(l)})),n.fire(d),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:a,getWindow(l){var h;let u=l;if((h=u==null?void 0:u.ownerDocument)!=null&&h.defaultView)return u.ownerDocument.defaultView.window;let d=l;return d!=null&&d.view?d.view.window:Xi},getDocument(l){return Li(l).document}}})(),NM=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ue(e,t,n,r){return new NM(e,t,n,r)}var D_=function(e,t,n,r){return Ue(e,t,n,r)},Cf,TM=class extends xM{constructor(e){super(),this.defaultTarget=e&&Li(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},I_=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Gl(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,o=a=>{n.set(a,!1);let l=e.get(a)??[];for(t.set(a,l),e.set(a,[]),r.set(a,!0);l.length>0;)l.sort(I_.sort),l.shift().execute();r.set(a,!1)};Cf=(a,l,u=0)=>{let d=EM(a),h=new I_(l,u),g=e.get(d);return g||(g=[],e.set(d,g)),g.push(h),n.get(d)||(n.set(d,!0),a.requestAnimationFrame(()=>o(d))),h}})();function RM(e){let t=e.getBoundingClientRect(),n=Li(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Qt={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"},MM=class{constructor(e){this.domNode=e,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(e){let t=Ln(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ln(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ln(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ln(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ln(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ln(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ln(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ln(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ln(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ln(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ln(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ln(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ln(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ln(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ln(e){return typeof e=="number"?`${e}px`:e}function aa(e){return new MM(e)}var Bb=class{constructor(){this._hooks=new Nr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let a=e;try{e.setPointerCapture(t),this._hooks.add(yt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=Li(e)}this._hooks.add(Ue(a,Qt.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Ue(a,Qt.POINTER_UP,l=>this.stopMonitoring(!0)))}};function AM(e,t,n){let r=null,o=null;if(typeof n.value=="function"?(r="value",o=n.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",o=n.get),!o)throw new Error("not supported");let a=`$memoize$${t}`;n[r]=function(...l){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,l)}),this[a]}}var Mi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Mi||(Mi={}));var Jo=class fn extends Ve{constructor(){super(),this.dispatched=!1,this.targets=new E_,this.ignoreTargets=new E_,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ln.runAndSubscribe(CM,({window:t,disposables:n})=>{n.add(Ue(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(Ue(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(Ue(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Xi,disposables:this._store}))}static addTarget(t){if(!fn.isTouchDevice())return Ve.None;fn.INSTANCE||(fn.INSTANCE=new fn);let n=fn.INSTANCE.targets.push(t);return yt(n)}static ignoreTarget(t){if(!fn.isTouchDevice())return Ve.None;fn.INSTANCE||(fn.INSTANCE=new fn);let n=fn.INSTANCE.ignoreTargets.push(t);return yt(n)}static isTouchDevice(){return"ontouchstart"in Xi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,o=t.targetTouches.length;r<o;r++){let a=t.targetTouches.item(r);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:n,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[n],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let l=this.newGestureEvent(Mi.Start,a.target);l.pageX=a.pageX,l.pageY=a.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),o=Object.keys(this.activeTouches).length;for(let a=0,l=n.changedTouches.length;a<l;a++){let u=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let d=this.activeTouches[u.identifier],h=Date.now()-d.initialTimeStamp;if(h<fn.HOLD_DELAY&&Math.abs(d.initialPageX-Un(d.rollingPageX))<30&&Math.abs(d.initialPageY-Un(d.rollingPageY))<30){let g=this.newGestureEvent(Mi.Tap,d.initialTarget);g.pageX=Un(d.rollingPageX),g.pageY=Un(d.rollingPageY),this.dispatchEvent(g)}else if(h>=fn.HOLD_DELAY&&Math.abs(d.initialPageX-Un(d.rollingPageX))<30&&Math.abs(d.initialPageY-Un(d.rollingPageY))<30){let g=this.newGestureEvent(Mi.Contextmenu,d.initialTarget);g.pageX=Un(d.rollingPageX),g.pageY=Un(d.rollingPageY),this.dispatchEvent(g)}else if(o===1){let g=Un(d.rollingPageX),p=Un(d.rollingPageY),v=Un(d.rollingTimestamps)-d.rollingTimestamps[0],y=g-d.rollingPageX[0],S=p-d.rollingPageY[0],w=[...this.targets].filter(E=>d.initialTarget instanceof Node&&E.contains(d.initialTarget));this.inertia(t,w,r,Math.abs(y)/v,y>0?1:-1,g,Math.abs(S)/v,S>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(Mi.End,d.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===Mi.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>fn.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===Mi.Change||t.type===Mi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let o=0,a=t.initialTarget;for(;a&&a!==r;)o++,a=a.parentElement;n.push([o,r])}n.sort((r,o)=>r[0]-o[0]);for(let[r,o]of n)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,o,a,l,u,d,h){this.handle=Cf(t,()=>{let g=Date.now(),p=g-r,v=0,y=0,S=!0;o+=fn.SCROLL_FRICTION*p,u+=fn.SCROLL_FRICTION*p,o>0&&(S=!1,v=a*o*p),u>0&&(S=!1,y=d*u*p);let w=this.newGestureEvent(Mi.Change);w.translationX=v,w.translationY=y,n.forEach(E=>E.dispatchEvent(w)),S||this.inertia(t,n,g,o,a,l+v,u,d,h+y)})}onTouchMove(t){let n=Date.now();for(let r=0,o=t.changedTouches.length;r<o;r++){let a=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],u=this.newGestureEvent(Mi.Change,l.initialTarget);u.translationX=a.pageX-Un(l.rollingPageX),u.translationY=a.pageY-Un(l.rollingPageY),u.pageX=a.pageX,u.pageY=a.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(a.pageX),l.rollingPageY.push(a.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Jo.SCROLL_FRICTION=-.005,Jo.HOLD_DELAY=700,Jo.CLEAR_TAP_COUNT_TIME=400,Mt([AM],Jo,"isTouchDevice",1);var LM=Jo,Nf=class extends Ve{onclick(e,t){this._register(Ue(e,Qt.CLICK,n=>t(new Ul(Li(e),n))))}onmousedown(e,t){this._register(Ue(e,Qt.MOUSE_DOWN,n=>t(new Ul(Li(e),n))))}onmouseover(e,t){this._register(Ue(e,Qt.MOUSE_OVER,n=>t(new Ul(Li(e),n))))}onmouseleave(e,t){this._register(Ue(e,Qt.MOUSE_LEAVE,n=>t(new Ul(Li(e),n))))}onkeydown(e,t){this._register(Ue(e,Qt.KEY_DOWN,n=>t(new M_(n))))}onkeyup(e,t){this._register(Ue(e,Qt.KEY_UP,n=>t(new M_(n))))}oninput(e,t){this._register(Ue(e,Qt.INPUT,t))}onblur(e,t){this._register(Ue(e,Qt.BLUR,t))}onfocus(e,t){this._register(Ue(e,Qt.FOCUS,t))}onchange(e,t){this._register(Ue(e,Qt.CHANGE,t))}ignoreGesture(e){return LM.ignoreTarget(e)}},P_=11,OM=class extends Nf{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=P_+"px",this.domNode.style.height=P_+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Bb),this._register(D_(this.bgDomNode,Qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(D_(this.domNode,Qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new TM),this._pointerdownScheduleRepeatTimer=this._register(new Ef)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Li(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},DM=class kd{constructor(t,n,r,o,a,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,o=o|0,a=a|0,l=l|0,u=u|0),this.rawScrollLeft=o,this.rawScrollTop=u,n<0&&(n=0),o+n>r&&(o=r-n),o<0&&(o=0),a<0&&(a=0),u+a>l&&(u=l-a),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=o,this.height=a,this.scrollHeight=l,this.scrollTop=u}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new kd(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new kd(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,d=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:o,scrollLeftChanged:a,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:d}}},IM=class extends Ve{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new DM(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new F_(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=F_.start(this._state,n,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 e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},B_=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Bh(e,t){let n=t-e;return function(r){return e+n*FM(r)}}function PM(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var F_=class Ed{constructor(t,n,r,o){this.from=t,this.to=n,this.duration=o,this.startTime=r,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(t,n,r){if(Math.abs(t-n)>2.5*r){let o,a;return t<n?(o=t+.75*r,a=n-.75*r):(o=t-.75*r,a=n+.75*r),PM(Bh(t,o),Bh(a,n),.33)}return Bh(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),o=this.scrollTop(n);return new B_(r,o,!1)}return new B_(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return Ed.start(t,n,r)}static start(t,n,r){r=r+10;let o=Date.now()-10;return new Ed(t,n,o,r)}};function BM(e){return Math.pow(e,3)}function FM(e){return 1-BM(1-e)}var zM=class extends Ve{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Ef)}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 t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},jM=140,Fb=class extends Nf{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 zM(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Bb),this._shouldRender=!0,this.domNode=aa(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(Ue(this.domNode.domNode,Qt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new OM(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=aa(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ue(this.slider.domNode,Qt.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.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 t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let o=RM(this.domNode.domNode);t=e.pageX-o.left,n=e.pageY-o.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let a=this._sliderOrthogonalPointerPosition(o),l=Math.abs(a-n);if(Ob&&l>jM){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let u=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},zb=class Cd{constructor(t,n,r,o,a,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=a,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Cd(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,o,a){let l=Math.max(0,r-t),u=Math.max(0,l-2*n),d=o>0&&o>r;if(!d)return{computedAvailableSize:Math.round(l),computedIsNeeded:d,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(r*u/o))),g=(u-h)/(o-r),p=a*g;return{computedAvailableSize:Math.round(l),computedIsNeeded:d,computedSliderSize:Math.round(h),computedSliderRatio:g,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=Cd._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},UM=class extends Fb{constructor(e,t,n){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new zb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),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,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}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}},HM=class extends Fb{constructor(e,t,n){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new zb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},$M=500,z_=50,WM=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Nd=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,o=this._rear;do{let a=o===this._front?t:Math.pow(2,-r);if(t-=a,n+=this._memory[o].score*a,o===this._front)break;o=(this._capacity+o-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(xf){let n=Li(t.browserEvent),r=tM(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let o=null,a=new WM(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=a,this._front=0,this._rear=0):(o=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]=a),a.score=this._computeScore(a,o)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),d=Math.max(Math.min(o,l),1),h=Math.max(Math.min(a,u),1),g=Math.max(o,l),p=Math.max(a,u);g%d===0&&p%h===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Nd.INSTANCE=new Nd;var KM=Nd,qM=class extends Nf{constructor(e,t,n){super(),this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new me),this.onWillScroll=this._onWillScroll.event,this._options=GM(t),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new HM(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new UM(this._scrollable,this._options,r)),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(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=aa(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=aa(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=aa(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Ef),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=us(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Oi&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new L_(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=us(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new L_(n))};this._mouseWheelToDispose.push(Ue(this._listenOnDomNode,Qt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let t=KM.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let u=!Oi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let d=this._scrollable.getFutureScrollPosition(),h={};if(a){let g=z_*a,p=d.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(h,p)}if(l){let g=z_*l,p=d.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(h,p)}h=this._scrollable.validateScrollPosition(h),(d.scrollLeft!==h.scrollLeft||d.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||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 e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",o=t?" top":"",a=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){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(),$M)}},VM=class extends qM{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function GM(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Oi&&(t.className+=" mac"),t}var Td=class extends Ve{constructor(e,t,n,r,o,a,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new IM({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>Cf(r.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new VM(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ln.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(yt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(yt(()=>this._styleElement.remove())),this._register(ln.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
107
|
-
`)})),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(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,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 t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Td=Mt([Se(2,xn),Se(3,Qi),Se(4,yb),Se(5,eo),Se(6,kn),Se(7,Ji)],Td);var Rd=class extends Ve{constructor(e,t,n,r,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=o,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(a=>this._removeDecoration(a))),this._register(yt(()=>{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 t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Rd=Mt([Se(1,xn),Se(2,Qi),Se(3,ba),Se(4,Ji)],Rd);var YM=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 t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,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,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Ni={full:0,left:0,center:0,right:0},xr={full:0,left:0,center:0,right:0},Wo={full:0,left:0,center:0,right:0},hc=class extends Ve{constructor(e,t,n,r,o,a,l,u){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=o,this._optionsService=a,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new YM,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(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(yt(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let d=this._canvas.getContext("2d");if(d)this._ctx=d;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),t=Math.ceil((this._canvas.width-1)/3);xr.full=this._canvas.width,xr.left=e,xr.center=t,xr.right=e,this._refreshDrawHeightConstants(),Wo.full=1,Wo.left=1,Wo.center=1+xr.left,Wo.right=1+xr.left+xr.center}_refreshDrawHeightConstants(){Ni.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ni.left=t,Ni.center=t,Ni.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ni.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ni.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ni.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ni.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);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(Wo[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ni[e.position||"full"]/2),xr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ni[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};hc=Mt([Se(2,xn),Se(3,ba),Se(4,Ji),Se(5,kn),Se(6,eo),Se(7,Qi)],hc);var se;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
108
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(se||(se={}));var Zl;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Zl||(Zl={}));var jb;(e=>e.ST=`${se.ESC}\\`)(jb||(jb={}));var Md=class{constructor(e,t,n,r,o,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=o,this._renderService=a,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 t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${se.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Md=Mt([Se(2,xn),Se(3,kn),Se(4,ps),Se(5,Ji)],Md);var Jt=0,en=0,tn=0,Rt=0,j_={css:"#00000000",rgba:0},jt;(e=>{function t(o,a,l,u){return u!==void 0?`#${Qr(o)}${Qr(a)}${Qr(l)}${Qr(u)}`:`#${Qr(o)}${Qr(a)}${Qr(l)}`}e.toCss=t;function n(o,a,l,u=255){return(o<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function r(o,a,l,u){return{css:e.toCss(o,a,l,u),rgba:e.toRgba(o,a,l,u)}}e.toColor=r})(jt||(jt={}));var gt;(e=>{function t(d,h){if(Rt=(h.rgba&255)/255,Rt===1)return{css:h.css,rgba:h.rgba};let g=h.rgba>>24&255,p=h.rgba>>16&255,v=h.rgba>>8&255,y=d.rgba>>24&255,S=d.rgba>>16&255,w=d.rgba>>8&255;Jt=y+Math.round((g-y)*Rt),en=S+Math.round((p-S)*Rt),tn=w+Math.round((v-w)*Rt);let E=jt.toCss(Jt,en,tn),k=jt.toRgba(Jt,en,tn);return{css:E,rgba:k}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function r(d,h,g){let p=Ql.ensureContrastRatio(d.rgba,h.rgba,g);if(p)return jt.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function o(d){let h=(d.rgba|255)>>>0;return[Jt,en,tn]=Ql.toChannels(h),{css:jt.toCss(Jt,en,tn),rgba:h}}e.opaque=o;function a(d,h){return Rt=Math.round(h*255),[Jt,en,tn]=Ql.toChannels(d.rgba),{css:jt.toCss(Jt,en,tn,Rt),rgba:jt.toRgba(Jt,en,tn,Rt)}}e.opacity=a;function l(d,h){return Rt=d.rgba&255,a(d,Rt*h/255)}e.multiplyOpacity=l;function u(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=u})(gt||(gt={}));var Ct;(e=>{let t,n;try{let o=document.createElement("canvas");o.width=1,o.height=1;let a=o.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return Jt=parseInt(o.slice(1,2).repeat(2),16),en=parseInt(o.slice(2,3).repeat(2),16),tn=parseInt(o.slice(3,4).repeat(2),16),jt.toColor(Jt,en,tn);case 5:return Jt=parseInt(o.slice(1,2).repeat(2),16),en=parseInt(o.slice(2,3).repeat(2),16),tn=parseInt(o.slice(3,4).repeat(2),16),Rt=parseInt(o.slice(4,5).repeat(2),16),jt.toColor(Jt,en,tn,Rt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let a=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return Jt=parseInt(a[1]),en=parseInt(a[2]),tn=parseInt(a[3]),Rt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),jt.toColor(Jt,en,tn,Rt);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Jt,en,tn,Rt]=t.getImageData(0,0,1,1).data,Rt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:jt.toRgba(Jt,en,tn,Rt),css:o}}e.toColor=r})(Ct||(Ct={}));var bn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,o,a){let l=r/255,u=o/255,d=a/255,h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return h*.2126+g*.7152+p*.0722}e.relativeLuminance2=n})(bn||(bn={}));var Ql;(e=>{function t(l,u){if(Rt=(u&255)/255,Rt===1)return u;let d=u>>24&255,h=u>>16&255,g=u>>8&255,p=l>>24&255,v=l>>16&255,y=l>>8&255;return Jt=p+Math.round((d-p)*Rt),en=v+Math.round((h-v)*Rt),tn=y+Math.round((g-y)*Rt),jt.toRgba(Jt,en,tn)}e.blend=t;function n(l,u,d){let h=bn.relativeLuminance(l>>8),g=bn.relativeLuminance(u>>8);if(Yi(h,g)<d){if(g<h){let y=r(l,u,d),S=Yi(h,bn.relativeLuminance(y>>8));if(S<d){let w=o(l,u,d),E=Yi(h,bn.relativeLuminance(w>>8));return S>E?y:w}return y}let p=o(l,u,d),v=Yi(h,bn.relativeLuminance(p>>8));if(v<d){let y=r(l,u,d),S=Yi(h,bn.relativeLuminance(y>>8));return v>S?p:y}return p}}e.ensureContrastRatio=n;function r(l,u,d){let h=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,S=u>>8&255,w=Yi(bn.relativeLuminance2(v,y,S),bn.relativeLuminance2(h,g,p));for(;w<d&&(v>0||y>0||S>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=Yi(bn.relativeLuminance2(v,y,S),bn.relativeLuminance2(h,g,p));return(v<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=r;function o(l,u,d){let h=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,S=u>>8&255,w=Yi(bn.relativeLuminance2(v,y,S),bn.relativeLuminance2(h,g,p));for(;w<d&&(v<255||y<255||S<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Yi(bn.relativeLuminance2(v,y,S),bn.relativeLuminance2(h,g,p));return(v<<24|y<<16|S<<8|255)>>>0}e.increaseLuminance=o;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(Ql||(Ql={}));function Qr(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Yi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var XM=class extends ya{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},dc=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new si}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),o=0,a=0,l=0,u=t.getFg(0),d=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==d){if(h-o>1){let g=this._getJoinedRanges(r,l,a,t,o);for(let p=0;p<g.length;p++)n.push(g[p])}o=h,l=a,u=this._workCell.fg,d=this._workCell.bg}a+=this._workCell.getChars().length||Cr.length}if(this._bufferService.cols-o>1){let h=this._getJoinedRanges(r,l,a,t,o);for(let g=0;g<h.length;g++)n.push(h[g])}return n}_getJoinedRanges(e,t,n,r,o){let a=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(a)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let d=this._characterJoiners[u].handler(a);for(let h=0;h<d.length;h++)dc._mergeRanges(l,d[h])}catch(d){console.error(d)}return this._stringRangesToCellRanges(l,r,o),l}_stringRangesToCellRanges(e,t,n){let r=0,o=!1,a=0,l=e[r];if(l){for(let u=n;u<this._bufferService.cols;u++){let d=t.getWidth(u),h=t.getString(u).length||Cr.length;if(d!==0){if(!o&&l[0]<=a&&(l[0]=u,o=!0),l[1]<=a){if(l[1]=u,l=e[++r],!l)break;l[0]<=a?(l[0]=u,o=!0):o=!1}a+=h}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(n){if(t[1]<=o[0])return e[r-1][1]=t[1],e;if(t[1]<=o[1])return e[r-1][1]=Math.max(t[1],o[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=o[0])return e.splice(r,0,t),e;if(t[1]<=o[1])return o[0]=Math.min(t[0],o[0]),e;t[0]<o[1]&&(o[0]=Math.min(t[0],o[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};dc=Mt([Se(0,xn)],dc);function ZM(e){return 57508<=e&&e<=57558}function QM(e){return 9472<=e&&e<=9631}function JM(e){return ZM(e)||QM(e)}function eA(){return{css:{canvas:Hl(),cell:Hl()},device:{canvas:Hl(),cell:Hl(),char:{width:0,height:0,left:0,top:0}}}}function Hl(){return{width:0,height:0}}var Ad=class{constructor(e,t,n,r,o,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=o,this._decorationService=a,this._themeService=l,this._workCell=new si,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,o,a,l,u,d,h,g){let p=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,S=e.getNoBgTrimmedLength();n&&S<a+1&&(S=a+1);let w,E=0,k="",R=0,T=0,A=0,V=0,D=!1,ne=0,Z=!1,ee=0,W=0,H=[],U=h!==-1&&g!==-1;for(let O=0;O<S;O++){e.loadCell(O,this._workCell);let q=this._workCell.getWidth();if(q===0)continue;let F=!1,Q=O>=W,ie=O,M=this._workCell;if(v.length>0&&O===v[0][0]&&Q){let Re=v.shift(),In=this._isCellInSelection(Re[0],t);for(R=Re[0]+1;R<Re[1];R++)Q&&(Q=In===this._isCellInSelection(R,t));Q&&(Q=!n||a<Re[0]||a>=Re[1]),Q?(F=!0,M=new XM(this._workCell,e.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),ie=Re[1]-1,q=M.getWidth()):W=Re[1]}let Y=this._isCellInSelection(O,t),C=n&&O===a,I=U&&O>=h&&O<=g,P=!1;this._decorationService.forEachDecorationAtCell(O,t,void 0,Re=>{P=!0});let N=M.getChars()||Cr;if(N===" "&&(M.isUnderline()||M.isOverline())&&(N=" "),ee=q*u-d.get(N,M.isBold(),M.isItalic()),!w)w=this._document.createElement("span");else if(E&&(Y&&Z||!Y&&!Z&&M.bg===T)&&(Y&&Z&&y.selectionForeground||M.fg===A)&&M.extended.ext===V&&I===D&&ee===ne&&!C&&!F&&!P&&Q){M.isInvisible()?k+=Cr:k+=N,E++;continue}else E&&(w.textContent=k),w=this._document.createElement("span"),E=0,k="";if(T=M.bg,A=M.fg,V=M.extended.ext,D=I,ne=ee,Z=Y,F&&a>=O&&a<=ie&&(a=O),!this._coreService.isCursorHidden&&C&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&H.push("xterm-cursor-blink"),H.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":H.push("xterm-cursor-outline");break;case"block":H.push("xterm-cursor-block");break;case"bar":H.push("xterm-cursor-bar");break;case"underline":H.push("xterm-cursor-underline");break}}if(M.isBold()&&H.push("xterm-bold"),M.isItalic()&&H.push("xterm-italic"),M.isDim()&&H.push("xterm-dim"),M.isInvisible()?k=Cr:k=M.getChars()||Cr,M.isUnderline()&&(H.push(`xterm-underline-${M.extended.underlineStyle}`),k===" "&&(k=" "),!M.isUnderlineColorDefault()))if(M.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${ya.toColorRGB(M.getUnderlineColor()).join(",")})`;else{let Re=M.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&M.isBold()&&Re<8&&(Re+=8),w.style.textDecorationColor=y.ansi[Re].css}M.isOverline()&&(H.push("xterm-overline"),k===" "&&(k=" ")),M.isStrikethrough()&&H.push("xterm-strikethrough"),I&&(w.style.textDecoration="underline");let ae=M.getFgColor(),ye=M.getFgColorMode(),z=M.getBgColor(),pe=M.getBgColorMode(),ve=!!M.isInverse();if(ve){let Re=ae;ae=z,z=Re;let In=ye;ye=pe,pe=In}let be,Be,st=!1;this._decorationService.forEachDecorationAtCell(O,t,void 0,Re=>{Re.options.layer!=="top"&&st||(Re.backgroundColorRGB&&(pe=50331648,z=Re.backgroundColorRGB.rgba>>8&16777215,be=Re.backgroundColorRGB),Re.foregroundColorRGB&&(ye=50331648,ae=Re.foregroundColorRGB.rgba>>8&16777215,Be=Re.foregroundColorRGB),st=Re.options.layer==="top")}),!st&&Y&&(be=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,z=be.rgba>>8&16777215,pe=50331648,st=!0,y.selectionForeground&&(ye=50331648,ae=y.selectionForeground.rgba>>8&16777215,Be=y.selectionForeground)),st&&H.push("xterm-decoration-top");let It;switch(pe){case 16777216:case 33554432:It=y.ansi[z],H.push(`xterm-bg-${z}`);break;case 50331648:It=jt.toColor(z>>16,z>>8&255,z&255),this._addStyle(w,`background-color:#${U_((z>>>0).toString(16),"0",6)}`);break;case 0:default:ve?(It=y.foreground,H.push("xterm-bg-257")):It=y.background}switch(be||M.isDim()&&(be=gt.multiplyOpacity(It,.5)),ye){case 16777216:case 33554432:M.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(w,It,y.ansi[ae],M,be,void 0)||H.push(`xterm-fg-${ae}`);break;case 50331648:let Re=jt.toColor(ae>>16&255,ae>>8&255,ae&255);this._applyMinimumContrast(w,It,Re,M,be,Be)||this._addStyle(w,`color:#${U_(ae.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,It,y.foreground,M,be,Be)||ve&&H.push("xterm-fg-257")}H.length&&(w.className=H.join(" "),H.length=0),!C&&!F&&!P&&Q?E++:w.textContent=k,ee!==this.defaultSpacing&&(w.style.letterSpacing=`${ee}px`),p.push(w),O=ie}return w&&E&&(w.textContent=k),p}_applyMinimumContrast(e,t,n,r,o,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||JM(r.getCode()))return!1;let l=this._getContrastCache(r),u;if(!o&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=gt.ensureContrastRatio(o||t,a||n,d),l.setColor((o||t).rgba,(a||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};Ad=Mt([Se(1,wb),Se(2,kn),Se(3,Qi),Se(4,ps),Se(5,ba),Se(6,eo)],Ad);function U_(e,t,n){for(;e.length<n;)e=t+e;return e}var tA=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[n,r,o,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(o),this._container.appendChild(a),t.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,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let l=this._measure(e,0);return l>0&&(this._flat[r]=l),l}let o=e;t&&(o+="B"),n&&(o+="I");let a=this._holey.get(o);if(a===void 0){let l=0;t&&(l|=1),n&&(l|=2),a=this._measure(e,l),a>0&&this._holey.set(o,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},nA=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,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let o=e.buffers.active.ydisp,a=t[1]-o,l=n[1]-o,u=Math.max(a,0),d=Math.min(l,e.rows-1);if(u>=e.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=l,this.viewportCappedStartRow=u,this.viewportCappedEndRow=d,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function iA(){return new nA}var Fh="xterm-dom-renderer-owner-",ti="xterm-rows",$l="xterm-fg-",H_="xterm-bg-",Ko="xterm-focus",Wl="xterm-selection",rA=1,Ld=class extends Ve{constructor(e,t,n,r,o,a,l,u,d,h,g,p,v,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=o,this._helperContainer=a,this._linkifier2=l,this._charSizeService=d,this._optionsService=h,this._bufferService=g,this._coreService=p,this._coreBrowserService=v,this._themeService=y,this._terminalClass=rA++,this._rowElements=[],this._selectionRenderModel=iA(),this.onRequestRedraw=this._register(new me).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(ti),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(Wl),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=eA(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(Ad,document),this._element.classList.add(Fh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(yt(()=>{this._element.classList.remove(Fh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new tA(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${ti} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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 t=`${this._terminalSelector} .${ti} { 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}`;t+=`${this._terminalSelector} .${ti} .xterm-dim { color: ${gt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${ti}.${Ko} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${ti}.${Ko} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${ti}.${Ko} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${ti} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${ti} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${ti} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${ti} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${ti} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Wl} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Wl} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Wl} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${$l}${a} { color: ${l.css}; }${this._terminalSelector} .${$l}${a}.xterm-dim { color: ${gt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${H_}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${$l}257 { color: ${gt.opaque(e.background).css}; }${this._terminalSelector} .${$l}257.xterm-dim { color: ${gt.multiplyOpacity(gt.opaque(e.background),.5).css}; }${this._terminalSelector} .${H_}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_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,t){for(let n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(Ko),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ko),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let d=e[0]>t[0];u.appendChild(this._createSelectionElement(a,d?t[0]:e[0],d?e[0]:t[0],l-a+1))}else{let d=r===a?e[0]:0,h=a===o?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,d,h));let g=l-a-1;if(u.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,g)),a!==l){let p=o===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,p))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let o=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return a+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-a),o.style.height=`${r*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${a}px`,o.style.width=`${l}px`,o}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,t){let n=this._bufferService.buffer,r=n.ybase+n.y,o=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=e;d<=t;d++){let h=d+n.ydisp,g=this._rowElements[d],p=n.lines.get(h);if(!g||!p)break;g.replaceChildren(...this._rowFactory.createRow(p,h,h===r,l,u,o,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Fh}${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,t,n,r,o,a){n<0&&(e=0),r<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),r=Math.max(Math.min(r,l),0),o=Math.min(o,this._bufferService.cols);let u=this._bufferService.buffer,d=u.ybase+u.y,h=Math.min(u.x,o-1),g=this._optionsService.rawOptions.cursorBlink,p=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=r;++y){let S=y+u.ydisp,w=this._rowElements[y],E=u.lines.get(S);if(!w||!E)break;w.replaceChildren(...this._rowFactory.createRow(E,S,S===d,p,v,h,g,this.dimensions.css.cell.width,this._widthCache,a?y===n?e:0:-1,a?(y===r?t:o)-1:-1))}}};Ld=Mt([Se(7,bf),Se(8,Ec),Se(9,kn),Se(10,xn),Se(11,ps),Se(12,Qi),Se(13,eo)],Ld);var Od=class extends Ve{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new me),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new oA(this._optionsService))}catch{this._measureStrategy=this._register(new sA(e,t,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())}};Od=Mt([Se(2,kn)],Od);var Ub=class extends Ve{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},sA=class extends Ub{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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}},oA=class extends Ub{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},aA=class extends Ve{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new lA(this._window)),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new me),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(ln.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ue(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ue(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}},lA=class extends Ve{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Xs),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(yt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ue(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)}},cA=class extends Ve{constructor(){super(),this.linkProviders=[],this._register(yt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Tf(e,t,n){let r=n.getBoundingClientRect(),o=e.getComputedStyle(n),a=parseInt(o.getPropertyValue("padding-left")),l=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-r.left-a,t.clientY-r.top-l]}function uA(e,t,n,r,o,a,l,u,d){if(!a)return;let h=Tf(e,t,n);if(h)return h[0]=Math.ceil((h[0]+(d?l/2:0))/l),h[1]=Math.ceil(h[1]/u),h[0]=Math.min(Math.max(h[0],1),r+(d?1:0)),h[1]=Math.min(Math.max(h[1],1),o),h}var Dd=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,o){return uA(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let n=Tf(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Dd=Mt([Se(0,Ji),Se(1,Ec)],Dd);var hA=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t,!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),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Hb={};SR(Hb,{getSafariVersion:()=>fA,isChromeOS:()=>qb,isFirefox:()=>$b,isIpad:()=>pA,isIphone:()=>mA,isLegacyEdge:()=>dA,isLinux:()=>Rf,isMac:()=>fc,isNode:()=>Cc,isSafari:()=>Wb,isWindows:()=>Kb});var Cc=typeof process<"u"&&"title"in process,Sa=Cc?"node":navigator.userAgent,wa=Cc?"node":navigator.platform,$b=Sa.includes("Firefox"),dA=Sa.includes("Edge"),Wb=/^((?!chrome|android).)*safari/i.test(Sa);function fA(){if(!Wb)return 0;let e=Sa.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var fc=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(wa),pA=wa==="iPad",mA=wa==="iPhone",Kb=["Windows","Win16","Win32","WinCE"].includes(wa),Rf=wa.indexOf("Linux")>=0,qb=/\bCrOS\b/.test(Sa),Vb=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),o=e.timeRemaining(),n*1.5>o){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=o}this.clear()}},gA=class extends Vb{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},_A=class extends Vb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},pc=!Cc&&"requestIdleCallback"in window?_A:gA,vA=class{constructor(){this._queue=new pc}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Id=class extends Ve{constructor(e,t,n,r,o,a,l,u,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=o,this._coreBrowserService=u,this._renderer=this._register(new Xs),this._pausedResizeTask=new vA,this._observerDisposable=this._register(new Xs),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new me),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new me),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new me),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new hA((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new yA(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(yt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.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(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=yt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),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:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(t=>this.refreshRows(t.start,t.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,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),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,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Id=Mt([Se(2,kn),Se(3,Ec),Se(4,ps),Se(5,ba),Se(6,xn),Se(7,Qi),Se(8,eo)],Id);var yA=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,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 e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function bA(e,t,n,r){let o=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return xA(o,a,e,t,n,r)+Nc(a,t,n,r)+kA(o,a,e,t,n,r);let l;if(a===t)return l=o>e?"D":"C",fa(Math.abs(o-e),da(l,r));l=a>t?"D":"C";let u=Math.abs(a-t),d=wA(a>t?e:o,n)+(u-1)*n.cols+1+SA(a>t?o:e);return fa(d,da(l,r))}function SA(e,t){return e-1}function wA(e,t){return t.cols-e}function xA(e,t,n,r,o,a){return Nc(t,r,o,a).length===0?"":fa(Yb(e,t,e,t-hs(t,o),!1,o).length,da("D",a))}function Nc(e,t,n,r){let o=e-hs(e,n),a=t-hs(t,n),l=Math.abs(o-a)-EA(e,t,n);return fa(l,da(Gb(e,t),r))}function kA(e,t,n,r,o,a){let l;Nc(t,r,o,a).length>0?l=r-hs(r,o):l=t;let u=r,d=CA(e,t,n,r,o,a);return fa(Yb(e,l,n,u,d==="C",o).length,da(d,a))}function EA(e,t,n){var l;let r=0,o=e-hs(e,n),a=t-hs(t,n);for(let u=0;u<Math.abs(o-a);u++){let d=Gb(e,t)==="A"?-1:1;(l=n.buffer.lines.get(o+d*u))!=null&&l.isWrapped&&r++}return r}function hs(e,t){let n=0,r=t.buffer.lines.get(e),o=r==null?void 0:r.isWrapped;for(;o&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),o=r==null?void 0:r.isWrapped;return n}function CA(e,t,n,r,o,a){let l;return Nc(n,r,o,a).length>0?l=r-hs(r,o):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function Gb(e,t){return e>t?"A":"B"}function Yb(e,t,n,r,o,a){let l=e,u=t,d="";for(;(l!==n||u!==r)&&u>=0&&u<a.buffer.lines.length;)l+=o?1:-1,o&&l>a.cols-1?(d+=a.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!o&&l<0&&(d+=a.buffer.translateBufferLineToString(u,!1,0,e+1),l=a.cols-1,e=l,u--);return d+a.buffer.translateBufferLineToString(u,!1,e,l)}function da(e,t){let n=t?"O":"[";return se.ESC+n+e}function fa(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var NA=class{constructor(e){this._bufferService=e,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 e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function $_(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var zh=50,TA=15,RA=50,MA=500,AA=" ",LA=new RegExp(AA,"g"),Pd=class extends Ve{constructor(e,t,n,r,o,a,l,u,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=o,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new si,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new me),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new me),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new NA(this._bufferService),this._activeSelectionMode=0,this._register(yt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.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,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,o,a);r.push(u)}}else{let o=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],o));for(let a=e[1]+1;a<=t[1]-1;a++){let l=n.lines.get(a),u=n.translateBufferLineToString(a,!0);l!=null&&l.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let a=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(o=>o.replace(LA," ")).join(Kb?`\r
|
|
109
|
-
`:`
|
|
110
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Rf&&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 t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var o,a;let n=(a=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:a.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=$_(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Tf(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-zh),zh),t/=zh,t/Math.abs(t)+Math.round(t*(TA-1)))}shouldForceSelection(e){return fc?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(),RA)}_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 t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(fc&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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 t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<MA&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=bA(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let o=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:o>1&&t!==r&&(n+=o-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,a=o.lines.get(e[1]);if(!a)return;let l=o.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(a,e[0]),d=u,h=e[0]-u,g=0,p=0,v=0,y=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;d<l.length&&l.charAt(d+1)===" ";)d++}else{let E=e[0],k=e[0];a.getWidth(E)===0&&(g++,E--),a.getWidth(k)===2&&(p++,k++);let R=a.getString(k).length;for(R>1&&(y+=R-1,d+=R-1);E>0&&u>0&&!this._isCharWordSeparator(a.loadCell(E-1,this._workCell));){a.loadCell(E-1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,E--):T>1&&(v+=T-1,u-=T-1),u--,E--}for(;k<a.length&&d+1<l.length&&!this._isCharWordSeparator(a.loadCell(k+1,this._workCell));){a.loadCell(k+1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,k++):T>1&&(y+=T-1,d+=T-1),d++,k++}}d++;let S=u+h-g+v,w=Math.min(this._bufferService.cols,d-u+g+p-v-y);if(!(!t&&l.slice(u,d).trim()==="")){if(n&&S===0&&a.getCodePoint(0)!==32){let E=o.lines.get(e[1]-1);if(E&&a.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let R=this._bufferService.cols-k.start;S-=R,w+=R}}}if(r&&S+w===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let E=o.lines.get(e[1]+1);if(E!=null&&E.isWrapped&&E.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(w+=k.length)}}return{start:S,length:w}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=$_(n,this._bufferService.cols)}};Pd=Mt([Se(3,xn),Se(4,ps),Se(5,Sf),Se(6,kn),Se(7,Ji),Se(8,Qi)],Pd);var W_=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},K_=class{constructor(){this._color=new W_,this._css=new W_}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Kt=Object.freeze((()=>{let e=[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")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],o=t[n/6%6|0],a=t[n%6];e.push({css:jt.toCss(r,o,a),rgba:jt.toRgba(r,o,a)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:jt.toCss(r,r,r),rgba:jt.toRgba(r,r,r)})}return e})()),es=Ct.toColor("#ffffff"),ea=Ct.toColor("#000000"),q_=Ct.toColor("#ffffff"),V_=ea,qo={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},OA=es,Bd=class extends Ve{constructor(e){super(),this._optionsService=e,this._contrastCache=new K_,this._halfContrastCache=new K_,this._onChangeColors=this._register(new me),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:es,background:ea,cursor:q_,cursorAccent:V_,selectionForeground:void 0,selectionBackgroundTransparent:qo,selectionBackgroundOpaque:gt.blend(ea,qo),selectionInactiveBackgroundTransparent:qo,selectionInactiveBackgroundOpaque:gt.blend(ea,qo),scrollbarSliderBackground:gt.opacity(es,.2),scrollbarSliderHoverBackground:gt.opacity(es,.4),scrollbarSliderActiveBackground:gt.opacity(es,.5),overviewRulerBorder:es,ansi:Kt.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 t=this._colors;if(t.foreground=at(e.foreground,es),t.background=at(e.background,ea),t.cursor=gt.blend(t.background,at(e.cursor,q_)),t.cursorAccent=gt.blend(t.background,at(e.cursorAccent,V_)),t.selectionBackgroundTransparent=at(e.selectionBackground,qo),t.selectionBackgroundOpaque=gt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=at(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=gt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?at(e.selectionForeground,j_):void 0,t.selectionForeground===j_&&(t.selectionForeground=void 0),gt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=gt.opacity(t.selectionBackgroundTransparent,.3)),gt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=gt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=at(e.scrollbarSliderBackground,gt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=at(e.scrollbarSliderHoverBackground,gt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=at(e.scrollbarSliderActiveBackground,gt.opacity(t.foreground,.5)),t.overviewRulerBorder=at(e.overviewRulerBorder,OA),t.ansi=Kt.slice(),t.ansi[0]=at(e.black,Kt[0]),t.ansi[1]=at(e.red,Kt[1]),t.ansi[2]=at(e.green,Kt[2]),t.ansi[3]=at(e.yellow,Kt[3]),t.ansi[4]=at(e.blue,Kt[4]),t.ansi[5]=at(e.magenta,Kt[5]),t.ansi[6]=at(e.cyan,Kt[6]),t.ansi[7]=at(e.white,Kt[7]),t.ansi[8]=at(e.brightBlack,Kt[8]),t.ansi[9]=at(e.brightRed,Kt[9]),t.ansi[10]=at(e.brightGreen,Kt[10]),t.ansi[11]=at(e.brightYellow,Kt[11]),t.ansi[12]=at(e.brightBlue,Kt[12]),t.ansi[13]=at(e.brightMagenta,Kt[13]),t.ansi[14]=at(e.brightCyan,Kt[14]),t.ansi[15]=at(e.brightWhite,Kt[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=at(e.extendedAnsi[r],Kt[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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};Bd=Mt([Se(0,kn)],Bd);function at(e,t){if(e!==void 0)try{return Ct.toColor(e)}catch{}return t}var DA=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},IA=class{constructor(){this._services=new DA,this._services.set(bf,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=TR(e).sort((a,l)=>a.index-l.index),r=[];for(let a of n){let l=this._services.get(a.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);r.push(l)}let o=n.length>0?n[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},PA={trace:0,debug:1,info:2,warn:3,error:4,off:5},BA="xterm.js: ",Fd=class extends Ve{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=PA[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":BA)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};Fd=Mt([Se(0,kn)],Fd);var G_=class extends Ve{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new me),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new me),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new me),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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,t,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let o=t-1;o>=0;o--)this.set(e+o+n,this.get(e+o));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},qe=3,zt=Object.freeze(new ya),Kl=0,jh=2,ta=class Xb{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*qe);let o=n||si.fromCharData([0,mb,1,0]);for(let a=0;a<t;++a)this.setCell(a,o);this.length=t}get(t){let n=this._data[t*qe+0],r=n&2097151;return[this._data[t*qe+1],n&2097152?this._combined[t]:r?Er(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*qe+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*qe+0]=t|2097152|n[2]<<22):this._data[t*qe+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*qe+0]>>22}hasWidth(t){return this._data[t*qe+0]&12582912}getFg(t){return this._data[t*qe+1]}getBg(t){return this._data[t*qe+2]}hasContent(t){return this._data[t*qe+0]&4194303}getCodePoint(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*qe+0]&2097152}getString(t){let n=this._data[t*qe+0];return n&2097152?this._combined[t]:n&2097151?Er(n&2097151):""}isProtected(t){return this._data[t*qe+2]&536870912}loadCell(t,n){return Kl=t*qe,n.content=this._data[Kl+0],n.fg=this._data[Kl+1],n.bg=this._data[Kl+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*qe+0]=n.content,this._data[t*qe+1]=n.fg,this._data[t*qe+2]=n.bg}setCellFromCodepoint(t,n,r,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*qe+0]=n|r<<22,this._data[t*qe+1]=o.fg,this._data[t*qe+2]=o.bg}addCodepointToCell(t,n,r){let o=this._data[t*qe+0];o&2097152?this._combined[t]+=Er(n):o&2097151?(this._combined[t]=Er(o&2097151)+Er(n),o&=-2097152,o|=2097152):o=n|1<<22,r&&(o&=-12582913,o|=r<<22),this._data[t*qe+0]=o}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let o=new si;for(let a=this.length-t-n-1;a>=0;--a)this.setCell(t+n+a,this.loadCell(t+a,o));for(let a=0;a<n;++a)this.setCell(t+a,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let o=new si;for(let a=0;a<this.length-t-n;++a)this.setCell(t+a,this.loadCell(t+n+a,o));for(let a=this.length-n;a<this.length;++a)this.setCell(a,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*jh<this._data.buffer.byteLength;let r=t*qe;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let o=new Uint32Array(r);o.set(this._data),this._data=o}for(let o=this.length;o<t;++o)this.setCell(o,n)}else{this._data=this._data.subarray(0,r);let o=Object.keys(this._combined);for(let l=0;l<o.length;l++){let u=parseInt(o[l],10);u>=t&&delete this._combined[u]}let a=Object.keys(this._extendedAttrs);for(let l=0;l<a.length;l++){let u=parseInt(a[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*jh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*jh<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new Xb(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*qe+0]&4194303)return t+(this._data[t*qe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*qe+0]&4194303||this._data[t*qe+2]&50331648)return t+(this._data[t*qe+0]>>22);return 0}copyCellsFrom(t,n,r,o,a){let l=t._data;if(a)for(let d=o-1;d>=0;d--){for(let h=0;h<qe;h++)this._data[(r+d)*qe+h]=l[(n+d)*qe+h];l[(n+d)*qe+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[n+d])}else for(let d=0;d<o;d++){for(let h=0;h<qe;h++)this._data[(r+d)*qe+h]=l[(n+d)*qe+h];l[(n+d)*qe+2]&268435456&&(this._extendedAttrs[r+d]=t._extendedAttrs[n+d])}let u=Object.keys(t._combined);for(let d=0;d<u.length;d++){let h=parseInt(u[d],10);h>=n&&(this._combined[h-n+r]=t._combined[h])}}translateToString(t,n,r,o){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),o&&(o.length=0);let a="";for(;n<r;){let l=this._data[n*qe+0],u=l&2097151,d=l&2097152?this._combined[n]:u?Er(u):Cr;if(a+=d,o)for(let h=0;h<d.length;++h)o.push(n);n+=l>>22||1}return o&&o.push(n),a}};function FA(e,t,n,r,o,a){let l=[];for(let u=0;u<e.length-1;u++){let d=u,h=e.get(++d);if(!h.isWrapped)continue;let g=[e.get(u)];for(;d<e.length&&h.isWrapped;)g.push(h),h=e.get(++d);if(!a&&r>=u&&r<d){u+=g.length-1;continue}let p=0,v=pa(g,p,t),y=1,S=0;for(;y<g.length;){let E=pa(g,y,t),k=E-S,R=n-v,T=Math.min(k,R);g[p].copyCellsFrom(g[y],S,v,T,!1),v+=T,v===n&&(p++,v=0),S+=T,S===E&&(y++,S=0),v===0&&p!==0&&g[p-1].getWidth(n-1)===2&&(g[p].copyCellsFrom(g[p-1],n-1,v++,1,!1),g[p-1].setCell(n-1,o))}g[p].replaceCells(v,n,o);let w=0;for(let E=g.length-1;E>0&&(E>p||g[E].getTrimmedLength()===0);E--)w++;w>0&&(l.push(u+g.length-w),l.push(w)),u+=g.length-1}return l}function zA(e,t){let n=[],r=0,o=t[r],a=0;for(let l=0;l<e.length;l++)if(o===l){let u=t[++r];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,o=t[++r]}else n.push(l);return{layout:n,countRemoved:a}}function jA(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function UA(e,t,n){let r=[],o=e.map((d,h)=>pa(e,h,t)).reduce((d,h)=>d+h),a=0,l=0,u=0;for(;u<o;){if(o-u<n){r.push(o-u);break}a+=n;let d=pa(e,l,t);a>d&&(a-=d,l++);let h=e[l].getWidth(a-1)===2;h&&a--;let g=h?n-1:n;r.push(g),u+=g}return r}function pa(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,o=e[t+1].getWidth(0)===2;return r&&o?n-1:n}var Zb=class Qb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Qb._nextId++,this._onDispose=this.register(new me),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),us(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};Zb._nextId=1;var HA=Zb,Vt={},ts=Vt.B;Vt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Vt.A={"#":"£"};Vt.B=void 0;Vt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Vt.C=Vt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Vt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Vt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Vt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Vt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Vt.E=Vt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Vt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Vt.H=Vt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Vt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Y_=4294967295,X_=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=zt.clone(),this.savedCharset=ts,this.markers=[],this._nullCell=si.fromCharData([0,mb,1,0]),this._whitespaceCell=si.fromCharData([0,Cr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new pc,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new G_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new uc),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new uc),this._whitespaceCell}getBlankLine(e,t){return new ta(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Y_?Y_:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=zt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new G_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(zt),r=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,n);let a=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new ta(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new ta(e,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let l=this.lines.length-o;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=FA(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(zt),n);if(r.length>0){let o=zA(this.lines,r);jA(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(zt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new ta(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(zt),o=[],a=0;for(let l=this.lines.length-1;l>=0;l--){let u=this.lines.get(l);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let d=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),d.unshift(u);if(!n){let T=this.ybase+this.y;if(T>=l&&T<l+d.length)continue}let h=d[d.length-1].getTrimmedLength(),g=UA(d,this._cols,e),p=g.length-d.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+p):v=Math.max(0,this.lines.length-this.lines.maxLength+p);let y=[];for(let T=0;T<p;T++){let A=this.getBlankLine(zt,!0);y.push(A)}y.length>0&&(o.push({start:l+d.length+a,newLines:y}),a+=y.length),d.push(...y);let S=g.length-1,w=g[S];w===0&&(S--,w=g[S]);let E=d.length-p-1,k=h;for(;E>=0;){let T=Math.min(k,w);if(d[S]===void 0)break;if(d[S].copyCellsFrom(d[E],k-T,w-T,T,!0),w-=T,w===0&&(S--,w=g[S]),k-=T,k===0){E--;let A=Math.max(E,0);k=pa(d,A,this._cols)}}for(let T=0;T<d.length;T++)g[T]<e&&d[T].setCell(g[T],r);let R=p-v;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(o.length>0){let l=[],u=[];for(let w=0;w<this.lines.length;w++)u.push(this.lines.get(w));let d=this.lines.length,h=d-1,g=0,p=o[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let v=0;for(let w=Math.min(this.lines.maxLength-1,d+a-1);w>=0;w--)if(p&&p.start>h+v){for(let E=p.newLines.length-1;E>=0;E--)this.lines.set(w--,p.newLines[E]);w++,l.push({index:h+1,amount:p.newLines.length}),v+=p.newLines.length,p=o[++g]}else this.lines.set(w,u[h--]);let y=0;for(let w=l.length-1;w>=0;w--)l[w].index+=y,this.lines.onInsertEmitter.fire(l[w]),y+=l[w].amount;let S=Math.max(0,d+a-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,n=0,r){let o=this.lines.get(e);return o?o.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new HA(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},$A=class extends Ve{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new me),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new X_(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new X_(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Jb=2,eS=1,zd=class extends Ve{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Jb),this.rows=Math.max(e.rawOptions.rows||0,eS),this.buffers=this._register(new $A(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let o=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;a===n.lines.length-1?l?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=a-o+1;n.lines.shiftElements(o+1,l-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};zd=Mt([Se(0,kn)],zd);var Ws={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:fc,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},WA=["normal","bold","100","200","300","400","500","600","700","800","900"],KA=class extends Ve{constructor(e){super(),this._onOptionChange=this._register(new me),this.onOptionChange=this._onOptionChange.event;let t={...Ws};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(yt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Ws))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Ws))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Ws[e]),!qA(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Ws[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=WA.includes(t)?t:Ws[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function qA(e){return e==="block"||e==="underline"||e==="bar"}function na(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&na(e[r],t-1);return n}var Z_=Object.freeze({insertMode:!1}),Q_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),jd=class extends Ve{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new me),this.onData=this._onData.event,this._onUserInput=this._register(new me),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new me),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=na(Z_),this.decPrivateModes=na(Q_)}reset(){this.modes=na(Z_),this.decPrivateModes=na(Q_)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};jd=Mt([Se(0,xn),Se(1,bb),Se(2,kn)],jd);var J_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Uh(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Hh=String.fromCharCode,ev={DEFAULT:e=>{let t=[Uh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Hh(t[0])}${Hh(t[1])}${Hh(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Uh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Uh(e,!0)};${e.x};${e.y}${t}`}},Ud=class extends Ve{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new me),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(J_))this.addProtocol(r,J_[r]);for(let r of Object.keys(ev))this.addEncoding(r,ev[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=r+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Ud=Mt([Se(0,xn),Se(1,ps),Se(2,kn)],Ud);var $h=[[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]],VA=[[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]],qt;function GA(e,t){let n=0,r=t.length-1,o;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(o=n+r>>1,e>t[o][1])n=o+1;else if(e<t[o][0])r=o-1;else return!0;return!1}var YA=class{constructor(){if(this.version="6",!qt){qt=new Uint8Array(65536),qt.fill(1),qt[0]=0,qt.fill(0,1,32),qt.fill(0,127,160),qt.fill(2,4352,4448),qt[9001]=2,qt[9002]=2,qt.fill(2,11904,42192),qt[12351]=1,qt.fill(2,44032,55204),qt.fill(2,63744,64256),qt.fill(2,65040,65050),qt.fill(2,65072,65136),qt.fill(2,65280,65377),qt.fill(2,65504,65511);for(let e=0;e<$h.length;++e)qt.fill(0,$h[e][0],$h[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?qt[e]:GA(e,VA)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let o=is.extractWidth(t);o===0?r=!1:o>n&&(n=o)}return is.createPropertyValue(0,n,r)}},is=class Jl{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new me,this.onChange=this._onChange.event;let t=new YA;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,o=t.length;for(let a=0;a<o;++a){let l=t.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=o)return n+this.wcwidth(l);let h=t.charCodeAt(a);56320<=h&&h<=57343?l=(l-55296)*1024+h-56320+65536:n+=this.wcwidth(h)}let u=this.charProperties(l,r),d=Jl.extractWidth(u);Jl.extractShouldJoin(u)&&(d-=Jl.extractWidth(r)),n+=d,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},XA=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,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function tv(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Vo=2147483647,ZA=256,tS=class Hd{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>ZA)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new Hd;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let o=t[r];if(Array.isArray(o))for(let a=0;a<o.length;++a)n.addSubParam(o[a]);else n.addParam(o)}return n}clone(){let t=new Hd(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,o))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Vo?Vo:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Vo?Vo:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-r>0&&(t[n]=this._subParams.slice(r,o))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,o=r[n-1];r[n-1]=~o?Math.min(o*10+t,Vo):t}},Go=[],QA=class{constructor(){this._state=0,this._active=Go,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Go}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=Go,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Go,!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,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",kc(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Go,this._id=-1,this._state=0}}},Hn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=kc(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},Yo=[],JA=class{constructor(){this._handlers=Object.create(null),this._active=Yo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Yo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Yo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Yo,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",kc(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Yo,this._ident=0}},ia=new tS;ia.addParam(0);var nv=class{constructor(e){this._handler=e,this._data="",this._params=ia,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ia,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=kc(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=ia,this._data="",this._hitLimit=!1,n));return this._params=ia,this._data="",this._hitLimit=!1,t}},eL=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=n<<4|r}},ii=160,tL=(function(){let e=new eL(4095),t=Array.apply(null,Array(256)).map((u,d)=>d),n=(u,d)=>t.slice(u,d),r=n(32,127),o=n(0,24);o.push(25),o.push.apply(o,n(28,32));let a=n(0,14),l;e.setDefault(1,0),e.addMany(r,0,2,0);for(l in a)e.addMany([24,26,153,154],l,3,0),e.addMany(n(128,144),l,3,0),e.addMany(n(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(ii,0,2,0),e.add(ii,8,5,8),e.add(ii,6,0,6),e.add(ii,11,0,11),e.add(ii,13,13,13),e})(),nL=class extends Ve{constructor(e=tL){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 tS,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(yt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new QA),this._dcsParser=this._register(new JA),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;o<e.intermediates.length;++o){let a=e.intermediates.charCodeAt(o);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,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,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}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,t,n,r,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=o}parse(e,t,n){let r=0,o=0,a=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&d>-1){for(;d>=0&&(l=u[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._parseStack.handlerPos=d,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&d>-1){for(;d>=0&&(l=u[d](),l!==!0);d--)if(l instanceof Promise)return this._parseStack.handlerPos=d,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=a;u<t;++u){switch(r=e[u],o=this._transitions.table[this.currentState<<8|(r<160?r:ii)],o>>4){case 2:for(let v=u+1;;++v){if(v>=t||(r=e[v])<32||r>126&&r<ii){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<ii){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<ii){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<ii){this._printHandler(e,u,v),u=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:u,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|r],h=d?d.length-1:-1;for(;h>=0&&(l=d[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._preserveStack(3,d,h,o,u),l;h<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(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let g=this._escHandlers[this._collect<<8|r],p=g?g.length-1:-1;for(;p>=0&&(l=g[p](),l!==!0);p--)if(l instanceof Promise)return this._preserveStack(4,g,p,o,u),l;p<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=u+1;;++v)if(v>=t||(r=e[v])===24||r===26||r===27||r>127&&r<ii){this._dcsParser.put(e,u,v),u=v-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,o,u),l;r===27&&(o|=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=u+1;;v++)if(v>=t||(r=e[v])<32||r>127&&r<ii){this._oscParser.put(e,u,v),u=v-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,o,u),l;r===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},iL=/^([\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})$/,rL=/^[\da-f]+$/;function iv(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=iL.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),rL.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let o=0;o<3;++o){let a=parseInt(t.slice(n*o,n*o+n),16);r[o]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return r}}function Wh(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function sL(e,t=16){let[n,r,o]=e;return`rgb:${Wh(n,t)}/${Wh(r,t)}/${Wh(o,t)}`}var oL={"(":0,")":1,"*":2,"+":3,"-":1,".":2},kr=131072,rv=10;function sv(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var ov=5e3,av=0,aL=class extends Ve{constructor(e,t,n,r,o,a,l,u,d=new nL){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=o,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new CR,this._utf8Decoder=new NR,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=zt.clone(),this._eraseAttrDataInternal=zt.clone(),this._onRequestBell=this._register(new me),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new me),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new me),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new me),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new me),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new me),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new me),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new me),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new me),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new $d(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:g.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,g,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:g,data:p})}),this._parser.setDcsHandlerFallback((h,g,p)=>{g==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:g,payload:p})}),this._parser.setPrintHandler((h,g,p)=>this.print(h,g,p)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(se.BEL,()=>this.bell()),this._parser.setExecuteHandler(se.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(se.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(se.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(se.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(se.BS,()=>this.backspace()),this._parser.setExecuteHandler(se.HT,()=>this.tab()),this._parser.setExecuteHandler(se.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(se.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Zl.IND,()=>this.index()),this._parser.setExecuteHandler(Zl.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Zl.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Hn(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new Hn(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new Hn(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new Hn(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new Hn(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new Hn(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new Hn(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new Hn(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new Hn(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new Hn(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new Hn(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new Hn(h=>this.restoreCursorColor(h))),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 h in Vt)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new nv((h,g)=>this.requestStatusString(h,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),ov))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${ov} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,o=this._activeBuffer.y,a=0,l=this._parseStack.paused;if(l){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>kr&&(a=this._parseStack.position+kr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<kr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,kr))),l||this._dirtyRowTracker.clearRange(),e.length>kr)for(let h=a;h<e.length;h+=kr){let g=h+kr<e.length?h+kr:e.length,p=typeof e=="string"?this._stringDecoder.decode(e.substring(h,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,g),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,p))return this._preserveStack(r,o,p,h),this._logSlowResolvingAsync(n),n}else if(!l){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,h))return this._preserveStack(r,o,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),d=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);d<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(d,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,o,a=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,d=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,g=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let v=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(r=e[y],r<127&&a){let k=a[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,v);o=is.extractWidth(S);let w=is.extractShouldJoin(S),E=w?is.extractWidth(v):0;if(v=S,l&&this._onA11yChar.fire(Er(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-E>u){if(d){let k=p,R=this._activeBuffer.x-E;for(this._activeBuffer.x=E,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&p instanceof ta&&p.copyCellsFrom(k,R,0,E,!1);R<u;)k.setCellFromCodepoint(R++,0,1,g)}else if(this._activeBuffer.x=u-1,o===2)continue}if(w&&this._activeBuffer.x){let k=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-k,r,o);for(let R=o-E;--R>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(h&&(p.insertCells(this._activeBuffer.x,o-E,this._activeBuffer.getNullCell(g)),p.getWidth(u-1)===2&&p.setCellFromCodepoint(u-1,0,1,g)),p.setCellFromCodepoint(this._activeBuffer.x++,r,o,g),o>0)for(;--o;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=v,this._activeBuffer.x<u&&n-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>sv(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new nv(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Hn(t))}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 e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,o=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),o),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(zt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=is.extractWidth(t),o=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),l=new Uint32Array(a.length*n),u=0;for(let h=0;h<a.length;){let g=a.codePointAt(h)||0;l[u++]=g,h+=g>65535?2:1}let d=u;for(let h=1;h<n;++h)l.copyWithin(d,0,u),d+=u;return this.print(l,0,d),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(se.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(se.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(se.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(se.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(se.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,ts),this._charsetService.setgCharset(1,ts),this._charsetService.setgCharset(2,ts),this._charsetService.setgCharset(3,ts);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(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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(),e.params[t]===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(e,t){(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:a}=this._coreMouseService,l=this._coreService,{buffers:u,cols:d}=this._bufferService,{active:h,alt:g}=u,p=this._optionsService.rawOptions,v=(w,E)=>(l.triggerDataEvent(`${se.ESC}[${t?"":"?"}${w};${E}$y`),!0),y=w=>w?1:2,S=e.params[0];return t?S===2?v(S,4):S===4?v(S,y(l.modes.insertMode)):S===12?v(S,3):S===20?v(S,y(p.convertEol)):v(S,0):S===1?v(S,y(r.applicationCursorKeys)):S===3?v(S,p.windowOptions.setWinLines?d===80?2:d===132?1:0:0):S===6?v(S,y(r.origin)):S===7?v(S,y(r.wraparound)):S===8?v(S,3):S===9?v(S,y(o==="X10")):S===12?v(S,y(p.cursorBlink)):S===25?v(S,y(!l.isCursorHidden)):S===45?v(S,y(r.reverseWraparound)):S===66?v(S,y(r.applicationKeypad)):S===67?v(S,4):S===1e3?v(S,y(o==="VT200")):S===1002?v(S,y(o==="DRAG")):S===1003?v(S,y(o==="ANY")):S===1004?v(S,y(r.sendFocus)):S===1005?v(S,4):S===1006?v(S,y(a==="SGR")):S===1015?v(S,4):S===1016?v(S,y(a==="SGR_PIXELS")):S===1048?v(S,1):S===47||S===1047||S===1049?v(S,y(h===g)):S===2004?v(S,y(r.bracketedPasteMode)):S===2026?v(S,y(r.synchronizedOutput)):v(S,0)}_updateAttrColor(e,t,n,r,o){return t===2?(e|=50331648,e&=-16777216,e|=ya.fromColorRGB([n,r,o])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],o=0,a=0;do{if(r[a+o]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do r[1]===5&&(o=1),r[a+u+1+o]=l[u];while(++u<l.length&&u+a+1+o<r.length);break}if(r[1]===5&&a+o>=2||r[1]===2&&a+o>=5)break;r[1]&&(o=1)}while(++a+t<e.length&&a+o<r.length);for(let l=2;l<r.length;++l)r[l]===-1&&(r[l]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=zt.fg,e.bg=zt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let o=0;o<t;o++)n=e.params[o],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=zt.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=zt.bg&16777215):n===38||n===48||n===58?o+=this._extractColor(e,o,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=zt.fg&16777215,r.bg&=-67108864,r.bg|=zt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${se.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${se.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${se.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=zt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){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 n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!sv(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${se.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>rv&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>rv&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),o=n.shift();if(/^\d+$/.exec(r)){let a=parseInt(r);if(lv(a))if(o==="?")t.push({type:0,index:a});else{let l=iv(o);l&&t.push({type:1,index:a,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,o=n.findIndex(a=>a.startsWith("id="));return o!==-1&&(r=n[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=iv(n[r]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let o=parseInt(n[r]);lv(o)&&t.push({type:2,index:o})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,ts),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(oL[e[0]],Vt[e[1]]||ts),!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 e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=zt.clone(),this._eraseAttrDataInternal=zt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new si;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${se.ESC}${l}${se.ESC}\\`),!0),r=this._bufferService.buffer,o=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},$d=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(av=e,e=t,t=av),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};$d=Mt([Se(0,xn)],$d);function lv(e){return 0<=e&&e<256}var lL=5e7,cv=12,cL=50,uL=class extends Ve{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>lL)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(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],o=this._action(r,t);if(o){let l=u=>performance.now()-n>=cv?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);o.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=cv)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>cL&&(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()}},Wd=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let u=t.addMarker(t.ybase+t.y),d={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(d,u)),this._dataByLinkId.set(d.id,d),d.id}let n=e,r=this._getEntryIdKey(n),o=this._entriesWithId.get(r);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let a=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Wd=Mt([Se(0,xn)],Wd);var uv=!1,hL=class extends Ve{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Xs),this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onData=this._register(new me),this.onData=this._onData.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new me),this._instantiationService=new IA,this.optionsService=this._register(new KA(e)),this._instantiationService.setService(kn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(zd)),this._instantiationService.setService(xn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Fd)),this._instantiationService.setService(bb,this._logService),this.coreService=this._register(this._instantiationService.createInstance(jd)),this._instantiationService.setService(ps,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Ud)),this._instantiationService.setService(yb,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(is)),this._instantiationService.setService(AR,this.unicodeService),this._charsetService=this._instantiationService.createInstance(XA),this._instantiationService.setService(MR,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Wd),this._instantiationService.setService(Sb,this._oscLinkService),this._inputHandler=this._register(new aL(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ln.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ln.forward(this._bufferService.onResize,this._onResize)),this._register(ln.forward(this.coreService.onData,this._onData)),this._register(ln.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 uL((t,n)=>this._inputHandler.parse(t,n))),this._register(ln.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new me),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.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 t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!uv&&(this._logService.warn("writeSync is unreliable and will be removed soon."),uv=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Jb),t=Math.max(t,eS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.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(tv.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(tv(this._bufferService),!1))),this._windowsWrappingHeuristics.value=yt(()=>{for(let t of e)t.dispose()})}}},dL={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 fL(e,t,n,r){var l;let o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?o.key=se.ESC+"OA":o.key=se.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=se.ESC+"OD":o.key=se.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=se.ESC+"OC":o.key=se.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=se.ESC+"OB":o.key=se.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":se.DEL,e.altKey&&(o.key=se.ESC+o.key);break;case 9:if(e.shiftKey){o.key=se.ESC+"[Z";break}o.key=se.HT,o.cancel=!0;break;case 13:o.key=e.altKey?se.ESC+se.CR:se.CR,o.cancel=!0;break;case 27:o.key=se.ESC,e.altKey&&(o.key=se.ESC+se.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?o.key=se.ESC+"[1;"+(a+1)+"D":t?o.key=se.ESC+"OD":o.key=se.ESC+"[D";break;case 39:if(e.metaKey)break;a?o.key=se.ESC+"[1;"+(a+1)+"C":t?o.key=se.ESC+"OC":o.key=se.ESC+"[C";break;case 38:if(e.metaKey)break;a?o.key=se.ESC+"[1;"+(a+1)+"A":t?o.key=se.ESC+"OA":o.key=se.ESC+"[A";break;case 40:if(e.metaKey)break;a?o.key=se.ESC+"[1;"+(a+1)+"B":t?o.key=se.ESC+"OB":o.key=se.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=se.ESC+"[2~");break;case 46:a?o.key=se.ESC+"[3;"+(a+1)+"~":o.key=se.ESC+"[3~";break;case 36:a?o.key=se.ESC+"[1;"+(a+1)+"H":t?o.key=se.ESC+"OH":o.key=se.ESC+"[H";break;case 35:a?o.key=se.ESC+"[1;"+(a+1)+"F":t?o.key=se.ESC+"OF":o.key=se.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=se.ESC+"[5;"+(a+1)+"~":o.key=se.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=se.ESC+"[6;"+(a+1)+"~":o.key=se.ESC+"[6~";break;case 112:a?o.key=se.ESC+"[1;"+(a+1)+"P":o.key=se.ESC+"OP";break;case 113:a?o.key=se.ESC+"[1;"+(a+1)+"Q":o.key=se.ESC+"OQ";break;case 114:a?o.key=se.ESC+"[1;"+(a+1)+"R":o.key=se.ESC+"OR";break;case 115:a?o.key=se.ESC+"[1;"+(a+1)+"S":o.key=se.ESC+"OS";break;case 116:a?o.key=se.ESC+"[15;"+(a+1)+"~":o.key=se.ESC+"[15~";break;case 117:a?o.key=se.ESC+"[17;"+(a+1)+"~":o.key=se.ESC+"[17~";break;case 118:a?o.key=se.ESC+"[18;"+(a+1)+"~":o.key=se.ESC+"[18~";break;case 119:a?o.key=se.ESC+"[19;"+(a+1)+"~":o.key=se.ESC+"[19~";break;case 120:a?o.key=se.ESC+"[20;"+(a+1)+"~":o.key=se.ESC+"[20~";break;case 121:a?o.key=se.ESC+"[21;"+(a+1)+"~":o.key=se.ESC+"[21~";break;case 122:a?o.key=se.ESC+"[23;"+(a+1)+"~":o.key=se.ESC+"[23~";break;case 123:a?o.key=se.ESC+"[24;"+(a+1)+"~":o.key=se.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=se.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=se.DEL:e.keyCode===219?o.key=se.ESC:e.keyCode===220?o.key=se.FS:e.keyCode===221&&(o.key=se.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(l=dL[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)o.key=se.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let d=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(d);e.shiftKey&&(h=h.toUpperCase()),o.key=se.ESC+h}else if(e.keyCode===32)o.key=se.ESC+(e.ctrlKey?se.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let d=e.code.slice(3,4);e.shiftKey||(d=d.toLowerCase()),o.key=se.ESC+d,o.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=se.US),e.key==="@"&&(o.key=se.NUL));break}return o}var Dt=0,pL=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new pc,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new pc,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((o,a)=>this._getKey(o)-this._getKey(a)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<r.length;o++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[o]=e[t],t++):r[o]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Dt=this._search(t),Dt===-1)||this._getKey(this._array[Dt])!==t)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])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,a)=>o-a),t=0,n=new Array(this._array.length-e.length),r=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:n[r++]=this._array[o];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(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,t){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 t(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 t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,o=this._getKey(this._array[r]);if(o>e)n=r-1;else if(o<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},Kh=0,hv=0,mL=class extends Ve{constructor(){super(),this._decorations=new pL(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new me),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new me),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(yt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new gL(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,o=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,o=r+(a.options.width??1),e>=r&&e<o&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,o=>{Kh=o.options.x??0,hv=Kh+(o.options.width??1),e>=Kh&&e<hv&&(!n||(o.options.layer??"bottom")===n)&&r(o)})}},gL=class extends Nr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new me),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new me),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.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()}},_L=1e3,vL=class{constructor(e,t=_L){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=r-this._lastRefreshMs,a=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},dv=20,mc=class extends Ve{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,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=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new vL(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(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
111
|
-
`))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ue(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(yt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<dv+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
112
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===dv+1&&(this._liveRegion.textContent+=ud.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let o=e;o<=t;o++){let a=n.lines.get(n.ydisp+o),l=[],u=(a==null?void 0:a.translateToString(!0,void 0,void 0,l))||"",d=(n.ydisp+o+1).toString(),h=this._rowElements[o];h&&(u.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=u,this._rowColumns.set(h,l)),h.setAttribute("aria-posinset",d),h.setAttribute("aria-setsize",r),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],o=n.getAttribute("aria-posinset"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===a||e.relatedTarget!==r)return;let l,u;if(t===0?(l=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(l=this._rowElements.shift(),u=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let d=this._createAccessibilityTreeNode();this._rowElements.unshift(d),this._rowContainer.insertAdjacentElement("afterbegin",d)}else{let d=this._createAccessibilityTreeNode();this._rowElements.push(d),this._rowContainer.appendChild(d)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var u;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((u=r.textContent)==null?void 0:u.length)??0}),!this._rowContainer.contains(n.node))return;let o=({node:d,offset:h})=>{let g=d instanceof Text?d.parentNode:d,p=parseInt(g==null?void 0:g.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(g);if(!v)return console.warn("columns is null. Race condition?"),null;let y=h<v.length?v[h]:v.slice(-1)[0]+1;return y>=this._terminal.cols&&(++p,y=0),{row:p,column:y}},a=o(t),l=o(n);if(!(!a||!l)){if(a.row>l.row||a.row===l.row&&a.column>=l.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(l.row-a.row)*this._terminal.cols-a.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var o,a;e.style.transform="";let t=e.getBoundingClientRect().width,n=(a=(o=this._rowColumns.get(e))==null?void 0:o.slice(-1))==null?void 0:a[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};mc=Mt([Se(1,bf),Se(2,Qi),Se(3,Ji)],mc);var Kd=class extends Ve{constructor(e,t,n,r,o){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new me),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new me),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(yt(()=>{var a;us(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(a=this._activeProviderReplies)==null||a.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ue(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ue(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ue(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ue(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let o=n[r];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,o;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(a=>{a==null||a.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[a,l]of this._linkProviderService.linkProviders.entries())t?(o=this._activeProviderReplies)!=null&&o.get(a)&&(n=this._checkLinkProviderResult(a,e,n)):l.provideLinks(e.y,u=>{var h,g;if(this._isMouseOut)return;let d=u==null?void 0:u.map(p=>({link:p}));(h=this._activeProviderReplies)==null||h.set(a,d),n=this._checkLinkProviderResult(a,e,n),((g=this._activeProviderReplies)==null?void 0:g.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let o=t.get(r);if(o)for(let a=0;a<o.length;a++){let l=o[a],u=l.link.range.start.y<e?0:l.link.range.start.x,d=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let h=u;h<=d;h++){if(n.has(h)){o.splice(a--,1);break}n.add(h)}}}}_checkLinkProviderResult(e,t,n){var a;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),o=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(o=!0);if(!o&&r){let l=r.find(u=>this._linkAtPosition(u.link,t));l&&(n=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let l=0;l<this._activeProviderReplies.size;l++){let u=(a=this._activeProviderReplies.get(l))==null?void 0:a.find(d=>this._linkAtPosition(d.link,t));if(u){n=!0,this._handleNewLink(u);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&yL(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,us(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,o,a;(r=this._currentLink)!=null&&r.state&&((a=(o=this._currentLink)==null?void 0:o.state)==null?void 0:a.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(r,o),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return n<=o&&o<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,o){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:o}}};Kd=Mt([Se(1,Sf),Se(2,Ji),Se(3,xn),Se(4,xb)],Kd);function yL(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var bL=class extends hL{constructor(e={}){super(e),this._linkifier=this._register(new Xs),this.browser=Hb,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Xs),this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new me),this.onKey=this._onKey.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new me),this.onBell=this._onBell.event,this._onFocus=this._register(new me),this._onBlur=this._register(new me),this._onA11yCharEmitter=this._register(new me),this._onA11yTabEmitter=this._register(new me),this._onWillOpen=this._register(new me),this._setup(),this._decorationService=this._instantiationService.createInstance(mL),this._instantiationService.setService(ba,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(cA),this._instantiationService.setService(xb,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(dd)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ln.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ln.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ln.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ln.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(yt(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let o=gt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${se.ESC}]${r};${sL(o)}${jb.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=jt.toColor(...t.color));else{let a=n;this._themeService.modifyColors(l=>l[a]=jt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.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(mc,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(se.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(se.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,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,o=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*o,l=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=l+"px",this.textarea.style.width=a+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ue(this.element,"copy",t=>{this.hasSelection()&&kR(t,this._selectionService)}));let e=t=>ER(t,this.textarea,this.coreService,this.optionsService);this._register(Ue(this.textarea,"paste",e)),this._register(Ue(this.element,"paste",e)),$b?this._register(Ue(this.element,"mousedown",t=>{t.button===2&&w_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ue(this.element,"contextmenu",t=>{w_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Rf&&this._register(Ue(this.element,"auxclick",t=>{t.button===1&&pb(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ue(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ue(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ue(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ue(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ue(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ue(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ue(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;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"),((o=this.element)==null?void 0:o.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 t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ue(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",cd.get()),qb||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(aA,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Qi,this._coreBrowserService),this._register(Ue(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Ue(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Od,this._document,this._helperContainer),this._instantiationService.setService(Ec,this._charSizeService),this._themeService=this._instantiationService.createInstance(Bd),this._instantiationService.setService(eo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(dc),this._instantiationService.setService(wb,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Id,this.rows,this.screenElement)),this._instantiationService.setService(Ji,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Md,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Dd),this._instantiationService.setService(Sf,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Kd,this.screenElement));this.element.appendChild(t);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(Td,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Pd,this.element,this.screenElement,r)),this._instantiationService.setService(OR,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(ln.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(Rd,this.screenElement)),this._register(Ue(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),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(mc,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(hc,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(hc,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Ld,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(a){var h,g,p,v,y;let l=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!l)return!1;let u,d;switch(a.overrideType||a.type){case"mousemove":d=32,a.buttons===void 0?(u=3,a.button!==void 0&&(u=a.button<3?a.button:3)):u=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":d=0,u=a.button<3?a.button:3;break;case"mousedown":d=1,u=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let S=a.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(a,(v=(p=(g=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:g.device)==null?void 0:p.cell)==null?void 0:v.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;d=S<0?0:1,u=4;break;default:return!1}return d===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:u,action:d,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:a=>(n(a),a.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(a)),wheel:a=>(n(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&n(a)},mousemove:a=>{a.buttons||n(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),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()),a&8?r.mousemove||(t.addEventListener("mousemove",o.mousemove),r.mousemove=o.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),a&16?r.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),r.wheel=o.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),a&2?r.mouseup||(r.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),a&4?r.mousedrag||(r.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ue(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return n(a),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(a)})),this._register(Ue(t,"wheel",a=>{var l,u,d,h,g;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,(h=(d=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:d.cell)==null?void 0:h.height,(g=e._coreBrowserService)==null?void 0:g.dpr)===0)return this.cancel(a,!0);let p=se.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(p,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.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,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){fb(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 t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}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,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=fL(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===se.ETX||n.key===se.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(SL(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!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 t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(zt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.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(se.ESC+"[I"):this.coreService.triggerDataEvent(se.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${se.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${se.ESC}[6;${o};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function SL(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var wL=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-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(t,1)}},xL=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new si)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},fv=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new xL(t)}getNullCell(){return new si}},kL=class extends Ve{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new me),this.onBufferChange=this._onBufferChange.event,this._normal=new fv(this._core.buffers.normal,"normal"),this._alternate=new fv(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)}},EL=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},CL=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}},NL=["cols","rows"],Ti=0,TL=class extends Ve{constructor(e){super(),this._core=this._register(new bL(e)),this._addonManager=this._register(new wL),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,o)=>{this._checkReadonlyOptions(r),this._core.options[r]=o};for(let r in this._core.options){let o={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,o)}}_checkReadonlyOptions(e){if(NL.includes(e))throw new Error(`Option "${e}" 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 EL(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new CL(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 kL(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
113
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return cd.get()},set promptLabel(e){cd.set(e)},get tooMuchOutput(){return ud.get()},set tooMuchOutput(e){ud.set(e)}}}_verifyIntegers(...e){for(Ti of e)if(Ti===1/0||isNaN(Ti)||Ti%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Ti of e)if(Ti&&(Ti===1/0||isNaN(Ti)||Ti%1!==0||Ti<0))throw new Error("This API only accepts positive integers")}};/**
|
|
114
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
115
|
-
* @license MIT
|
|
116
|
-
*
|
|
117
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
118
|
-
* @license MIT
|
|
119
|
-
*
|
|
120
|
-
* Originally forked from (with the author's permission):
|
|
121
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
122
|
-
* http://bellard.org/jslinux/
|
|
123
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
124
|
-
*/var RL=2,ML=1,AL=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var p;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((p=this._terminal.options.overviewRuler)==null?void 0:p.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue("height")),o=Math.max(0,parseInt(n.getPropertyValue("width"))),a=window.getComputedStyle(this._terminal.element),l={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},u=l.top+l.bottom,d=l.right+l.left,h=r-u,g=o-d-t;return{cols:Math.max(RL,Math.floor(g/e.css.cell.width)),rows:Math.max(ML,Math.floor(h/e.css.cell.height))}}};const LL={background:"#0b0d12",foreground:"#e6e8ef",cursor:"#8b5cf6",cursorAccent:"#0b0d12",selectionBackground:"rgba(139, 92, 246, 0.35)",black:"#1a1d26",red:"#f87171",green:"#34d399",yellow:"#fbbf24",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#e6e8ef",brightBlack:"#6b7284",brightRed:"#f87171",brightGreen:"#34d399",brightYellow:"#fbbf24",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#ffffff"};function OL({terminalId:e,command:t,cwd:n,active:r,send:o,register:a}){const l=K.useRef(null),u=K.useRef(null);return K.useEffect(()=>{const d=l.current;if(!d)return;const h=new TL({theme:LL,fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace',fontSize:13,cursorBlink:!0,scrollback:8e3}),g=new AL;h.loadAddon(g),h.open(d),u.current={term:h,fit:g},r&&h.focus(),h.attachCustomKeyEventHandler(E=>{var R;if(E.type!=="keydown")return!0;const k=(R=E.key)==null?void 0:R.toLowerCase();if((E.ctrlKey||E.metaKey)&&k==="v")return!1;if(E.ctrlKey&&!E.shiftKey&&!E.altKey&&k==="c"&&h.hasSelection()){const T=h.textarea;return T&&(T.value=h.getSelection(),T.select()),!1}return!0});const p=a(e,{write:E=>h.write(E),dispose:()=>h.dispose()}),v=()=>{try{g.fit(),o({type:"terminal_resize",terminalId:e,cols:h.cols,rows:h.rows})}catch{}},y=requestAnimationFrame(()=>{try{g.fit()}catch{}o(t?{type:"run_command",terminalId:e,command:t,cols:h.cols,rows:h.rows}:{type:"terminal_create",terminalId:e,cwd:n,cols:h.cols,rows:h.rows})}),S=h.onData(E=>{o({type:"terminal_input",terminalId:e,data:E})});let w=null;return typeof ResizeObserver<"u"&&(w=new ResizeObserver(()=>{d.offsetWidth>0&&d.offsetHeight>0&&v()}),w.observe(d)),()=>{cancelAnimationFrame(y),S.dispose(),w==null||w.disconnect(),p(),o({type:"terminal_kill",terminalId:e}),h.dispose(),u.current=null}},[e,t,o,a]),K.useEffect(()=>{if(!r)return;const d=requestAnimationFrame(()=>{const h=u.current;if(h){try{h.fit.fit(),o({type:"terminal_resize",terminalId:e,cols:h.term.cols,rows:h.term.rows})}catch{}h.term.focus()}});return()=>cancelAnimationFrame(d)},[r]),m.jsx("div",{ref:l,className:`term-xterm ${r?"":"hidden"}`})}const pv={name:"",command:"",cwd:"${pwd}"};function DL({chat:e,send:t,terminal:n}){const r=bt(),[o,a]=K.useState(null),[l,u]=K.useState(!1),[d,h]=K.useState(!1),[g,p]=K.useState(null),[v,y]=K.useState(pv),[S,w]=K.useState(null),E=K.useRef(null);K.useEffect(()=>{e.terminals.length===0?a(null):e.terminals.some(H=>H.id===o)||a(e.terminals[e.terminals.length-1].id)},[e.terminals,o]),K.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]);const k=H=>{if(!e.ready)return;const U=Dv();n.create({...H,id:U,running:!0,exitCode:null}),a(U),u(!1)},R=()=>{var H;return k({title:r("terminalTitle",{n:e.terminals.length+1}),cwd:((H=e.state)==null?void 0:H.cwd)??""})},T=H=>{var q;const U=H.name||H.command,O=e.terminals.find(F=>F.title===U);if(O){n.restart(O.id),a(O.id),t({type:"run_command",terminalId:O.id,command:H,cols:80,rows:24});return}k({title:U,cwd:((q=e.state)==null?void 0:q.cwd)??"",command:H})},A=H=>{if(n.close(H),o===H){const U=e.terminals.filter(O=>O.id!==H);a(U.length>0?U[U.length-1].id:null)}},V=()=>{h(!0),p(null),y(pv)},D=H=>{const U=e.commands[H];U&&(h(!1),p(H),y({name:U.name,command:U.command,cwd:U.cwd??""}))},ne=()=>{h(!1),p(null)},Z=()=>{const H=v.name.trim(),U=v.command.trim();if(!H||!U)return;const O=v.cwd.trim(),q={name:H,command:U,cwd:O||void 0},F=d?[...e.commands,q]:g!==null?e.commands.map((Q,ie)=>ie===g?q:Q):e.commands;t({type:"save_commands",commands:F}),ne()},ee=H=>{if(S===H){const U=e.commands.filter((O,q)=>q!==H);t({type:"save_commands",commands:U}),w(null),E.current&&clearTimeout(E.current)}else w(H),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>w(null),2500)},W=d||g!==null;return m.jsxs("div",{className:"terminal-view",children:[m.jsxs("aside",{className:`term-side term-commands ${l?"open":""}`,children:[m.jsxs("div",{className:"panel-header",children:[m.jsx("span",{className:"panel-title",children:r("commands")}),m.jsxs("div",{className:"panel-header-actions",children:[m.jsx("button",{type:"button",className:"panel-refresh",title:r("rerun"),onClick:()=>t({type:"list_commands"}),children:m.jsx(kv,{})}),m.jsx("button",{type:"button",className:"panel-new",title:r("newCommand"),onClick:V,children:m.jsx(Tr,{})})]})]}),m.jsx("div",{className:"panel-body",children:W?m.jsxs("div",{className:"cmd-form",children:[m.jsx("label",{htmlFor:"cmd-name",children:r("name")}),m.jsx("input",{id:"cmd-name",className:"cmd-input",value:v.name,placeholder:r("exampleName"),autoFocus:!0,onChange:H=>y({...v,name:H.target.value})}),m.jsx("label",{htmlFor:"cmd-command",children:r("command")}),m.jsx("input",{id:"cmd-command",className:"cmd-input",value:v.command,placeholder:r("exampleCommand"),onChange:H=>y({...v,command:H.target.value}),onKeyDown:H=>{H.key==="Enter"&&!H.nativeEvent.isComposing&&Z()}}),m.jsxs("label",{htmlFor:"cmd-cwd",children:[r("directory")," ",m.jsx("span",{className:"cmd-hint",children:r("cwdHint")})]}),m.jsx("input",{id:"cmd-cwd",className:"cmd-input",value:v.cwd,placeholder:"${pwd}",onChange:H=>y({...v,cwd:H.target.value}),onKeyDown:H=>{H.key==="Enter"&&!H.nativeEvent.isComposing&&Z()}}),m.jsxs("div",{className:"cmd-form-actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:ne,children:r("cancel")}),m.jsx("button",{type:"button",className:"btn primary",disabled:!v.name.trim()||!v.command.trim(),onClick:Z,children:r("save")})]})]}):m.jsxs(m.Fragment,{children:[e.commands.length===0&&m.jsx("div",{className:"panel-empty",children:r("noCommands")}),e.commands.map((H,U)=>m.jsxs("div",{className:"cmd-item",children:[m.jsx("button",{type:"button",className:"cmd-run",title:r("clickToRun"),onClick:()=>T(H),children:m.jsx(Qw,{})}),m.jsxs("button",{type:"button",className:"cmd-main",title:r("clickToRun"),onClick:()=>T(H),children:[m.jsx("span",{className:"cmd-name",children:H.name}),m.jsx("span",{className:"cmd-command",children:H.command}),H.cwd&&m.jsx("span",{className:"cmd-cwd",children:H.cwd})]}),m.jsx("button",{type:"button",className:"cmd-act",title:r("edit"),onClick:()=>D(U),children:m.jsx(Nv,{})}),m.jsx("button",{type:"button",className:`cmd-act del ${S===U?"confirm":""}`,title:r("delete"),onClick:()=>ee(U),children:S===U?r("confirmQ"):m.jsx(nc,{})})]},U))]})}),m.jsxs("div",{className:"term-tabs-block",children:[m.jsxs("div",{className:"panel-header",children:[m.jsx("span",{className:"panel-title",children:r("terminal")}),m.jsx("button",{type:"button",className:"panel-new",title:r("newTerminal"),onClick:R,children:m.jsx(Tr,{})})]}),m.jsxs("div",{className:"panel-body",children:[e.terminals.length===0&&m.jsx("div",{className:"panel-empty",children:r("noTerminal")}),e.terminals.map(H=>m.jsxs("div",{className:`term-tab ${H.id===o?"active":""}`,children:[m.jsxs("button",{type:"button",className:"term-tab-main",title:`${H.cwd}${H.command?`
|
|
125
|
-
> ${H.command.command}`:""}`,onClick:()=>{a(H.id),u(!1)},children:[m.jsx("span",{className:`term-tab-dot ${H.running?"run":"exit"}`}),m.jsxs("span",{className:"term-tab-title",children:[H.title,!H.running&&m.jsx("span",{className:"term-tab-exit",children:r("exited",{code:H.exitCode===null?"":` ${H.exitCode}`})})]})]}),m.jsx("button",{type:"button",className:"term-tab-close",title:r("closeTerminal"),onClick:()=>A(H.id),children:m.jsx(ls,{})})]},H.id))]})]})]}),m.jsxs("div",{className:"term-main",children:[l&&m.jsx("div",{className:"drawer-backdrop",onClick:()=>u(!1)}),m.jsx("button",{type:"button",className:"term-side-toggle",title:r("commands"),onClick:()=>u(H=>!H),children:m.jsx(Ev,{})}),e.terminals.length===0?m.jsxs("div",{className:"term-empty",children:[m.jsx(Vd,{className:"term-empty-icon"}),m.jsx("div",{className:"term-empty-title",children:r("builtinTerminal")}),m.jsx("div",{className:"term-empty-sub",children:r("termEmptySub")})]}):e.terminals.map(H=>m.jsx(OL,{terminalId:H.id,command:H.command,cwd:H.cwd,active:H.id===o,send:t,register:n.register},H.id))]})]})}function IL({send:e,piConfigured:t,providers:n,installResult:r,onClose:o}){const a=bt(),[l,u]=K.useState(!1),[d,h]=K.useState(""),[g,p]=K.useState(""),[v,y]=K.useState(!1);K.useEffect(()=>{e({type:"list_providers"})},[e]),K.useEffect(()=>{t&&o()},[t,o]),K.useEffect(()=>{r&&u(!1)},[r]),K.useEffect(()=>{var T;!d&&n.length>0&&h(((T=n.find(A=>!A.configured))==null?void 0:T.id)??n[0].id)},[n,d]);const S=()=>{l||(u(!0),e({type:"install_pi_agent"}))},w=()=>{!g.trim()||v||(y(!0),e({type:"set_provider_api_key",provider:d.trim(),apiKey:g.trim()}),setTimeout(()=>y(!1),3e3))},E=()=>{e({type:"get_state"}),e({type:"list_providers"})},k=n.find(T=>T.id===d),R=r!==null&&!r.ok;return m.jsx("div",{className:"modal-backdrop",children:m.jsxs("div",{className:"modal setup-modal",children:[m.jsx("button",{type:"button",className:"modal-close","aria-label":a("close"),onClick:o,children:m.jsx(ls,{})}),m.jsxs("div",{className:"modal-head",children:[m.jsx(_c,{className:"modal-head-icon"}),m.jsx("h2",{children:a("setupTitle")})]}),m.jsx("p",{className:"modal-desc",children:a("setupDesc")}),R?m.jsxs("div",{className:"setup-failed",children:[m.jsx("div",{className:"setup-done",children:a("installFailed")}),m.jsx("pre",{className:"setup-detail",children:r.detail}),m.jsxs("div",{className:"setup-actions",children:[m.jsx("button",{type:"button",className:"btn primary",disabled:l,onClick:S,children:a("retryInstall")}),m.jsx("button",{type:"button",className:"btn",onClick:o,children:a("skip")})]})]}):r!=null&&r.ok?m.jsxs("div",{className:"setup-key-form",children:[m.jsx("div",{className:"setup-done",children:a("installDone")}),m.jsxs("label",{className:"field",children:[m.jsx("span",{className:"field-label",children:a("provider")}),m.jsxs("select",{value:d,onChange:T=>h(T.target.value),children:[n.length===0&&m.jsx("option",{value:"",children:a("loading")}),n.map(T=>m.jsxs("option",{value:T.id,children:[T.name,"(",T.id,")",T.configured?` · ${a("configured")}`:""]},T.id))]}),(k==null?void 0:k.configured)&&m.jsx("div",{className:"field-hint",children:a("providerKeyReady")})]}),m.jsxs("label",{className:"field",children:[m.jsx("span",{className:"field-label",children:a("apiKey")}),m.jsx("input",{type:"password",value:g,onChange:T=>p(T.target.value),placeholder:"sk-…"})]}),m.jsxs("div",{className:"setup-actions",children:[m.jsx("button",{type:"button",className:"btn primary",disabled:!g.trim()||v||!d,onClick:w,children:a(v?"saving":"saveAndStart")}),m.jsxs("button",{type:"button",className:"btn",onClick:E,children:[m.jsx(kv,{})," ",a("recheck")]})]})]}):m.jsxs("div",{className:"setup-actions",children:[m.jsx("button",{type:"button",className:"btn primary",disabled:l,onClick:S,children:a(l?"installing":"autoInstall")}),m.jsx("button",{type:"button",className:"btn",onClick:o,children:a("skip")})]})]})})}const PL=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],Mf=()=>({id:"",name:"",reasoning:!1,input:"text",contextWindow:"",maxTokens:""}),BL=()=>({providerId:"",name:"",api:"openai-completions",baseUrl:"",apiKey:"",authHeader:!0,models:[Mf()]});function FL(e){return{providerId:e.providerId,name:e.name??"",api:e.api??"openai-completions",baseUrl:e.baseUrl??"",apiKey:e.apiKey??"",authHeader:e.authHeader??!1,models:(e.models.length?e.models:[Mf()]).map(t=>{var n;return{id:t.id,name:t.name??"",reasoning:t.reasoning??!1,input:(n=t.input)!=null&&n.includes("image")?"text-image":"text",contextWindow:t.contextWindow?String(t.contextWindow):"",maxTokens:t.maxTokens?String(t.maxTokens):""}})}}function zL({send:e,providers:t,providerStatus:n,onClose:r}){const o=bt(),[a,l]=K.useState(null),[u,d]=K.useState({}),[h,g]=K.useState(null);K.useEffect(()=>{e({type:"list_models_config"}),e({type:"list_providers"})},[e]);const p=w=>{const E=(u[w.id]??"").trim();!E||h||(g(w.id),e({type:"set_provider_api_key",provider:w.id,apiKey:E}),setTimeout(()=>{g(null),d(k=>({...k,[w.id]:""})),e({type:"list_providers"})},1500))},v=()=>{if(!a)return;const w=a.providerId.trim(),E=a.models.filter(R=>R.id.trim()).map(R=>({id:R.id.trim(),name:R.name.trim()||void 0,reasoning:R.reasoning||void 0,input:R.input==="text-image"?["text","image"]:void 0,contextWindow:R.contextWindow?Number(R.contextWindow):void 0,maxTokens:R.maxTokens?Number(R.maxTokens):void 0})),k={providerId:w,name:a.name.trim()||void 0,api:a.api.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,apiKey:a.apiKey.trim()||void 0,authHeader:a.authHeader||void 0,models:E};e({type:"save_model_config",providerId:w,config:k}),r()},y=w=>{window.confirm(o("deleteProviderConfirm",{id:w.providerId,n:w.models.length}))&&e({type:"delete_model_config",providerId:w.providerId})},S=(w,E)=>{a&&l({...a,models:a.models.map((k,R)=>R===w?{...k,...E}:k)})};return m.jsx("div",{className:"modal-backdrop",children:m.jsxs("div",{className:"modal model-modal",children:[m.jsx("button",{type:"button",className:"modal-close","aria-label":o("close"),onClick:r,children:m.jsx(ls,{})}),m.jsx("div",{className:"modal-head",children:m.jsx("h2",{children:o(a?"editProvider":"manageModelsTitle")})}),a?m.jsxs("div",{className:"provider-form",children:[m.jsxs("div",{className:"form-grid",children:[m.jsxs("label",{className:"field",children:[m.jsxs("span",{className:"field-label",children:[o("providerId")," ",m.jsx("em",{children:o("providerIdHint")})]}),m.jsx("input",{type:"text",value:a.providerId,disabled:t.some(w=>w.providerId===a.providerId),onChange:w=>l({...a,providerId:w.target.value}),placeholder:"my-proxy"})]}),m.jsxs("label",{className:"field",children:[m.jsx("span",{className:"field-label",children:o("displayName")}),m.jsx("input",{type:"text",value:a.name,onChange:w=>l({...a,name:w.target.value}),placeholder:o("displayNamePh")})]}),m.jsxs("label",{className:"field",children:[m.jsx("span",{className:"field-label",children:o("apiType")}),m.jsx("select",{value:a.api,onChange:w=>l({...a,api:w.target.value}),children:PL.map(w=>m.jsx("option",{value:w,children:w},w))})]}),m.jsxs("label",{className:"field",children:[m.jsxs("span",{className:"field-label",children:["baseUrl ",m.jsx("em",{children:o("baseUrlHint")})]}),m.jsx("input",{type:"text",value:a.baseUrl,onChange:w=>l({...a,baseUrl:w.target.value}),placeholder:"http://localhost:11434/v1"})]}),m.jsxs("label",{className:"field",children:[m.jsx("span",{className:"field-label",children:o("apiKey")}),m.jsx("input",{type:"password",value:a.apiKey,onChange:w=>l({...a,apiKey:w.target.value}),placeholder:o("apiKeyHint")})]}),m.jsxs("label",{className:"field check",children:[m.jsx("input",{type:"checkbox",checked:a.authHeader,onChange:w=>l({...a,authHeader:w.target.checked})}),m.jsx("span",{children:o("authHeader")})]})]}),m.jsx("div",{className:"form-section-title",children:o("modelsTitle")}),a.models.map((w,E)=>m.jsxs("div",{className:"model-row",children:[m.jsx("input",{type:"text",value:w.id,onChange:k=>S(E,{id:k.target.value}),placeholder:o("modelIdReq")}),m.jsx("input",{type:"text",value:w.name,onChange:k=>S(E,{name:k.target.value}),placeholder:o("displayName")}),m.jsxs("select",{value:w.input,onChange:k=>S(E,{input:k.target.value}),children:[m.jsx("option",{value:"text",children:o("text")}),m.jsx("option",{value:"text-image",children:o("textImage")})]}),m.jsxs("label",{className:"check",children:[m.jsx("input",{type:"checkbox",checked:w.reasoning,onChange:k=>S(E,{reasoning:k.target.checked})}),m.jsx("span",{children:o("reasoning")})]}),m.jsx("input",{type:"number",value:w.contextWindow,onChange:k=>S(E,{contextWindow:k.target.value}),placeholder:o("contextWindow"),title:"contextWindow"}),m.jsx("input",{type:"number",value:w.maxTokens,onChange:k=>S(E,{maxTokens:k.target.value}),placeholder:o("maxOutput"),title:"maxTokens"}),m.jsx("button",{type:"button",className:"iconbtn danger",title:o("removeModel"),onClick:()=>l({...a,models:a.models.filter((k,R)=>R!==E)}),children:m.jsx(nc,{})})]},E)),m.jsxs("button",{type:"button",className:"btn",onClick:()=>l({...a,models:[...a.models,Mf()]}),children:[m.jsx(Tr,{})," ",o("addModel")]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:()=>l(null),children:o("cancel")}),m.jsx("button",{type:"button",className:"btn primary",disabled:!a.providerId.trim()||!a.models.some(w=>w.id.trim()),onClick:v,children:o("save")})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"form-section-title",children:[o("builtinProviders")," ",m.jsx("em",{className:"section-hint",children:o("hintKeyOnly")})]}),m.jsxs("div",{className:"provider-list",children:[n.length===0&&m.jsx("div",{className:"dd-loading",children:o("loading")}),n.map(w=>m.jsxs("div",{className:"provider-row",children:[m.jsxs("div",{className:"provider-info",children:[m.jsx("span",{className:"provider-name",children:w.name}),m.jsxs("span",{className:"provider-sub",children:[w.id,w.configured&&m.jsx("span",{className:"auth-badge",children:o("configuredBadge")}),w.source&&!w.configured&&m.jsx("span",{className:"auth-badge dim",children:w.source})]})]}),m.jsx("div",{className:"provider-actions",children:w.configured?m.jsx("span",{className:"auth-badge",children:o("keyReady")}):m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"password",className:"key-input",placeholder:o("pasteKey"),value:u[w.id]??"",onChange:E=>d(k=>({...k,[w.id]:E.target.value}))}),m.jsxs("button",{type:"button",className:"btn primary sm",disabled:!(u[w.id]??"").trim()||h===w.id,onClick:()=>p(w),children:[m.jsx(n0,{})," ",h===w.id?o("savingKey"):o("saveKey")]})]})})]},w.id))]}),m.jsx("div",{className:"form-section-title",children:o("customProviders")}),m.jsx("p",{className:"modal-desc",children:o("customDesc")}),t.length===0&&m.jsx("div",{className:"dd-loading",children:o("noCustomProviders")}),m.jsx("div",{className:"provider-list",children:t.map(w=>m.jsxs("div",{className:"provider-row",children:[m.jsxs("div",{className:"provider-info",children:[m.jsx("span",{className:"provider-name",children:w.providerId}),m.jsxs("span",{className:"provider-sub",children:[w.api??"—",w.baseUrl?` · ${w.baseUrl}`:"",w.models.length>0&&` · ${o("modelsCount",{n:w.models.length})}`]})]}),m.jsxs("div",{className:"provider-actions",children:[m.jsx("button",{type:"button",className:"iconbtn",title:o("edit"),onClick:()=>l(FL(w)),children:m.jsx(Nv,{})}),m.jsx("button",{type:"button",className:"iconbtn danger",title:o("delete"),onClick:()=>y(w),children:m.jsx(nc,{})})]})]},w.providerId))}),m.jsx("div",{className:"modal-actions",children:m.jsxs("button",{type:"button",className:"btn primary",onClick:()=>l(BL()),children:[m.jsx(Tr,{})," ",o("addProvider")]})})]})]})})}function mv({title:e,subtitle:t,enabled:n,onToggle:r}){const o=bt();return m.jsxs("div",{className:"set-row",children:[m.jsxs("div",{className:"set-row-info",children:[m.jsx("div",{className:"set-row-name",children:e}),t&&m.jsx("div",{className:"set-row-desc",children:t})]}),m.jsx("button",{type:"button",className:`set-switch ${n?"on":""}`,role:"switch","aria-checked":n,title:o(n?"settingsEnabled":"settingsDisabled"),onClick:r,children:m.jsx("span",{className:"set-switch-knob"})})]})}function jL({chat:e,send:t,onClose:n}){const r=bt(),o=e.settings,[a,l]=K.useState(""),[u,d]=K.useState("append"),h=K.useRef(!1),[g,p]=K.useState("");if(K.useEffect(()=>{o&&(d(o.promptMode),h.current||l(o.customSystemPrompt))},[o]),!o)return null;const v=new Set(o.disabledSkills),y=new Set(o.disabledExtensions),S=R=>t({type:"set_settings",...R}),w=R=>{const T=new Set(v);T.has(R.name)?T.delete(R.name):T.add(R.name),S({disabledSkills:[...T]})},E=R=>{const T=new Set(y);T.has(R.id)?T.delete(R.id):T.add(R.id),S({disabledExtensions:[...T]})},k=()=>S({promptMode:u,customSystemPrompt:a});return m.jsx("div",{className:"modal-backdrop",onClick:n,children:m.jsxs("div",{className:"modal settings-modal",onClick:R=>R.stopPropagation(),children:[m.jsx("button",{type:"button",className:"modal-close","aria-label":r("close"),onClick:n,children:m.jsx(ls,{})}),m.jsxs("div",{className:"modal-head",children:[m.jsx(ic,{className:"modal-head-icon"}),m.jsx("h2",{children:r("settingsTitle")})]}),m.jsx("p",{className:"modal-desc",children:r("settingsDesc")}),m.jsxs("div",{className:"set-section",children:[m.jsxs("div",{className:"set-section-title",children:[m.jsx(wv,{className:"set-section-icon"}),r("settingsSystemPrompt")]}),m.jsxs("div",{className:"set-mode-row",children:[m.jsx("label",{className:"set-field-label",children:r("settingsPromptMode")}),m.jsxs("select",{className:"set-select",value:u,onChange:R=>{const T=R.target.value;d(T),S({promptMode:T})},children:[m.jsx("option",{value:"append",children:r("promptModeAppend")}),m.jsx("option",{value:"replace",children:r("promptModeReplace")})]})]}),m.jsx("textarea",{className:"set-prompt-input",rows:6,placeholder:r("promptPlaceholder"),value:a,onFocus:()=>h.current=!0,onBlur:()=>{h.current=!1,k()},onChange:R=>l(R.target.value)}),m.jsx("p",{className:"set-hint",children:r(u==="append"?"promptAppendHint":"promptReplaceHint")})]}),m.jsxs("div",{className:"set-section",children:[m.jsxs("div",{className:"set-section-title",children:[m.jsx(_c,{className:"set-section-icon"}),r("settingsSkills"),m.jsx("span",{className:"set-count",children:o.skills.length})]}),o.skills.length===0?m.jsx("p",{className:"set-empty",children:r("noSkills")}):m.jsx("div",{className:"set-list",children:o.skills.map(R=>m.jsx(mv,{title:R.name,subtitle:R.description,enabled:R.enabled,onToggle:()=>w(R)},R.name))})]}),m.jsxs("div",{className:"set-section",children:[m.jsxs("div",{className:"set-section-title",children:[m.jsx(Jw,{className:"set-section-icon"}),r("settingsExtensions"),m.jsx("span",{className:"set-count",children:o.extensions.length})]}),o.extensions.length===0?m.jsx("p",{className:"set-empty",children:r("noExtensions")}):m.jsx("div",{className:"set-list",children:o.extensions.map(R=>m.jsx(mv,{title:R.name,subtitle:R.path,enabled:R.enabled,onToggle:()=>E(R)},R.id))})]}),m.jsxs("div",{className:"set-section",children:[m.jsxs("div",{className:"set-section-title",children:[m.jsx(ic,{className:"set-section-icon"}),r("settingsPresets"),m.jsx("span",{className:"set-count",children:o.presets.length})]}),m.jsxs("div",{className:"set-preset-save",children:[m.jsx("input",{className:"set-input",placeholder:r("presetNamePlaceholder"),value:g,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&g.trim()&&(t({type:"save_preset",name:g.trim()}),p(""))}}),m.jsxs("button",{type:"button",className:"set-save-btn",disabled:!g.trim(),onClick:()=>{t({type:"save_preset",name:g.trim()}),p("")},children:[m.jsx(Tr,{})," ",r("saveAsPreset")]})]}),o.presets.length===0?m.jsx("p",{className:"set-empty",children:r("noPresets")}):m.jsx("div",{className:"set-list",children:o.presets.map(R=>m.jsxs("div",{className:"set-row",children:[m.jsxs("div",{className:"set-row-info",children:[m.jsx("div",{className:"set-row-name",children:R.name}),m.jsxs("div",{className:"set-row-desc",children:[R.promptMode==="replace"?r("promptModeReplace"):r("promptModeAppend"),R.disabledSkills.length>0&&` · ${r("settingsSkills")} ${R.disabledSkills.length}`,R.disabledExtensions.length>0&&` · ${r("settingsExtensions")} ${R.disabledExtensions.length}`]})]}),m.jsxs("div",{className:"set-row-actions",children:[m.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>t({type:"apply_preset",name:R.name}),children:r("applyPreset")}),m.jsx("button",{type:"button",className:"set-icon-btn danger",title:r("deletePreset"),onClick:()=>t({type:"delete_preset",name:R.name}),children:m.jsx(nc,{})})]})]},R.name))})]}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"dd-refresh",onClick:n,children:r("close")})})]})})}const qh=5e3;function UL({file:e,content:t,send:n,onAddLines:r,onAttach:o,onClose:a}){const l=bt(),[u,d]=K.useState(null),[h,g]=K.useState(!1),[p,v]=K.useState(null),[y,S]=K.useState(!1),[w,E]=K.useState(!1),k=K.useRef(0),R=K.useRef(!1),T=K.useRef(null);K.useEffect(()=>{g(!0),d(null),v(null),n({type:"read_file",path:e.path})},[e.path,n]),K.useEffect(()=>{t&&t.path===e.path&&(d(t),g(!1))},[t,e.path]),K.useEffect(()=>{const F=Q=>{if(Q.key==="Escape"){a();return}const ie=Q.target,M=ie&&(ie.tagName==="INPUT"||ie.tagName==="TEXTAREA"||ie.isContentEditable);(Q.ctrlKey||Q.metaKey)&&Q.key.toLowerCase()==="a"&&!M&&(Q.preventDefault(),Z())};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[a,u]),K.useEffect(()=>{const F=()=>{R.current=!1,S(!1)};return window.addEventListener("mouseup",F),()=>window.removeEventListener("mouseup",F)},[]);const A=K.useMemo(()=>{if(!u)return[];const F=u.text.split(`
|
|
126
|
-
`);return F.length>0&&F[F.length-1]===""&&F.pop(),F.slice(0,qh)},[u]),V=(u==null?void 0:u.lines)??0,D=V>qh,ne=(F,Q)=>{if(Q){const ie=k.current>0?k.current:F;v({start:Math.min(ie,F),end:Math.max(ie,F)})}else k.current=F,v({start:F,end:F})},Z=()=>{A.length!==0&&(k.current=1,v({start:1,end:A.length}))},ee=()=>{p&&(r(e.path,e.name,p.start,p.end),E(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>E(!1),1400))},W=p?p.end-p.start+1:0,H=(u==null?void 0:u.binary)??!1,U=(u==null?void 0:u.truncated)??!1,O=(u==null?void 0:u.kind)??"text",q=F=>`/api/file?clientId=${encodeURIComponent(Zd())}&path=${encodeURIComponent(F)}`;return m.jsx("div",{className:"fp-overlay",onMouseDown:F=>{F.target===F.currentTarget&&a()},children:m.jsxs("div",{className:"fp",children:[m.jsxs("div",{className:"fp-head",children:[m.jsx("span",{className:"fp-name",title:e.path,children:e.name}),m.jsx("span",{className:"fp-path",children:e.path}),m.jsxs("span",{className:"fp-meta",children:[u&&O==="text"&&!H&&l("fileLines",{n:V}),u&&` · ${HL(u.size)}`]}),m.jsxs("span",{className:"fp-head-actions",children:[O!=="video"&&O!=="none"&&m.jsx("button",{type:"button",className:"fp-attach inline","data-tip":l("attachInlineTip"),onClick:()=>o(e.path,e.name,"inline"),children:m.jsx(Tr,{})}),m.jsx("button",{type:"button",className:"fp-attach ref","data-tip":l("referenceTip"),onClick:()=>o(e.path,e.name,"reference"),children:m.jsx(Gh,{})}),m.jsx("button",{type:"button",className:"fp-close",title:l("close"),onClick:a,children:m.jsx(ls,{})})]})]}),U&&O==="text"&&!H&&m.jsx("div",{className:"fp-notice",children:l("previewTruncated")}),h&&!u&&m.jsx("div",{className:"fp-empty",children:l("loading")}),!h&&O==="none"&&!H&&m.jsx("div",{className:"fp-empty",children:l("previewNotSupported")}),!h&&O==="image"&&m.jsx("div",{className:"fp-media-wrap",children:m.jsx("img",{className:"fp-media",src:q(e.path),alt:e.name})}),!h&&O==="video"&&m.jsx("div",{className:"fp-media-wrap",children:m.jsx("video",{className:"fp-media",src:q(e.path),controls:!0,preload:"metadata"})}),!h&&H&&O!=="image"&&O!=="video"&&u&&m.jsxs("div",{className:"fp-hex-wrap",children:[m.jsxs("div",{className:"fp-notice",children:[l("binaryFile"),u.truncated&&l("binaryHexTruncated")]}),m.jsx("pre",{className:"fp-hex",children:u.text})]}),!h&&O==="text"&&!H&&u&&A.length===0&&m.jsx("div",{className:"fp-empty",children:l("emptyFile")}),!h&&O==="text"&&!H&&A.length>0&&m.jsxs("div",{className:`fp-code ${y?"dragging":""}`,onMouseDown:F=>{F.button===0&&F.preventDefault()},children:[A.map((F,Q)=>{const ie=Q+1,M=p!==null&&ie>=p.start&&ie<=p.end;return m.jsxs("div",{className:`fp-line ${M?"sel":""}`,onMouseDown:Y=>{Y.button===0&&(ne(ie,Y.shiftKey),R.current=!0,S(!0))},onMouseEnter:()=>{R.current&&ne(ie,!0)},children:[m.jsx("span",{className:"fp-num",children:ie}),m.jsx("span",{className:"fp-code-text",children:F})]},ie)}),D&&m.jsx("div",{className:"fp-lines-note",children:l("previewLinesTruncated",{n:qh})})]}),m.jsx("div",{className:"fp-foot",children:O==="text"&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"fp-hint",children:p?l("selectedRange",{n:W,start:p.start,end:p.end}):l("selectLinesHint")}),m.jsxs("div",{className:"fp-actions",children:[m.jsx("button",{type:"button",className:"btn",disabled:A.length===0,onClick:Z,children:l("selectAll")}),m.jsx("button",{type:"button",className:"btn",disabled:!p,onClick:()=>v(null),children:l("clearSelection")}),m.jsxs("button",{type:"button",className:"btn primary",disabled:!p||H,onClick:ee,children:[w?m.jsx(Mv,{}):null,l(w?"addedToChat":"addToChat")]})]})]})})]})})}function HL(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}const nS="pi-web-sounds",Xo={enabled:!0,question:!0,done:!0,start:!1,error:!0,volume:100};function iS(){try{const e=localStorage.getItem(nS);if(!e)return{...Xo};const t=JSON.parse(e),n={...Xo,...t};for(const r of["enabled","question","done","start","error"])typeof n[r]!="boolean"&&(n[r]=Xo[r]);return typeof n.volume!="number"||!Number.isFinite(n.volume)?n.volume=Xo.volume:n.volume=Math.round(Math.max(0,Math.min(100,n.volume))/5)*5,n}catch{return{...Xo}}}function $L(e){try{localStorage.setItem(nS,JSON.stringify(e))}catch{}}let Zo=null;function WL(){try{if(!Zo){const e=window.AudioContext??window.webkitAudioContext;if(!e)return null;Zo=new e}return Zo.state==="suspended"&&Zo.resume(),Zo}catch{return null}}const KL=[{type:"sine",freq:587.33,start:0,dur:.13,peak:.5},{type:"sine",freq:880,start:.11,dur:.24,peak:.5}],qL=[{type:"sine",freq:880,start:0,dur:.15,peak:.35},{type:"sine",freq:587.33,start:.15,dur:.32,peak:.35}],VL=[{type:"triangle",freq:660,start:0,dur:.08,peak:.22}],GL=[{type:"square",freq:220,start:0,dur:.16,peak:.18},{type:"square",freq:174.61,start:.18,dur:.26,peak:.18}],YL={question:KL,done:qL,start:VL,error:GL};function XL(e,t,n){const r=e.createOscillator(),o=e.createGain();r.type=t.type,r.frequency.value=t.freq;const a=e.currentTime+t.start,l=Math.max(1e-4,t.peak*n);o.gain.setValueAtTime(1e-4,a),o.gain.exponentialRampToValueAtTime(l,a+.012),o.gain.exponentialRampToValueAtTime(1e-4,a+t.dur),r.connect(o),o.connect(e.destination),r.start(a),r.stop(a+t.dur+.05)}function Qo(e,t=iS()){if(!t.enabled||!t[e])return;const n=WL();if(!n)return;const r=Math.max(0,Math.min(1,t.volume/100));for(const o of YL[e])XL(n,o,r)}function ZL(){var I;const e=bt(),{chat:t,send:n,dismissNotice:r,pushNotice:o,terminal:a}=x0(),[l,u]=K.useState([]),[d,h]=K.useState(null),[g,p]=K.useState("chat"),[v,y]=K.useState(null),[S,w]=K.useState(!1),[E,k]=K.useState(!1),[R,T]=K.useState(!1),[A,V]=K.useState(iS),D=K.useRef(null),ne=K.useRef(null),Z=K.useRef(0);K.useEffect(()=>{$L(A)},[A]),K.useEffect(()=>{var ae;const P=((ae=t.state)==null?void 0:ae.isStreaming)??!1,N=D.current;D.current=P,N!==null&&(!N&&P?Qo("start",A):N&&!P&&Qo("done",A))},[(I=t.state)==null?void 0:I.isStreaming,A]),K.useEffect(()=>{var N;const P=((N=t.dialog)==null?void 0:N.id)??null;P!==null&&P!==ne.current&&Qo("question",A),ne.current=P},[t.dialog,A]),K.useEffect(()=>{const P=[...t.notices].reverse().find(N=>N.level==="error");P&&P.id!==Z.current&&(Z.current=P.id,Qo("error",A))},[t.notices,A]);const ee=(P,N,ae,ye=!1,z)=>{const pe=`${P}|${ae}|${z?`${z.start}-${z.end}`:""}`;u(ve=>ve.some(be=>`${be.path}|${be.mode}|${be.lines?`${be.lines.start}-${be.lines.end}`:""}`===pe)?ve:[...ve,{path:P,name:N,mode:ae,isDir:ye,...z?{lines:z}:{}}])},W=P=>u(N=>N.filter(ae=>ae.key?ae.key!==P:ae.path!==P)),H=K.useCallback(P=>(y(null),n(P)),[n]),U=K.useRef(0),O=K.useRef(0),q=P=>{var ye;const N=Date.now();(ye=t.state)!=null&&ye.model&&!t.state.model.vision&&N-O.current>1e4&&(O.current=N,o("warning",e("imageNotSupported")));const ae=`paste-${++U.current}`;u(z=>[...z,{path:"",key:ae,name:P.name,mode:"inline",imageData:P.data,mimeType:P.mimeType}])},F=async P=>{for(const N of P){const ae=await pR(N);if(!ae){o("error",e("imageLoadFailed",{name:N.name}));continue}q(ae)}},Q=20*1024*1024,ie=K.useRef(0),M=async P=>{if(P.size>Q){o("warning",e("fileTooLarge",{name:P.name,size:Q/1024/1024}));return}let N;try{N=(await new Promise((z,pe)=>{const ve=new FileReader;ve.onload=()=>z(ve.result),ve.onerror=()=>pe(ve.error??new Error("read failed")),ve.readAsDataURL(P)})).replace(/^data:[^;]*;base64,/,"")}catch{o("error",e("fileLoadFailed",{name:P.name}));return}const ae=`upload-${++ie.current}`;u(ye=>[...ye,{path:"",key:ae,name:P.name,mode:"inline",fileData:N,size:P.size,mimeType:P.type||void 0}])},Y=async P=>{for(const N of P)Vl(N.type)?await F([N]):await M(N)},C=K.useCallback((P,N)=>{n({type:"edit_message",messageId:P,text:N})},[n]);return m.jsxs("div",{className:"app",onDragOver:P=>P.preventDefault(),onDrop:P=>P.preventDefault(),children:[m.jsx(p0,{chat:t,send:n,view:g,onViewChange:P=>{p(P),y(null)},onOpenPanel:y,onManageModels:()=>k(!0),onOpenSettings:()=>T(!0),sound:A,onSoundChange:V,onSoundPreview:P=>Qo(P,A)}),m.jsx("div",{className:"notices",children:t.notices.map(P=>m.jsx("button",{type:"button",className:`notice notice-${P.level}`,onClick:()=>r(P.id),children:P.text},P.id))}),m.jsxs("div",{className:"layout",children:[v&&m.jsx("div",{className:"drawer-backdrop",onClick:()=>y(null)}),m.jsxs("div",{className:`view-pane ${g==="chat"?"":"hidden"}`,children:[m.jsx("div",{className:`panel-drawer drawer-left ${v==="left"?"open":""}`,children:m.jsx(m0,{chat:t,send:H})}),m.jsxs("main",{className:"main",children:[t.state?m.jsx(hR,{state:t.state,liveOutputs:t.liveOutputs,toolStatuses:t.toolStatuses,onEdit:C,onKillBash:()=>n({type:"abort_bash"})},t.state.conversationId??"boot"):m.jsx("div",{className:"boot-wait",children:t.ready?e("loadingSession"):e("connectingServer")}),m.jsx(gR,{chat:t,send:n}),m.jsx(mR,{chat:t,send:n,attachments:l,onRemoveAttachment:W,onAddImageFiles:F,onAddLocalFiles:Y,onNotice:o,onManageModels:()=>k(!0),onSent:()=>u([])})]}),m.jsx("div",{className:`panel-drawer drawer-right ${v==="right"?"open":""}`,children:m.jsx(L0,{chat:t,send:H,onAttach:(P,N,ae,ye)=>{y(null),ee(P,N,ae,ye)},onPreview:(P,N)=>{y(null),h({path:P,name:N})},onNotice:(P,N)=>o(P,N)})})]}),m.jsx("div",{className:`view-pane ${g==="terminal"?"":"hidden"}`,children:m.jsx(DL,{chat:t,send:n,terminal:a})})]}),m.jsx(_R,{chat:t,send:n}),t.dialog&&m.jsx(yR,{dialog:t.dialog,send:n}),d&&m.jsx(UL,{file:d,content:t.fileContent,send:n,onAddLines:(P,N,ae,ye)=>ee(P,N,"lines",!1,{start:ae,end:ye}),onAttach:(P,N,ae)=>ee(P,N,ae),onClose:()=>h(null)}),t.ready&&t.state&&t.state.piConfigured===!1&&!S&&!E&&m.jsx(IL,{send:n,piConfigured:t.state.piConfigured,providers:t.providers,installResult:t.installResult,onClose:()=>w(!0)}),E&&m.jsx(zL,{send:n,providers:t.modelsConfig,providerStatus:t.providers,onClose:()=>k(!1)}),R&&m.jsx(jL,{chat:t,send:n,onClose:()=>T(!1)})]})}Hw.createRoot(document.getElementById("root")).render(m.jsx(K.StrictMode,{children:m.jsx(h0,{children:m.jsx(ZL,{})})}));
|