pi-web-ui 0.2.4 → 0.2.6
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.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Dm;function nw(){if(Dm)return Ve;Dm=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=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(){}},b=Object.assign,x={};function k(I,G,N){this.props=I,this.context=G,this.refs=x,this.updater=N||y}k.prototype.isReactComponent={},k.prototype.setState=function(I,G){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,G,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function
|
|
9
|
+
*/var Dm;function nw(){if(Dm)return Ve;Dm=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=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(){}},b=Object.assign,x={};function k(I,G,N){this.props=I,this.context=G,this.refs=x,this.updater=N||y}k.prototype.isReactComponent={},k.prototype.setState=function(I,G){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,G,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function C(){}C.prototype=k.prototype;function O(I,G,N){this.props=I,this.context=G,this.refs=x,this.updater=N||y}var L=O.prototype=new C;L.constructor=O,b(L,k.prototype),L.isPureReactComponent=!0;var A=Array.isArray,H=Object.prototype.hasOwnProperty,D={current:null},se={key:!0,ref:!0,__self:!0,__source:!0};function W(I,G,N){var ye,Ne={},_e=null,Ue=null;if(G!=null)for(ye in G.ref!==void 0&&(Ue=G.ref),G.key!==void 0&&(_e=""+G.key),G)H.call(G,ye)&&!se.hasOwnProperty(ye)&&(Ne[ye]=G[ye]);var Le=arguments.length-2;if(Le===1)Ne.children=N;else if(1<Le){for(var He=Array(Le),nt=0;nt<Le;nt++)He[nt]=arguments[nt+2];Ne.children=He}if(I&&I.defaultProps)for(ye in Le=I.defaultProps,Le)Ne[ye]===void 0&&(Ne[ye]=Le[ye]);return{$$typeof:e,type:I,key:_e,ref:Ue,props:Ne,_owner:D.current}}function ee(I,G){return{$$typeof:e,type:I.type,key:G,ref:I.ref,props:I.props,_owner:I._owner}}function R(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function Y(I){var G={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(N){return G[N]})}var $=/\/+/g;function K(I,G){return typeof I=="object"&&I!==null&&I.key!=null?Y(""+I.key):G.toString(36)}function q(I,G,N,ye,Ne){var _e=typeof I;(_e==="undefined"||_e==="boolean")&&(I=null);var Ue=!1;if(I===null)Ue=!0;else switch(_e){case"string":case"number":Ue=!0;break;case"object":switch(I.$$typeof){case e:case t:Ue=!0}}if(Ue)return Ue=I,Ne=Ne(Ue),I=ye===""?"."+K(Ue,0):ye,A(Ne)?(N="",I!=null&&(N=I.replace($,"$&/")+"/"),q(Ne,G,N,"",function(nt){return nt})):Ne!=null&&(R(Ne)&&(Ne=ee(Ne,N+(!Ne.key||Ue&&Ue.key===Ne.key?"":(""+Ne.key).replace($,"$&/")+"/")+I)),G.push(Ne)),1;if(Ue=0,ye=ye===""?".":ye+":",A(I))for(var Le=0;Le<I.length;Le++){_e=I[Le];var He=ye+K(_e,Le);Ue+=q(_e,G,N,He,Ne)}else if(He=v(I),typeof He=="function")for(I=He.call(I),Le=0;!(_e=I.next()).done;)_e=_e.value,He=ye+K(_e,Le++),Ue+=q(_e,G,N,He,Ne);else if(_e==="object")throw G=String(I),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return Ue}function z(I,G,N){if(I==null)return I;var ye=[],Ne=0;return q(I,ye,"","",function(_e){return G.call(N,_e,Ne++)}),ye}function Z(I){if(I._status===-1){var G=I._result;G=G(),G.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=G)}if(I._status===1)return I._result.default;throw I._result}var oe={current:null},F={transition:null},te={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:F,ReactCurrentOwner:D};function E(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:z,forEach:function(I,G,N){z(I,function(){G.apply(this,arguments)},N)},count:function(I){var G=0;return z(I,function(){G++}),G},toArray:function(I){return z(I,function(G){return G})||[]},only:function(I){if(!R(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ve.Component=k,Ve.Fragment=n,Ve.Profiler=o,Ve.PureComponent=O,Ve.StrictMode=i,Ve.Suspense=d,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Ve.act=E,Ve.cloneElement=function(I,G,N){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ye=b({},I.props),Ne=I.key,_e=I.ref,Ue=I._owner;if(G!=null){if(G.ref!==void 0&&(_e=G.ref,Ue=D.current),G.key!==void 0&&(Ne=""+G.key),I.type&&I.type.defaultProps)var Le=I.type.defaultProps;for(He in G)H.call(G,He)&&!se.hasOwnProperty(He)&&(ye[He]=G[He]===void 0&&Le!==void 0?Le[He]:G[He])}var He=arguments.length-2;if(He===1)ye.children=N;else if(1<He){Le=Array(He);for(var nt=0;nt<He;nt++)Le[nt]=arguments[nt+2];ye.children=Le}return{$$typeof:e,type:I.type,key:Ne,ref:_e,props:ye,_owner:Ue}},Ve.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},Ve.createElement=W,Ve.createFactory=function(I){var G=W.bind(null,I);return G.type=I,G},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(I){return{$$typeof:u,render:I}},Ve.isValidElement=R,Ve.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:Z}},Ve.memo=function(I,G){return{$$typeof:h,type:I,compare:G===void 0?null:G}},Ve.startTransition=function(I){var G=F.transition;F.transition={};try{I()}finally{F.transition=G}},Ve.unstable_act=E,Ve.useCallback=function(I,G){return oe.current.useCallback(I,G)},Ve.useContext=function(I){return oe.current.useContext(I)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(I){return oe.current.useDeferredValue(I)},Ve.useEffect=function(I,G){return oe.current.useEffect(I,G)},Ve.useId=function(){return oe.current.useId()},Ve.useImperativeHandle=function(I,G,N){return oe.current.useImperativeHandle(I,G,N)},Ve.useInsertionEffect=function(I,G){return oe.current.useInsertionEffect(I,G)},Ve.useLayoutEffect=function(I,G){return oe.current.useLayoutEffect(I,G)},Ve.useMemo=function(I,G){return oe.current.useMemo(I,G)},Ve.useReducer=function(I,G,N){return oe.current.useReducer(I,G,N)},Ve.useRef=function(I){return oe.current.useRef(I)},Ve.useState=function(I){return oe.current.useState(I)},Ve.useSyncExternalStore=function(I,G,N){return oe.current.useSyncExternalStore(I,G,N)},Ve.useTransition=function(){return oe.current.useTransition()},Ve.version="18.3.1",Ve}var Lm;function Id(){return Lm||(Lm=1,Qu.exports=nw()),Qu.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Bm;function sw(){return Bm||(Bm=1,(function(e){function t(F,te){var
|
|
25
|
+
*/var Bm;function sw(){return Bm||(Bm=1,(function(e){function t(F,te){var E=F.length;F.push(te);e:for(;0<E;){var I=E-1>>>1,G=F[I];if(0<o(G,te))F[I]=te,F[E]=G,E=I;else break e}}function n(F){return F.length===0?null:F[0]}function i(F){if(F.length===0)return null;var te=F[0],E=F.pop();if(E!==te){F[0]=E;e:for(var I=0,G=F.length,N=G>>>1;I<N;){var ye=2*(I+1)-1,Ne=F[ye],_e=ye+1,Ue=F[_e];if(0>o(Ne,E))_e<G&&0>o(Ue,Ne)?(F[I]=Ue,F[_e]=E,I=_e):(F[I]=Ne,F[ye]=E,I=ye);else if(_e<G&&0>o(Ue,E))F[I]=Ue,F[_e]=E,I=_e;else break e}}return te}function o(F,te){var E=F.sortIndex-te.sortIndex;return E!==0?E:F.id-te.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,b=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function L(F){for(var te=n(h);te!==null;){if(te.callback===null)i(h);else if(te.startTime<=F)i(h),te.sortIndex=te.expirationTime,t(d,te);else break;te=n(h)}}function A(F){if(x=!1,L(F),!b)if(n(d)!==null)b=!0,Z(H);else{var te=n(h);te!==null&&oe(A,te.startTime-F)}}function H(F,te){b=!1,x&&(x=!1,C(W),W=-1),y=!0;var E=v;try{for(L(te),p=n(d);p!==null&&(!(p.expirationTime>te)||F&&!Y());){var I=p.callback;if(typeof I=="function"){p.callback=null,v=p.priorityLevel;var G=I(p.expirationTime<=te);te=e.unstable_now(),typeof G=="function"?p.callback=G:p===n(d)&&i(d),L(te)}else i(d);p=n(d)}if(p!==null)var N=!0;else{var ye=n(h);ye!==null&&oe(A,ye.startTime-te),N=!1}return N}finally{p=null,v=E,y=!1}}var D=!1,se=null,W=-1,ee=5,R=-1;function Y(){return!(e.unstable_now()-R<ee)}function $(){if(se!==null){var F=e.unstable_now();R=F;var te=!0;try{te=se(!0,F)}finally{te?K():(D=!1,se=null)}}else D=!1}var K;if(typeof O=="function")K=function(){O($)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,z=q.port2;q.port1.onmessage=$,K=function(){z.postMessage(null)}}else K=function(){k($,0)};function Z(F){se=F,D||(D=!0,K())}function oe(F,te){W=k(function(){F(e.unstable_now())},te)}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(F){F.callback=null},e.unstable_continueExecution=function(){b||y||(b=!0,Z(H))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(F){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var E=v;v=te;try{return F()}finally{v=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,te){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var E=v;v=F;try{return te()}finally{v=E}},e.unstable_scheduleCallback=function(F,te,E){var I=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?I+E:I):E=I,F){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=E+G,F={id:g++,callback:te,priorityLevel:F,startTime:E,expirationTime:G,sortIndex:-1},E>I?(F.sortIndex=E,t(h,F),n(d)===null&&F===n(h)&&(x?(C(W),W=-1):x=!0,oe(A,E-I))):(F.sortIndex=G,t(d,F),b||y||(b=!0,Z(H))),F},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(F){var te=v;return function(){var E=v;v=te;try{return F.apply(this,arguments)}finally{v=E}}}})(th)),th}var Fm;function ow(){return Fm||(Fm=1,eh.exports=sw()),eh.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,29 +30,29 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var zm;function aw(){if(zm)return An;zm=1;var e=Id(),t=ow();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,c=1;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function a(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(o[r]=s,r=0;r<s.length;r++)i.add(s[r])}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(r){return d.call(p,r)?!0:d.call(g,r)?!1:h.test(r)?p[r]=!0:(g[r]=!0,!1)}function y(r,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:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function b(r,s,c,f){if(s===null||typeof s>"u"||y(r,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 x(r,s,c,f,m,_,w){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=f,this.attributeNamespace=m,this.mustUseProperty=c,this.propertyName=r,this.type=s,this.sanitizeURL=_,this.removeEmptyString=w}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){k[r]=new x(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];k[s]=new x(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){k[r]=new x(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){k[r]=new x(r,2,!1,r,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(r){k[r]=new x(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){k[r]=new x(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){k[r]=new x(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){k[r]=new x(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){k[r]=new x(r,5,!1,r.toLowerCase(),null,!1,!1)});var
|
|
33
|
+
*/var zm;function aw(){if(zm)return An;zm=1;var e=Id(),t=ow();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,c=1;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function a(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(o[r]=s,r=0;r<s.length;r++)i.add(s[r])}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(r){return d.call(p,r)?!0:d.call(g,r)?!1:h.test(r)?p[r]=!0:(g[r]=!0,!1)}function y(r,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:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function b(r,s,c,f){if(s===null||typeof s>"u"||y(r,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 x(r,s,c,f,m,_,w){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=f,this.attributeNamespace=m,this.mustUseProperty=c,this.propertyName=r,this.type=s,this.sanitizeURL=_,this.removeEmptyString=w}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){k[r]=new x(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];k[s]=new x(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){k[r]=new x(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){k[r]=new x(r,2,!1,r,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(r){k[r]=new x(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){k[r]=new x(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){k[r]=new x(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){k[r]=new x(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){k[r]=new x(r,5,!1,r.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function O(r){return r[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(r){var s=r.replace(C,O);k[s]=new x(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(C,O);k[s]=new x(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(C,O);k[s]=new x(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){k[r]=new x(r,1,!1,r.toLowerCase(),null,!1,!1)}),k.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){k[r]=new x(r,1,!1,r.toLowerCase(),null,!0,!0)});function L(r,s,c,f){var m=k.hasOwnProperty(s)?k[s]:null;(m!==null?m.type!==0:f||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(b(s,c,m,f)&&(c=null),f||m===null?v(s)&&(c===null?r.removeAttribute(s):r.setAttribute(s,""+c)):m.mustUseProperty?r[m.propertyName]=c===null?m.type===3?!1:"":c:(s=m.attributeName,f=m.attributeNamespace,c===null?r.removeAttribute(s):(m=m.type,c=m===3||m===4&&c===!0?"":""+c,f?r.setAttributeNS(f,s,c):r.setAttribute(s,c))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=Symbol.for("react.element"),D=Symbol.for("react.portal"),se=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),Y=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),F=Symbol.iterator;function te(r){return r===null||typeof r!="object"?null:(r=F&&r[F]||r["@@iterator"],typeof r=="function"?r:null)}var E=Object.assign,I;function G(r){if(I===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);I=s&&s[1]||""}return`
|
|
34
34
|
`+I+r}var N=!1;function ye(r,s){if(!r||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(V){var f=V}Reflect.construct(r,[],s)}else{try{s.call()}catch(V){f=V}r.call(s.prototype)}else{try{throw Error()}catch(V){f=V}r()}}catch(V){if(V&&f&&typeof V.stack=="string"){for(var m=V.stack.split(`
|
|
35
35
|
`),_=f.stack.split(`
|
|
36
36
|
`),w=m.length-1,T=_.length-1;1<=w&&0<=T&&m[w]!==_[T];)T--;for(;1<=w&&0<=T;w--,T--)if(m[w]!==_[T]){if(w!==1||T!==1)do if(w--,T--,0>T||m[w]!==_[T]){var P=`
|
|
37
|
-
`+m[w].replace(" at new "," at ");return r.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",r.displayName)),P}while(1<=w&&0<=T);break}}}finally{N=!1,Error.prepareStackTrace=c}return(r=r?r.displayName||r.name:"")?G(r):""}function Ne(r){switch(r.tag){case 5:return G(r.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return r=ye(r.type,!1),r;case 11:return r=ye(r.type.render,!1),r;case 1:return r=ye(r.type,!0),r;default:return""}}function _e(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case se:return"Fragment";case D:return"Portal";case ee:return"Profiler";case W:return"StrictMode";case K:return"Suspense";case q:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case Y:return(r.displayName||"Context")+".Consumer";case R:return(r._context.displayName||"Context")+".Provider";case $:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case z:return s=r.displayName||null,s!==null?s:_e(r.type)||"Memo";case Z:s=r._payload,r=r._init;try{return _e(r(s))}catch{}}return null}function Ue(r){var s=r.type;switch(r.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 r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _e(s);case 8:return s===W?"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 Le(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function He(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function nt(r){var s=He(r)?"checked":"value",c=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),f=""+r[s];if(!r.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,_=c.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return m.call(this)},set:function(w){f=""+w,_.call(this,w)}}),Object.defineProperty(r,s,{enumerable:c.enumerable}),{getValue:function(){return f},setValue:function(w){f=""+w},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Ft(r){r._valueTracker||(r._valueTracker=nt(r))}function tn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var c=s.getValue(),f="";return r&&(f=He(r)?r.checked?"true":"false":r.value),r=f,r!==c?(s.setValue(r),!0):!1}function $e(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Ln(r,s){var c=s.checked;return C({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??r._wrapperState.initialChecked})}function Ir(r,s){var c=s.defaultValue==null?"":s.defaultValue,f=s.checked!=null?s.checked:s.defaultChecked;c=Le(s.value!=null?s.value:c),r._wrapperState={initialChecked:f,initialValue:c,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Qe(r,s){s=s.checked,s!=null&&L(r,"checked",s,!1)}function In(r,s){Qe(r,s);var c=Le(s.value),f=s.type;if(c!=null)f==="number"?(c===0&&r.value===""||r.value!=c)&&(r.value=""+c):r.value!==""+c&&(r.value=""+c);else if(f==="submit"||f==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?_r(r,s.type,c):s.hasOwnProperty("defaultValue")&&_r(r,s.type,Le(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Wn(r,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=""+r._wrapperState.initialValue,c||s===r.value||(r.value=s),r.defaultValue=s}c=r.name,c!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,c!==""&&(r.name=c)}function _r(r,s,c){(s!=="number"||$e(r.ownerDocument)!==r)&&(c==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+c&&(r.defaultValue=""+c))}var sr=Array.isArray;function vr(r,s,c,f){if(r=r.options,s){s={};for(var m=0;m<c.length;m++)s["$"+c[m]]=!0;for(c=0;c<r.length;c++)m=s.hasOwnProperty("$"+r[c].value),r[c].selected!==m&&(r[c].selected=m),m&&f&&(r[c].defaultSelected=!0)}else{for(c=""+Le(c),s=null,m=0;m<r.length;m++){if(r[m].value===c){r[m].selected=!0,f&&(r[m].defaultSelected=!0);return}s!==null||r[m].disabled||(s=r[m])}s!==null&&(s.selected=!0)}}function Ti(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return C({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Ri(r,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(sr(c)){if(1<c.length)throw Error(n(93));c=c[0]}s=c}s==null&&(s=""),c=s}r._wrapperState={initialValue:Le(c)}}function Kn(r,s){var c=Le(s.value),f=Le(s.defaultValue);c!=null&&(c=""+c,c!==r.value&&(r.value=c),s.defaultValue==null&&r.defaultValue!==c&&(r.defaultValue=c)),f!=null&&(r.defaultValue=""+f)}function Ai(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function X(r){switch(r){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 he(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?X(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Oe,je=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,c,f,m){MSApp.execUnsafeLocalFunction(function(){return r(s,c,f,m)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(Oe=Oe||document.createElement("div"),Oe.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Oe.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function Xe(r,s){if(s){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=s;return}}r.textContent=s}var zt={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},or=["Webkit","ms","Moz","O"];Object.keys(zt).forEach(function(r){or.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),zt[s]=zt[r]})});function kn(r,s,c){return s==null||typeof s=="boolean"||s===""?"":c||typeof s!="number"||s===0||zt.hasOwnProperty(r)&&zt[r]?(""+s).trim():s+"px"}function ar(r,s){r=r.style;for(var c in s)if(s.hasOwnProperty(c)){var f=c.indexOf("--")===0,m=kn(c,s[c],f);c==="float"&&(c="cssFloat"),f?r.setProperty(c,m):r[c]=m}}var Pr=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 Ut(r,s){if(s){if(Pr[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));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 qn(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 nn=null;function us(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var hs=null,Jr=null,Br=null;function Fr(r){if(r=vo(r)){if(typeof hs!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Ba(s),hs(r.stateNode,r.type,s))}}function M(r){Jr?Br?Br.push(r):Br=[r]:Jr=r}function Q(){if(Jr){var r=Jr,s=Br;if(Br=Jr=null,Fr(r),s)for(r=0;r<s.length;r++)Fr(s[r])}}function pe(r,s){return r(s)}function Ie(){}var ht=!1;function mt(r,s,c){if(ht)return r(s,c);ht=!0;try{return pe(r,s,c)}finally{ht=!1,(Jr!==null||Br!==null)&&(Ie(),Q())}}function be(r,s){var c=r.stateNode;if(c===null)return null;var f=Ba(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)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(n(231,s,typeof c));return c}var ve=!1;if(u)try{var Te={};Object.defineProperty(Te,"passive",{get:function(){ve=!0}}),window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{ve=!1}function Dt(r,s,c,f,m,_,w,T,P){var V=Array.prototype.slice.call(arguments,3);try{s.apply(c,V)}catch(re){this.onError(re)}}var ct=!1,yr=null,ei=!1,Mi=null,_c={onError:function(r){ct=!0,yr=r}};function Zs(r,s,c,f,m,_,w,T,P){ct=!1,yr=null,Dt.apply(_c,arguments)}function vc(r,s,c,f,m,_,w,T,P){if(Zs.apply(this,arguments),ct){if(ct){var V=yr;ct=!1,yr=null}else throw Error(n(198));ei||(ei=!0,Mi=V)}}function zr(r){var s=r,c=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(c=s.return),r=s.return;while(r)}return s.tag===3?c:null}function ma(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function Qs(r){if(zr(r)!==r)throw Error(n(188))}function ds(r){var s=r.alternate;if(!s){if(s=zr(r),s===null)throw Error(n(188));return s!==r?null:r}for(var c=r,f=s;;){var m=c.return;if(m===null)break;var _=m.alternate;if(_===null){if(f=m.return,f!==null){c=f;continue}break}if(m.child===_.child){for(_=m.child;_;){if(_===c)return Qs(m),r;if(_===f)return Qs(m),s;_=_.sibling}throw Error(n(188))}if(c.return!==f.return)c=m,f=_;else{for(var w=!1,T=m.child;T;){if(T===c){w=!0,c=m,f=_;break}if(T===f){w=!0,f=m,c=_;break}T=T.sibling}if(!w){for(T=_.child;T;){if(T===c){w=!0,c=_,f=m;break}if(T===f){w=!0,f=_,c=m;break}T=T.sibling}if(!w)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?r:s}function ga(r){return r=ds(r),r!==null?_a(r):null}function _a(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=_a(r);if(s!==null)return s;r=r.sibling}return null}var va=t.unstable_scheduleCallback,lr=t.unstable_cancelCallback,ya=t.unstable_shouldYield,ba=t.unstable_requestPaint,yt=t.unstable_now,yc=t.unstable_getCurrentPriorityLevel,Js=t.unstable_ImmediatePriority,Oi=t.unstable_UserBlockingPriority,fs=t.unstable_NormalPriority,ce=t.unstable_LowPriority,Ce=t.unstable_IdlePriority,We=null,Ge=null;function Rt(r){if(Ge&&typeof Ge.onCommitFiberRoot=="function")try{Ge.onCommitFiberRoot(We,r,void 0,(r.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:mn,br=Math.log,ps=Math.LN2;function mn(r){return r>>>=0,r===0?32:31-(br(r)/ps|0)|0}var gn=64,Di=4194304;function ti(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Li(r,s){var c=r.pendingLanes;if(c===0)return 0;var f=0,m=r.suspendedLanes,_=r.pingedLanes,w=c&268435455;if(w!==0){var T=w&~m;T!==0?f=ti(T):(_&=w,_!==0&&(f=ti(_)))}else w=c&~m,w!==0?f=ti(w):_!==0&&(f=ti(_));if(f===0)return 0;if(s!==0&&s!==f&&(s&m)===0&&(m=f&-f,_=s&-s,m>=_||m===16&&(_&4194240)!==0))return s;if((f&4)!==0&&(f|=c&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=f;0<s;)c=31-bt(s),m=1<<c,f|=r[c],s&=~m;return f}function bc(r,s){switch(r){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 Sc(r,s){for(var c=r.suspendedLanes,f=r.pingedLanes,m=r.expirationTimes,_=r.pendingLanes;0<_;){var w=31-bt(_),T=1<<w,P=m[w];P===-1?((T&c)===0||(T&f)!==0)&&(m[w]=bc(T,s)):P<=s&&(r.expiredLanes|=T),_&=~T}}function eo(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Sa(){var r=gn;return gn<<=1,(gn&4194240)===0&&(gn=64),r}function ni(r){for(var s=[],c=0;31>c;c++)s.push(r);return s}function ri(r,s,c){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-bt(s),r[s]=c}function Vn(r,s){var c=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var f=r.eventTimes;for(r=r.expirationTimes;0<c;){var m=31-bt(c),_=1<<m;s[m]=0,f[m]=-1,r[m]=-1,c&=~_}}function to(r,s){var c=r.entangledLanes|=s;for(r=r.entanglements;c;){var f=31-bt(c),m=1<<f;m&s|r[f]&s&&(r[f]|=s),c&=~m}}var et=0;function Fe(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var no,At,it,Ii,Sr,Pi=!1,ii=[],fe=null,Se=null,De=null,Ze=new Map,Et=new Map,qt=[],wc="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 wa(r,s){switch(r){case"focusin":case"focusout":fe=null;break;case"dragenter":case"dragleave":Se=null;break;case"mouseover":case"mouseout":De=null;break;case"pointerover":case"pointerout":Ze.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Et.delete(s.pointerId)}}function ro(r,s,c,f,m,_){return r===null||r.nativeEvent!==_?(r={blockedOn:s,domEventName:c,eventSystemFlags:f,nativeEvent:_,targetContainers:[m]},s!==null&&(s=vo(s),s!==null&&At(s)),r):(r.eventSystemFlags|=f,s=r.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),r)}function Eb(r,s,c,f,m){switch(s){case"focusin":return fe=ro(fe,r,s,c,f,m),!0;case"dragenter":return Se=ro(Se,r,s,c,f,m),!0;case"mouseover":return De=ro(De,r,s,c,f,m),!0;case"pointerover":var _=m.pointerId;return Ze.set(_,ro(Ze.get(_)||null,r,s,c,f,m)),!0;case"gotpointercapture":return _=m.pointerId,Et.set(_,ro(Et.get(_)||null,r,s,c,f,m)),!0}return!1}function _f(r){var s=Bi(r.target);if(s!==null){var c=zr(s);if(c!==null){if(s=c.tag,s===13){if(s=ma(c),s!==null){r.blockedOn=s,Sr(r.priority,function(){it(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function xa(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var c=kc(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(c===null){c=r.nativeEvent;var f=new c.constructor(c.type,c);nn=f,c.target.dispatchEvent(f),nn=null}else return s=vo(c),s!==null&&At(s),r.blockedOn=c,!1;s.shift()}return!0}function vf(r,s,c){xa(r)&&c.delete(s)}function Cb(){Pi=!1,fe!==null&&xa(fe)&&(fe=null),Se!==null&&xa(Se)&&(Se=null),De!==null&&xa(De)&&(De=null),Ze.forEach(vf),Et.forEach(vf)}function io(r,s){r.blockedOn===s&&(r.blockedOn=null,Pi||(Pi=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Cb)))}function so(r){function s(m){return io(m,r)}if(0<ii.length){io(ii[0],r);for(var c=1;c<ii.length;c++){var f=ii[c];f.blockedOn===r&&(f.blockedOn=null)}}for(fe!==null&&io(fe,r),Se!==null&&io(Se,r),De!==null&&io(De,r),Ze.forEach(s),Et.forEach(s),c=0;c<qt.length;c++)f=qt[c],f.blockedOn===r&&(f.blockedOn=null);for(;0<qt.length&&(c=qt[0],c.blockedOn===null);)_f(c),c.blockedOn===null&&qt.shift()}var ms=A.ReactCurrentBatchConfig,ka=!0;function Nb(r,s,c,f){var m=et,_=ms.transition;ms.transition=null;try{et=1,xc(r,s,c,f)}finally{et=m,ms.transition=_}}function Tb(r,s,c,f){var m=et,_=ms.transition;ms.transition=null;try{et=4,xc(r,s,c,f)}finally{et=m,ms.transition=_}}function xc(r,s,c,f){if(ka){var m=kc(r,s,c,f);if(m===null)Hc(r,s,f,Ea,c),wa(r,f);else if(Eb(m,r,s,c,f))f.stopPropagation();else if(wa(r,f),s&4&&-1<wc.indexOf(r)){for(;m!==null;){var _=vo(m);if(_!==null&&no(_),_=kc(r,s,c,f),_===null&&Hc(r,s,f,Ea,c),_===m)break;m=_}m!==null&&f.stopPropagation()}else Hc(r,s,f,null,c)}}var Ea=null;function kc(r,s,c,f){if(Ea=null,r=us(f),r=Bi(r),r!==null)if(s=zr(r),s===null)r=null;else if(c=s.tag,c===13){if(r=ma(s),r!==null)return r;r=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return Ea=r,null}function yf(r){switch(r){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(yc()){case Js:return 1;case Oi:return 4;case fs:case ce:return 16;case Ce:return 536870912;default:return 16}default:return 16}}var si=null,Ec=null,Ca=null;function bf(){if(Ca)return Ca;var r,s=Ec,c=s.length,f,m="value"in si?si.value:si.textContent,_=m.length;for(r=0;r<c&&s[r]===m[r];r++);var w=c-r;for(f=1;f<=w&&s[c-f]===m[_-f];f++);return Ca=m.slice(r,1<f?1-f:void 0)}function Na(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Ta(){return!0}function Sf(){return!1}function Pn(r){function s(c,f,m,_,w){this._reactName=c,this._targetInst=m,this.type=f,this.nativeEvent=_,this.target=w,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(c=r[T],this[T]=c?c(_):_[T]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Ta:Sf,this.isPropagationStopped=Sf,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=Ta)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Ta)},persist:function(){},isPersistent:Ta}),s}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cc=Pn(gs),oo=C({},gs,{view:0,detail:0}),Rb=Pn(oo),Nc,Tc,ao,Ra=C({},oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ac,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ao&&(ao&&r.type==="mousemove"?(Nc=r.screenX-ao.screenX,Tc=r.screenY-ao.screenY):Tc=Nc=0,ao=r),Nc)},movementY:function(r){return"movementY"in r?r.movementY:Tc}}),wf=Pn(Ra),Ab=C({},Ra,{dataTransfer:0}),Mb=Pn(Ab),Ob=C({},oo,{relatedTarget:0}),Rc=Pn(Ob),Db=C({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),Lb=Pn(Db),Ib=C({},gs,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Pb=Pn(Ib),Bb=C({},gs,{data:0}),xf=Pn(Bb),Fb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zb={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"},Ub={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hb(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=Ub[r])?!!s[r]:!1}function Ac(){return Hb}var $b=C({},oo,{key:function(r){if(r.key){var s=Fb[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Na(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?zb[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ac,charCode:function(r){return r.type==="keypress"?Na(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Na(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),jb=Pn($b),Wb=C({},Ra,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kf=Pn(Wb),Kb=C({},oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ac}),qb=Pn(Kb),Vb=C({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gb=Pn(Vb),Yb=C({},Ra,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Xb=Pn(Yb),Zb=[9,13,27,32],Mc=u&&"CompositionEvent"in window,lo=null;u&&"documentMode"in document&&(lo=document.documentMode);var Qb=u&&"TextEvent"in window&&!lo,Ef=u&&(!Mc||lo&&8<lo&&11>=lo),Cf=" ",Nf=!1;function Tf(r,s){switch(r){case"keyup":return Zb.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rf(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var _s=!1;function Jb(r,s){switch(r){case"compositionend":return Rf(s);case"keypress":return s.which!==32?null:(Nf=!0,Cf);case"textInput":return r=s.data,r===Cf&&Nf?null:r;default:return null}}function eS(r,s){if(_s)return r==="compositionend"||!Mc&&Tf(r,s)?(r=bf(),Ca=Ec=si=null,_s=!1,r):null;switch(r){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 Ef&&s.locale!=="ko"?null:s.data;default:return null}}var tS={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 Af(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!tS[r.type]:s==="textarea"}function Mf(r,s,c,f){M(f),s=La(s,"onChange"),0<s.length&&(c=new Cc("onChange","change",null,c,f),r.push({event:c,listeners:s}))}var co=null,uo=null;function nS(r){Yf(r,0)}function Aa(r){var s=ws(r);if(tn(s))return r}function rS(r,s){if(r==="change")return s}var Of=!1;if(u){var Oc;if(u){var Dc="oninput"in document;if(!Dc){var Df=document.createElement("div");Df.setAttribute("oninput","return;"),Dc=typeof Df.oninput=="function"}Oc=Dc}else Oc=!1;Of=Oc&&(!document.documentMode||9<document.documentMode)}function Lf(){co&&(co.detachEvent("onpropertychange",If),uo=co=null)}function If(r){if(r.propertyName==="value"&&Aa(uo)){var s=[];Mf(s,uo,r,us(r)),mt(nS,s)}}function iS(r,s,c){r==="focusin"?(Lf(),co=s,uo=c,co.attachEvent("onpropertychange",If)):r==="focusout"&&Lf()}function sS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Aa(uo)}function oS(r,s){if(r==="click")return Aa(s)}function aS(r,s){if(r==="input"||r==="change")return Aa(s)}function lS(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var cr=typeof Object.is=="function"?Object.is:lS;function ho(r,s){if(cr(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),f=Object.keys(s);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var m=c[f];if(!d.call(s,m)||!cr(r[m],s[m]))return!1}return!0}function Pf(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Bf(r,s){var c=Pf(r);r=0;for(var f;c;){if(c.nodeType===3){if(f=r+c.textContent.length,r<=s&&f>=s)return{node:c,offset:s-r};r=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Pf(c)}}function Ff(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Ff(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function zf(){for(var r=window,s=$e();s instanceof r.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)r=s.contentWindow;else break;s=$e(r.document)}return s}function Lc(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function cS(r){var s=zf(),c=r.focusedElem,f=r.selectionRange;if(s!==c&&c&&c.ownerDocument&&Ff(c.ownerDocument.documentElement,c)){if(f!==null&&Lc(c)){if(s=f.start,r=f.end,r===void 0&&(r=s),"selectionStart"in c)c.selectionStart=s,c.selectionEnd=Math.min(r,c.value.length);else if(r=(s=c.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var m=c.textContent.length,_=Math.min(f.start,m);f=f.end===void 0?_:Math.min(f.end,m),!r.extend&&_>f&&(m=f,f=_,_=m),m=Bf(c,_);var w=Bf(c,f);m&&w&&(r.rangeCount!==1||r.anchorNode!==m.node||r.anchorOffset!==m.offset||r.focusNode!==w.node||r.focusOffset!==w.offset)&&(s=s.createRange(),s.setStart(m.node,m.offset),r.removeAllRanges(),_>f?(r.addRange(s),r.extend(w.node,w.offset)):(s.setEnd(w.node,w.offset),r.addRange(s)))}}for(s=[],r=c;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<s.length;c++)r=s[c],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var uS=u&&"documentMode"in document&&11>=document.documentMode,vs=null,Ic=null,fo=null,Pc=!1;function Uf(r,s,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Pc||vs==null||vs!==$e(f)||(f=vs,"selectionStart"in f&&Lc(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}),fo&&ho(fo,f)||(fo=f,f=La(Ic,"onSelect"),0<f.length&&(s=new Cc("onSelect","select",null,s,c),r.push({event:s,listeners:f}),s.target=vs)))}function Ma(r,s){var c={};return c[r.toLowerCase()]=s.toLowerCase(),c["Webkit"+r]="webkit"+s,c["Moz"+r]="moz"+s,c}var ys={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionend:Ma("Transition","TransitionEnd")},Bc={},Hf={};u&&(Hf=document.createElement("div").style,"AnimationEvent"in window||(delete ys.animationend.animation,delete ys.animationiteration.animation,delete ys.animationstart.animation),"TransitionEvent"in window||delete ys.transitionend.transition);function Oa(r){if(Bc[r])return Bc[r];if(!ys[r])return r;var s=ys[r],c;for(c in s)if(s.hasOwnProperty(c)&&c in Hf)return Bc[r]=s[c];return r}var $f=Oa("animationend"),jf=Oa("animationiteration"),Wf=Oa("animationstart"),Kf=Oa("transitionend"),qf=new Map,Vf="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 oi(r,s){qf.set(r,s),a(s,[r])}for(var Fc=0;Fc<Vf.length;Fc++){var zc=Vf[Fc],hS=zc.toLowerCase(),dS=zc[0].toUpperCase()+zc.slice(1);oi(hS,"on"+dS)}oi($f,"onAnimationEnd"),oi(jf,"onAnimationIteration"),oi(Wf,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(Kf,"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 po="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(" "),fS=new Set("cancel close invalid load scroll toggle".split(" ").concat(po));function Gf(r,s,c){var f=r.type||"unknown-event";r.currentTarget=c,vc(f,s,void 0,r),r.currentTarget=null}function Yf(r,s){s=(s&4)!==0;for(var c=0;c<r.length;c++){var f=r[c],m=f.event;f=f.listeners;e:{var _=void 0;if(s)for(var w=f.length-1;0<=w;w--){var T=f[w],P=T.instance,V=T.currentTarget;if(T=T.listener,P!==_&&m.isPropagationStopped())break e;Gf(m,T,V),_=P}else for(w=0;w<f.length;w++){if(T=f[w],P=T.instance,V=T.currentTarget,T=T.listener,P!==_&&m.isPropagationStopped())break e;Gf(m,T,V),_=P}}}if(ei)throw r=Mi,ei=!1,Mi=null,r}function dt(r,s){var c=s[Vc];c===void 0&&(c=s[Vc]=new Set);var f=r+"__bubble";c.has(f)||(Xf(s,r,2,!1),c.add(f))}function Uc(r,s,c){var f=0;s&&(f|=4),Xf(c,r,f,s)}var Da="_reactListening"+Math.random().toString(36).slice(2);function mo(r){if(!r[Da]){r[Da]=!0,i.forEach(function(c){c!=="selectionchange"&&(fS.has(c)||Uc(c,!1,r),Uc(c,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Da]||(s[Da]=!0,Uc("selectionchange",!1,s))}}function Xf(r,s,c,f){switch(yf(s)){case 1:var m=Nb;break;case 4:m=Tb;break;default:m=xc}c=m.bind(null,s,c,r),m=void 0,!ve||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(m=!0),f?m!==void 0?r.addEventListener(s,c,{capture:!0,passive:m}):r.addEventListener(s,c,!0):m!==void 0?r.addEventListener(s,c,{passive:m}):r.addEventListener(s,c,!1)}function Hc(r,s,c,f,m){var _=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var w=f.tag;if(w===3||w===4){var T=f.stateNode.containerInfo;if(T===m||T.nodeType===8&&T.parentNode===m)break;if(w===4)for(w=f.return;w!==null;){var P=w.tag;if((P===3||P===4)&&(P=w.stateNode.containerInfo,P===m||P.nodeType===8&&P.parentNode===m))return;w=w.return}for(;T!==null;){if(w=Bi(T),w===null)return;if(P=w.tag,P===5||P===6){f=_=w;continue e}T=T.parentNode}}f=f.return}mt(function(){var V=_,re=us(c),ae=[];e:{var ne=qf.get(r);if(ne!==void 0){var ge=Cc,xe=r;switch(r){case"keypress":if(Na(c)===0)break e;case"keydown":case"keyup":ge=jb;break;case"focusin":xe="focus",ge=Rc;break;case"focusout":xe="blur",ge=Rc;break;case"beforeblur":case"afterblur":ge=Rc;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":ge=wf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Mb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=qb;break;case $f:case jf:case Wf:ge=Lb;break;case Kf:ge=Gb;break;case"scroll":ge=Rb;break;case"wheel":ge=Xb;break;case"copy":case"cut":case"paste":ge=Pb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=kf}var ke=(s&4)!==0,Mt=!ke&&r==="scroll",U=ke?ne!==null?ne+"Capture":null:ne;ke=[];for(var B=V,j;B!==null;){j=B;var ue=j.stateNode;if(j.tag===5&&ue!==null&&(j=ue,U!==null&&(ue=be(B,U),ue!=null&&ke.push(go(B,ue,j)))),Mt)break;B=B.return}0<ke.length&&(ne=new ge(ne,xe,null,c,re),ae.push({event:ne,listeners:ke}))}}if((s&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",ge=r==="mouseout"||r==="pointerout",ne&&c!==nn&&(xe=c.relatedTarget||c.fromElement)&&(Bi(xe)||xe[Ur]))break e;if((ge||ne)&&(ne=re.window===re?re:(ne=re.ownerDocument)?ne.defaultView||ne.parentWindow:window,ge?(xe=c.relatedTarget||c.toElement,ge=V,xe=xe?Bi(xe):null,xe!==null&&(Mt=zr(xe),xe!==Mt||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ge=null,xe=V),ge!==xe)){if(ke=wf,ue="onMouseLeave",U="onMouseEnter",B="mouse",(r==="pointerout"||r==="pointerover")&&(ke=kf,ue="onPointerLeave",U="onPointerEnter",B="pointer"),Mt=ge==null?ne:ws(ge),j=xe==null?ne:ws(xe),ne=new ke(ue,B+"leave",ge,c,re),ne.target=Mt,ne.relatedTarget=j,ue=null,Bi(re)===V&&(ke=new ke(U,B+"enter",xe,c,re),ke.target=j,ke.relatedTarget=Mt,ue=ke),Mt=ue,ge&&xe)t:{for(ke=ge,U=xe,B=0,j=ke;j;j=bs(j))B++;for(j=0,ue=U;ue;ue=bs(ue))j++;for(;0<B-j;)ke=bs(ke),B--;for(;0<j-B;)U=bs(U),j--;for(;B--;){if(ke===U||U!==null&&ke===U.alternate)break t;ke=bs(ke),U=bs(U)}ke=null}else ke=null;ge!==null&&Zf(ae,ne,ge,ke,!1),xe!==null&&Mt!==null&&Zf(ae,Mt,xe,ke,!0)}}e:{if(ne=V?ws(V):window,ge=ne.nodeName&&ne.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ne.type==="file")var Ee=rS;else if(Af(ne))if(Of)Ee=aS;else{Ee=sS;var Re=iS}else(ge=ne.nodeName)&&ge.toLowerCase()==="input"&&(ne.type==="checkbox"||ne.type==="radio")&&(Ee=oS);if(Ee&&(Ee=Ee(r,V))){Mf(ae,Ee,c,re);break e}Re&&Re(r,ne,V),r==="focusout"&&(Re=ne._wrapperState)&&Re.controlled&&ne.type==="number"&&_r(ne,"number",ne.value)}switch(Re=V?ws(V):window,r){case"focusin":(Af(Re)||Re.contentEditable==="true")&&(vs=Re,Ic=V,fo=null);break;case"focusout":fo=Ic=vs=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,Uf(ae,c,re);break;case"selectionchange":if(uS)break;case"keydown":case"keyup":Uf(ae,c,re)}var Ae;if(Mc)e:{switch(r){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else _s?Tf(r,c)&&(Pe="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(Pe="onCompositionStart");Pe&&(Ef&&c.locale!=="ko"&&(_s||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&_s&&(Ae=bf()):(si=re,Ec="value"in si?si.value:si.textContent,_s=!0)),Re=La(V,Pe),0<Re.length&&(Pe=new xf(Pe,r,null,c,re),ae.push({event:Pe,listeners:Re}),Ae?Pe.data=Ae:(Ae=Rf(c),Ae!==null&&(Pe.data=Ae)))),(Ae=Qb?Jb(r,c):eS(r,c))&&(V=La(V,"onBeforeInput"),0<V.length&&(re=new xf("onBeforeInput","beforeinput",null,c,re),ae.push({event:re,listeners:V}),re.data=Ae))}Yf(ae,s)})}function go(r,s,c){return{instance:r,listener:s,currentTarget:c}}function La(r,s){for(var c=s+"Capture",f=[];r!==null;){var m=r,_=m.stateNode;m.tag===5&&_!==null&&(m=_,_=be(r,c),_!=null&&f.unshift(go(r,_,m)),_=be(r,s),_!=null&&f.push(go(r,_,m))),r=r.return}return f}function bs(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Zf(r,s,c,f,m){for(var _=s._reactName,w=[];c!==null&&c!==f;){var T=c,P=T.alternate,V=T.stateNode;if(P!==null&&P===f)break;T.tag===5&&V!==null&&(T=V,m?(P=be(c,_),P!=null&&w.unshift(go(c,P,T))):m||(P=be(c,_),P!=null&&w.push(go(c,P,T)))),c=c.return}w.length!==0&&r.push({event:s,listeners:w})}var pS=/\r\n?/g,mS=/\u0000|\uFFFD/g;function Qf(r){return(typeof r=="string"?r:""+r).replace(pS,`
|
|
38
|
-
`).replace(mS,"")}function Ia(r,s,c){if(s=Qf(s),Qf(r)!==s&&c)throw Error(n(425))}function Pa(){}var $c=null,jc=null;function Wc(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Kc=typeof setTimeout=="function"?setTimeout:void 0,gS=typeof clearTimeout=="function"?clearTimeout:void 0,Jf=typeof Promise=="function"?Promise:void 0,_S=typeof queueMicrotask=="function"?queueMicrotask:typeof Jf<"u"?function(r){return Jf.resolve(null).then(r).catch(vS)}:Kc;function vS(r){setTimeout(function(){throw r})}function qc(r,s){var c=s,f=0;do{var m=c.nextSibling;if(r.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(f===0){r.removeChild(m),so(s);return}f--}else c!=="$"&&c!=="$?"&&c!=="$!"||f++;c=m}while(c);so(s)}function ai(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function ep(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"){if(s===0)return r;s--}else c==="/$"&&s++}r=r.previousSibling}return null}var Ss=Math.random().toString(36).slice(2),wr="__reactFiber$"+Ss,_o="__reactProps$"+Ss,Ur="__reactContainer$"+Ss,Vc="__reactEvents$"+Ss,yS="__reactListeners$"+Ss,bS="__reactHandles$"+Ss;function Bi(r){var s=r[wr];if(s)return s;for(var c=r.parentNode;c;){if(s=c[Ur]||c[wr]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(r=ep(r);r!==null;){if(c=r[wr])return c;r=ep(r)}return s}r=c,c=r.parentNode}return null}function vo(r){return r=r[wr]||r[Ur],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function ws(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Ba(r){return r[_o]||null}var Gc=[],xs=-1;function li(r){return{current:r}}function ft(r){0>xs||(r.current=Gc[xs],Gc[xs]=null,xs--)}function ut(r,s){xs++,Gc[xs]=r.current,r.current=s}var ci={},ln=li(ci),En=li(!1),Fi=ci;function ks(r,s){var c=r.type.contextTypes;if(!c)return ci;var f=r.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===s)return f.__reactInternalMemoizedMaskedChildContext;var m={},_;for(_ in c)m[_]=s[_];return f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=m),m}function Cn(r){return r=r.childContextTypes,r!=null}function Fa(){ft(En),ft(ln)}function tp(r,s,c){if(ln.current!==ci)throw Error(n(168));ut(ln,s),ut(En,c)}function np(r,s,c){var f=r.stateNode;if(s=s.childContextTypes,typeof f.getChildContext!="function")return c;f=f.getChildContext();for(var m in f)if(!(m in s))throw Error(n(108,Ue(r)||"Unknown",m));return C({},c,f)}function za(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||ci,Fi=ln.current,ut(ln,r),ut(En,En.current),!0}function rp(r,s,c){var f=r.stateNode;if(!f)throw Error(n(169));c?(r=np(r,s,Fi),f.__reactInternalMemoizedMergedChildContext=r,ft(En),ft(ln),ut(ln,r)):ft(En),ut(En,c)}var Hr=null,Ua=!1,Yc=!1;function ip(r){Hr===null?Hr=[r]:Hr.push(r)}function SS(r){Ua=!0,ip(r)}function ui(){if(!Yc&&Hr!==null){Yc=!0;var r=0,s=et;try{var c=Hr;for(et=1;r<c.length;r++){var f=c[r];do f=f(!0);while(f!==null)}Hr=null,Ua=!1}catch(m){throw Hr!==null&&(Hr=Hr.slice(r+1)),va(Js,ui),m}finally{et=s,Yc=!1}}return null}var Es=[],Cs=0,Ha=null,$a=0,Gn=[],Yn=0,zi=null,$r=1,jr="";function Ui(r,s){Es[Cs++]=$a,Es[Cs++]=Ha,Ha=r,$a=s}function sp(r,s,c){Gn[Yn++]=$r,Gn[Yn++]=jr,Gn[Yn++]=zi,zi=r;var f=$r;r=jr;var m=32-bt(f)-1;f&=~(1<<m),c+=1;var _=32-bt(s)+m;if(30<_){var w=m-m%5;_=(f&(1<<w)-1).toString(32),f>>=w,m-=w,$r=1<<32-bt(s)+m|c<<m|f,jr=_+r}else $r=1<<_|c<<m|f,jr=r}function Xc(r){r.return!==null&&(Ui(r,1),sp(r,1,0))}function Zc(r){for(;r===Ha;)Ha=Es[--Cs],Es[Cs]=null,$a=Es[--Cs],Es[Cs]=null;for(;r===zi;)zi=Gn[--Yn],Gn[Yn]=null,jr=Gn[--Yn],Gn[Yn]=null,$r=Gn[--Yn],Gn[Yn]=null}var Bn=null,Fn=null,gt=!1,ur=null;function op(r,s){var c=Jn(5,null,null,0);c.elementType="DELETED",c.stateNode=s,c.return=r,s=r.deletions,s===null?(r.deletions=[c],r.flags|=16):s.push(c)}function ap(r,s){switch(r.tag){case 5:var c=r.type;return s=s.nodeType!==1||c.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,Bn=r,Fn=ai(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,Bn=r,Fn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(c=zi!==null?{id:$r,overflow:jr}:null,r.memoizedState={dehydrated:s,treeContext:c,retryLane:1073741824},c=Jn(18,null,null,0),c.stateNode=s,c.return=r,r.child=c,Bn=r,Fn=null,!0):!1;default:return!1}}function Qc(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Jc(r){if(gt){var s=Fn;if(s){var c=s;if(!ap(r,s)){if(Qc(r))throw Error(n(418));s=ai(c.nextSibling);var f=Bn;s&&ap(r,s)?op(f,c):(r.flags=r.flags&-4097|2,gt=!1,Bn=r)}}else{if(Qc(r))throw Error(n(418));r.flags=r.flags&-4097|2,gt=!1,Bn=r}}}function lp(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Bn=r}function ja(r){if(r!==Bn)return!1;if(!gt)return lp(r),gt=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!Wc(r.type,r.memoizedProps)),s&&(s=Fn)){if(Qc(r))throw cp(),Error(n(418));for(;s;)op(r,s),s=ai(s.nextSibling)}if(lp(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"){if(s===0){Fn=ai(r.nextSibling);break e}s--}else c!=="$"&&c!=="$!"&&c!=="$?"||s++}r=r.nextSibling}Fn=null}}else Fn=Bn?ai(r.stateNode.nextSibling):null;return!0}function cp(){for(var r=Fn;r;)r=ai(r.nextSibling)}function Ns(){Fn=Bn=null,gt=!1}function eu(r){ur===null?ur=[r]:ur.push(r)}var wS=A.ReactCurrentBatchConfig;function yo(r,s,c){if(r=c.ref,r!==null&&typeof r!="function"&&typeof r!="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,r));var m=f,_=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===_?s.ref:(s=function(w){var T=m.refs;w===null?delete T[_]:T[_]=w},s._stringRef=_,s)}if(typeof r!="string")throw Error(n(284));if(!c._owner)throw Error(n(290,r))}return r}function Wa(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function up(r){var s=r._init;return s(r._payload)}function hp(r){function s(U,B){if(r){var j=U.deletions;j===null?(U.deletions=[B],U.flags|=16):j.push(B)}}function c(U,B){if(!r)return null;for(;B!==null;)s(U,B),B=B.sibling;return null}function f(U,B){for(U=new Map;B!==null;)B.key!==null?U.set(B.key,B):U.set(B.index,B),B=B.sibling;return U}function m(U,B){return U=vi(U,B),U.index=0,U.sibling=null,U}function _(U,B,j){return U.index=j,r?(j=U.alternate,j!==null?(j=j.index,j<B?(U.flags|=2,B):j):(U.flags|=2,B)):(U.flags|=1048576,B)}function w(U){return r&&U.alternate===null&&(U.flags|=2),U}function T(U,B,j,ue){return B===null||B.tag!==6?(B=Ku(j,U.mode,ue),B.return=U,B):(B=m(B,j),B.return=U,B)}function P(U,B,j,ue){var Ee=j.type;return Ee===se?re(U,B,j.props.children,ue,j.key):B!==null&&(B.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Z&&up(Ee)===B.type)?(ue=m(B,j.props),ue.ref=yo(U,B,j),ue.return=U,ue):(ue=pl(j.type,j.key,j.props,null,U.mode,ue),ue.ref=yo(U,B,j),ue.return=U,ue)}function V(U,B,j,ue){return B===null||B.tag!==4||B.stateNode.containerInfo!==j.containerInfo||B.stateNode.implementation!==j.implementation?(B=qu(j,U.mode,ue),B.return=U,B):(B=m(B,j.children||[]),B.return=U,B)}function re(U,B,j,ue,Ee){return B===null||B.tag!==7?(B=Gi(j,U.mode,ue,Ee),B.return=U,B):(B=m(B,j),B.return=U,B)}function ae(U,B,j){if(typeof B=="string"&&B!==""||typeof B=="number")return B=Ku(""+B,U.mode,j),B.return=U,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case H:return j=pl(B.type,B.key,B.props,null,U.mode,j),j.ref=yo(U,null,B),j.return=U,j;case D:return B=qu(B,U.mode,j),B.return=U,B;case Z:var ue=B._init;return ae(U,ue(B._payload),j)}if(sr(B)||te(B))return B=Gi(B,U.mode,j,null),B.return=U,B;Wa(U,B)}return null}function ne(U,B,j,ue){var Ee=B!==null?B.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return Ee!==null?null:T(U,B,""+j,ue);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case H:return j.key===Ee?P(U,B,j,ue):null;case D:return j.key===Ee?V(U,B,j,ue):null;case Z:return Ee=j._init,ne(U,B,Ee(j._payload),ue)}if(sr(j)||te(j))return Ee!==null?null:re(U,B,j,ue,null);Wa(U,j)}return null}function ge(U,B,j,ue,Ee){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return U=U.get(j)||null,T(B,U,""+ue,Ee);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case H:return U=U.get(ue.key===null?j:ue.key)||null,P(B,U,ue,Ee);case D:return U=U.get(ue.key===null?j:ue.key)||null,V(B,U,ue,Ee);case Z:var Re=ue._init;return ge(U,B,j,Re(ue._payload),Ee)}if(sr(ue)||te(ue))return U=U.get(j)||null,re(B,U,ue,Ee,null);Wa(B,ue)}return null}function xe(U,B,j,ue){for(var Ee=null,Re=null,Ae=B,Pe=B=0,Yt=null;Ae!==null&&Pe<j.length;Pe++){Ae.index>Pe?(Yt=Ae,Ae=null):Yt=Ae.sibling;var rt=ne(U,Ae,j[Pe],ue);if(rt===null){Ae===null&&(Ae=Yt);break}r&&Ae&&rt.alternate===null&&s(U,Ae),B=_(rt,B,Pe),Re===null?Ee=rt:Re.sibling=rt,Re=rt,Ae=Yt}if(Pe===j.length)return c(U,Ae),gt&&Ui(U,Pe),Ee;if(Ae===null){for(;Pe<j.length;Pe++)Ae=ae(U,j[Pe],ue),Ae!==null&&(B=_(Ae,B,Pe),Re===null?Ee=Ae:Re.sibling=Ae,Re=Ae);return gt&&Ui(U,Pe),Ee}for(Ae=f(U,Ae);Pe<j.length;Pe++)Yt=ge(Ae,U,Pe,j[Pe],ue),Yt!==null&&(r&&Yt.alternate!==null&&Ae.delete(Yt.key===null?Pe:Yt.key),B=_(Yt,B,Pe),Re===null?Ee=Yt:Re.sibling=Yt,Re=Yt);return r&&Ae.forEach(function(yi){return s(U,yi)}),gt&&Ui(U,Pe),Ee}function ke(U,B,j,ue){var Ee=te(j);if(typeof Ee!="function")throw Error(n(150));if(j=Ee.call(j),j==null)throw Error(n(151));for(var Re=Ee=null,Ae=B,Pe=B=0,Yt=null,rt=j.next();Ae!==null&&!rt.done;Pe++,rt=j.next()){Ae.index>Pe?(Yt=Ae,Ae=null):Yt=Ae.sibling;var yi=ne(U,Ae,rt.value,ue);if(yi===null){Ae===null&&(Ae=Yt);break}r&&Ae&&yi.alternate===null&&s(U,Ae),B=_(yi,B,Pe),Re===null?Ee=yi:Re.sibling=yi,Re=yi,Ae=Yt}if(rt.done)return c(U,Ae),gt&&Ui(U,Pe),Ee;if(Ae===null){for(;!rt.done;Pe++,rt=j.next())rt=ae(U,rt.value,ue),rt!==null&&(B=_(rt,B,Pe),Re===null?Ee=rt:Re.sibling=rt,Re=rt);return gt&&Ui(U,Pe),Ee}for(Ae=f(U,Ae);!rt.done;Pe++,rt=j.next())rt=ge(Ae,U,Pe,rt.value,ue),rt!==null&&(r&&rt.alternate!==null&&Ae.delete(rt.key===null?Pe:rt.key),B=_(rt,B,Pe),Re===null?Ee=rt:Re.sibling=rt,Re=rt);return r&&Ae.forEach(function(tw){return s(U,tw)}),gt&&Ui(U,Pe),Ee}function Mt(U,B,j,ue){if(typeof j=="object"&&j!==null&&j.type===se&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case H:e:{for(var Ee=j.key,Re=B;Re!==null;){if(Re.key===Ee){if(Ee=j.type,Ee===se){if(Re.tag===7){c(U,Re.sibling),B=m(Re,j.props.children),B.return=U,U=B;break e}}else if(Re.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Z&&up(Ee)===Re.type){c(U,Re.sibling),B=m(Re,j.props),B.ref=yo(U,Re,j),B.return=U,U=B;break e}c(U,Re);break}else s(U,Re);Re=Re.sibling}j.type===se?(B=Gi(j.props.children,U.mode,ue,j.key),B.return=U,U=B):(ue=pl(j.type,j.key,j.props,null,U.mode,ue),ue.ref=yo(U,B,j),ue.return=U,U=ue)}return w(U);case D:e:{for(Re=j.key;B!==null;){if(B.key===Re)if(B.tag===4&&B.stateNode.containerInfo===j.containerInfo&&B.stateNode.implementation===j.implementation){c(U,B.sibling),B=m(B,j.children||[]),B.return=U,U=B;break e}else{c(U,B);break}else s(U,B);B=B.sibling}B=qu(j,U.mode,ue),B.return=U,U=B}return w(U);case Z:return Re=j._init,Mt(U,B,Re(j._payload),ue)}if(sr(j))return xe(U,B,j,ue);if(te(j))return ke(U,B,j,ue);Wa(U,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,B!==null&&B.tag===6?(c(U,B.sibling),B=m(B,j),B.return=U,U=B):(c(U,B),B=Ku(j,U.mode,ue),B.return=U,U=B),w(U)):c(U,B)}return Mt}var Ts=hp(!0),dp=hp(!1),Ka=li(null),qa=null,Rs=null,tu=null;function nu(){tu=Rs=qa=null}function ru(r){var s=Ka.current;ft(Ka),r._currentValue=s}function iu(r,s,c){for(;r!==null;){var f=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),r===c)break;r=r.return}}function As(r,s){qa=r,tu=Rs=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(Nn=!0),r.firstContext=null)}function Xn(r){var s=r._currentValue;if(tu!==r)if(r={context:r,memoizedValue:s,next:null},Rs===null){if(qa===null)throw Error(n(308));Rs=r,qa.dependencies={lanes:0,firstContext:r}}else Rs=Rs.next=r;return s}var Hi=null;function su(r){Hi===null?Hi=[r]:Hi.push(r)}function fp(r,s,c,f){var m=s.interleaved;return m===null?(c.next=c,su(s)):(c.next=m.next,m.next=c),s.interleaved=c,Wr(r,f)}function Wr(r,s){r.lanes|=s;var c=r.alternate;for(c!==null&&(c.lanes|=s),c=r,r=r.return;r!==null;)r.childLanes|=s,c=r.alternate,c!==null&&(c.childLanes|=s),c=r,r=r.return;return c.tag===3?c.stateNode:null}var hi=!1;function ou(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pp(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Kr(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function di(r,s,c){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(tt&2)!==0){var m=f.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),f.pending=s,Wr(r,c)}return m=f.interleaved,m===null?(s.next=s,su(f)):(s.next=m.next,m.next=s),f.interleaved=s,Wr(r,c)}function Va(r,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194240)!==0)){var f=s.lanes;f&=r.pendingLanes,c|=f,s.lanes=c,to(r,c)}}function mp(r,s){var c=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var m=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var w={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};_===null?m=_=w:_=_.next=w,c=c.next}while(c!==null);_===null?m=_=s:_=_.next=s}else m=_=s;c={baseState:f.baseState,firstBaseUpdate:m,lastBaseUpdate:_,shared:f.shared,effects:f.effects},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=s:r.next=s,c.lastBaseUpdate=s}function Ga(r,s,c,f){var m=r.updateQueue;hi=!1;var _=m.firstBaseUpdate,w=m.lastBaseUpdate,T=m.shared.pending;if(T!==null){m.shared.pending=null;var P=T,V=P.next;P.next=null,w===null?_=V:w.next=V,w=P;var re=r.alternate;re!==null&&(re=re.updateQueue,T=re.lastBaseUpdate,T!==w&&(T===null?re.firstBaseUpdate=V:T.next=V,re.lastBaseUpdate=P))}if(_!==null){var ae=m.baseState;w=0,re=V=P=null,T=_;do{var ne=T.lane,ge=T.eventTime;if((f&ne)===ne){re!==null&&(re=re.next={eventTime:ge,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var xe=r,ke=T;switch(ne=s,ge=c,ke.tag){case 1:if(xe=ke.payload,typeof xe=="function"){ae=xe.call(ge,ae,ne);break e}ae=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ke.payload,ne=typeof xe=="function"?xe.call(ge,ae,ne):xe,ne==null)break e;ae=C({},ae,ne);break e;case 2:hi=!0}}T.callback!==null&&T.lane!==0&&(r.flags|=64,ne=m.effects,ne===null?m.effects=[T]:ne.push(T))}else ge={eventTime:ge,lane:ne,tag:T.tag,payload:T.payload,callback:T.callback,next:null},re===null?(V=re=ge,P=ae):re=re.next=ge,w|=ne;if(T=T.next,T===null){if(T=m.shared.pending,T===null)break;ne=T,T=ne.next,ne.next=null,m.lastBaseUpdate=ne,m.shared.pending=null}}while(!0);if(re===null&&(P=ae),m.baseState=P,m.firstBaseUpdate=V,m.lastBaseUpdate=re,s=m.shared.interleaved,s!==null){m=s;do w|=m.lane,m=m.next;while(m!==s)}else _===null&&(m.shared.lanes=0);Wi|=w,r.lanes=w,r.memoizedState=ae}}function gp(r,s,c){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var f=r[s],m=f.callback;if(m!==null){if(f.callback=null,f=c,typeof m!="function")throw Error(n(191,m));m.call(f)}}}var bo={},xr=li(bo),So=li(bo),wo=li(bo);function $i(r){if(r===bo)throw Error(n(174));return r}function au(r,s){switch(ut(wo,s),ut(So,r),ut(xr,bo),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:he(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=he(s,r)}ft(xr),ut(xr,s)}function Ms(){ft(xr),ft(So),ft(wo)}function _p(r){$i(wo.current);var s=$i(xr.current),c=he(s,r.type);s!==c&&(ut(So,r),ut(xr,c))}function lu(r){So.current===r&&(ft(xr),ft(So))}var St=li(0);function Ya(r){for(var s=r;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===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var cu=[];function uu(){for(var r=0;r<cu.length;r++)cu[r]._workInProgressVersionPrimary=null;cu.length=0}var Xa=A.ReactCurrentDispatcher,hu=A.ReactCurrentBatchConfig,ji=0,wt=null,Ht=null,Vt=null,Za=!1,xo=!1,ko=0,xS=0;function cn(){throw Error(n(321))}function du(r,s){if(s===null)return!1;for(var c=0;c<s.length&&c<r.length;c++)if(!cr(r[c],s[c]))return!1;return!0}function fu(r,s,c,f,m,_){if(ji=_,wt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Xa.current=r===null||r.memoizedState===null?NS:TS,r=c(f,m),xo){_=0;do{if(xo=!1,ko=0,25<=_)throw Error(n(301));_+=1,Vt=Ht=null,s.updateQueue=null,Xa.current=RS,r=c(f,m)}while(xo)}if(Xa.current=el,s=Ht!==null&&Ht.next!==null,ji=0,Vt=Ht=wt=null,Za=!1,s)throw Error(n(300));return r}function pu(){var r=ko!==0;return ko=0,r}function kr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?wt.memoizedState=Vt=r:Vt=Vt.next=r,Vt}function Zn(){if(Ht===null){var r=wt.alternate;r=r!==null?r.memoizedState:null}else r=Ht.next;var s=Vt===null?wt.memoizedState:Vt.next;if(s!==null)Vt=s,Ht=r;else{if(r===null)throw Error(n(310));Ht=r,r={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Vt===null?wt.memoizedState=Vt=r:Vt=Vt.next=r}return Vt}function Eo(r,s){return typeof s=="function"?s(r):s}function mu(r){var s=Zn(),c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=r;var f=Ht,m=f.baseQueue,_=c.pending;if(_!==null){if(m!==null){var w=m.next;m.next=_.next,_.next=w}f.baseQueue=m=_,c.pending=null}if(m!==null){_=m.next,f=f.baseState;var T=w=null,P=null,V=_;do{var re=V.lane;if((ji&re)===re)P!==null&&(P=P.next={lane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),f=V.hasEagerState?V.eagerState:r(f,V.action);else{var ae={lane:re,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null};P===null?(T=P=ae,w=f):P=P.next=ae,wt.lanes|=re,Wi|=re}V=V.next}while(V!==null&&V!==_);P===null?w=f:P.next=T,cr(f,s.memoizedState)||(Nn=!0),s.memoizedState=f,s.baseState=w,s.baseQueue=P,c.lastRenderedState=f}if(r=c.interleaved,r!==null){m=r;do _=m.lane,wt.lanes|=_,Wi|=_,m=m.next;while(m!==r)}else m===null&&(c.lanes=0);return[s.memoizedState,c.dispatch]}function gu(r){var s=Zn(),c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=r;var f=c.dispatch,m=c.pending,_=s.memoizedState;if(m!==null){c.pending=null;var w=m=m.next;do _=r(_,w.action),w=w.next;while(w!==m);cr(_,s.memoizedState)||(Nn=!0),s.memoizedState=_,s.baseQueue===null&&(s.baseState=_),c.lastRenderedState=_}return[_,f]}function vp(){}function yp(r,s){var c=wt,f=Zn(),m=s(),_=!cr(f.memoizedState,m);if(_&&(f.memoizedState=m,Nn=!0),f=f.queue,_u(wp.bind(null,c,f,r),[r]),f.getSnapshot!==s||_||Vt!==null&&Vt.memoizedState.tag&1){if(c.flags|=2048,Co(9,Sp.bind(null,c,f,m,s),void 0,null),Gt===null)throw Error(n(349));(ji&30)!==0||bp(c,s,m)}return m}function bp(r,s,c){r.flags|=16384,r={getSnapshot:s,value:c},s=wt.updateQueue,s===null?(s={lastEffect:null,stores:null},wt.updateQueue=s,s.stores=[r]):(c=s.stores,c===null?s.stores=[r]:c.push(r))}function Sp(r,s,c,f){s.value=c,s.getSnapshot=f,xp(s)&&kp(r)}function wp(r,s,c){return c(function(){xp(s)&&kp(r)})}function xp(r){var s=r.getSnapshot;r=r.value;try{var c=s();return!cr(r,c)}catch{return!0}}function kp(r){var s=Wr(r,1);s!==null&&pr(s,r,1,-1)}function Ep(r){var s=kr();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:r},s.queue=r,r=r.dispatch=CS.bind(null,wt,r),[s.memoizedState,r]}function Co(r,s,c,f){return r={tag:r,create:s,destroy:c,deps:f,next:null},s=wt.updateQueue,s===null?(s={lastEffect:null,stores:null},wt.updateQueue=s,s.lastEffect=r.next=r):(c=s.lastEffect,c===null?s.lastEffect=r.next=r:(f=c.next,c.next=r,r.next=f,s.lastEffect=r)),r}function Cp(){return Zn().memoizedState}function Qa(r,s,c,f){var m=kr();wt.flags|=r,m.memoizedState=Co(1|s,c,void 0,f===void 0?null:f)}function Ja(r,s,c,f){var m=Zn();f=f===void 0?null:f;var _=void 0;if(Ht!==null){var w=Ht.memoizedState;if(_=w.destroy,f!==null&&du(f,w.deps)){m.memoizedState=Co(s,c,_,f);return}}wt.flags|=r,m.memoizedState=Co(1|s,c,_,f)}function Np(r,s){return Qa(8390656,8,r,s)}function _u(r,s){return Ja(2048,8,r,s)}function Tp(r,s){return Ja(4,2,r,s)}function Rp(r,s){return Ja(4,4,r,s)}function Ap(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Mp(r,s,c){return c=c!=null?c.concat([r]):null,Ja(4,4,Ap.bind(null,s,r),c)}function vu(){}function Op(r,s){var c=Zn();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&du(s,f[1])?f[0]:(c.memoizedState=[r,s],r)}function Dp(r,s){var c=Zn();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&du(s,f[1])?f[0]:(r=r(),c.memoizedState=[r,s],r)}function Lp(r,s,c){return(ji&21)===0?(r.baseState&&(r.baseState=!1,Nn=!0),r.memoizedState=c):(cr(c,s)||(c=Sa(),wt.lanes|=c,Wi|=c,r.baseState=!0),s)}function kS(r,s){var c=et;et=c!==0&&4>c?c:4,r(!0);var f=hu.transition;hu.transition={};try{r(!1),s()}finally{et=c,hu.transition=f}}function Ip(){return Zn().memoizedState}function ES(r,s,c){var f=gi(r);if(c={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null},Pp(r))Bp(s,c);else if(c=fp(r,s,c,f),c!==null){var m=vn();pr(c,r,f,m),Fp(c,s,f)}}function CS(r,s,c){var f=gi(r),m={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null};if(Pp(r))Bp(s,m);else{var _=r.alternate;if(r.lanes===0&&(_===null||_.lanes===0)&&(_=s.lastRenderedReducer,_!==null))try{var w=s.lastRenderedState,T=_(w,c);if(m.hasEagerState=!0,m.eagerState=T,cr(T,w)){var P=s.interleaved;P===null?(m.next=m,su(s)):(m.next=P.next,P.next=m),s.interleaved=m;return}}catch{}finally{}c=fp(r,s,m,f),c!==null&&(m=vn(),pr(c,r,f,m),Fp(c,s,f))}}function Pp(r){var s=r.alternate;return r===wt||s!==null&&s===wt}function Bp(r,s){xo=Za=!0;var c=r.pending;c===null?s.next=s:(s.next=c.next,c.next=s),r.pending=s}function Fp(r,s,c){if((c&4194240)!==0){var f=s.lanes;f&=r.pendingLanes,c|=f,s.lanes=c,to(r,c)}}var el={readContext:Xn,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useInsertionEffect:cn,useLayoutEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useMutableSource:cn,useSyncExternalStore:cn,useId:cn,unstable_isNewReconciler:!1},NS={readContext:Xn,useCallback:function(r,s){return kr().memoizedState=[r,s===void 0?null:s],r},useContext:Xn,useEffect:Np,useImperativeHandle:function(r,s,c){return c=c!=null?c.concat([r]):null,Qa(4194308,4,Ap.bind(null,s,r),c)},useLayoutEffect:function(r,s){return Qa(4194308,4,r,s)},useInsertionEffect:function(r,s){return Qa(4,2,r,s)},useMemo:function(r,s){var c=kr();return s=s===void 0?null:s,r=r(),c.memoizedState=[r,s],r},useReducer:function(r,s,c){var f=kr();return s=c!==void 0?c(s):s,f.memoizedState=f.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},f.queue=r,r=r.dispatch=ES.bind(null,wt,r),[f.memoizedState,r]},useRef:function(r){var s=kr();return r={current:r},s.memoizedState=r},useState:Ep,useDebugValue:vu,useDeferredValue:function(r){return kr().memoizedState=r},useTransition:function(){var r=Ep(!1),s=r[0];return r=kS.bind(null,r[1]),kr().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,c){var f=wt,m=kr();if(gt){if(c===void 0)throw Error(n(407));c=c()}else{if(c=s(),Gt===null)throw Error(n(349));(ji&30)!==0||bp(f,s,c)}m.memoizedState=c;var _={value:c,getSnapshot:s};return m.queue=_,Np(wp.bind(null,f,_,r),[r]),f.flags|=2048,Co(9,Sp.bind(null,f,_,c,s),void 0,null),c},useId:function(){var r=kr(),s=Gt.identifierPrefix;if(gt){var c=jr,f=$r;c=(f&~(1<<32-bt(f)-1)).toString(32)+c,s=":"+s+"R"+c,c=ko++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=xS++,s=":"+s+"r"+c.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},TS={readContext:Xn,useCallback:Op,useContext:Xn,useEffect:_u,useImperativeHandle:Mp,useInsertionEffect:Tp,useLayoutEffect:Rp,useMemo:Dp,useReducer:mu,useRef:Cp,useState:function(){return mu(Eo)},useDebugValue:vu,useDeferredValue:function(r){var s=Zn();return Lp(s,Ht.memoizedState,r)},useTransition:function(){var r=mu(Eo)[0],s=Zn().memoizedState;return[r,s]},useMutableSource:vp,useSyncExternalStore:yp,useId:Ip,unstable_isNewReconciler:!1},RS={readContext:Xn,useCallback:Op,useContext:Xn,useEffect:_u,useImperativeHandle:Mp,useInsertionEffect:Tp,useLayoutEffect:Rp,useMemo:Dp,useReducer:gu,useRef:Cp,useState:function(){return gu(Eo)},useDebugValue:vu,useDeferredValue:function(r){var s=Zn();return Ht===null?s.memoizedState=r:Lp(s,Ht.memoizedState,r)},useTransition:function(){var r=gu(Eo)[0],s=Zn().memoizedState;return[r,s]},useMutableSource:vp,useSyncExternalStore:yp,useId:Ip,unstable_isNewReconciler:!1};function hr(r,s){if(r&&r.defaultProps){s=C({},s),r=r.defaultProps;for(var c in r)s[c]===void 0&&(s[c]=r[c]);return s}return s}function yu(r,s,c,f){s=r.memoizedState,c=c(f,s),c=c==null?s:C({},s,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var tl={isMounted:function(r){return(r=r._reactInternals)?zr(r)===r:!1},enqueueSetState:function(r,s,c){r=r._reactInternals;var f=vn(),m=gi(r),_=Kr(f,m);_.payload=s,c!=null&&(_.callback=c),s=di(r,_,m),s!==null&&(pr(s,r,m,f),Va(s,r,m))},enqueueReplaceState:function(r,s,c){r=r._reactInternals;var f=vn(),m=gi(r),_=Kr(f,m);_.tag=1,_.payload=s,c!=null&&(_.callback=c),s=di(r,_,m),s!==null&&(pr(s,r,m,f),Va(s,r,m))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var c=vn(),f=gi(r),m=Kr(c,f);m.tag=2,s!=null&&(m.callback=s),s=di(r,m,f),s!==null&&(pr(s,r,f,c),Va(s,r,f))}};function zp(r,s,c,f,m,_,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,_,w):s.prototype&&s.prototype.isPureReactComponent?!ho(c,f)||!ho(m,_):!0}function Up(r,s,c){var f=!1,m=ci,_=s.contextType;return typeof _=="object"&&_!==null?_=Xn(_):(m=Cn(s)?Fi:ln.current,f=s.contextTypes,_=(f=f!=null)?ks(r,m):ci),s=new s(c,_),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=tl,r.stateNode=s,s._reactInternals=r,f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=m,r.__reactInternalMemoizedMaskedChildContext=_),s}function Hp(r,s,c,f){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,f),s.state!==r&&tl.enqueueReplaceState(s,s.state,null)}function bu(r,s,c,f){var m=r.stateNode;m.props=c,m.state=r.memoizedState,m.refs={},ou(r);var _=s.contextType;typeof _=="object"&&_!==null?m.context=Xn(_):(_=Cn(s)?Fi:ln.current,m.context=ks(r,_)),m.state=r.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(yu(r,s,_,c),m.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(s=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),s!==m.state&&tl.enqueueReplaceState(m,m.state,null),Ga(r,c,m,f),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308)}function Os(r,s){try{var c="",f=s;do c+=Ne(f),f=f.return;while(f);var m=c}catch(_){m=`
|
|
37
|
+
`+m[w].replace(" at new "," at ");return r.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",r.displayName)),P}while(1<=w&&0<=T);break}}}finally{N=!1,Error.prepareStackTrace=c}return(r=r?r.displayName||r.name:"")?G(r):""}function Ne(r){switch(r.tag){case 5:return G(r.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return r=ye(r.type,!1),r;case 11:return r=ye(r.type.render,!1),r;case 1:return r=ye(r.type,!0),r;default:return""}}function _e(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case se:return"Fragment";case D:return"Portal";case ee:return"Profiler";case W:return"StrictMode";case K:return"Suspense";case q:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case Y:return(r.displayName||"Context")+".Consumer";case R:return(r._context.displayName||"Context")+".Provider";case $:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case z:return s=r.displayName||null,s!==null?s:_e(r.type)||"Memo";case Z:s=r._payload,r=r._init;try{return _e(r(s))}catch{}}return null}function Ue(r){var s=r.type;switch(r.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 r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _e(s);case 8:return s===W?"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 Le(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function He(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function nt(r){var s=He(r)?"checked":"value",c=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),f=""+r[s];if(!r.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,_=c.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return m.call(this)},set:function(w){f=""+w,_.call(this,w)}}),Object.defineProperty(r,s,{enumerable:c.enumerable}),{getValue:function(){return f},setValue:function(w){f=""+w},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Ft(r){r._valueTracker||(r._valueTracker=nt(r))}function tn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var c=s.getValue(),f="";return r&&(f=He(r)?r.checked?"true":"false":r.value),r=f,r!==c?(s.setValue(r),!0):!1}function $e(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Ln(r,s){var c=s.checked;return E({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??r._wrapperState.initialChecked})}function Ir(r,s){var c=s.defaultValue==null?"":s.defaultValue,f=s.checked!=null?s.checked:s.defaultChecked;c=Le(s.value!=null?s.value:c),r._wrapperState={initialChecked:f,initialValue:c,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Qe(r,s){s=s.checked,s!=null&&L(r,"checked",s,!1)}function In(r,s){Qe(r,s);var c=Le(s.value),f=s.type;if(c!=null)f==="number"?(c===0&&r.value===""||r.value!=c)&&(r.value=""+c):r.value!==""+c&&(r.value=""+c);else if(f==="submit"||f==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?_r(r,s.type,c):s.hasOwnProperty("defaultValue")&&_r(r,s.type,Le(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Wn(r,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=""+r._wrapperState.initialValue,c||s===r.value||(r.value=s),r.defaultValue=s}c=r.name,c!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,c!==""&&(r.name=c)}function _r(r,s,c){(s!=="number"||$e(r.ownerDocument)!==r)&&(c==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+c&&(r.defaultValue=""+c))}var sr=Array.isArray;function vr(r,s,c,f){if(r=r.options,s){s={};for(var m=0;m<c.length;m++)s["$"+c[m]]=!0;for(c=0;c<r.length;c++)m=s.hasOwnProperty("$"+r[c].value),r[c].selected!==m&&(r[c].selected=m),m&&f&&(r[c].defaultSelected=!0)}else{for(c=""+Le(c),s=null,m=0;m<r.length;m++){if(r[m].value===c){r[m].selected=!0,f&&(r[m].defaultSelected=!0);return}s!==null||r[m].disabled||(s=r[m])}s!==null&&(s.selected=!0)}}function Ti(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return E({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Ri(r,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(sr(c)){if(1<c.length)throw Error(n(93));c=c[0]}s=c}s==null&&(s=""),c=s}r._wrapperState={initialValue:Le(c)}}function Kn(r,s){var c=Le(s.value),f=Le(s.defaultValue);c!=null&&(c=""+c,c!==r.value&&(r.value=c),s.defaultValue==null&&r.defaultValue!==c&&(r.defaultValue=c)),f!=null&&(r.defaultValue=""+f)}function Ai(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function X(r){switch(r){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 he(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?X(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Oe,je=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,c,f,m){MSApp.execUnsafeLocalFunction(function(){return r(s,c,f,m)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(Oe=Oe||document.createElement("div"),Oe.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Oe.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function Xe(r,s){if(s){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=s;return}}r.textContent=s}var zt={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},or=["Webkit","ms","Moz","O"];Object.keys(zt).forEach(function(r){or.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),zt[s]=zt[r]})});function kn(r,s,c){return s==null||typeof s=="boolean"||s===""?"":c||typeof s!="number"||s===0||zt.hasOwnProperty(r)&&zt[r]?(""+s).trim():s+"px"}function ar(r,s){r=r.style;for(var c in s)if(s.hasOwnProperty(c)){var f=c.indexOf("--")===0,m=kn(c,s[c],f);c==="float"&&(c="cssFloat"),f?r.setProperty(c,m):r[c]=m}}var Pr=E({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 Ut(r,s){if(s){if(Pr[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));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 qn(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 nn=null;function us(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var hs=null,Jr=null,Br=null;function Fr(r){if(r=vo(r)){if(typeof hs!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Ba(s),hs(r.stateNode,r.type,s))}}function M(r){Jr?Br?Br.push(r):Br=[r]:Jr=r}function Q(){if(Jr){var r=Jr,s=Br;if(Br=Jr=null,Fr(r),s)for(r=0;r<s.length;r++)Fr(s[r])}}function pe(r,s){return r(s)}function Ie(){}var ht=!1;function mt(r,s,c){if(ht)return r(s,c);ht=!0;try{return pe(r,s,c)}finally{ht=!1,(Jr!==null||Br!==null)&&(Ie(),Q())}}function be(r,s){var c=r.stateNode;if(c===null)return null;var f=Ba(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)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(n(231,s,typeof c));return c}var ve=!1;if(u)try{var Te={};Object.defineProperty(Te,"passive",{get:function(){ve=!0}}),window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{ve=!1}function Dt(r,s,c,f,m,_,w,T,P){var V=Array.prototype.slice.call(arguments,3);try{s.apply(c,V)}catch(re){this.onError(re)}}var ct=!1,yr=null,ei=!1,Mi=null,_c={onError:function(r){ct=!0,yr=r}};function Zs(r,s,c,f,m,_,w,T,P){ct=!1,yr=null,Dt.apply(_c,arguments)}function vc(r,s,c,f,m,_,w,T,P){if(Zs.apply(this,arguments),ct){if(ct){var V=yr;ct=!1,yr=null}else throw Error(n(198));ei||(ei=!0,Mi=V)}}function zr(r){var s=r,c=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(c=s.return),r=s.return;while(r)}return s.tag===3?c:null}function ma(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function Qs(r){if(zr(r)!==r)throw Error(n(188))}function ds(r){var s=r.alternate;if(!s){if(s=zr(r),s===null)throw Error(n(188));return s!==r?null:r}for(var c=r,f=s;;){var m=c.return;if(m===null)break;var _=m.alternate;if(_===null){if(f=m.return,f!==null){c=f;continue}break}if(m.child===_.child){for(_=m.child;_;){if(_===c)return Qs(m),r;if(_===f)return Qs(m),s;_=_.sibling}throw Error(n(188))}if(c.return!==f.return)c=m,f=_;else{for(var w=!1,T=m.child;T;){if(T===c){w=!0,c=m,f=_;break}if(T===f){w=!0,f=m,c=_;break}T=T.sibling}if(!w){for(T=_.child;T;){if(T===c){w=!0,c=_,f=m;break}if(T===f){w=!0,f=_,c=m;break}T=T.sibling}if(!w)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?r:s}function ga(r){return r=ds(r),r!==null?_a(r):null}function _a(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=_a(r);if(s!==null)return s;r=r.sibling}return null}var va=t.unstable_scheduleCallback,lr=t.unstable_cancelCallback,ya=t.unstable_shouldYield,ba=t.unstable_requestPaint,yt=t.unstable_now,yc=t.unstable_getCurrentPriorityLevel,Js=t.unstable_ImmediatePriority,Oi=t.unstable_UserBlockingPriority,fs=t.unstable_NormalPriority,ce=t.unstable_LowPriority,Ce=t.unstable_IdlePriority,We=null,Ge=null;function Rt(r){if(Ge&&typeof Ge.onCommitFiberRoot=="function")try{Ge.onCommitFiberRoot(We,r,void 0,(r.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:mn,br=Math.log,ps=Math.LN2;function mn(r){return r>>>=0,r===0?32:31-(br(r)/ps|0)|0}var gn=64,Di=4194304;function ti(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Li(r,s){var c=r.pendingLanes;if(c===0)return 0;var f=0,m=r.suspendedLanes,_=r.pingedLanes,w=c&268435455;if(w!==0){var T=w&~m;T!==0?f=ti(T):(_&=w,_!==0&&(f=ti(_)))}else w=c&~m,w!==0?f=ti(w):_!==0&&(f=ti(_));if(f===0)return 0;if(s!==0&&s!==f&&(s&m)===0&&(m=f&-f,_=s&-s,m>=_||m===16&&(_&4194240)!==0))return s;if((f&4)!==0&&(f|=c&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=f;0<s;)c=31-bt(s),m=1<<c,f|=r[c],s&=~m;return f}function bc(r,s){switch(r){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 Sc(r,s){for(var c=r.suspendedLanes,f=r.pingedLanes,m=r.expirationTimes,_=r.pendingLanes;0<_;){var w=31-bt(_),T=1<<w,P=m[w];P===-1?((T&c)===0||(T&f)!==0)&&(m[w]=bc(T,s)):P<=s&&(r.expiredLanes|=T),_&=~T}}function eo(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Sa(){var r=gn;return gn<<=1,(gn&4194240)===0&&(gn=64),r}function ni(r){for(var s=[],c=0;31>c;c++)s.push(r);return s}function ri(r,s,c){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-bt(s),r[s]=c}function Vn(r,s){var c=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var f=r.eventTimes;for(r=r.expirationTimes;0<c;){var m=31-bt(c),_=1<<m;s[m]=0,f[m]=-1,r[m]=-1,c&=~_}}function to(r,s){var c=r.entangledLanes|=s;for(r=r.entanglements;c;){var f=31-bt(c),m=1<<f;m&s|r[f]&s&&(r[f]|=s),c&=~m}}var et=0;function Fe(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var no,At,it,Ii,Sr,Pi=!1,ii=[],fe=null,Se=null,De=null,Ze=new Map,Et=new Map,qt=[],wc="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 wa(r,s){switch(r){case"focusin":case"focusout":fe=null;break;case"dragenter":case"dragleave":Se=null;break;case"mouseover":case"mouseout":De=null;break;case"pointerover":case"pointerout":Ze.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Et.delete(s.pointerId)}}function ro(r,s,c,f,m,_){return r===null||r.nativeEvent!==_?(r={blockedOn:s,domEventName:c,eventSystemFlags:f,nativeEvent:_,targetContainers:[m]},s!==null&&(s=vo(s),s!==null&&At(s)),r):(r.eventSystemFlags|=f,s=r.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),r)}function Eb(r,s,c,f,m){switch(s){case"focusin":return fe=ro(fe,r,s,c,f,m),!0;case"dragenter":return Se=ro(Se,r,s,c,f,m),!0;case"mouseover":return De=ro(De,r,s,c,f,m),!0;case"pointerover":var _=m.pointerId;return Ze.set(_,ro(Ze.get(_)||null,r,s,c,f,m)),!0;case"gotpointercapture":return _=m.pointerId,Et.set(_,ro(Et.get(_)||null,r,s,c,f,m)),!0}return!1}function _f(r){var s=Bi(r.target);if(s!==null){var c=zr(s);if(c!==null){if(s=c.tag,s===13){if(s=ma(c),s!==null){r.blockedOn=s,Sr(r.priority,function(){it(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function xa(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var c=kc(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(c===null){c=r.nativeEvent;var f=new c.constructor(c.type,c);nn=f,c.target.dispatchEvent(f),nn=null}else return s=vo(c),s!==null&&At(s),r.blockedOn=c,!1;s.shift()}return!0}function vf(r,s,c){xa(r)&&c.delete(s)}function Cb(){Pi=!1,fe!==null&&xa(fe)&&(fe=null),Se!==null&&xa(Se)&&(Se=null),De!==null&&xa(De)&&(De=null),Ze.forEach(vf),Et.forEach(vf)}function io(r,s){r.blockedOn===s&&(r.blockedOn=null,Pi||(Pi=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Cb)))}function so(r){function s(m){return io(m,r)}if(0<ii.length){io(ii[0],r);for(var c=1;c<ii.length;c++){var f=ii[c];f.blockedOn===r&&(f.blockedOn=null)}}for(fe!==null&&io(fe,r),Se!==null&&io(Se,r),De!==null&&io(De,r),Ze.forEach(s),Et.forEach(s),c=0;c<qt.length;c++)f=qt[c],f.blockedOn===r&&(f.blockedOn=null);for(;0<qt.length&&(c=qt[0],c.blockedOn===null);)_f(c),c.blockedOn===null&&qt.shift()}var ms=A.ReactCurrentBatchConfig,ka=!0;function Nb(r,s,c,f){var m=et,_=ms.transition;ms.transition=null;try{et=1,xc(r,s,c,f)}finally{et=m,ms.transition=_}}function Tb(r,s,c,f){var m=et,_=ms.transition;ms.transition=null;try{et=4,xc(r,s,c,f)}finally{et=m,ms.transition=_}}function xc(r,s,c,f){if(ka){var m=kc(r,s,c,f);if(m===null)Hc(r,s,f,Ea,c),wa(r,f);else if(Eb(m,r,s,c,f))f.stopPropagation();else if(wa(r,f),s&4&&-1<wc.indexOf(r)){for(;m!==null;){var _=vo(m);if(_!==null&&no(_),_=kc(r,s,c,f),_===null&&Hc(r,s,f,Ea,c),_===m)break;m=_}m!==null&&f.stopPropagation()}else Hc(r,s,f,null,c)}}var Ea=null;function kc(r,s,c,f){if(Ea=null,r=us(f),r=Bi(r),r!==null)if(s=zr(r),s===null)r=null;else if(c=s.tag,c===13){if(r=ma(s),r!==null)return r;r=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return Ea=r,null}function yf(r){switch(r){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(yc()){case Js:return 1;case Oi:return 4;case fs:case ce:return 16;case Ce:return 536870912;default:return 16}default:return 16}}var si=null,Ec=null,Ca=null;function bf(){if(Ca)return Ca;var r,s=Ec,c=s.length,f,m="value"in si?si.value:si.textContent,_=m.length;for(r=0;r<c&&s[r]===m[r];r++);var w=c-r;for(f=1;f<=w&&s[c-f]===m[_-f];f++);return Ca=m.slice(r,1<f?1-f:void 0)}function Na(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Ta(){return!0}function Sf(){return!1}function Pn(r){function s(c,f,m,_,w){this._reactName=c,this._targetInst=m,this.type=f,this.nativeEvent=_,this.target=w,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(c=r[T],this[T]=c?c(_):_[T]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Ta:Sf,this.isPropagationStopped=Sf,this}return E(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=Ta)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Ta)},persist:function(){},isPersistent:Ta}),s}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cc=Pn(gs),oo=E({},gs,{view:0,detail:0}),Rb=Pn(oo),Nc,Tc,ao,Ra=E({},oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ac,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ao&&(ao&&r.type==="mousemove"?(Nc=r.screenX-ao.screenX,Tc=r.screenY-ao.screenY):Tc=Nc=0,ao=r),Nc)},movementY:function(r){return"movementY"in r?r.movementY:Tc}}),wf=Pn(Ra),Ab=E({},Ra,{dataTransfer:0}),Mb=Pn(Ab),Ob=E({},oo,{relatedTarget:0}),Rc=Pn(Ob),Db=E({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),Lb=Pn(Db),Ib=E({},gs,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Pb=Pn(Ib),Bb=E({},gs,{data:0}),xf=Pn(Bb),Fb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zb={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"},Ub={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hb(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=Ub[r])?!!s[r]:!1}function Ac(){return Hb}var $b=E({},oo,{key:function(r){if(r.key){var s=Fb[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Na(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?zb[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ac,charCode:function(r){return r.type==="keypress"?Na(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Na(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),jb=Pn($b),Wb=E({},Ra,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kf=Pn(Wb),Kb=E({},oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ac}),qb=Pn(Kb),Vb=E({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gb=Pn(Vb),Yb=E({},Ra,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Xb=Pn(Yb),Zb=[9,13,27,32],Mc=u&&"CompositionEvent"in window,lo=null;u&&"documentMode"in document&&(lo=document.documentMode);var Qb=u&&"TextEvent"in window&&!lo,Ef=u&&(!Mc||lo&&8<lo&&11>=lo),Cf=" ",Nf=!1;function Tf(r,s){switch(r){case"keyup":return Zb.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rf(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var _s=!1;function Jb(r,s){switch(r){case"compositionend":return Rf(s);case"keypress":return s.which!==32?null:(Nf=!0,Cf);case"textInput":return r=s.data,r===Cf&&Nf?null:r;default:return null}}function eS(r,s){if(_s)return r==="compositionend"||!Mc&&Tf(r,s)?(r=bf(),Ca=Ec=si=null,_s=!1,r):null;switch(r){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 Ef&&s.locale!=="ko"?null:s.data;default:return null}}var tS={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 Af(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!tS[r.type]:s==="textarea"}function Mf(r,s,c,f){M(f),s=La(s,"onChange"),0<s.length&&(c=new Cc("onChange","change",null,c,f),r.push({event:c,listeners:s}))}var co=null,uo=null;function nS(r){Yf(r,0)}function Aa(r){var s=ws(r);if(tn(s))return r}function rS(r,s){if(r==="change")return s}var Of=!1;if(u){var Oc;if(u){var Dc="oninput"in document;if(!Dc){var Df=document.createElement("div");Df.setAttribute("oninput","return;"),Dc=typeof Df.oninput=="function"}Oc=Dc}else Oc=!1;Of=Oc&&(!document.documentMode||9<document.documentMode)}function Lf(){co&&(co.detachEvent("onpropertychange",If),uo=co=null)}function If(r){if(r.propertyName==="value"&&Aa(uo)){var s=[];Mf(s,uo,r,us(r)),mt(nS,s)}}function iS(r,s,c){r==="focusin"?(Lf(),co=s,uo=c,co.attachEvent("onpropertychange",If)):r==="focusout"&&Lf()}function sS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Aa(uo)}function oS(r,s){if(r==="click")return Aa(s)}function aS(r,s){if(r==="input"||r==="change")return Aa(s)}function lS(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var cr=typeof Object.is=="function"?Object.is:lS;function ho(r,s){if(cr(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),f=Object.keys(s);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var m=c[f];if(!d.call(s,m)||!cr(r[m],s[m]))return!1}return!0}function Pf(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Bf(r,s){var c=Pf(r);r=0;for(var f;c;){if(c.nodeType===3){if(f=r+c.textContent.length,r<=s&&f>=s)return{node:c,offset:s-r};r=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Pf(c)}}function Ff(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Ff(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function zf(){for(var r=window,s=$e();s instanceof r.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)r=s.contentWindow;else break;s=$e(r.document)}return s}function Lc(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function cS(r){var s=zf(),c=r.focusedElem,f=r.selectionRange;if(s!==c&&c&&c.ownerDocument&&Ff(c.ownerDocument.documentElement,c)){if(f!==null&&Lc(c)){if(s=f.start,r=f.end,r===void 0&&(r=s),"selectionStart"in c)c.selectionStart=s,c.selectionEnd=Math.min(r,c.value.length);else if(r=(s=c.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var m=c.textContent.length,_=Math.min(f.start,m);f=f.end===void 0?_:Math.min(f.end,m),!r.extend&&_>f&&(m=f,f=_,_=m),m=Bf(c,_);var w=Bf(c,f);m&&w&&(r.rangeCount!==1||r.anchorNode!==m.node||r.anchorOffset!==m.offset||r.focusNode!==w.node||r.focusOffset!==w.offset)&&(s=s.createRange(),s.setStart(m.node,m.offset),r.removeAllRanges(),_>f?(r.addRange(s),r.extend(w.node,w.offset)):(s.setEnd(w.node,w.offset),r.addRange(s)))}}for(s=[],r=c;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<s.length;c++)r=s[c],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var uS=u&&"documentMode"in document&&11>=document.documentMode,vs=null,Ic=null,fo=null,Pc=!1;function Uf(r,s,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Pc||vs==null||vs!==$e(f)||(f=vs,"selectionStart"in f&&Lc(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}),fo&&ho(fo,f)||(fo=f,f=La(Ic,"onSelect"),0<f.length&&(s=new Cc("onSelect","select",null,s,c),r.push({event:s,listeners:f}),s.target=vs)))}function Ma(r,s){var c={};return c[r.toLowerCase()]=s.toLowerCase(),c["Webkit"+r]="webkit"+s,c["Moz"+r]="moz"+s,c}var ys={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionend:Ma("Transition","TransitionEnd")},Bc={},Hf={};u&&(Hf=document.createElement("div").style,"AnimationEvent"in window||(delete ys.animationend.animation,delete ys.animationiteration.animation,delete ys.animationstart.animation),"TransitionEvent"in window||delete ys.transitionend.transition);function Oa(r){if(Bc[r])return Bc[r];if(!ys[r])return r;var s=ys[r],c;for(c in s)if(s.hasOwnProperty(c)&&c in Hf)return Bc[r]=s[c];return r}var $f=Oa("animationend"),jf=Oa("animationiteration"),Wf=Oa("animationstart"),Kf=Oa("transitionend"),qf=new Map,Vf="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 oi(r,s){qf.set(r,s),a(s,[r])}for(var Fc=0;Fc<Vf.length;Fc++){var zc=Vf[Fc],hS=zc.toLowerCase(),dS=zc[0].toUpperCase()+zc.slice(1);oi(hS,"on"+dS)}oi($f,"onAnimationEnd"),oi(jf,"onAnimationIteration"),oi(Wf,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(Kf,"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 po="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(" "),fS=new Set("cancel close invalid load scroll toggle".split(" ").concat(po));function Gf(r,s,c){var f=r.type||"unknown-event";r.currentTarget=c,vc(f,s,void 0,r),r.currentTarget=null}function Yf(r,s){s=(s&4)!==0;for(var c=0;c<r.length;c++){var f=r[c],m=f.event;f=f.listeners;e:{var _=void 0;if(s)for(var w=f.length-1;0<=w;w--){var T=f[w],P=T.instance,V=T.currentTarget;if(T=T.listener,P!==_&&m.isPropagationStopped())break e;Gf(m,T,V),_=P}else for(w=0;w<f.length;w++){if(T=f[w],P=T.instance,V=T.currentTarget,T=T.listener,P!==_&&m.isPropagationStopped())break e;Gf(m,T,V),_=P}}}if(ei)throw r=Mi,ei=!1,Mi=null,r}function dt(r,s){var c=s[Vc];c===void 0&&(c=s[Vc]=new Set);var f=r+"__bubble";c.has(f)||(Xf(s,r,2,!1),c.add(f))}function Uc(r,s,c){var f=0;s&&(f|=4),Xf(c,r,f,s)}var Da="_reactListening"+Math.random().toString(36).slice(2);function mo(r){if(!r[Da]){r[Da]=!0,i.forEach(function(c){c!=="selectionchange"&&(fS.has(c)||Uc(c,!1,r),Uc(c,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Da]||(s[Da]=!0,Uc("selectionchange",!1,s))}}function Xf(r,s,c,f){switch(yf(s)){case 1:var m=Nb;break;case 4:m=Tb;break;default:m=xc}c=m.bind(null,s,c,r),m=void 0,!ve||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(m=!0),f?m!==void 0?r.addEventListener(s,c,{capture:!0,passive:m}):r.addEventListener(s,c,!0):m!==void 0?r.addEventListener(s,c,{passive:m}):r.addEventListener(s,c,!1)}function Hc(r,s,c,f,m){var _=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var w=f.tag;if(w===3||w===4){var T=f.stateNode.containerInfo;if(T===m||T.nodeType===8&&T.parentNode===m)break;if(w===4)for(w=f.return;w!==null;){var P=w.tag;if((P===3||P===4)&&(P=w.stateNode.containerInfo,P===m||P.nodeType===8&&P.parentNode===m))return;w=w.return}for(;T!==null;){if(w=Bi(T),w===null)return;if(P=w.tag,P===5||P===6){f=_=w;continue e}T=T.parentNode}}f=f.return}mt(function(){var V=_,re=us(c),ae=[];e:{var ne=qf.get(r);if(ne!==void 0){var ge=Cc,xe=r;switch(r){case"keypress":if(Na(c)===0)break e;case"keydown":case"keyup":ge=jb;break;case"focusin":xe="focus",ge=Rc;break;case"focusout":xe="blur",ge=Rc;break;case"beforeblur":case"afterblur":ge=Rc;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":ge=wf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Mb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=qb;break;case $f:case jf:case Wf:ge=Lb;break;case Kf:ge=Gb;break;case"scroll":ge=Rb;break;case"wheel":ge=Xb;break;case"copy":case"cut":case"paste":ge=Pb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=kf}var ke=(s&4)!==0,Mt=!ke&&r==="scroll",U=ke?ne!==null?ne+"Capture":null:ne;ke=[];for(var B=V,j;B!==null;){j=B;var ue=j.stateNode;if(j.tag===5&&ue!==null&&(j=ue,U!==null&&(ue=be(B,U),ue!=null&&ke.push(go(B,ue,j)))),Mt)break;B=B.return}0<ke.length&&(ne=new ge(ne,xe,null,c,re),ae.push({event:ne,listeners:ke}))}}if((s&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",ge=r==="mouseout"||r==="pointerout",ne&&c!==nn&&(xe=c.relatedTarget||c.fromElement)&&(Bi(xe)||xe[Ur]))break e;if((ge||ne)&&(ne=re.window===re?re:(ne=re.ownerDocument)?ne.defaultView||ne.parentWindow:window,ge?(xe=c.relatedTarget||c.toElement,ge=V,xe=xe?Bi(xe):null,xe!==null&&(Mt=zr(xe),xe!==Mt||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ge=null,xe=V),ge!==xe)){if(ke=wf,ue="onMouseLeave",U="onMouseEnter",B="mouse",(r==="pointerout"||r==="pointerover")&&(ke=kf,ue="onPointerLeave",U="onPointerEnter",B="pointer"),Mt=ge==null?ne:ws(ge),j=xe==null?ne:ws(xe),ne=new ke(ue,B+"leave",ge,c,re),ne.target=Mt,ne.relatedTarget=j,ue=null,Bi(re)===V&&(ke=new ke(U,B+"enter",xe,c,re),ke.target=j,ke.relatedTarget=Mt,ue=ke),Mt=ue,ge&&xe)t:{for(ke=ge,U=xe,B=0,j=ke;j;j=bs(j))B++;for(j=0,ue=U;ue;ue=bs(ue))j++;for(;0<B-j;)ke=bs(ke),B--;for(;0<j-B;)U=bs(U),j--;for(;B--;){if(ke===U||U!==null&&ke===U.alternate)break t;ke=bs(ke),U=bs(U)}ke=null}else ke=null;ge!==null&&Zf(ae,ne,ge,ke,!1),xe!==null&&Mt!==null&&Zf(ae,Mt,xe,ke,!0)}}e:{if(ne=V?ws(V):window,ge=ne.nodeName&&ne.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ne.type==="file")var Ee=rS;else if(Af(ne))if(Of)Ee=aS;else{Ee=sS;var Re=iS}else(ge=ne.nodeName)&&ge.toLowerCase()==="input"&&(ne.type==="checkbox"||ne.type==="radio")&&(Ee=oS);if(Ee&&(Ee=Ee(r,V))){Mf(ae,Ee,c,re);break e}Re&&Re(r,ne,V),r==="focusout"&&(Re=ne._wrapperState)&&Re.controlled&&ne.type==="number"&&_r(ne,"number",ne.value)}switch(Re=V?ws(V):window,r){case"focusin":(Af(Re)||Re.contentEditable==="true")&&(vs=Re,Ic=V,fo=null);break;case"focusout":fo=Ic=vs=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,Uf(ae,c,re);break;case"selectionchange":if(uS)break;case"keydown":case"keyup":Uf(ae,c,re)}var Ae;if(Mc)e:{switch(r){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else _s?Tf(r,c)&&(Pe="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(Pe="onCompositionStart");Pe&&(Ef&&c.locale!=="ko"&&(_s||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&_s&&(Ae=bf()):(si=re,Ec="value"in si?si.value:si.textContent,_s=!0)),Re=La(V,Pe),0<Re.length&&(Pe=new xf(Pe,r,null,c,re),ae.push({event:Pe,listeners:Re}),Ae?Pe.data=Ae:(Ae=Rf(c),Ae!==null&&(Pe.data=Ae)))),(Ae=Qb?Jb(r,c):eS(r,c))&&(V=La(V,"onBeforeInput"),0<V.length&&(re=new xf("onBeforeInput","beforeinput",null,c,re),ae.push({event:re,listeners:V}),re.data=Ae))}Yf(ae,s)})}function go(r,s,c){return{instance:r,listener:s,currentTarget:c}}function La(r,s){for(var c=s+"Capture",f=[];r!==null;){var m=r,_=m.stateNode;m.tag===5&&_!==null&&(m=_,_=be(r,c),_!=null&&f.unshift(go(r,_,m)),_=be(r,s),_!=null&&f.push(go(r,_,m))),r=r.return}return f}function bs(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Zf(r,s,c,f,m){for(var _=s._reactName,w=[];c!==null&&c!==f;){var T=c,P=T.alternate,V=T.stateNode;if(P!==null&&P===f)break;T.tag===5&&V!==null&&(T=V,m?(P=be(c,_),P!=null&&w.unshift(go(c,P,T))):m||(P=be(c,_),P!=null&&w.push(go(c,P,T)))),c=c.return}w.length!==0&&r.push({event:s,listeners:w})}var pS=/\r\n?/g,mS=/\u0000|\uFFFD/g;function Qf(r){return(typeof r=="string"?r:""+r).replace(pS,`
|
|
38
|
+
`).replace(mS,"")}function Ia(r,s,c){if(s=Qf(s),Qf(r)!==s&&c)throw Error(n(425))}function Pa(){}var $c=null,jc=null;function Wc(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Kc=typeof setTimeout=="function"?setTimeout:void 0,gS=typeof clearTimeout=="function"?clearTimeout:void 0,Jf=typeof Promise=="function"?Promise:void 0,_S=typeof queueMicrotask=="function"?queueMicrotask:typeof Jf<"u"?function(r){return Jf.resolve(null).then(r).catch(vS)}:Kc;function vS(r){setTimeout(function(){throw r})}function qc(r,s){var c=s,f=0;do{var m=c.nextSibling;if(r.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(f===0){r.removeChild(m),so(s);return}f--}else c!=="$"&&c!=="$?"&&c!=="$!"||f++;c=m}while(c);so(s)}function ai(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function ep(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"){if(s===0)return r;s--}else c==="/$"&&s++}r=r.previousSibling}return null}var Ss=Math.random().toString(36).slice(2),wr="__reactFiber$"+Ss,_o="__reactProps$"+Ss,Ur="__reactContainer$"+Ss,Vc="__reactEvents$"+Ss,yS="__reactListeners$"+Ss,bS="__reactHandles$"+Ss;function Bi(r){var s=r[wr];if(s)return s;for(var c=r.parentNode;c;){if(s=c[Ur]||c[wr]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(r=ep(r);r!==null;){if(c=r[wr])return c;r=ep(r)}return s}r=c,c=r.parentNode}return null}function vo(r){return r=r[wr]||r[Ur],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function ws(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Ba(r){return r[_o]||null}var Gc=[],xs=-1;function li(r){return{current:r}}function ft(r){0>xs||(r.current=Gc[xs],Gc[xs]=null,xs--)}function ut(r,s){xs++,Gc[xs]=r.current,r.current=s}var ci={},ln=li(ci),En=li(!1),Fi=ci;function ks(r,s){var c=r.type.contextTypes;if(!c)return ci;var f=r.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===s)return f.__reactInternalMemoizedMaskedChildContext;var m={},_;for(_ in c)m[_]=s[_];return f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=m),m}function Cn(r){return r=r.childContextTypes,r!=null}function Fa(){ft(En),ft(ln)}function tp(r,s,c){if(ln.current!==ci)throw Error(n(168));ut(ln,s),ut(En,c)}function np(r,s,c){var f=r.stateNode;if(s=s.childContextTypes,typeof f.getChildContext!="function")return c;f=f.getChildContext();for(var m in f)if(!(m in s))throw Error(n(108,Ue(r)||"Unknown",m));return E({},c,f)}function za(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||ci,Fi=ln.current,ut(ln,r),ut(En,En.current),!0}function rp(r,s,c){var f=r.stateNode;if(!f)throw Error(n(169));c?(r=np(r,s,Fi),f.__reactInternalMemoizedMergedChildContext=r,ft(En),ft(ln),ut(ln,r)):ft(En),ut(En,c)}var Hr=null,Ua=!1,Yc=!1;function ip(r){Hr===null?Hr=[r]:Hr.push(r)}function SS(r){Ua=!0,ip(r)}function ui(){if(!Yc&&Hr!==null){Yc=!0;var r=0,s=et;try{var c=Hr;for(et=1;r<c.length;r++){var f=c[r];do f=f(!0);while(f!==null)}Hr=null,Ua=!1}catch(m){throw Hr!==null&&(Hr=Hr.slice(r+1)),va(Js,ui),m}finally{et=s,Yc=!1}}return null}var Es=[],Cs=0,Ha=null,$a=0,Gn=[],Yn=0,zi=null,$r=1,jr="";function Ui(r,s){Es[Cs++]=$a,Es[Cs++]=Ha,Ha=r,$a=s}function sp(r,s,c){Gn[Yn++]=$r,Gn[Yn++]=jr,Gn[Yn++]=zi,zi=r;var f=$r;r=jr;var m=32-bt(f)-1;f&=~(1<<m),c+=1;var _=32-bt(s)+m;if(30<_){var w=m-m%5;_=(f&(1<<w)-1).toString(32),f>>=w,m-=w,$r=1<<32-bt(s)+m|c<<m|f,jr=_+r}else $r=1<<_|c<<m|f,jr=r}function Xc(r){r.return!==null&&(Ui(r,1),sp(r,1,0))}function Zc(r){for(;r===Ha;)Ha=Es[--Cs],Es[Cs]=null,$a=Es[--Cs],Es[Cs]=null;for(;r===zi;)zi=Gn[--Yn],Gn[Yn]=null,jr=Gn[--Yn],Gn[Yn]=null,$r=Gn[--Yn],Gn[Yn]=null}var Bn=null,Fn=null,gt=!1,ur=null;function op(r,s){var c=Jn(5,null,null,0);c.elementType="DELETED",c.stateNode=s,c.return=r,s=r.deletions,s===null?(r.deletions=[c],r.flags|=16):s.push(c)}function ap(r,s){switch(r.tag){case 5:var c=r.type;return s=s.nodeType!==1||c.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,Bn=r,Fn=ai(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,Bn=r,Fn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(c=zi!==null?{id:$r,overflow:jr}:null,r.memoizedState={dehydrated:s,treeContext:c,retryLane:1073741824},c=Jn(18,null,null,0),c.stateNode=s,c.return=r,r.child=c,Bn=r,Fn=null,!0):!1;default:return!1}}function Qc(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Jc(r){if(gt){var s=Fn;if(s){var c=s;if(!ap(r,s)){if(Qc(r))throw Error(n(418));s=ai(c.nextSibling);var f=Bn;s&&ap(r,s)?op(f,c):(r.flags=r.flags&-4097|2,gt=!1,Bn=r)}}else{if(Qc(r))throw Error(n(418));r.flags=r.flags&-4097|2,gt=!1,Bn=r}}}function lp(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Bn=r}function ja(r){if(r!==Bn)return!1;if(!gt)return lp(r),gt=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!Wc(r.type,r.memoizedProps)),s&&(s=Fn)){if(Qc(r))throw cp(),Error(n(418));for(;s;)op(r,s),s=ai(s.nextSibling)}if(lp(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"){if(s===0){Fn=ai(r.nextSibling);break e}s--}else c!=="$"&&c!=="$!"&&c!=="$?"||s++}r=r.nextSibling}Fn=null}}else Fn=Bn?ai(r.stateNode.nextSibling):null;return!0}function cp(){for(var r=Fn;r;)r=ai(r.nextSibling)}function Ns(){Fn=Bn=null,gt=!1}function eu(r){ur===null?ur=[r]:ur.push(r)}var wS=A.ReactCurrentBatchConfig;function yo(r,s,c){if(r=c.ref,r!==null&&typeof r!="function"&&typeof r!="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,r));var m=f,_=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===_?s.ref:(s=function(w){var T=m.refs;w===null?delete T[_]:T[_]=w},s._stringRef=_,s)}if(typeof r!="string")throw Error(n(284));if(!c._owner)throw Error(n(290,r))}return r}function Wa(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function up(r){var s=r._init;return s(r._payload)}function hp(r){function s(U,B){if(r){var j=U.deletions;j===null?(U.deletions=[B],U.flags|=16):j.push(B)}}function c(U,B){if(!r)return null;for(;B!==null;)s(U,B),B=B.sibling;return null}function f(U,B){for(U=new Map;B!==null;)B.key!==null?U.set(B.key,B):U.set(B.index,B),B=B.sibling;return U}function m(U,B){return U=vi(U,B),U.index=0,U.sibling=null,U}function _(U,B,j){return U.index=j,r?(j=U.alternate,j!==null?(j=j.index,j<B?(U.flags|=2,B):j):(U.flags|=2,B)):(U.flags|=1048576,B)}function w(U){return r&&U.alternate===null&&(U.flags|=2),U}function T(U,B,j,ue){return B===null||B.tag!==6?(B=Ku(j,U.mode,ue),B.return=U,B):(B=m(B,j),B.return=U,B)}function P(U,B,j,ue){var Ee=j.type;return Ee===se?re(U,B,j.props.children,ue,j.key):B!==null&&(B.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Z&&up(Ee)===B.type)?(ue=m(B,j.props),ue.ref=yo(U,B,j),ue.return=U,ue):(ue=pl(j.type,j.key,j.props,null,U.mode,ue),ue.ref=yo(U,B,j),ue.return=U,ue)}function V(U,B,j,ue){return B===null||B.tag!==4||B.stateNode.containerInfo!==j.containerInfo||B.stateNode.implementation!==j.implementation?(B=qu(j,U.mode,ue),B.return=U,B):(B=m(B,j.children||[]),B.return=U,B)}function re(U,B,j,ue,Ee){return B===null||B.tag!==7?(B=Gi(j,U.mode,ue,Ee),B.return=U,B):(B=m(B,j),B.return=U,B)}function ae(U,B,j){if(typeof B=="string"&&B!==""||typeof B=="number")return B=Ku(""+B,U.mode,j),B.return=U,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case H:return j=pl(B.type,B.key,B.props,null,U.mode,j),j.ref=yo(U,null,B),j.return=U,j;case D:return B=qu(B,U.mode,j),B.return=U,B;case Z:var ue=B._init;return ae(U,ue(B._payload),j)}if(sr(B)||te(B))return B=Gi(B,U.mode,j,null),B.return=U,B;Wa(U,B)}return null}function ne(U,B,j,ue){var Ee=B!==null?B.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return Ee!==null?null:T(U,B,""+j,ue);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case H:return j.key===Ee?P(U,B,j,ue):null;case D:return j.key===Ee?V(U,B,j,ue):null;case Z:return Ee=j._init,ne(U,B,Ee(j._payload),ue)}if(sr(j)||te(j))return Ee!==null?null:re(U,B,j,ue,null);Wa(U,j)}return null}function ge(U,B,j,ue,Ee){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return U=U.get(j)||null,T(B,U,""+ue,Ee);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case H:return U=U.get(ue.key===null?j:ue.key)||null,P(B,U,ue,Ee);case D:return U=U.get(ue.key===null?j:ue.key)||null,V(B,U,ue,Ee);case Z:var Re=ue._init;return ge(U,B,j,Re(ue._payload),Ee)}if(sr(ue)||te(ue))return U=U.get(j)||null,re(B,U,ue,Ee,null);Wa(B,ue)}return null}function xe(U,B,j,ue){for(var Ee=null,Re=null,Ae=B,Pe=B=0,Yt=null;Ae!==null&&Pe<j.length;Pe++){Ae.index>Pe?(Yt=Ae,Ae=null):Yt=Ae.sibling;var rt=ne(U,Ae,j[Pe],ue);if(rt===null){Ae===null&&(Ae=Yt);break}r&&Ae&&rt.alternate===null&&s(U,Ae),B=_(rt,B,Pe),Re===null?Ee=rt:Re.sibling=rt,Re=rt,Ae=Yt}if(Pe===j.length)return c(U,Ae),gt&&Ui(U,Pe),Ee;if(Ae===null){for(;Pe<j.length;Pe++)Ae=ae(U,j[Pe],ue),Ae!==null&&(B=_(Ae,B,Pe),Re===null?Ee=Ae:Re.sibling=Ae,Re=Ae);return gt&&Ui(U,Pe),Ee}for(Ae=f(U,Ae);Pe<j.length;Pe++)Yt=ge(Ae,U,Pe,j[Pe],ue),Yt!==null&&(r&&Yt.alternate!==null&&Ae.delete(Yt.key===null?Pe:Yt.key),B=_(Yt,B,Pe),Re===null?Ee=Yt:Re.sibling=Yt,Re=Yt);return r&&Ae.forEach(function(yi){return s(U,yi)}),gt&&Ui(U,Pe),Ee}function ke(U,B,j,ue){var Ee=te(j);if(typeof Ee!="function")throw Error(n(150));if(j=Ee.call(j),j==null)throw Error(n(151));for(var Re=Ee=null,Ae=B,Pe=B=0,Yt=null,rt=j.next();Ae!==null&&!rt.done;Pe++,rt=j.next()){Ae.index>Pe?(Yt=Ae,Ae=null):Yt=Ae.sibling;var yi=ne(U,Ae,rt.value,ue);if(yi===null){Ae===null&&(Ae=Yt);break}r&&Ae&&yi.alternate===null&&s(U,Ae),B=_(yi,B,Pe),Re===null?Ee=yi:Re.sibling=yi,Re=yi,Ae=Yt}if(rt.done)return c(U,Ae),gt&&Ui(U,Pe),Ee;if(Ae===null){for(;!rt.done;Pe++,rt=j.next())rt=ae(U,rt.value,ue),rt!==null&&(B=_(rt,B,Pe),Re===null?Ee=rt:Re.sibling=rt,Re=rt);return gt&&Ui(U,Pe),Ee}for(Ae=f(U,Ae);!rt.done;Pe++,rt=j.next())rt=ge(Ae,U,Pe,rt.value,ue),rt!==null&&(r&&rt.alternate!==null&&Ae.delete(rt.key===null?Pe:rt.key),B=_(rt,B,Pe),Re===null?Ee=rt:Re.sibling=rt,Re=rt);return r&&Ae.forEach(function(tw){return s(U,tw)}),gt&&Ui(U,Pe),Ee}function Mt(U,B,j,ue){if(typeof j=="object"&&j!==null&&j.type===se&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case H:e:{for(var Ee=j.key,Re=B;Re!==null;){if(Re.key===Ee){if(Ee=j.type,Ee===se){if(Re.tag===7){c(U,Re.sibling),B=m(Re,j.props.children),B.return=U,U=B;break e}}else if(Re.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Z&&up(Ee)===Re.type){c(U,Re.sibling),B=m(Re,j.props),B.ref=yo(U,Re,j),B.return=U,U=B;break e}c(U,Re);break}else s(U,Re);Re=Re.sibling}j.type===se?(B=Gi(j.props.children,U.mode,ue,j.key),B.return=U,U=B):(ue=pl(j.type,j.key,j.props,null,U.mode,ue),ue.ref=yo(U,B,j),ue.return=U,U=ue)}return w(U);case D:e:{for(Re=j.key;B!==null;){if(B.key===Re)if(B.tag===4&&B.stateNode.containerInfo===j.containerInfo&&B.stateNode.implementation===j.implementation){c(U,B.sibling),B=m(B,j.children||[]),B.return=U,U=B;break e}else{c(U,B);break}else s(U,B);B=B.sibling}B=qu(j,U.mode,ue),B.return=U,U=B}return w(U);case Z:return Re=j._init,Mt(U,B,Re(j._payload),ue)}if(sr(j))return xe(U,B,j,ue);if(te(j))return ke(U,B,j,ue);Wa(U,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,B!==null&&B.tag===6?(c(U,B.sibling),B=m(B,j),B.return=U,U=B):(c(U,B),B=Ku(j,U.mode,ue),B.return=U,U=B),w(U)):c(U,B)}return Mt}var Ts=hp(!0),dp=hp(!1),Ka=li(null),qa=null,Rs=null,tu=null;function nu(){tu=Rs=qa=null}function ru(r){var s=Ka.current;ft(Ka),r._currentValue=s}function iu(r,s,c){for(;r!==null;){var f=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),r===c)break;r=r.return}}function As(r,s){qa=r,tu=Rs=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(Nn=!0),r.firstContext=null)}function Xn(r){var s=r._currentValue;if(tu!==r)if(r={context:r,memoizedValue:s,next:null},Rs===null){if(qa===null)throw Error(n(308));Rs=r,qa.dependencies={lanes:0,firstContext:r}}else Rs=Rs.next=r;return s}var Hi=null;function su(r){Hi===null?Hi=[r]:Hi.push(r)}function fp(r,s,c,f){var m=s.interleaved;return m===null?(c.next=c,su(s)):(c.next=m.next,m.next=c),s.interleaved=c,Wr(r,f)}function Wr(r,s){r.lanes|=s;var c=r.alternate;for(c!==null&&(c.lanes|=s),c=r,r=r.return;r!==null;)r.childLanes|=s,c=r.alternate,c!==null&&(c.childLanes|=s),c=r,r=r.return;return c.tag===3?c.stateNode:null}var hi=!1;function ou(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pp(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Kr(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function di(r,s,c){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(tt&2)!==0){var m=f.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),f.pending=s,Wr(r,c)}return m=f.interleaved,m===null?(s.next=s,su(f)):(s.next=m.next,m.next=s),f.interleaved=s,Wr(r,c)}function Va(r,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194240)!==0)){var f=s.lanes;f&=r.pendingLanes,c|=f,s.lanes=c,to(r,c)}}function mp(r,s){var c=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var m=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var w={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};_===null?m=_=w:_=_.next=w,c=c.next}while(c!==null);_===null?m=_=s:_=_.next=s}else m=_=s;c={baseState:f.baseState,firstBaseUpdate:m,lastBaseUpdate:_,shared:f.shared,effects:f.effects},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=s:r.next=s,c.lastBaseUpdate=s}function Ga(r,s,c,f){var m=r.updateQueue;hi=!1;var _=m.firstBaseUpdate,w=m.lastBaseUpdate,T=m.shared.pending;if(T!==null){m.shared.pending=null;var P=T,V=P.next;P.next=null,w===null?_=V:w.next=V,w=P;var re=r.alternate;re!==null&&(re=re.updateQueue,T=re.lastBaseUpdate,T!==w&&(T===null?re.firstBaseUpdate=V:T.next=V,re.lastBaseUpdate=P))}if(_!==null){var ae=m.baseState;w=0,re=V=P=null,T=_;do{var ne=T.lane,ge=T.eventTime;if((f&ne)===ne){re!==null&&(re=re.next={eventTime:ge,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var xe=r,ke=T;switch(ne=s,ge=c,ke.tag){case 1:if(xe=ke.payload,typeof xe=="function"){ae=xe.call(ge,ae,ne);break e}ae=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ke.payload,ne=typeof xe=="function"?xe.call(ge,ae,ne):xe,ne==null)break e;ae=E({},ae,ne);break e;case 2:hi=!0}}T.callback!==null&&T.lane!==0&&(r.flags|=64,ne=m.effects,ne===null?m.effects=[T]:ne.push(T))}else ge={eventTime:ge,lane:ne,tag:T.tag,payload:T.payload,callback:T.callback,next:null},re===null?(V=re=ge,P=ae):re=re.next=ge,w|=ne;if(T=T.next,T===null){if(T=m.shared.pending,T===null)break;ne=T,T=ne.next,ne.next=null,m.lastBaseUpdate=ne,m.shared.pending=null}}while(!0);if(re===null&&(P=ae),m.baseState=P,m.firstBaseUpdate=V,m.lastBaseUpdate=re,s=m.shared.interleaved,s!==null){m=s;do w|=m.lane,m=m.next;while(m!==s)}else _===null&&(m.shared.lanes=0);Wi|=w,r.lanes=w,r.memoizedState=ae}}function gp(r,s,c){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var f=r[s],m=f.callback;if(m!==null){if(f.callback=null,f=c,typeof m!="function")throw Error(n(191,m));m.call(f)}}}var bo={},xr=li(bo),So=li(bo),wo=li(bo);function $i(r){if(r===bo)throw Error(n(174));return r}function au(r,s){switch(ut(wo,s),ut(So,r),ut(xr,bo),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:he(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=he(s,r)}ft(xr),ut(xr,s)}function Ms(){ft(xr),ft(So),ft(wo)}function _p(r){$i(wo.current);var s=$i(xr.current),c=he(s,r.type);s!==c&&(ut(So,r),ut(xr,c))}function lu(r){So.current===r&&(ft(xr),ft(So))}var St=li(0);function Ya(r){for(var s=r;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===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var cu=[];function uu(){for(var r=0;r<cu.length;r++)cu[r]._workInProgressVersionPrimary=null;cu.length=0}var Xa=A.ReactCurrentDispatcher,hu=A.ReactCurrentBatchConfig,ji=0,wt=null,Ht=null,Vt=null,Za=!1,xo=!1,ko=0,xS=0;function cn(){throw Error(n(321))}function du(r,s){if(s===null)return!1;for(var c=0;c<s.length&&c<r.length;c++)if(!cr(r[c],s[c]))return!1;return!0}function fu(r,s,c,f,m,_){if(ji=_,wt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Xa.current=r===null||r.memoizedState===null?NS:TS,r=c(f,m),xo){_=0;do{if(xo=!1,ko=0,25<=_)throw Error(n(301));_+=1,Vt=Ht=null,s.updateQueue=null,Xa.current=RS,r=c(f,m)}while(xo)}if(Xa.current=el,s=Ht!==null&&Ht.next!==null,ji=0,Vt=Ht=wt=null,Za=!1,s)throw Error(n(300));return r}function pu(){var r=ko!==0;return ko=0,r}function kr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?wt.memoizedState=Vt=r:Vt=Vt.next=r,Vt}function Zn(){if(Ht===null){var r=wt.alternate;r=r!==null?r.memoizedState:null}else r=Ht.next;var s=Vt===null?wt.memoizedState:Vt.next;if(s!==null)Vt=s,Ht=r;else{if(r===null)throw Error(n(310));Ht=r,r={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Vt===null?wt.memoizedState=Vt=r:Vt=Vt.next=r}return Vt}function Eo(r,s){return typeof s=="function"?s(r):s}function mu(r){var s=Zn(),c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=r;var f=Ht,m=f.baseQueue,_=c.pending;if(_!==null){if(m!==null){var w=m.next;m.next=_.next,_.next=w}f.baseQueue=m=_,c.pending=null}if(m!==null){_=m.next,f=f.baseState;var T=w=null,P=null,V=_;do{var re=V.lane;if((ji&re)===re)P!==null&&(P=P.next={lane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),f=V.hasEagerState?V.eagerState:r(f,V.action);else{var ae={lane:re,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null};P===null?(T=P=ae,w=f):P=P.next=ae,wt.lanes|=re,Wi|=re}V=V.next}while(V!==null&&V!==_);P===null?w=f:P.next=T,cr(f,s.memoizedState)||(Nn=!0),s.memoizedState=f,s.baseState=w,s.baseQueue=P,c.lastRenderedState=f}if(r=c.interleaved,r!==null){m=r;do _=m.lane,wt.lanes|=_,Wi|=_,m=m.next;while(m!==r)}else m===null&&(c.lanes=0);return[s.memoizedState,c.dispatch]}function gu(r){var s=Zn(),c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=r;var f=c.dispatch,m=c.pending,_=s.memoizedState;if(m!==null){c.pending=null;var w=m=m.next;do _=r(_,w.action),w=w.next;while(w!==m);cr(_,s.memoizedState)||(Nn=!0),s.memoizedState=_,s.baseQueue===null&&(s.baseState=_),c.lastRenderedState=_}return[_,f]}function vp(){}function yp(r,s){var c=wt,f=Zn(),m=s(),_=!cr(f.memoizedState,m);if(_&&(f.memoizedState=m,Nn=!0),f=f.queue,_u(wp.bind(null,c,f,r),[r]),f.getSnapshot!==s||_||Vt!==null&&Vt.memoizedState.tag&1){if(c.flags|=2048,Co(9,Sp.bind(null,c,f,m,s),void 0,null),Gt===null)throw Error(n(349));(ji&30)!==0||bp(c,s,m)}return m}function bp(r,s,c){r.flags|=16384,r={getSnapshot:s,value:c},s=wt.updateQueue,s===null?(s={lastEffect:null,stores:null},wt.updateQueue=s,s.stores=[r]):(c=s.stores,c===null?s.stores=[r]:c.push(r))}function Sp(r,s,c,f){s.value=c,s.getSnapshot=f,xp(s)&&kp(r)}function wp(r,s,c){return c(function(){xp(s)&&kp(r)})}function xp(r){var s=r.getSnapshot;r=r.value;try{var c=s();return!cr(r,c)}catch{return!0}}function kp(r){var s=Wr(r,1);s!==null&&pr(s,r,1,-1)}function Ep(r){var s=kr();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:r},s.queue=r,r=r.dispatch=CS.bind(null,wt,r),[s.memoizedState,r]}function Co(r,s,c,f){return r={tag:r,create:s,destroy:c,deps:f,next:null},s=wt.updateQueue,s===null?(s={lastEffect:null,stores:null},wt.updateQueue=s,s.lastEffect=r.next=r):(c=s.lastEffect,c===null?s.lastEffect=r.next=r:(f=c.next,c.next=r,r.next=f,s.lastEffect=r)),r}function Cp(){return Zn().memoizedState}function Qa(r,s,c,f){var m=kr();wt.flags|=r,m.memoizedState=Co(1|s,c,void 0,f===void 0?null:f)}function Ja(r,s,c,f){var m=Zn();f=f===void 0?null:f;var _=void 0;if(Ht!==null){var w=Ht.memoizedState;if(_=w.destroy,f!==null&&du(f,w.deps)){m.memoizedState=Co(s,c,_,f);return}}wt.flags|=r,m.memoizedState=Co(1|s,c,_,f)}function Np(r,s){return Qa(8390656,8,r,s)}function _u(r,s){return Ja(2048,8,r,s)}function Tp(r,s){return Ja(4,2,r,s)}function Rp(r,s){return Ja(4,4,r,s)}function Ap(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Mp(r,s,c){return c=c!=null?c.concat([r]):null,Ja(4,4,Ap.bind(null,s,r),c)}function vu(){}function Op(r,s){var c=Zn();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&du(s,f[1])?f[0]:(c.memoizedState=[r,s],r)}function Dp(r,s){var c=Zn();s=s===void 0?null:s;var f=c.memoizedState;return f!==null&&s!==null&&du(s,f[1])?f[0]:(r=r(),c.memoizedState=[r,s],r)}function Lp(r,s,c){return(ji&21)===0?(r.baseState&&(r.baseState=!1,Nn=!0),r.memoizedState=c):(cr(c,s)||(c=Sa(),wt.lanes|=c,Wi|=c,r.baseState=!0),s)}function kS(r,s){var c=et;et=c!==0&&4>c?c:4,r(!0);var f=hu.transition;hu.transition={};try{r(!1),s()}finally{et=c,hu.transition=f}}function Ip(){return Zn().memoizedState}function ES(r,s,c){var f=gi(r);if(c={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null},Pp(r))Bp(s,c);else if(c=fp(r,s,c,f),c!==null){var m=vn();pr(c,r,f,m),Fp(c,s,f)}}function CS(r,s,c){var f=gi(r),m={lane:f,action:c,hasEagerState:!1,eagerState:null,next:null};if(Pp(r))Bp(s,m);else{var _=r.alternate;if(r.lanes===0&&(_===null||_.lanes===0)&&(_=s.lastRenderedReducer,_!==null))try{var w=s.lastRenderedState,T=_(w,c);if(m.hasEagerState=!0,m.eagerState=T,cr(T,w)){var P=s.interleaved;P===null?(m.next=m,su(s)):(m.next=P.next,P.next=m),s.interleaved=m;return}}catch{}finally{}c=fp(r,s,m,f),c!==null&&(m=vn(),pr(c,r,f,m),Fp(c,s,f))}}function Pp(r){var s=r.alternate;return r===wt||s!==null&&s===wt}function Bp(r,s){xo=Za=!0;var c=r.pending;c===null?s.next=s:(s.next=c.next,c.next=s),r.pending=s}function Fp(r,s,c){if((c&4194240)!==0){var f=s.lanes;f&=r.pendingLanes,c|=f,s.lanes=c,to(r,c)}}var el={readContext:Xn,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useInsertionEffect:cn,useLayoutEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useMutableSource:cn,useSyncExternalStore:cn,useId:cn,unstable_isNewReconciler:!1},NS={readContext:Xn,useCallback:function(r,s){return kr().memoizedState=[r,s===void 0?null:s],r},useContext:Xn,useEffect:Np,useImperativeHandle:function(r,s,c){return c=c!=null?c.concat([r]):null,Qa(4194308,4,Ap.bind(null,s,r),c)},useLayoutEffect:function(r,s){return Qa(4194308,4,r,s)},useInsertionEffect:function(r,s){return Qa(4,2,r,s)},useMemo:function(r,s){var c=kr();return s=s===void 0?null:s,r=r(),c.memoizedState=[r,s],r},useReducer:function(r,s,c){var f=kr();return s=c!==void 0?c(s):s,f.memoizedState=f.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},f.queue=r,r=r.dispatch=ES.bind(null,wt,r),[f.memoizedState,r]},useRef:function(r){var s=kr();return r={current:r},s.memoizedState=r},useState:Ep,useDebugValue:vu,useDeferredValue:function(r){return kr().memoizedState=r},useTransition:function(){var r=Ep(!1),s=r[0];return r=kS.bind(null,r[1]),kr().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,c){var f=wt,m=kr();if(gt){if(c===void 0)throw Error(n(407));c=c()}else{if(c=s(),Gt===null)throw Error(n(349));(ji&30)!==0||bp(f,s,c)}m.memoizedState=c;var _={value:c,getSnapshot:s};return m.queue=_,Np(wp.bind(null,f,_,r),[r]),f.flags|=2048,Co(9,Sp.bind(null,f,_,c,s),void 0,null),c},useId:function(){var r=kr(),s=Gt.identifierPrefix;if(gt){var c=jr,f=$r;c=(f&~(1<<32-bt(f)-1)).toString(32)+c,s=":"+s+"R"+c,c=ko++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=xS++,s=":"+s+"r"+c.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},TS={readContext:Xn,useCallback:Op,useContext:Xn,useEffect:_u,useImperativeHandle:Mp,useInsertionEffect:Tp,useLayoutEffect:Rp,useMemo:Dp,useReducer:mu,useRef:Cp,useState:function(){return mu(Eo)},useDebugValue:vu,useDeferredValue:function(r){var s=Zn();return Lp(s,Ht.memoizedState,r)},useTransition:function(){var r=mu(Eo)[0],s=Zn().memoizedState;return[r,s]},useMutableSource:vp,useSyncExternalStore:yp,useId:Ip,unstable_isNewReconciler:!1},RS={readContext:Xn,useCallback:Op,useContext:Xn,useEffect:_u,useImperativeHandle:Mp,useInsertionEffect:Tp,useLayoutEffect:Rp,useMemo:Dp,useReducer:gu,useRef:Cp,useState:function(){return gu(Eo)},useDebugValue:vu,useDeferredValue:function(r){var s=Zn();return Ht===null?s.memoizedState=r:Lp(s,Ht.memoizedState,r)},useTransition:function(){var r=gu(Eo)[0],s=Zn().memoizedState;return[r,s]},useMutableSource:vp,useSyncExternalStore:yp,useId:Ip,unstable_isNewReconciler:!1};function hr(r,s){if(r&&r.defaultProps){s=E({},s),r=r.defaultProps;for(var c in r)s[c]===void 0&&(s[c]=r[c]);return s}return s}function yu(r,s,c,f){s=r.memoizedState,c=c(f,s),c=c==null?s:E({},s,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var tl={isMounted:function(r){return(r=r._reactInternals)?zr(r)===r:!1},enqueueSetState:function(r,s,c){r=r._reactInternals;var f=vn(),m=gi(r),_=Kr(f,m);_.payload=s,c!=null&&(_.callback=c),s=di(r,_,m),s!==null&&(pr(s,r,m,f),Va(s,r,m))},enqueueReplaceState:function(r,s,c){r=r._reactInternals;var f=vn(),m=gi(r),_=Kr(f,m);_.tag=1,_.payload=s,c!=null&&(_.callback=c),s=di(r,_,m),s!==null&&(pr(s,r,m,f),Va(s,r,m))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var c=vn(),f=gi(r),m=Kr(c,f);m.tag=2,s!=null&&(m.callback=s),s=di(r,m,f),s!==null&&(pr(s,r,f,c),Va(s,r,f))}};function zp(r,s,c,f,m,_,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,_,w):s.prototype&&s.prototype.isPureReactComponent?!ho(c,f)||!ho(m,_):!0}function Up(r,s,c){var f=!1,m=ci,_=s.contextType;return typeof _=="object"&&_!==null?_=Xn(_):(m=Cn(s)?Fi:ln.current,f=s.contextTypes,_=(f=f!=null)?ks(r,m):ci),s=new s(c,_),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=tl,r.stateNode=s,s._reactInternals=r,f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=m,r.__reactInternalMemoizedMaskedChildContext=_),s}function Hp(r,s,c,f){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,f),s.state!==r&&tl.enqueueReplaceState(s,s.state,null)}function bu(r,s,c,f){var m=r.stateNode;m.props=c,m.state=r.memoizedState,m.refs={},ou(r);var _=s.contextType;typeof _=="object"&&_!==null?m.context=Xn(_):(_=Cn(s)?Fi:ln.current,m.context=ks(r,_)),m.state=r.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(yu(r,s,_,c),m.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(s=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),s!==m.state&&tl.enqueueReplaceState(m,m.state,null),Ga(r,c,m,f),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308)}function Os(r,s){try{var c="",f=s;do c+=Ne(f),f=f.return;while(f);var m=c}catch(_){m=`
|
|
39
39
|
Error generating stack: `+_.message+`
|
|
40
|
-
`+_.stack}return{value:r,source:s,stack:m,digest:null}}function Su(r,s,c){return{value:r,source:null,stack:c??null,digest:s??null}}function wu(r,s){try{console.error(s.value)}catch(c){setTimeout(function(){throw c})}}var AS=typeof WeakMap=="function"?WeakMap:Map;function $p(r,s,c){c=Kr(-1,c),c.tag=3,c.payload={element:null};var f=s.value;return c.callback=function(){ll||(ll=!0,Bu=f),wu(r,s)},c}function jp(r,s,c){c=Kr(-1,c),c.tag=3;var f=r.type.getDerivedStateFromError;if(typeof f=="function"){var m=s.value;c.payload=function(){return f(m)},c.callback=function(){wu(r,s)}}var _=r.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(c.callback=function(){wu(r,s),typeof f!="function"&&(pi===null?pi=new Set([this]):pi.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})}),c}function Wp(r,s,c){var f=r.pingCache;if(f===null){f=r.pingCache=new AS;var m=new Set;f.set(s,m)}else m=f.get(s),m===void 0&&(m=new Set,f.set(s,m));m.has(c)||(m.add(c),r=WS.bind(null,r,s,c),s.then(r,r))}function Kp(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function qp(r,s,c,f,m){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(s=Kr(-1,1),s.tag=2,di(c,s,1))),c.lanes|=1),r):(r.flags|=65536,r.lanes=m,r)}var MS=A.ReactCurrentOwner,Nn=!1;function _n(r,s,c,f){s.child=r===null?dp(s,null,c,f):Ts(s,r.child,c,f)}function Vp(r,s,c,f,m){c=c.render;var _=s.ref;return As(s,m),f=fu(r,s,c,f,_,m),c=pu(),r!==null&&!Nn?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~m,qr(r,s,m)):(gt&&c&&Xc(s),s.flags|=1,_n(r,s,f,m),s.child)}function Gp(r,s,c,f,m){if(r===null){var _=c.type;return typeof _=="function"&&!Wu(_)&&_.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(s.tag=15,s.type=_,Yp(r,s,_,f,m)):(r=pl(c.type,null,f,s,s.mode,m),r.ref=s.ref,r.return=s,s.child=r)}if(_=r.child,(r.lanes&m)===0){var w=_.memoizedProps;if(c=c.compare,c=c!==null?c:ho,c(w,f)&&r.ref===s.ref)return qr(r,s,m)}return s.flags|=1,r=vi(_,f),r.ref=s.ref,r.return=s,s.child=r}function Yp(r,s,c,f,m){if(r!==null){var _=r.memoizedProps;if(ho(_,f)&&r.ref===s.ref)if(Nn=!1,s.pendingProps=f=_,(r.lanes&m)!==0)(r.flags&131072)!==0&&(Nn=!0);else return s.lanes=r.lanes,qr(r,s,m)}return xu(r,s,c,f,m)}function Xp(r,s,c){var f=s.pendingProps,m=f.children,_=r!==null?r.memoizedState:null;if(f.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Ls,zn),zn|=c;else{if((c&1073741824)===0)return r=_!==null?_.baseLanes|c:c,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,ut(Ls,zn),zn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=_!==null?_.baseLanes:c,ut(Ls,zn),zn|=f}else _!==null?(f=_.baseLanes|c,s.memoizedState=null):f=c,ut(Ls,zn),zn|=f;return _n(r,s,m,c),s.child}function Zp(r,s){var c=s.ref;(r===null&&c!==null||r!==null&&r.ref!==c)&&(s.flags|=512,s.flags|=2097152)}function xu(r,s,c,f,m){var _=Cn(c)?Fi:ln.current;return _=ks(s,_),As(s,m),c=fu(r,s,c,f,_,m),f=pu(),r!==null&&!Nn?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~m,qr(r,s,m)):(gt&&f&&Xc(s),s.flags|=1,_n(r,s,c,m),s.child)}function Qp(r,s,c,f,m){if(Cn(c)){var _=!0;za(s)}else _=!1;if(As(s,m),s.stateNode===null)rl(r,s),Up(s,c,f),bu(s,c,f,m),f=!0;else if(r===null){var w=s.stateNode,T=s.memoizedProps;w.props=T;var P=w.context,V=c.contextType;typeof V=="object"&&V!==null?V=Xn(V):(V=Cn(c)?Fi:ln.current,V=ks(s,V));var re=c.getDerivedStateFromProps,ae=typeof re=="function"||typeof w.getSnapshotBeforeUpdate=="function";ae||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==f||P!==V)&&Hp(s,w,f,V),hi=!1;var ne=s.memoizedState;w.state=ne,Ga(s,f,w,m),P=s.memoizedState,T!==f||ne!==P||En.current||hi?(typeof re=="function"&&(yu(s,c,re,f),P=s.memoizedState),(T=hi||zp(s,c,T,f,ne,P,V))?(ae||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=P),w.props=f,w.state=P,w.context=V,f=T):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{w=s.stateNode,pp(r,s),T=s.memoizedProps,V=s.type===s.elementType?T:hr(s.type,T),w.props=V,ae=s.pendingProps,ne=w.context,P=c.contextType,typeof P=="object"&&P!==null?P=Xn(P):(P=Cn(c)?Fi:ln.current,P=ks(s,P));var ge=c.getDerivedStateFromProps;(re=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==ae||ne!==P)&&Hp(s,w,f,P),hi=!1,ne=s.memoizedState,w.state=ne,Ga(s,f,w,m);var xe=s.memoizedState;T!==ae||ne!==xe||En.current||hi?(typeof ge=="function"&&(yu(s,c,ge,f),xe=s.memoizedState),(V=hi||zp(s,c,V,f,ne,xe,P)||!1)?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(f,xe,P),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(f,xe,P)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=xe),w.props=f,w.state=xe,w.context=P,f=V):(typeof w.componentDidUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=1024),f=!1)}return ku(r,s,c,f,_,m)}function ku(r,s,c,f,m,_){Zp(r,s);var w=(s.flags&128)!==0;if(!f&&!w)return m&&rp(s,c,!1),qr(r,s,_);f=s.stateNode,MS.current=s;var T=w&&typeof c.getDerivedStateFromError!="function"?null:f.render();return s.flags|=1,r!==null&&w?(s.child=Ts(s,r.child,null,_),s.child=Ts(s,null,T,_)):_n(r,s,T,_),s.memoizedState=f.state,m&&rp(s,c,!0),s.child}function Jp(r){var s=r.stateNode;s.pendingContext?tp(r,s.pendingContext,s.pendingContext!==s.context):s.context&&tp(r,s.context,!1),au(r,s.containerInfo)}function em(r,s,c,f,m){return Ns(),eu(m),s.flags|=256,_n(r,s,c,f),s.child}var Eu={dehydrated:null,treeContext:null,retryLane:0};function Cu(r){return{baseLanes:r,cachePool:null,transitions:null}}function tm(r,s,c){var f=s.pendingProps,m=St.current,_=!1,w=(s.flags&128)!==0,T;if((T=w)||(T=r!==null&&r.memoizedState===null?!1:(m&2)!==0),T?(_=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(m|=1),ut(St,m&1),r===null)return Jc(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(w=f.children,r=f.fallback,_?(f=s.mode,_=s.child,w={mode:"hidden",children:w},(f&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=w):_=ml(w,f,0,null),r=Gi(r,f,c,null),_.return=s,r.return=s,_.sibling=r,s.child=_,s.child.memoizedState=Cu(c),s.memoizedState=Eu,r):Nu(s,w));if(m=r.memoizedState,m!==null&&(T=m.dehydrated,T!==null))return OS(r,s,w,f,T,m,c);if(_){_=f.fallback,w=s.mode,m=r.child,T=m.sibling;var P={mode:"hidden",children:f.children};return(w&1)===0&&s.child!==m?(f=s.child,f.childLanes=0,f.pendingProps=P,s.deletions=null):(f=vi(m,P),f.subtreeFlags=m.subtreeFlags&14680064),T!==null?_=vi(T,_):(_=Gi(_,w,c,null),_.flags|=2),_.return=s,f.return=s,f.sibling=_,s.child=f,f=_,_=s.child,w=r.child.memoizedState,w=w===null?Cu(c):{baseLanes:w.baseLanes|c,cachePool:null,transitions:w.transitions},_.memoizedState=w,_.childLanes=r.childLanes&~c,s.memoizedState=Eu,f}return _=r.child,r=_.sibling,f=vi(_,{mode:"visible",children:f.children}),(s.mode&1)===0&&(f.lanes=c),f.return=s,f.sibling=null,r!==null&&(c=s.deletions,c===null?(s.deletions=[r],s.flags|=16):c.push(r)),s.child=f,s.memoizedState=null,f}function Nu(r,s){return s=ml({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function nl(r,s,c,f){return f!==null&&eu(f),Ts(s,r.child,null,c),r=Nu(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function OS(r,s,c,f,m,_,w){if(c)return s.flags&256?(s.flags&=-257,f=Su(Error(n(422))),nl(r,s,w,f)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(_=f.fallback,m=s.mode,f=ml({mode:"visible",children:f.children},m,0,null),_=Gi(_,m,w,null),_.flags|=2,f.return=s,_.return=s,f.sibling=_,s.child=f,(s.mode&1)!==0&&Ts(s,r.child,null,w),s.child.memoizedState=Cu(w),s.memoizedState=Eu,_);if((s.mode&1)===0)return nl(r,s,w,null);if(m.data==="$!"){if(f=m.nextSibling&&m.nextSibling.dataset,f)var T=f.dgst;return f=T,_=Error(n(419)),f=Su(_,f,void 0),nl(r,s,w,f)}if(T=(w&r.childLanes)!==0,Nn||T){if(f=Gt,f!==null){switch(w&-w){case 4:m=2;break;case 16:m=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:m=32;break;case 536870912:m=268435456;break;default:m=0}m=(m&(f.suspendedLanes|w))!==0?0:m,m!==0&&m!==_.retryLane&&(_.retryLane=m,Wr(r,m),pr(f,r,m,-1))}return ju(),f=Su(Error(n(421))),nl(r,s,w,f)}return m.data==="$?"?(s.flags|=128,s.child=r.child,s=KS.bind(null,r),m._reactRetry=s,null):(r=_.treeContext,Fn=ai(m.nextSibling),Bn=s,gt=!0,ur=null,r!==null&&(Gn[Yn++]=$r,Gn[Yn++]=jr,Gn[Yn++]=zi,$r=r.id,jr=r.overflow,zi=s),s=Nu(s,f.children),s.flags|=4096,s)}function nm(r,s,c){r.lanes|=s;var f=r.alternate;f!==null&&(f.lanes|=s),iu(r.return,s,c)}function Tu(r,s,c,f,m){var _=r.memoizedState;_===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:m}:(_.isBackwards=s,_.rendering=null,_.renderingStartTime=0,_.last=f,_.tail=c,_.tailMode=m)}function rm(r,s,c){var f=s.pendingProps,m=f.revealOrder,_=f.tail;if(_n(r,s,f.children,c),f=St.current,(f&2)!==0)f=f&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&nm(r,c,s);else if(r.tag===19)nm(r,c,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}f&=1}if(ut(St,f),(s.mode&1)===0)s.memoizedState=null;else switch(m){case"forwards":for(c=s.child,m=null;c!==null;)r=c.alternate,r!==null&&Ya(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=s.child,s.child=null):(m=c.sibling,c.sibling=null),Tu(s,!1,m,c,_);break;case"backwards":for(c=null,m=s.child,s.child=null;m!==null;){if(r=m.alternate,r!==null&&Ya(r)===null){s.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}Tu(s,!0,c,null,_);break;case"together":Tu(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function rl(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function qr(r,s,c){if(r!==null&&(s.dependencies=r.dependencies),Wi|=s.lanes,(c&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,c=vi(r,r.pendingProps),s.child=c,c.return=s;r.sibling!==null;)r=r.sibling,c=c.sibling=vi(r,r.pendingProps),c.return=s;c.sibling=null}return s.child}function DS(r,s,c){switch(s.tag){case 3:Jp(s),Ns();break;case 5:_p(s);break;case 1:Cn(s.type)&&za(s);break;case 4:au(s,s.stateNode.containerInfo);break;case 10:var f=s.type._context,m=s.memoizedProps.value;ut(Ka,f._currentValue),f._currentValue=m;break;case 13:if(f=s.memoizedState,f!==null)return f.dehydrated!==null?(ut(St,St.current&1),s.flags|=128,null):(c&s.child.childLanes)!==0?tm(r,s,c):(ut(St,St.current&1),r=qr(r,s,c),r!==null?r.sibling:null);ut(St,St.current&1);break;case 19:if(f=(c&s.childLanes)!==0,(r.flags&128)!==0){if(f)return rm(r,s,c);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ut(St,St.current),f)break;return null;case 22:case 23:return s.lanes=0,Xp(r,s,c)}return qr(r,s,c)}var im,Ru,sm,om;im=function(r,s){for(var c=s.child;c!==null;){if(c.tag===5||c.tag===6)r.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}},Ru=function(){},sm=function(r,s,c,f){var m=r.memoizedProps;if(m!==f){r=s.stateNode,$i(xr.current);var _=null;switch(c){case"input":m=Ln(r,m),f=Ln(r,f),_=[];break;case"select":m=C({},m,{value:void 0}),f=C({},f,{value:void 0}),_=[];break;case"textarea":m=Ti(r,m),f=Ti(r,f),_=[];break;default:typeof m.onClick!="function"&&typeof f.onClick=="function"&&(r.onclick=Pa)}Ut(c,f);var w;c=null;for(V in m)if(!f.hasOwnProperty(V)&&m.hasOwnProperty(V)&&m[V]!=null)if(V==="style"){var T=m[V];for(w in T)T.hasOwnProperty(w)&&(c||(c={}),c[w]="")}else V!=="dangerouslySetInnerHTML"&&V!=="children"&&V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&V!=="autoFocus"&&(o.hasOwnProperty(V)?_||(_=[]):(_=_||[]).push(V,null));for(V in f){var P=f[V];if(T=m!=null?m[V]:void 0,f.hasOwnProperty(V)&&P!==T&&(P!=null||T!=null))if(V==="style")if(T){for(w in T)!T.hasOwnProperty(w)||P&&P.hasOwnProperty(w)||(c||(c={}),c[w]="");for(w in P)P.hasOwnProperty(w)&&T[w]!==P[w]&&(c||(c={}),c[w]=P[w])}else c||(_||(_=[]),_.push(V,c)),c=P;else V==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,T=T?T.__html:void 0,P!=null&&T!==P&&(_=_||[]).push(V,P)):V==="children"?typeof P!="string"&&typeof P!="number"||(_=_||[]).push(V,""+P):V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&(o.hasOwnProperty(V)?(P!=null&&V==="onScroll"&&dt("scroll",r),_||T===P||(_=[])):(_=_||[]).push(V,P))}c&&(_=_||[]).push("style",c);var V=_;(s.updateQueue=V)&&(s.flags|=4)}},om=function(r,s,c,f){c!==f&&(s.flags|=4)};function No(r,s){if(!gt)switch(r.tailMode){case"hidden":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function un(r){var s=r.alternate!==null&&r.alternate.child===r.child,c=0,f=0;if(s)for(var m=r.child;m!==null;)c|=m.lanes|m.childLanes,f|=m.subtreeFlags&14680064,f|=m.flags&14680064,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)c|=m.lanes|m.childLanes,f|=m.subtreeFlags,f|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=f,r.childLanes=c,s}function LS(r,s,c){var f=s.pendingProps;switch(Zc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(s),null;case 1:return Cn(s.type)&&Fa(),un(s),null;case 3:return f=s.stateNode,Ms(),ft(En),ft(ln),uu(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(r===null||r.child===null)&&(ja(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ur!==null&&(Uu(ur),ur=null))),Ru(r,s),un(s),null;case 5:lu(s);var m=$i(wo.current);if(c=s.type,r!==null&&s.stateNode!=null)sm(r,s,c,f,m),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!f){if(s.stateNode===null)throw Error(n(166));return un(s),null}if(r=$i(xr.current),ja(s)){f=s.stateNode,c=s.type;var _=s.memoizedProps;switch(f[wr]=s,f[_o]=_,r=(s.mode&1)!==0,c){case"dialog":dt("cancel",f),dt("close",f);break;case"iframe":case"object":case"embed":dt("load",f);break;case"video":case"audio":for(m=0;m<po.length;m++)dt(po[m],f);break;case"source":dt("error",f);break;case"img":case"image":case"link":dt("error",f),dt("load",f);break;case"details":dt("toggle",f);break;case"input":Ir(f,_),dt("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!_.multiple},dt("invalid",f);break;case"textarea":Ri(f,_),dt("invalid",f)}Ut(c,_),m=null;for(var w in _)if(_.hasOwnProperty(w)){var T=_[w];w==="children"?typeof T=="string"?f.textContent!==T&&(_.suppressHydrationWarning!==!0&&Ia(f.textContent,T,r),m=["children",T]):typeof T=="number"&&f.textContent!==""+T&&(_.suppressHydrationWarning!==!0&&Ia(f.textContent,T,r),m=["children",""+T]):o.hasOwnProperty(w)&&T!=null&&w==="onScroll"&&dt("scroll",f)}switch(c){case"input":Ft(f),Wn(f,_,!0);break;case"textarea":Ft(f),Ai(f);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(f.onclick=Pa)}f=m,s.updateQueue=f,f!==null&&(s.flags|=4)}else{w=m.nodeType===9?m:m.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=X(c)),r==="http://www.w3.org/1999/xhtml"?c==="script"?(r=w.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof f.is=="string"?r=w.createElement(c,{is:f.is}):(r=w.createElement(c),c==="select"&&(w=r,f.multiple?w.multiple=!0:f.size&&(w.size=f.size))):r=w.createElementNS(r,c),r[wr]=s,r[_o]=f,im(r,s,!1,!1),s.stateNode=r;e:{switch(w=qn(c,f),c){case"dialog":dt("cancel",r),dt("close",r),m=f;break;case"iframe":case"object":case"embed":dt("load",r),m=f;break;case"video":case"audio":for(m=0;m<po.length;m++)dt(po[m],r);m=f;break;case"source":dt("error",r),m=f;break;case"img":case"image":case"link":dt("error",r),dt("load",r),m=f;break;case"details":dt("toggle",r),m=f;break;case"input":Ir(r,f),m=Ln(r,f),dt("invalid",r);break;case"option":m=f;break;case"select":r._wrapperState={wasMultiple:!!f.multiple},m=C({},f,{value:void 0}),dt("invalid",r);break;case"textarea":Ri(r,f),m=Ti(r,f),dt("invalid",r);break;default:m=f}Ut(c,m),T=m;for(_ in T)if(T.hasOwnProperty(_)){var P=T[_];_==="style"?ar(r,P):_==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,P!=null&&je(r,P)):_==="children"?typeof P=="string"?(c!=="textarea"||P!=="")&&Xe(r,P):typeof P=="number"&&Xe(r,""+P):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?P!=null&&_==="onScroll"&&dt("scroll",r):P!=null&&L(r,_,P,w))}switch(c){case"input":Ft(r),Wn(r,f,!1);break;case"textarea":Ft(r),Ai(r);break;case"option":f.value!=null&&r.setAttribute("value",""+Le(f.value));break;case"select":r.multiple=!!f.multiple,_=f.value,_!=null?vr(r,!!f.multiple,_,!1):f.defaultValue!=null&&vr(r,!!f.multiple,f.defaultValue,!0);break;default:typeof m.onClick=="function"&&(r.onclick=Pa)}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 un(s),null;case 6:if(r&&s.stateNode!=null)om(r,s,r.memoizedProps,f);else{if(typeof f!="string"&&s.stateNode===null)throw Error(n(166));if(c=$i(wo.current),$i(xr.current),ja(s)){if(f=s.stateNode,c=s.memoizedProps,f[wr]=s,(_=f.nodeValue!==c)&&(r=Bn,r!==null))switch(r.tag){case 3:Ia(f.nodeValue,c,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Ia(f.nodeValue,c,(r.mode&1)!==0)}_&&(s.flags|=4)}else f=(c.nodeType===9?c:c.ownerDocument).createTextNode(f),f[wr]=s,s.stateNode=f}return un(s),null;case 13:if(ft(St),f=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(gt&&Fn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)cp(),Ns(),s.flags|=98560,_=!1;else if(_=ja(s),f!==null&&f.dehydrated!==null){if(r===null){if(!_)throw Error(n(318));if(_=s.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[wr]=s}else Ns(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;un(s),_=!1}else ur!==null&&(Uu(ur),ur=null),_=!0;if(!_)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=c,s):(f=f!==null,f!==(r!==null&&r.memoizedState!==null)&&f&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(St.current&1)!==0?$t===0&&($t=3):ju())),s.updateQueue!==null&&(s.flags|=4),un(s),null);case 4:return Ms(),Ru(r,s),r===null&&mo(s.stateNode.containerInfo),un(s),null;case 10:return ru(s.type._context),un(s),null;case 17:return Cn(s.type)&&Fa(),un(s),null;case 19:if(ft(St),_=s.memoizedState,_===null)return un(s),null;if(f=(s.flags&128)!==0,w=_.rendering,w===null)if(f)No(_,!1);else{if($t!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(w=Ya(r),w!==null){for(s.flags|=128,No(_,!1),f=w.updateQueue,f!==null&&(s.updateQueue=f,s.flags|=4),s.subtreeFlags=0,f=c,c=s.child;c!==null;)_=c,r=f,_.flags&=14680066,w=_.alternate,w===null?(_.childLanes=0,_.lanes=r,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=w.childLanes,_.lanes=w.lanes,_.child=w.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=w.memoizedProps,_.memoizedState=w.memoizedState,_.updateQueue=w.updateQueue,_.type=w.type,r=w.dependencies,_.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),c=c.sibling;return ut(St,St.current&1|2),s.child}r=r.sibling}_.tail!==null&&yt()>Is&&(s.flags|=128,f=!0,No(_,!1),s.lanes=4194304)}else{if(!f)if(r=Ya(w),r!==null){if(s.flags|=128,f=!0,c=r.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),No(_,!0),_.tail===null&&_.tailMode==="hidden"&&!w.alternate&&!gt)return un(s),null}else 2*yt()-_.renderingStartTime>Is&&c!==1073741824&&(s.flags|=128,f=!0,No(_,!1),s.lanes=4194304);_.isBackwards?(w.sibling=s.child,s.child=w):(c=_.last,c!==null?c.sibling=w:s.child=w,_.last=w)}return _.tail!==null?(s=_.tail,_.rendering=s,_.tail=s.sibling,_.renderingStartTime=yt(),s.sibling=null,c=St.current,ut(St,f?c&1|2:c&1),s):(un(s),null);case 22:case 23:return $u(),f=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==f&&(s.flags|=8192),f&&(s.mode&1)!==0?(zn&1073741824)!==0&&(un(s),s.subtreeFlags&6&&(s.flags|=8192)):un(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function IS(r,s){switch(Zc(s),s.tag){case 1:return Cn(s.type)&&Fa(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Ms(),ft(En),ft(ln),uu(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return lu(s),null;case 13:if(ft(St),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Ns()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return ft(St),null;case 4:return Ms(),null;case 10:return ru(s.type._context),null;case 22:case 23:return $u(),null;case 24:return null;default:return null}}var il=!1,hn=!1,PS=typeof WeakSet=="function"?WeakSet:Set,we=null;function Ds(r,s){var c=r.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(f){Ct(r,s,f)}else c.current=null}function Au(r,s,c){try{c()}catch(f){Ct(r,s,f)}}var am=!1;function BS(r,s){if($c=ka,r=zf(),Lc(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var m=f.anchorOffset,_=f.focusNode;f=f.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var w=0,T=-1,P=-1,V=0,re=0,ae=r,ne=null;t:for(;;){for(var ge;ae!==c||m!==0&&ae.nodeType!==3||(T=w+m),ae!==_||f!==0&&ae.nodeType!==3||(P=w+f),ae.nodeType===3&&(w+=ae.nodeValue.length),(ge=ae.firstChild)!==null;)ne=ae,ae=ge;for(;;){if(ae===r)break t;if(ne===c&&++V===m&&(T=w),ne===_&&++re===f&&(P=w),(ge=ae.nextSibling)!==null)break;ae=ne,ne=ae.parentNode}ae=ge}c=T===-1||P===-1?null:{start:T,end:P}}else c=null}c=c||{start:0,end:0}}else c=null;for(jc={focusedElem:r,selectionRange:c},ka=!1,we=s;we!==null;)if(s=we,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,we=r;else for(;we!==null;){s=we;try{var xe=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var ke=xe.memoizedProps,Mt=xe.memoizedState,U=s.stateNode,B=U.getSnapshotBeforeUpdate(s.elementType===s.type?ke:hr(s.type,ke),Mt);U.__reactInternalSnapshotBeforeUpdate=B}break;case 3:var j=s.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ue){Ct(s,s.return,ue)}if(r=s.sibling,r!==null){r.return=s.return,we=r;break}we=s.return}return xe=am,am=!1,xe}function To(r,s,c){var f=s.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var m=f=f.next;do{if((m.tag&r)===r){var _=m.destroy;m.destroy=void 0,_!==void 0&&Au(s,c,_)}m=m.next}while(m!==f)}}function sl(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&r)===r){var f=c.create;c.destroy=f()}c=c.next}while(c!==s)}}function Mu(r){var s=r.ref;if(s!==null){var c=r.stateNode;switch(r.tag){case 5:r=c;break;default:r=c}typeof s=="function"?s(r):s.current=r}}function lm(r){var s=r.alternate;s!==null&&(r.alternate=null,lm(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[wr],delete s[_o],delete s[Vc],delete s[yS],delete s[bS])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function cm(r){return r.tag===5||r.tag===3||r.tag===4}function um(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||cm(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Ou(r,s,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?c.nodeType===8?c.parentNode.insertBefore(r,s):c.insertBefore(r,s):(c.nodeType===8?(s=c.parentNode,s.insertBefore(r,c)):(s=c,s.appendChild(r)),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=Pa));else if(f!==4&&(r=r.child,r!==null))for(Ou(r,s,c),r=r.sibling;r!==null;)Ou(r,s,c),r=r.sibling}function Du(r,s,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?c.insertBefore(r,s):c.appendChild(r);else if(f!==4&&(r=r.child,r!==null))for(Du(r,s,c),r=r.sibling;r!==null;)Du(r,s,c),r=r.sibling}var rn=null,dr=!1;function fi(r,s,c){for(c=c.child;c!==null;)hm(r,s,c),c=c.sibling}function hm(r,s,c){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(We,c)}catch{}switch(c.tag){case 5:hn||Ds(c,s);case 6:var f=rn,m=dr;rn=null,fi(r,s,c),rn=f,dr=m,rn!==null&&(dr?(r=rn,c=c.stateNode,r.nodeType===8?r.parentNode.removeChild(c):r.removeChild(c)):rn.removeChild(c.stateNode));break;case 18:rn!==null&&(dr?(r=rn,c=c.stateNode,r.nodeType===8?qc(r.parentNode,c):r.nodeType===1&&qc(r,c),so(r)):qc(rn,c.stateNode));break;case 4:f=rn,m=dr,rn=c.stateNode.containerInfo,dr=!0,fi(r,s,c),rn=f,dr=m;break;case 0:case 11:case 14:case 15:if(!hn&&(f=c.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){m=f=f.next;do{var _=m,w=_.destroy;_=_.tag,w!==void 0&&((_&2)!==0||(_&4)!==0)&&Au(c,s,w),m=m.next}while(m!==f)}fi(r,s,c);break;case 1:if(!hn&&(Ds(c,s),f=c.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=c.memoizedProps,f.state=c.memoizedState,f.componentWillUnmount()}catch(T){Ct(c,s,T)}fi(r,s,c);break;case 21:fi(r,s,c);break;case 22:c.mode&1?(hn=(f=hn)||c.memoizedState!==null,fi(r,s,c),hn=f):fi(r,s,c);break;default:fi(r,s,c)}}function dm(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var c=r.stateNode;c===null&&(c=r.stateNode=new PS),s.forEach(function(f){var m=qS.bind(null,r,f);c.has(f)||(c.add(f),f.then(m,m))})}}function fr(r,s){var c=s.deletions;if(c!==null)for(var f=0;f<c.length;f++){var m=c[f];try{var _=r,w=s,T=w;e:for(;T!==null;){switch(T.tag){case 5:rn=T.stateNode,dr=!1;break e;case 3:rn=T.stateNode.containerInfo,dr=!0;break e;case 4:rn=T.stateNode.containerInfo,dr=!0;break e}T=T.return}if(rn===null)throw Error(n(160));hm(_,w,m),rn=null,dr=!1;var P=m.alternate;P!==null&&(P.return=null),m.return=null}catch(V){Ct(m,s,V)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)fm(s,r),s=s.sibling}function fm(r,s){var c=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(fr(s,r),Er(r),f&4){try{To(3,r,r.return),sl(3,r)}catch(ke){Ct(r,r.return,ke)}try{To(5,r,r.return)}catch(ke){Ct(r,r.return,ke)}}break;case 1:fr(s,r),Er(r),f&512&&c!==null&&Ds(c,c.return);break;case 5:if(fr(s,r),Er(r),f&512&&c!==null&&Ds(c,c.return),r.flags&32){var m=r.stateNode;try{Xe(m,"")}catch(ke){Ct(r,r.return,ke)}}if(f&4&&(m=r.stateNode,m!=null)){var _=r.memoizedProps,w=c!==null?c.memoizedProps:_,T=r.type,P=r.updateQueue;if(r.updateQueue=null,P!==null)try{T==="input"&&_.type==="radio"&&_.name!=null&&Qe(m,_),qn(T,w);var V=qn(T,_);for(w=0;w<P.length;w+=2){var re=P[w],ae=P[w+1];re==="style"?ar(m,ae):re==="dangerouslySetInnerHTML"?je(m,ae):re==="children"?Xe(m,ae):L(m,re,ae,V)}switch(T){case"input":In(m,_);break;case"textarea":Kn(m,_);break;case"select":var ne=m._wrapperState.wasMultiple;m._wrapperState.wasMultiple=!!_.multiple;var ge=_.value;ge!=null?vr(m,!!_.multiple,ge,!1):ne!==!!_.multiple&&(_.defaultValue!=null?vr(m,!!_.multiple,_.defaultValue,!0):vr(m,!!_.multiple,_.multiple?[]:"",!1))}m[_o]=_}catch(ke){Ct(r,r.return,ke)}}break;case 6:if(fr(s,r),Er(r),f&4){if(r.stateNode===null)throw Error(n(162));m=r.stateNode,_=r.memoizedProps;try{m.nodeValue=_}catch(ke){Ct(r,r.return,ke)}}break;case 3:if(fr(s,r),Er(r),f&4&&c!==null&&c.memoizedState.isDehydrated)try{so(s.containerInfo)}catch(ke){Ct(r,r.return,ke)}break;case 4:fr(s,r),Er(r);break;case 13:fr(s,r),Er(r),m=r.child,m.flags&8192&&(_=m.memoizedState!==null,m.stateNode.isHidden=_,!_||m.alternate!==null&&m.alternate.memoizedState!==null||(Pu=yt())),f&4&&dm(r);break;case 22:if(re=c!==null&&c.memoizedState!==null,r.mode&1?(hn=(V=hn)||re,fr(s,r),hn=V):fr(s,r),Er(r),f&8192){if(V=r.memoizedState!==null,(r.stateNode.isHidden=V)&&!re&&(r.mode&1)!==0)for(we=r,re=r.child;re!==null;){for(ae=we=re;we!==null;){switch(ne=we,ge=ne.child,ne.tag){case 0:case 11:case 14:case 15:To(4,ne,ne.return);break;case 1:Ds(ne,ne.return);var xe=ne.stateNode;if(typeof xe.componentWillUnmount=="function"){f=ne,c=ne.return;try{s=f,xe.props=s.memoizedProps,xe.state=s.memoizedState,xe.componentWillUnmount()}catch(ke){Ct(f,c,ke)}}break;case 5:Ds(ne,ne.return);break;case 22:if(ne.memoizedState!==null){gm(ae);continue}}ge!==null?(ge.return=ne,we=ge):gm(ae)}re=re.sibling}e:for(re=null,ae=r;;){if(ae.tag===5){if(re===null){re=ae;try{m=ae.stateNode,V?(_=m.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(T=ae.stateNode,P=ae.memoizedProps.style,w=P!=null&&P.hasOwnProperty("display")?P.display:null,T.style.display=kn("display",w))}catch(ke){Ct(r,r.return,ke)}}}else if(ae.tag===6){if(re===null)try{ae.stateNode.nodeValue=V?"":ae.memoizedProps}catch(ke){Ct(r,r.return,ke)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===r)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===r)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===r)break e;re===ae&&(re=null),ae=ae.return}re===ae&&(re=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:fr(s,r),Er(r),f&4&&dm(r);break;case 21:break;default:fr(s,r),Er(r)}}function Er(r){var s=r.flags;if(s&2){try{e:{for(var c=r.return;c!==null;){if(cm(c)){var f=c;break e}c=c.return}throw Error(n(160))}switch(f.tag){case 5:var m=f.stateNode;f.flags&32&&(Xe(m,""),f.flags&=-33);var _=um(r);Du(r,_,m);break;case 3:case 4:var w=f.stateNode.containerInfo,T=um(r);Ou(r,T,w);break;default:throw Error(n(161))}}catch(P){Ct(r,r.return,P)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function FS(r,s,c){we=r,pm(r)}function pm(r,s,c){for(var f=(r.mode&1)!==0;we!==null;){var m=we,_=m.child;if(m.tag===22&&f){var w=m.memoizedState!==null||il;if(!w){var T=m.alternate,P=T!==null&&T.memoizedState!==null||hn;T=il;var V=hn;if(il=w,(hn=P)&&!V)for(we=m;we!==null;)w=we,P=w.child,w.tag===22&&w.memoizedState!==null?_m(m):P!==null?(P.return=w,we=P):_m(m);for(;_!==null;)we=_,pm(_),_=_.sibling;we=m,il=T,hn=V}mm(r)}else(m.subtreeFlags&8772)!==0&&_!==null?(_.return=m,we=_):mm(r)}}function mm(r){for(;we!==null;){var s=we;if((s.flags&8772)!==0){var c=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:hn||sl(5,s);break;case 1:var f=s.stateNode;if(s.flags&4&&!hn)if(c===null)f.componentDidMount();else{var m=s.elementType===s.type?c.memoizedProps:hr(s.type,c.memoizedProps);f.componentDidUpdate(m,c.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var _=s.updateQueue;_!==null&&gp(s,_,f);break;case 3:var w=s.updateQueue;if(w!==null){if(c=null,s.child!==null)switch(s.child.tag){case 5:c=s.child.stateNode;break;case 1:c=s.child.stateNode}gp(s,w,c)}break;case 5:var T=s.stateNode;if(c===null&&s.flags&4){c=T;var P=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":P.autoFocus&&c.focus();break;case"img":P.src&&(c.src=P.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var V=s.alternate;if(V!==null){var re=V.memoizedState;if(re!==null){var ae=re.dehydrated;ae!==null&&so(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}hn||s.flags&512&&Mu(s)}catch(ne){Ct(s,s.return,ne)}}if(s===r){we=null;break}if(c=s.sibling,c!==null){c.return=s.return,we=c;break}we=s.return}}function gm(r){for(;we!==null;){var s=we;if(s===r){we=null;break}var c=s.sibling;if(c!==null){c.return=s.return,we=c;break}we=s.return}}function _m(r){for(;we!==null;){var s=we;try{switch(s.tag){case 0:case 11:case 15:var c=s.return;try{sl(4,s)}catch(P){Ct(s,c,P)}break;case 1:var f=s.stateNode;if(typeof f.componentDidMount=="function"){var m=s.return;try{f.componentDidMount()}catch(P){Ct(s,m,P)}}var _=s.return;try{Mu(s)}catch(P){Ct(s,_,P)}break;case 5:var w=s.return;try{Mu(s)}catch(P){Ct(s,w,P)}}}catch(P){Ct(s,s.return,P)}if(s===r){we=null;break}var T=s.sibling;if(T!==null){T.return=s.return,we=T;break}we=s.return}}var zS=Math.ceil,ol=A.ReactCurrentDispatcher,Lu=A.ReactCurrentOwner,Qn=A.ReactCurrentBatchConfig,tt=0,Gt=null,Lt=null,sn=0,zn=0,Ls=li(0),$t=0,Ro=null,Wi=0,al=0,Iu=0,Ao=null,Tn=null,Pu=0,Is=1/0,Vr=null,ll=!1,Bu=null,pi=null,cl=!1,mi=null,ul=0,Mo=0,Fu=null,hl=-1,dl=0;function vn(){return(tt&6)!==0?yt():hl!==-1?hl:hl=yt()}function gi(r){return(r.mode&1)===0?1:(tt&2)!==0&&sn!==0?sn&-sn:wS.transition!==null?(dl===0&&(dl=Sa()),dl):(r=et,r!==0||(r=window.event,r=r===void 0?16:yf(r.type)),r)}function pr(r,s,c,f){if(50<Mo)throw Mo=0,Fu=null,Error(n(185));ri(r,c,f),((tt&2)===0||r!==Gt)&&(r===Gt&&((tt&2)===0&&(al|=c),$t===4&&_i(r,sn)),Rn(r,f),c===1&&tt===0&&(s.mode&1)===0&&(Is=yt()+500,Ua&&ui()))}function Rn(r,s){var c=r.callbackNode;Sc(r,s);var f=Li(r,r===Gt?sn:0);if(f===0)c!==null&&lr(c),r.callbackNode=null,r.callbackPriority=0;else if(s=f&-f,r.callbackPriority!==s){if(c!=null&&lr(c),s===1)r.tag===0?SS(ym.bind(null,r)):ip(ym.bind(null,r)),_S(function(){(tt&6)===0&&ui()}),c=null;else{switch(Fe(f)){case 1:c=Js;break;case 4:c=Oi;break;case 16:c=fs;break;case 536870912:c=Ce;break;default:c=fs}c=Nm(c,vm.bind(null,r))}r.callbackPriority=s,r.callbackNode=c}}function vm(r,s){if(hl=-1,dl=0,(tt&6)!==0)throw Error(n(327));var c=r.callbackNode;if(Ps()&&r.callbackNode!==c)return null;var f=Li(r,r===Gt?sn:0);if(f===0)return null;if((f&30)!==0||(f&r.expiredLanes)!==0||s)s=fl(r,f);else{s=f;var m=tt;tt|=2;var _=Sm();(Gt!==r||sn!==s)&&(Vr=null,Is=yt()+500,qi(r,s));do try{$S();break}catch(T){bm(r,T)}while(!0);nu(),ol.current=_,tt=m,Lt!==null?s=0:(Gt=null,sn=0,s=$t)}if(s!==0){if(s===2&&(m=eo(r),m!==0&&(f=m,s=zu(r,m))),s===1)throw c=Ro,qi(r,0),_i(r,f),Rn(r,yt()),c;if(s===6)_i(r,f);else{if(m=r.current.alternate,(f&30)===0&&!US(m)&&(s=fl(r,f),s===2&&(_=eo(r),_!==0&&(f=_,s=zu(r,_))),s===1))throw c=Ro,qi(r,0),_i(r,f),Rn(r,yt()),c;switch(r.finishedWork=m,r.finishedLanes=f,s){case 0:case 1:throw Error(n(345));case 2:Vi(r,Tn,Vr);break;case 3:if(_i(r,f),(f&130023424)===f&&(s=Pu+500-yt(),10<s)){if(Li(r,0)!==0)break;if(m=r.suspendedLanes,(m&f)!==f){vn(),r.pingedLanes|=r.suspendedLanes&m;break}r.timeoutHandle=Kc(Vi.bind(null,r,Tn,Vr),s);break}Vi(r,Tn,Vr);break;case 4:if(_i(r,f),(f&4194240)===f)break;for(s=r.eventTimes,m=-1;0<f;){var w=31-bt(f);_=1<<w,w=s[w],w>m&&(m=w),f&=~_}if(f=m,f=yt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*zS(f/1960))-f,10<f){r.timeoutHandle=Kc(Vi.bind(null,r,Tn,Vr),f);break}Vi(r,Tn,Vr);break;case 5:Vi(r,Tn,Vr);break;default:throw Error(n(329))}}}return Rn(r,yt()),r.callbackNode===c?vm.bind(null,r):null}function zu(r,s){var c=Ao;return r.current.memoizedState.isDehydrated&&(qi(r,s).flags|=256),r=fl(r,s),r!==2&&(s=Tn,Tn=c,s!==null&&Uu(s)),r}function Uu(r){Tn===null?Tn=r:Tn.push.apply(Tn,r)}function US(r){for(var s=r;;){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 m=c[f],_=m.getSnapshot;m=m.value;try{if(!cr(_(),m))return!1}catch{return!1}}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function _i(r,s){for(s&=~Iu,s&=~al,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var c=31-bt(s),f=1<<c;r[c]=-1,s&=~f}}function ym(r){if((tt&6)!==0)throw Error(n(327));Ps();var s=Li(r,0);if((s&1)===0)return Rn(r,yt()),null;var c=fl(r,s);if(r.tag!==0&&c===2){var f=eo(r);f!==0&&(s=f,c=zu(r,f))}if(c===1)throw c=Ro,qi(r,0),_i(r,s),Rn(r,yt()),c;if(c===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Vi(r,Tn,Vr),Rn(r,yt()),null}function Hu(r,s){var c=tt;tt|=1;try{return r(s)}finally{tt=c,tt===0&&(Is=yt()+500,Ua&&ui())}}function Ki(r){mi!==null&&mi.tag===0&&(tt&6)===0&&Ps();var s=tt;tt|=1;var c=Qn.transition,f=et;try{if(Qn.transition=null,et=1,r)return r()}finally{et=f,Qn.transition=c,tt=s,(tt&6)===0&&ui()}}function $u(){zn=Ls.current,ft(Ls)}function qi(r,s){r.finishedWork=null,r.finishedLanes=0;var c=r.timeoutHandle;if(c!==-1&&(r.timeoutHandle=-1,gS(c)),Lt!==null)for(c=Lt.return;c!==null;){var f=c;switch(Zc(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Fa();break;case 3:Ms(),ft(En),ft(ln),uu();break;case 5:lu(f);break;case 4:Ms();break;case 13:ft(St);break;case 19:ft(St);break;case 10:ru(f.type._context);break;case 22:case 23:$u()}c=c.return}if(Gt=r,Lt=r=vi(r.current,null),sn=zn=s,$t=0,Ro=null,Iu=al=Wi=0,Tn=Ao=null,Hi!==null){for(s=0;s<Hi.length;s++)if(c=Hi[s],f=c.interleaved,f!==null){c.interleaved=null;var m=f.next,_=c.pending;if(_!==null){var w=_.next;_.next=m,f.next=w}c.pending=f}Hi=null}return r}function bm(r,s){do{var c=Lt;try{if(nu(),Xa.current=el,Za){for(var f=wt.memoizedState;f!==null;){var m=f.queue;m!==null&&(m.pending=null),f=f.next}Za=!1}if(ji=0,Vt=Ht=wt=null,xo=!1,ko=0,Lu.current=null,c===null||c.return===null){$t=1,Ro=s,Lt=null;break}e:{var _=r,w=c.return,T=c,P=s;if(s=sn,T.flags|=32768,P!==null&&typeof P=="object"&&typeof P.then=="function"){var V=P,re=T,ae=re.tag;if((re.mode&1)===0&&(ae===0||ae===11||ae===15)){var ne=re.alternate;ne?(re.updateQueue=ne.updateQueue,re.memoizedState=ne.memoizedState,re.lanes=ne.lanes):(re.updateQueue=null,re.memoizedState=null)}var ge=Kp(w);if(ge!==null){ge.flags&=-257,qp(ge,w,T,_,s),ge.mode&1&&Wp(_,V,s),s=ge,P=V;var xe=s.updateQueue;if(xe===null){var ke=new Set;ke.add(P),s.updateQueue=ke}else xe.add(P);break e}else{if((s&1)===0){Wp(_,V,s),ju();break e}P=Error(n(426))}}else if(gt&&T.mode&1){var Mt=Kp(w);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),qp(Mt,w,T,_,s),eu(Os(P,T));break e}}_=P=Os(P,T),$t!==4&&($t=2),Ao===null?Ao=[_]:Ao.push(_),_=w;do{switch(_.tag){case 3:_.flags|=65536,s&=-s,_.lanes|=s;var U=$p(_,P,s);mp(_,U);break e;case 1:T=P;var B=_.type,j=_.stateNode;if((_.flags&128)===0&&(typeof B.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(pi===null||!pi.has(j)))){_.flags|=65536,s&=-s,_.lanes|=s;var ue=jp(_,T,s);mp(_,ue);break e}}_=_.return}while(_!==null)}xm(c)}catch(Ee){s=Ee,Lt===c&&c!==null&&(Lt=c=c.return);continue}break}while(!0)}function Sm(){var r=ol.current;return ol.current=el,r===null?el:r}function ju(){($t===0||$t===3||$t===2)&&($t=4),Gt===null||(Wi&268435455)===0&&(al&268435455)===0||_i(Gt,sn)}function fl(r,s){var c=tt;tt|=2;var f=Sm();(Gt!==r||sn!==s)&&(Vr=null,qi(r,s));do try{HS();break}catch(m){bm(r,m)}while(!0);if(nu(),tt=c,ol.current=f,Lt!==null)throw Error(n(261));return Gt=null,sn=0,$t}function HS(){for(;Lt!==null;)wm(Lt)}function $S(){for(;Lt!==null&&!ya();)wm(Lt)}function wm(r){var s=Cm(r.alternate,r,zn);r.memoizedProps=r.pendingProps,s===null?xm(r):Lt=s,Lu.current=null}function xm(r){var s=r;do{var c=s.alternate;if(r=s.return,(s.flags&32768)===0){if(c=LS(c,s,zn),c!==null){Lt=c;return}}else{if(c=IS(c,s),c!==null){c.flags&=32767,Lt=c;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{$t=6,Lt=null;return}}if(s=s.sibling,s!==null){Lt=s;return}Lt=s=r}while(s!==null);$t===0&&($t=5)}function Vi(r,s,c){var f=et,m=Qn.transition;try{Qn.transition=null,et=1,jS(r,s,c,f)}finally{Qn.transition=m,et=f}return null}function jS(r,s,c,f){do Ps();while(mi!==null);if((tt&6)!==0)throw Error(n(327));c=r.finishedWork;var m=r.finishedLanes;if(c===null)return null;if(r.finishedWork=null,r.finishedLanes=0,c===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var _=c.lanes|c.childLanes;if(Vn(r,_),r===Gt&&(Lt=Gt=null,sn=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||cl||(cl=!0,Nm(fs,function(){return Ps(),null})),_=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||_){_=Qn.transition,Qn.transition=null;var w=et;et=1;var T=tt;tt|=4,Lu.current=null,BS(r,c),fm(c,r),cS(jc),ka=!!$c,jc=$c=null,r.current=c,FS(c),ba(),tt=T,et=w,Qn.transition=_}else r.current=c;if(cl&&(cl=!1,mi=r,ul=m),_=r.pendingLanes,_===0&&(pi=null),Rt(c.stateNode),Rn(r,yt()),s!==null)for(f=r.onRecoverableError,c=0;c<s.length;c++)m=s[c],f(m.value,{componentStack:m.stack,digest:m.digest});if(ll)throw ll=!1,r=Bu,Bu=null,r;return(ul&1)!==0&&r.tag!==0&&Ps(),_=r.pendingLanes,(_&1)!==0?r===Fu?Mo++:(Mo=0,Fu=r):Mo=0,ui(),null}function Ps(){if(mi!==null){var r=Fe(ul),s=Qn.transition,c=et;try{if(Qn.transition=null,et=16>r?16:r,mi===null)var f=!1;else{if(r=mi,mi=null,ul=0,(tt&6)!==0)throw Error(n(331));var m=tt;for(tt|=4,we=r.current;we!==null;){var _=we,w=_.child;if((we.flags&16)!==0){var T=_.deletions;if(T!==null){for(var P=0;P<T.length;P++){var V=T[P];for(we=V;we!==null;){var re=we;switch(re.tag){case 0:case 11:case 15:To(8,re,_)}var ae=re.child;if(ae!==null)ae.return=re,we=ae;else for(;we!==null;){re=we;var ne=re.sibling,ge=re.return;if(lm(re),re===V){we=null;break}if(ne!==null){ne.return=ge,we=ne;break}we=ge}}}var xe=_.alternate;if(xe!==null){var ke=xe.child;if(ke!==null){xe.child=null;do{var Mt=ke.sibling;ke.sibling=null,ke=Mt}while(ke!==null)}}we=_}}if((_.subtreeFlags&2064)!==0&&w!==null)w.return=_,we=w;else e:for(;we!==null;){if(_=we,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:To(9,_,_.return)}var U=_.sibling;if(U!==null){U.return=_.return,we=U;break e}we=_.return}}var B=r.current;for(we=B;we!==null;){w=we;var j=w.child;if((w.subtreeFlags&2064)!==0&&j!==null)j.return=w,we=j;else e:for(w=B;we!==null;){if(T=we,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:sl(9,T)}}catch(Ee){Ct(T,T.return,Ee)}if(T===w){we=null;break e}var ue=T.sibling;if(ue!==null){ue.return=T.return,we=ue;break e}we=T.return}}if(tt=m,ui(),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(We,r)}catch{}f=!0}return f}finally{et=c,Qn.transition=s}}return!1}function km(r,s,c){s=Os(c,s),s=$p(r,s,1),r=di(r,s,1),s=vn(),r!==null&&(ri(r,1,s),Rn(r,s))}function Ct(r,s,c){if(r.tag===3)km(r,r,c);else for(;s!==null;){if(s.tag===3){km(s,r,c);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(pi===null||!pi.has(f))){r=Os(c,r),r=jp(s,r,1),s=di(s,r,1),r=vn(),s!==null&&(ri(s,1,r),Rn(s,r));break}}s=s.return}}function WS(r,s,c){var f=r.pingCache;f!==null&&f.delete(s),s=vn(),r.pingedLanes|=r.suspendedLanes&c,Gt===r&&(sn&c)===c&&($t===4||$t===3&&(sn&130023424)===sn&&500>yt()-Pu?qi(r,0):Iu|=c),Rn(r,s)}function Em(r,s){s===0&&((r.mode&1)===0?s=1:(s=Di,Di<<=1,(Di&130023424)===0&&(Di=4194304)));var c=vn();r=Wr(r,s),r!==null&&(ri(r,s,c),Rn(r,c))}function KS(r){var s=r.memoizedState,c=0;s!==null&&(c=s.retryLane),Em(r,c)}function qS(r,s){var c=0;switch(r.tag){case 13:var f=r.stateNode,m=r.memoizedState;m!==null&&(c=m.retryLane);break;case 19:f=r.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(s),Em(r,c)}var Cm;Cm=function(r,s,c){if(r!==null)if(r.memoizedProps!==s.pendingProps||En.current)Nn=!0;else{if((r.lanes&c)===0&&(s.flags&128)===0)return Nn=!1,DS(r,s,c);Nn=(r.flags&131072)!==0}else Nn=!1,gt&&(s.flags&1048576)!==0&&sp(s,$a,s.index);switch(s.lanes=0,s.tag){case 2:var f=s.type;rl(r,s),r=s.pendingProps;var m=ks(s,ln.current);As(s,c),m=fu(null,s,f,r,m,c);var _=pu();return s.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Cn(f)?(_=!0,za(s)):_=!1,s.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,ou(s),m.updater=tl,s.stateNode=m,m._reactInternals=s,bu(s,f,r,c),s=ku(null,s,f,!0,_,c)):(s.tag=0,gt&&_&&Xc(s),_n(null,s,m,c),s=s.child),s;case 16:f=s.elementType;e:{switch(rl(r,s),r=s.pendingProps,m=f._init,f=m(f._payload),s.type=f,m=s.tag=GS(f),r=hr(f,r),m){case 0:s=xu(null,s,f,r,c);break e;case 1:s=Qp(null,s,f,r,c);break e;case 11:s=Vp(null,s,f,r,c);break e;case 14:s=Gp(null,s,f,hr(f.type,r),c);break e}throw Error(n(306,f,""))}return s;case 0:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),xu(r,s,f,m,c);case 1:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),Qp(r,s,f,m,c);case 3:e:{if(Jp(s),r===null)throw Error(n(387));f=s.pendingProps,_=s.memoizedState,m=_.element,pp(r,s),Ga(s,f,null,c);var w=s.memoizedState;if(f=w.element,_.isDehydrated)if(_={element:f,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},s.updateQueue.baseState=_,s.memoizedState=_,s.flags&256){m=Os(Error(n(423)),s),s=em(r,s,f,c,m);break e}else if(f!==m){m=Os(Error(n(424)),s),s=em(r,s,f,c,m);break e}else for(Fn=ai(s.stateNode.containerInfo.firstChild),Bn=s,gt=!0,ur=null,c=dp(s,null,f,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ns(),f===m){s=qr(r,s,c);break e}_n(r,s,f,c)}s=s.child}return s;case 5:return _p(s),r===null&&Jc(s),f=s.type,m=s.pendingProps,_=r!==null?r.memoizedProps:null,w=m.children,Wc(f,m)?w=null:_!==null&&Wc(f,_)&&(s.flags|=32),Zp(r,s),_n(r,s,w,c),s.child;case 6:return r===null&&Jc(s),null;case 13:return tm(r,s,c);case 4:return au(s,s.stateNode.containerInfo),f=s.pendingProps,r===null?s.child=Ts(s,null,f,c):_n(r,s,f,c),s.child;case 11:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),Vp(r,s,f,m,c);case 7:return _n(r,s,s.pendingProps,c),s.child;case 8:return _n(r,s,s.pendingProps.children,c),s.child;case 12:return _n(r,s,s.pendingProps.children,c),s.child;case 10:e:{if(f=s.type._context,m=s.pendingProps,_=s.memoizedProps,w=m.value,ut(Ka,f._currentValue),f._currentValue=w,_!==null)if(cr(_.value,w)){if(_.children===m.children&&!En.current){s=qr(r,s,c);break e}}else for(_=s.child,_!==null&&(_.return=s);_!==null;){var T=_.dependencies;if(T!==null){w=_.child;for(var P=T.firstContext;P!==null;){if(P.context===f){if(_.tag===1){P=Kr(-1,c&-c),P.tag=2;var V=_.updateQueue;if(V!==null){V=V.shared;var re=V.pending;re===null?P.next=P:(P.next=re.next,re.next=P),V.pending=P}}_.lanes|=c,P=_.alternate,P!==null&&(P.lanes|=c),iu(_.return,c,s),T.lanes|=c;break}P=P.next}}else if(_.tag===10)w=_.type===s.type?null:_.child;else if(_.tag===18){if(w=_.return,w===null)throw Error(n(341));w.lanes|=c,T=w.alternate,T!==null&&(T.lanes|=c),iu(w,c,s),w=_.sibling}else w=_.child;if(w!==null)w.return=_;else for(w=_;w!==null;){if(w===s){w=null;break}if(_=w.sibling,_!==null){_.return=w.return,w=_;break}w=w.return}_=w}_n(r,s,m.children,c),s=s.child}return s;case 9:return m=s.type,f=s.pendingProps.children,As(s,c),m=Xn(m),f=f(m),s.flags|=1,_n(r,s,f,c),s.child;case 14:return f=s.type,m=hr(f,s.pendingProps),m=hr(f.type,m),Gp(r,s,f,m,c);case 15:return Yp(r,s,s.type,s.pendingProps,c);case 17:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),rl(r,s),s.tag=1,Cn(f)?(r=!0,za(s)):r=!1,As(s,c),Up(s,f,m),bu(s,f,m,c),ku(null,s,f,!0,r,c);case 19:return rm(r,s,c);case 22:return Xp(r,s,c)}throw Error(n(156,s.tag))};function Nm(r,s){return va(r,s)}function VS(r,s,c,f){this.tag=r,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 Jn(r,s,c,f){return new VS(r,s,c,f)}function Wu(r){return r=r.prototype,!(!r||!r.isReactComponent)}function GS(r){if(typeof r=="function")return Wu(r)?1:0;if(r!=null){if(r=r.$$typeof,r===$)return 11;if(r===z)return 14}return 2}function vi(r,s){var c=r.alternate;return c===null?(c=Jn(r.tag,s,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=s,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&14680064,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,s=r.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c}function pl(r,s,c,f,m,_){var w=2;if(f=r,typeof r=="function")Wu(r)&&(w=1);else if(typeof r=="string")w=5;else e:switch(r){case se:return Gi(c.children,m,_,s);case W:w=8,m|=8;break;case ee:return r=Jn(12,c,s,m|2),r.elementType=ee,r.lanes=_,r;case K:return r=Jn(13,c,s,m),r.elementType=K,r.lanes=_,r;case q:return r=Jn(19,c,s,m),r.elementType=q,r.lanes=_,r;case oe:return ml(c,m,_,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:w=10;break e;case Y:w=9;break e;case $:w=11;break e;case z:w=14;break e;case Z:w=16,f=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Jn(w,c,s,m),s.elementType=r,s.type=f,s.lanes=_,s}function Gi(r,s,c,f){return r=Jn(7,r,f,s),r.lanes=c,r}function ml(r,s,c,f){return r=Jn(22,r,f,s),r.elementType=oe,r.lanes=c,r.stateNode={isHidden:!1},r}function Ku(r,s,c){return r=Jn(6,r,null,s),r.lanes=c,r}function qu(r,s,c){return s=Jn(4,r.children!==null?r.children:[],r.key,s),s.lanes=c,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function YS(r,s,c,f,m){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ni(0),this.expirationTimes=ni(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ni(0),this.identifierPrefix=f,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function Vu(r,s,c,f,m,_,w,T,P){return r=new YS(r,s,c,T,P),s===1?(s=1,_===!0&&(s|=8)):s=0,_=Jn(3,null,null,s),r.current=_,_.stateNode=r,_.memoizedState={element:f,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},ou(_),r}function XS(r,s,c){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:f==null?null:""+f,children:r,containerInfo:s,implementation:c}}function Tm(r){if(!r)return ci;r=r._reactInternals;e:{if(zr(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Cn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var c=r.type;if(Cn(c))return np(r,c,s)}return s}function Rm(r,s,c,f,m,_,w,T,P){return r=Vu(c,f,!0,r,m,_,w,T,P),r.context=Tm(null),c=r.current,f=vn(),m=gi(c),_=Kr(f,m),_.callback=s??null,di(c,_,m),r.current.lanes=m,ri(r,m,f),Rn(r,f),r}function gl(r,s,c,f){var m=s.current,_=vn(),w=gi(m);return c=Tm(c),s.context===null?s.context=c:s.pendingContext=c,s=Kr(_,w),s.payload={element:r},f=f===void 0?null:f,f!==null&&(s.callback=f),r=di(m,s,w),r!==null&&(pr(r,m,w,_),Va(r,m,w)),w}function _l(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Am(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<s?c:s}}function Gu(r,s){Am(r,s),(r=r.alternate)&&Am(r,s)}function ZS(){return null}var Mm=typeof reportError=="function"?reportError:function(r){console.error(r)};function Yu(r){this._internalRoot=r}vl.prototype.render=Yu.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));gl(r,s,null,null)},vl.prototype.unmount=Yu.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Ki(function(){gl(null,r,null,null)}),s[Ur]=null}};function vl(r){this._internalRoot=r}vl.prototype.unstable_scheduleHydration=function(r){if(r){var s=Ii();r={blockedOn:null,target:r,priority:s};for(var c=0;c<qt.length&&s!==0&&s<qt[c].priority;c++);qt.splice(c,0,r),c===0&&_f(r)}};function Xu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function yl(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Om(){}function QS(r,s,c,f,m){if(m){if(typeof f=="function"){var _=f;f=function(){var V=_l(w);_.call(V)}}var w=Rm(s,f,r,0,null,!1,!1,"",Om);return r._reactRootContainer=w,r[Ur]=w.current,mo(r.nodeType===8?r.parentNode:r),Ki(),w}for(;m=r.lastChild;)r.removeChild(m);if(typeof f=="function"){var T=f;f=function(){var V=_l(P);T.call(V)}}var P=Vu(r,0,!1,null,null,!1,!1,"",Om);return r._reactRootContainer=P,r[Ur]=P.current,mo(r.nodeType===8?r.parentNode:r),Ki(function(){gl(s,P,c,f)}),P}function bl(r,s,c,f,m){var _=c._reactRootContainer;if(_){var w=_;if(typeof m=="function"){var T=m;m=function(){var P=_l(w);T.call(P)}}gl(s,w,r,m)}else w=QS(c,s,r,m,f);return _l(w)}no=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var c=ti(s.pendingLanes);c!==0&&(to(s,c|1),Rn(s,yt()),(tt&6)===0&&(Is=yt()+500,ui()))}break;case 13:Ki(function(){var f=Wr(r,1);if(f!==null){var m=vn();pr(f,r,1,m)}}),Gu(r,1)}},At=function(r){if(r.tag===13){var s=Wr(r,134217728);if(s!==null){var c=vn();pr(s,r,134217728,c)}Gu(r,134217728)}},it=function(r){if(r.tag===13){var s=gi(r),c=Wr(r,s);if(c!==null){var f=vn();pr(c,r,s,f)}Gu(r,s)}},Ii=function(){return et},Sr=function(r,s){var c=et;try{return et=r,s()}finally{et=c}},hs=function(r,s,c){switch(s){case"input":if(In(r,c),s=c.name,c.type==="radio"&&s!=null){for(c=r;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!==r&&f.form===r.form){var m=Ba(f);if(!m)throw Error(n(90));tn(f),In(f,m)}}}break;case"textarea":Kn(r,c);break;case"select":s=c.value,s!=null&&vr(r,!!c.multiple,s,!1)}},pe=Hu,Ie=Ki;var JS={usingClientEntryPoint:!1,Events:[vo,ws,Ba,M,Q,Hu]},Oo={findFiberByHostInstance:Bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ew={bundleType:Oo.bundleType,version:Oo.version,rendererPackageName:Oo.rendererPackageName,rendererConfig:Oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=ga(r),r===null?null:r.stateNode},findFiberByHostInstance:Oo.findFiberByHostInstance||ZS,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 Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sl.isDisabled&&Sl.supportsFiber)try{We=Sl.inject(ew),Ge=Sl}catch{}}return An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=JS,An.createPortal=function(r,s){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xu(s))throw Error(n(200));return XS(r,s,null,c)},An.createRoot=function(r,s){if(!Xu(r))throw Error(n(299));var c=!1,f="",m=Mm;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onRecoverableError!==void 0&&(m=s.onRecoverableError)),s=Vu(r,1,!1,null,null,c,!1,f,m),r[Ur]=s.current,mo(r.nodeType===8?r.parentNode:r),new Yu(s)},An.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=ga(s),r=r===null?null:r.stateNode,r},An.flushSync=function(r){return Ki(r)},An.hydrate=function(r,s,c){if(!yl(s))throw Error(n(200));return bl(null,r,s,!0,c)},An.hydrateRoot=function(r,s,c){if(!Xu(r))throw Error(n(405));var f=c!=null&&c.hydratedSources||null,m=!1,_="",w=Mm;if(c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onRecoverableError!==void 0&&(w=c.onRecoverableError)),s=Rm(s,null,r,1,c??null,m,!1,_,w),r[Ur]=s.current,mo(r),f)for(r=0;r<f.length;r++)c=f[r],m=c._getVersion,m=m(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,m]:s.mutableSourceEagerHydrationData.push(c,m);return new vl(s)},An.render=function(r,s,c){if(!yl(s))throw Error(n(200));return bl(null,r,s,!1,c)},An.unmountComponentAtNode=function(r){if(!yl(r))throw Error(n(40));return r._reactRootContainer?(Ki(function(){bl(null,null,r,!1,function(){r._reactRootContainer=null,r[Ur]=null})}),!0):!1},An.unstable_batchedUpdates=Hu,An.unstable_renderSubtreeIntoContainer=function(r,s,c,f){if(!yl(c))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return bl(r,s,c,!1,f)},An.version="18.3.1-next-f1338f8080-20240426",An}var Um;function lw(){if(Um)return Ju.exports;Um=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(),Ju.exports=aw(),Ju.exports}var Hm;function cw(){if(Hm)return wl;Hm=1;var e=lw();return wl.createRoot=e.createRoot,wl.hydrateRoot=e.hydrateRoot,wl}var uw=cw(),J_={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$m=ts.createContext&&ts.createContext(J_),hw=["attr","size","title"];function dw(e,t){if(e==null)return{};var n,i,o=fw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function fw(e,t){if(e==null)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;n[i]=e[i]}return n}function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Kl.apply(null,arguments)}function jm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jm(Object(n),!0).forEach(function(i){pw(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jm(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function pw(e,t,n){return(t=mw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mw(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 i=n.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ev(e){return e&&e.map((t,n)=>ts.createElement(t.tag,ql({key:n},t.attr),ev(t.child)))}function vt(e){return t=>ts.createElement(_w,Kl({attr:ql({},e.attr)},t),ev(e.child))}function _w(e){var t=n=>{var i=e.attr,o=e.size,a=e.title,l=dw(e,hw),u=o||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),ts.createElement("svg",Kl({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,l,{className:d,style:ql(ql({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&ts.createElement("title",null,a),e.children)};return $m!==void 0?ts.createElement($m.Consumer,null,n=>t(n)):t(J_)}function vw(e){return vt({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 Pd(e){return vt({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 tv(e){return vt({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 Fh(e){return vt({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 Bd(e){return vt({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 nv(e){return vt({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 yw(e){return vt({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 Fd(e){return vt({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 Ws(e){return vt({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 bw(e){return vt({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 rv(e){return vt({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 Wm(e){return vt({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 Sw(e){return vt({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 nh(e){return vt({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 Km(e){return vt({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 ww(e){return vt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"},child:[]},{tag:"polyline",attr:{points:"14 2 14 8 20 8"},child:[]},{tag:"line",attr:{x1:"16",y1:"13",x2:"8",y2:"13"},child:[]},{tag:"line",attr:{x1:"16",y1:"17",x2:"8",y2:"17"},child:[]},{tag:"polyline",attr:{points:"10 9 9 9 8 9"},child:[]}]})(e)}function iv(e){return vt({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 zd(e){return vt({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 sv(e){return vt({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 oc(e){return vt({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 ac(e){return vt({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 xw(e){return vt({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 kw(e){return vt({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 Ew(e){return vt({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 rh({trigger:e,open:t,onOpenChange:n,children:i,align:o="right"}){const a=ie.useRef(null);return ie.useEffect(()=>{if(!t)return;const l=d=>{a.current&&!a.current.contains(d.target)&&n(!1)},u=d=>{d.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",u)}},[t,n]),S.jsxs("div",{className:`dropdown ${o}`,ref:a,children:[S.jsxs("button",{type:"button",className:"chip",onClick:()=>n(!t),"aria-expanded":t,children:[e,S.jsx(ac,{className:`dd-caret ${t?"up":""}`})]}),t&&S.jsx("div",{className:"dd-menu",children:i})]})}function qm({active:e,onClick:t,children:n}){return S.jsx("button",{type:"button",className:`dd-item ${e?"active":""}`,onClick:t,children:n})}const Cw=[{kind:"question",label:"问卷弹出",desc:"ask_user_question 出现时"},{kind:"done",label:"回复结束",desc:"智能体完成一轮回答时"},{kind:"start",label:"回复开始",desc:"智能体开始新一轮时"},{kind:"error",label:"出错",desc:"出现错误提示时"}];function Nw({settings:e,onChange:t,onPreview:n}){const i=o=>t({...e,...o});return S.jsxs("div",{className:"sound-menu",children:[S.jsx("div",{className:"dd-header",children:"声音提示"}),S.jsxs("label",{className:"sound-row sound-master",children:[S.jsxs("span",{className:"sound-label",children:[S.jsx(tv,{className:"sound-icon"}),S.jsx("span",{children:"启用声音"})]}),S.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>i({enabled:o.target.checked})})]}),Cw.map(({kind:o,label:a,desc:l})=>S.jsxs("label",{className:`sound-row ${e.enabled?"":"disabled"}`,children:[S.jsxs("span",{className:"sound-label",children:[S.jsx("span",{className:"sound-name",children:a}),S.jsx("span",{className:"sound-desc",children:l})]}),S.jsxs("span",{className:"sound-right",children:[S.jsx("button",{type:"button",className:"sound-preview",title:"试听",disabled:!e.enabled,onClick:u=>{u.preventDefault(),n(o)},children:"试听"}),S.jsx("input",{type:"checkbox",checked:e[o],disabled:!e.enabled,onChange:u=>i({[o]:u.target.checked})})]})]},o)),S.jsxs("div",{className:`sound-volume ${e.enabled?"":"disabled"}`,children:[S.jsx("span",{className:"sound-name",children:"音量"}),S.jsx("input",{type:"range",min:0,max:100,step:5,value:e.volume,disabled:!e.enabled,onChange:o=>i({volume:Number(o.target.value)})}),S.jsxs("span",{className:"sound-vol-num",children:[e.volume,"%"]})]})]})}const ov=[{value:"off",label:"关闭"},{value:"minimal",label:"极简"},{value:"low",label:"低"},{value:"medium",label:"中"},{value:"high",label:"高"},{value:"xhigh",label:"极高"},{value:"max",label:"最大"}];function Tw(e){var t;return((t=ov.find(n=>n.value===e))==null?void 0:t.label)??e}function Rw({chat:e,send:t,view:n,onViewChange:i,onManageModels:o,sound:a,onSoundChange:l,onSoundPreview:u}){const d=e.state,h=d==null?void 0:d.model,g=h?`${h.provider}/${h.id}`:null,[p,v]=ie.useState(!1),[y,b]=ie.useState(!1),[x,k]=ie.useState(!1),[E,O]=ie.useState(!1);ie.useEffect(()=>{p&&e.models.length===0&&!E&&(O(!0),t({type:"list_models"}))},[p,e.models.length,E,t]),ie.useEffect(()=>{e.models.length>0&&O(!1)},[e.models.length]);const L=e.ready?"已连接":e.status==="closed"?"重连中…":"连接中…",A=e.ready?"ok":"busy";return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"brand",children:[S.jsx("span",{className:"brand-logo",children:"π"}),S.jsx("span",{className:"brand-name",children:"pi-web-ui"}),S.jsx("span",{className:`conn-dot ${A}`,title:L}),S.jsx("span",{className:"conn-label",children:L})]}),S.jsxs("div",{className:"topbar-actions",children:[S.jsxs("div",{className:"view-switch",role:"tablist","aria-label":"视图切换",children:[S.jsxs("button",{type:"button",role:"tab","aria-selected":n==="chat",className:n==="chat"?"active":"",onClick:()=>i("chat"),children:[S.jsx(rv,{}),S.jsx("span",{children:"对话"})]}),S.jsxs("button",{type:"button",role:"tab","aria-selected":n==="terminal",className:n==="terminal"?"active":"",onClick:()=>i("terminal"),children:[S.jsx(Bd,{}),S.jsx("span",{children:"终端"})]})]}),S.jsxs(rh,{trigger:S.jsxs(S.Fragment,{children:[S.jsx(zd,{}),S.jsx("span",{className:"chip-model",children:h?h.name:"选择模型"}),h&&S.jsx("span",{className:"chip-sub",children:h.provider})]}),open:p,onOpenChange:v,children:[S.jsx("div",{className:"dd-header",children:"可用模型"}),(E||e.modelsLoading)&&S.jsx("div",{className:"dd-loading",children:"加载中…"}),e.models.length===0&&!E&&!e.modelsLoading&&S.jsx("div",{className:"dd-loading",children:"暂无可用模型(请先配置 API 密钥)"}),e.models.map(H=>S.jsxs(qm,{active:g===H.id,onClick:()=>{g!==H.id&&t({type:"set_model",modelId:H.id}),v(!1)},children:[S.jsx("span",{className:"dd-model-name",children:H.name}),S.jsxs("span",{className:"dd-model-sub",children:[H.provider,H.reasoning?" · 推理":""]})]},H.id)),S.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>t({type:"list_models"}),children:"刷新模型列表"}),S.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>{v(!1),o()},children:"⚙ 管理模型(新增 / 修改)"})]}),S.jsxs(rh,{trigger:S.jsxs(S.Fragment,{children:[S.jsx(vw,{}),S.jsxs("span",{className:"chip-sub",children:["思考:",d?Tw(d.thinkingLevel):"—"]})]}),open:y,onOpenChange:b,children:[S.jsx("div",{className:"dd-header",children:"思考强度"}),ov.map(H=>S.jsx(qm,{active:(d==null?void 0:d.thinkingLevel)===H.value,onClick:()=>{(d==null?void 0:d.thinkingLevel)!==H.value&&t({type:"set_thinking",level:H.value}),b(!1)},children:H.label},H.value))]}),S.jsx(rh,{trigger:S.jsxs(S.Fragment,{children:[S.jsx(tv,{}),S.jsx("span",{className:"chip-sub",children:"声音"})]}),open:x,onOpenChange:k,children:S.jsx(Nw,{settings:a,onChange:l,onPreview:u})}),S.jsxs("button",{type:"button",className:"chip newchat","data-tip":"新建对话(每个浏览器独立保存会话)",onClick:()=>t({type:"new_chat"}),children:[S.jsx(Ws,{}),S.jsx("span",{children:"新对话"})]})]})]})}function Aw(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 Mw({chat:e,send:t}){var a;const n=(a=e.state)==null?void 0:a.sessionFile,i=e.sessions,o=l=>{const u=l.name||l.firstMessage.trim();return u.length>0?u:"空对话"};return S.jsxs("aside",{className:"panel panel-left",children:[S.jsxs("div",{className:"panel-header",children:[S.jsx("span",{className:"panel-title",children:"对话"}),S.jsx("button",{type:"button",className:"panel-new",title:"新建对话",onClick:()=>t({type:"new_chat"}),children:S.jsx(nv,{})})]}),S.jsxs("div",{className:"panel-body",children:[i.length===0&&S.jsx("div",{className:"panel-empty",children:"还没有历史对话"}),i.map(l=>{const u=n===l.path;return S.jsxs("button",{type:"button",className:`session-item ${u?"active":""}`,title:l.path,onClick:()=>{u||t({type:"switch_session",path:l.path})},children:[S.jsx(rv,{className:"session-icon"}),S.jsxs("span",{className:"session-info",children:[S.jsx("span",{className:"session-title",children:o(l)}),S.jsxs("span",{className:"session-sub",children:[u?"当前":`${l.messageCount} 条消息`,l.source==="tui"&&S.jsx("span",{className:"session-src",title:"pi 终端(TUI)中的对话",children:"TUI"})]})]}),S.jsx("span",{className:"session-time",children:Aw(l.modified)})]},l.path)})]}),S.jsx("div",{className:"panel-footer",children:S.jsx("button",{type:"button",className:"panel-refresh",onClick:()=>t({type:"list_sessions"}),children:"刷新列表"})})]})}function Ow({chat:e,send:t,onAttach:n}){var W,ee;const[i,o]=ie.useState(""),[a,l]=ie.useState(!1),[u,d]=ie.useState(!1),[h,g]=ie.useState(""),[p,v]=ie.useState(0),y=ie.useRef(null),b=e.files;ie.useEffect(()=>{if(!u)return;const R=setTimeout(()=>{t({type:"complete_path",path:h})},150);return()=>clearTimeout(R)},[h,u,t]),ie.useEffect(()=>v(0),[e.pathCompletions]);const x=e.pathCompletions,k=ie.useRef(null);ie.useEffect(()=>{var Y;const R=(Y=k.current)==null?void 0:Y.querySelector(`.pc-item[data-idx="${p}"]`);R==null||R.scrollIntoView({block:"nearest"})},[p]);const E=(R,Y)=>{var $;g(Y?`${R}/`:R),v(0),($=y.current)==null||$.focus()},O=R=>{if(R.key==="ArrowDown")R.preventDefault(),v(Y=>Math.min(Y+1,x.length-1));else if(R.key==="ArrowUp")R.preventDefault(),v(Y=>Math.max(Y-1,0));else if(R.key==="Tab"&&x.length>0){R.preventDefault();const Y=x[Math.min(p,x.length-1)];E(Y.path,Y.type==="dir")}else if(R.key==="Enter"&&!R.nativeEvent.isComposing){const Y=h.trim();if(Y.endsWith("/"))d(!1),t({type:"set_cwd",path:Y});else if(x.some($=>$.path===Y))d(!1),t({type:"set_cwd",path:Y});else if(x.length>0&&x[p]){R.preventDefault();const $=x[p];E($.path,$.type==="dir")}else d(!1),Y&&t({type:"set_cwd",path:Y})}else R.key==="Escape"&&(x.length>0?(R.stopPropagation(),g(h),t({type:"complete_path",path:""})):d(!1))},L=ie.useRef(0),A=ie.useCallback(R=>{const Y=++L.current;o(R),l(!0),t({type:"list_files",path:R===""?void 0:R})||L.current===Y&&l(!1)},[t]);ie.useEffect(()=>{b&&b.path===i&&l(!1)},[b,i]);const H=R=>A(R),D=()=>{(b==null?void 0:b.parent)!==null&&(b==null?void 0:b.parent)!==void 0&&A(b.parent)},se=i.split("/").filter(Boolean);return S.jsxs("aside",{className:"panel panel-right",children:[S.jsxs("div",{className:"panel-header",children:[S.jsx("span",{className:"panel-title",children:"文件"}),S.jsx("button",{type:"button",className:"panel-refresh",title:"刷新文件列表",onClick:()=>A(i),children:S.jsx(Fd,{})})]}),S.jsxs("div",{className:"panel-crumbs",children:[S.jsx("button",{type:"button",className:`crumb ${i===""?"active":""}`,onClick:()=>A(""),children:"根目录"}),se.map((R,Y)=>{const $=se.slice(0,Y+1).join("/");return S.jsxs("span",{className:"crumb-seg",children:[S.jsx(oc,{}),S.jsx("button",{type:"button",className:`crumb ${$===i?"active":""}`,onClick:()=>A($),children:R})]},$)})]}),S.jsxs("div",{className:"panel-body",children:[a&&S.jsx("div",{className:"panel-empty",children:"加载中…"}),!a&&b&&b.path===i&&S.jsxs(S.Fragment,{children:[b.path!==""&&S.jsxs("button",{type:"button",className:"file-item dir",onClick:D,children:[S.jsx(nh,{className:"file-icon"}),S.jsx("span",{className:"file-name",children:".."})]}),b.entries.map(R=>R.type==="dir"?S.jsxs("div",{className:"file-item dir",children:[S.jsxs("button",{type:"button",className:"file-dir-main",onClick:()=>H(R.path),children:[S.jsx(nh,{className:"file-icon"}),S.jsx("span",{className:"file-name",children:R.name})]}),S.jsx("button",{type:"button",className:"file-attach ref","data-tip":"链接文件夹路径到对话",onClick:()=>n(R.path,R.name,"reference",!0),children:S.jsx(Wm,{})})]},R.path):S.jsxs("div",{className:"file-item file",children:[S.jsx(Km,{className:"file-icon"}),S.jsx("span",{className:"file-name",title:R.path,children:R.name}),S.jsx("button",{type:"button",className:"file-attach inline","data-tip":"附加内容到对话",onClick:()=>n(R.path,R.name,"inline"),children:S.jsx(Ws,{})}),S.jsx("button",{type:"button",className:"file-attach ref","data-tip":"仅引用路径(AI 按需读取)",onClick:()=>n(R.path,R.name,"reference"),children:S.jsx(Wm,{})})]},R.path))]}),!a&&!b&&S.jsx("div",{className:"panel-empty",children:"暂无文件"})]}),e.widgets.filter(R=>R.lines.length>0).length>0&&S.jsx("div",{className:"panel-widgets",children:e.widgets.filter(R=>R.lines.length>0).map(R=>S.jsxs("div",{className:"widget",children:[S.jsx("div",{className:"widget-title",children:R.key}),S.jsx("pre",{className:"widget-lines",children:R.lines.join(`
|
|
41
|
-
`)})]},R.key))}),S.jsx("div",{className:"panel-footer",children:u?S.jsxs("div",{className:"cwd-edit-wrap",children:[S.jsx("input",{ref:y,className:"cwd-input",value:h,autoFocus:!0,placeholder:"输入路径,Enter 切换",onChange:R=>g(R.target.value),onKeyDown:O,onBlur:()=>d(!1)}),x.length>0&&S.jsx("ul",{ref:k,className:"path-completions",onMouseDown:R=>R.preventDefault(),children:x.map((R,Y)=>S.jsx("li",{children:S.jsxs("button",{type:"button","data-idx":Y,className:`pc-item ${Y===p?"sel":""}`,onMouseEnter:()=>v(Y),onClick:()=>E(R.path,R.type==="dir"),children:[S.jsx("span",{className:"pc-icon",children:R.type==="dir"?S.jsx(nh,{}):S.jsx(Km,{})}),S.jsxs("span",{className:"pc-body",children:[S.jsx("span",{className:"pc-name",children:R.name}),S.jsx("span",{className:"pc-path",children:R.path})]})]})},R.path))})]}):S.jsxs("button",{type:"button",className:"cwd-bar",title:"点击切换工作目录",onClick:()=>{var R;g(((R=e.state)==null?void 0:R.cwd)??""),d(!0)},children:[S.jsx("span",{className:"cwd-label",children:"目录"}),S.jsx("span",{className:"panel-cwd",title:(W=e.state)==null?void 0:W.cwd,children:(ee=e.state)==null?void 0:ee.cwd}),S.jsx("span",{className:"cwd-edit",children:"✎"})]})})]})}function Dw(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Lw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Iw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pw={};function Vm(e,t){return(Pw.jsx?Iw:Lw).test(e)}const Bw=/[ \t\n\f\r]/g;function Fw(e){return typeof e=="object"?e.type==="text"?Gm(e.value):!1:Gm(e)}function Gm(e){return e.replace(Bw,"")===""}class aa{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}aa.prototype.normal={};aa.prototype.property={};aa.prototype.space=void 0;function av(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new aa(n,i,t)}function zh(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 zw=0;const ze=as(),It=as(),Uh=as(),le=as(),at=as(),ns=as(),$n=as();function as(){return 2**++zw}const Hh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:It,commaOrSpaceSeparated:$n,commaSeparated:ns,number:le,overloadedBoolean:Uh,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),ih=Object.keys(Hh);class Ud extends Dn{constructor(t,n,i,o){let a=-1;if(super(t,n),Ym(this,"space",o),typeof i=="number")for(;++a<ih.length;){const l=ih[a];Ym(this,ih[a],(i&Hh[l])===Hh[l])}}}Ud.prototype.defined=!0;function Ym(e,t,n){n&&(e[t]=n)}function Vs(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const a=new Ud(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[zh(i)]=i,n[zh(a.attribute)]=i}return new aa(t,n,e.space)}const lv=Vs({properties:{ariaActiveDescendant:null,ariaAtomic:It,ariaAutoComplete:null,ariaBusy:It,ariaChecked:It,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:It,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:It,ariaFlowTo:at,ariaGrabbed:It,ariaHasPopup:null,ariaHidden:It,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:le,ariaLive:null,ariaModal:It,ariaMultiLine:It,ariaMultiSelectable:It,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:It,ariaReadOnly:It,ariaRelevant:null,ariaRequired:It,ariaRoleDescription:at,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:It,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cv(e,t){return t in e?e[t]:t}function uv(e,t){return cv(e,t.toLowerCase())}const Uw=Vs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ns,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:at,autoFocus:ze,autoPlay:ze,blocking:at,capture:null,charSet:null,checked:ze,cite:null,className:at,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:It,controls:ze,controlsList:at,coords:le|ns,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Uh,draggable:It,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:at,height:le,hidden:Uh,high:le,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:at,itemRef:at,itemScope:ze,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,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:ze,optimum:le,pattern:null,ping:at,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:at,required:ze,reversed:ze,rows:le,rowSpan:le,sandbox:at,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:It,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:It,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:It,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:ns,part:at,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:uv}),Hw=Vs({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:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:at,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:ns,g2:ns,glyphName:ns,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:$n,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:$n,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$n,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,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:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cv}),hv=Vs({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()}}),dv=Vs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uv}),fv=Vs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$w={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"},jw=/[A-Z]/g,Xm=/-[a-z]/g,Ww=/^data[-\w.:]+$/i;function Kw(e,t){const n=zh(t);let i=t,o=Dn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ww.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Xm,Vw);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Xm.test(a)){let l=a.replace(jw,qw);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Ud}return new o(i,t)}function qw(e){return"-"+e.toLowerCase()}function Vw(e){return e.charAt(1).toUpperCase()}const Gw=av([lv,Uw,hv,dv,fv],"html"),Hd=av([lv,Hw,hv,dv,fv],"svg");function Yw(e){return e.join(" ").trim()}var Bs={},sh,Zm;function Xw(){if(Zm)return sh;Zm=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
42
|
-
`,h="/",g="*",p="",v="comment",y="declaration";function b(k,E){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];E=E||{};var O=1,L=1;function A(q){var z=q.match(t);z&&(O+=z.length);var Z=q.lastIndexOf(d);L=~Z?q.length-Z:L+q.length}function H(){var q={line:O,column:L};return function(z){return z.position=new D(q),ee(),z}}function D(q){this.start=q,this.end={line:O,column:L},this.source=E.source}D.prototype.content=k;function se(q){var z=new Error(E.source+":"+O+":"+L+": "+q);if(z.reason=q,z.filename=E.source,z.line=O,z.column=L,z.source=k,!E.silent)throw z}function W(q){var z=q.exec(k);if(z){var Z=z[0];return A(Z),k=k.slice(Z.length),z}}function ee(){W(n)}function R(q){var z;for(q=q||[];z=Y();)z!==!1&&q.push(z);return q}function Y(){var q=H();if(!(h!=k.charAt(0)||g!=k.charAt(1))){for(var z=2;p!=k.charAt(z)&&(g!=k.charAt(z)||h!=k.charAt(z+1));)++z;if(z+=2,p===k.charAt(z-1))return se("End of comment missing");var Z=k.slice(2,z-2);return L+=2,A(Z),k=k.slice(z),L+=2,q({type:v,comment:Z})}}function $(){var q=H(),z=W(i);if(z){if(Y(),!W(o))return se("property missing ':'");var Z=W(a),oe=q({type:y,property:x(z[0].replace(e,p)),value:Z?x(Z[0].replace(e,p)):p});return W(l),oe}}function K(){var q=[];R(q);for(var z;z=$();)z!==!1&&(q.push(z),R(q));return q}return ee(),K()}function x(k){return k?k.replace(u,p):p}return sh=b,sh}var Qm;function Zw(){if(Qm)return Bs;Qm=1;var e=Bs&&Bs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.default=n;const t=e(Xw());function n(i,o){let a=null;if(!i||typeof i!="string")return a;const l=(0,t.default)(i),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 Bs}var Lo={},Jm;function Qw(){if(Jm)return Lo;Jm=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(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(i,u),h.replace(t,l))};return Lo.camelCase=d,Lo}var Io,eg;function Jw(){if(eg)return Io;eg=1;var e=Io&&Io.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Zw()),n=Qw();function i(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 i.default=i,Io=i,Io}var e0=Jw();const t0=sc(e0),pv=mv("end"),$d=mv("start");function mv(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function n0(e){const t=$d(e),n=pv(e);if(t&&n)return{start:t,end:n}}function Qo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tg(e.position):"start"in e||"end"in e?tg(e):"line"in e||"column"in e?$h(e):""}function $h(e){return ng(e&&e.line)+":"+ng(e&&e.column)}function tg(e){return $h(e&&e.start)+"-"+$h(e&&e.end)}function ng(e){return e&&typeof e=="number"?e:1}class pn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=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 i=="string"){const d=i.indexOf(":");d===-1?a.ruleId=i:(a.source=i.slice(0,d),a.ruleId=i.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=Qo(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}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const jd={}.hasOwnProperty,r0=new Map,i0=/[A-Z]/g,s0=new Set(["table","tbody","thead","tfoot","tr"]),o0=new Set(["td","th"]),gv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function a0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=m0(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");i=p0(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?Hd:Gw,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=_v(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function _v(e,t,n){if(t.type==="element")return l0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return c0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return h0(e,t,n);if(t.type==="mdxjsEsm")return u0(e,t);if(t.type==="root")return d0(e,t,n);if(t.type==="text")return f0(e,t)}function l0(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Hd,e.schema=o),e.ancestors.push(t);const a=yv(e,t.tagName,!1),l=g0(e,t);let u=Kd(e,t);return s0.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!Fw(d):!0})),vv(e,l,a,t),Wd(l,u),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function c0(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}na(e,t.position)}function u0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);na(e,t.position)}function h0(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Hd,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:yv(e,t.name,!0),l=_0(e,t),u=Kd(e,t);return vv(e,l,a,t),Wd(l,u),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function d0(e,t,n){const i={};return Wd(i,Kd(e,t)),e.create(t,e.Fragment,i,n)}function f0(e,t){return t.value}function vv(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Wd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function p0(e,t,n){return i;function i(o,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function m0(e,t){return n;function n(i,o,a,l){const u=Array.isArray(a.children),d=$d(i);return t(o,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function g0(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&jd.call(t.properties,o)){const a=v0(e,o,t.properties[o]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&o0.has(t.tagName)?i=u:n[l]=u}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function _0(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.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 na(e,t.position);else{const o=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const u=i.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else na(e,t.position);else a=i.value===null?!0:i.value;n[o]=a}return n}function Kd(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:r0;for(;++i<t.children.length;){const a=t.children[i];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=_v(e,a,l);u!==void 0&&n.push(u)}return n}function v0(e,t,n){const i=Kw(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?Dw(n):Yw(n)),i.property==="style"){let o=typeof n=="object"?n:y0(e,String(n));return e.stylePropertyNameCase==="css"&&(o=b0(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?$w[i.property]||i.property:i.attribute,n]}}function y0(e,t){try{return t0(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=gv+"#cannot-parse-style-attribute",o}}function yv(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const u=Vm(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}i=l}else i=Vm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return jd.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);na(e)}function na(e,t){const n=new pn("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=gv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function b0(e){const t={};let n;for(n in e)jd.call(e,n)&&(t[S0(n)]=e[n]);return t}function S0(e){let t=e.replace(i0,w0);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function w0(e){return"-"+e.toLowerCase()}const oh={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"]},x0={};function qd(e,t){const n=x0,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bv(e,i,o)}function bv(e,t,n){if(k0(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 rg(e.children,t,n)}return Array.isArray(e)?rg(e,t,n):""}function rg(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=bv(e[o],t,n);return i.join("")}function k0(e){return!!(e&&typeof e=="object")}const ig=document.createElement("i");function Vd(e){const t="&"+e+";";ig.innerHTML=t;const n=ig.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function jn(e,t,n,i){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,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<i.length;)l=i.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function rr(e,t){return e.length>0?(jn(e,e.length,0,t),e):t}const sg={}.hasOwnProperty;function Sv(e){const t={};let n=-1;for(;++n<e.length;)E0(t,e[n]);return t}function E0(e,t){let n;for(n in t){const o=(sg.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){sg.call(o,l)||(o[l]=[]);const u=a[l];C0(o[l],Array.isArray(u)?u:u?[u]:[])}}}function C0(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);jn(e,0,0,i)}function wv(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 gr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=Ni(/[A-Za-z]/),fn=Ni(/[\dA-Za-z]/),N0=Ni(/[#-'*+\--9=?A-Z^-~]/);function Vl(e){return e!==null&&(e<32||e===127)}const jh=Ni(/\d/),T0=Ni(/[\dA-Fa-f]/),R0=Ni(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const lc=Ni(new RegExp("\\p{P}|\\p{S}","u")),is=Ni(/\s/);function Ni(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gs(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&fn(e.charCodeAt(n+1))&&fn(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(i,n),encodeURIComponent(l)),i=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}function Je(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Ye(d)?(e.enter(n),u(d)):t(d)}function u(d){return Ye(d)&&a++<o?(e.consume(d),u):(e.exit(n),t(d))}}const A0={tokenize:M0};function M0(e){const t=e.attempt(this.parser.constructs.contentInitial,i,o);let n;return t;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Je(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 Me(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const O0={tokenize:D0},og={tokenize:L0};function D0(e){const t=this,n=[];let i=0,o,a,l;return u;function u(L){if(i<n.length){const A=n[i];return t.containerState=A[1],e.attempt(A[0].continuation,d,h)(L)}return h(L)}function d(L){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&O();const A=t.events.length;let H=A,D;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){D=t.events[H][1].end;break}E(i);let se=A;for(;se<t.events.length;)t.events[se][1].end={...D},se++;return jn(t.events,H+1,0,t.events.slice(A)),t.events.length=se,h(L)}return u(L)}function h(L){if(i===n.length){if(!o)return v(L);if(o.currentConstruct&&o.currentConstruct.concrete)return b(L);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(og,g,p)(L)}function g(L){return o&&O(),E(i),v(L)}function p(L){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,b(L)}function v(L){return t.containerState={},e.attempt(og,y,b)(L)}function y(L){return i++,n.push([t.currentConstruct,t.containerState]),v(L)}function b(L){if(L===null){o&&O(),E(0),e.consume(L);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),x(L)}function x(L){if(L===null){k(e.exit("chunkFlow"),!0),E(0),e.consume(L);return}return Me(L)?(e.consume(L),k(e.exit("chunkFlow")),i=0,t.interrupt=void 0,u):(e.consume(L),x)}function k(L,A){const H=t.sliceStream(L);if(A&&H.push(null),L.previous=a,a&&(a.next=L),a=L,o.defineSkip(L.start),o.write(H),t.parser.lazy[L.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 se=t.events.length;let W=se,ee,R;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){if(ee){R=t.events[W][1].end;break}ee=!0}for(E(i),D=se;D<t.events.length;)t.events[D][1].end={...R},D++;jn(t.events,W+1,0,t.events.slice(se)),t.events.length=D}}function E(L){let A=n.length;for(;A-- >L;){const H=n[A];t.containerState=H[1],H[0].exit.call(t,e)}n.length=L}function O(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function L0(e,t,n){return Je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ks(e){if(e===null||lt(e)||is(e))return 1;if(lc(e))return 2}function cc(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!i.includes(a)&&(t=a(t,n),i.push(a))}return t}const Wh={name:"attention",resolveAll:I0,tokenize:P0};function I0(e,t){let n=-1,i,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(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[i][1].end},v={...e[n][1].start};ag(p,-d),ag(v,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},a={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[i][1].end={...l.start},e[n][1].start={...u.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=rr(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=rr(h,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=rr(h,cc(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=rr(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=rr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,jn(e,i-1,n-i+3,h),n=i+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function P0(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Ks(i);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=Ks(d),p=!g||g===2&&o||n.includes(d),v=!o||o===2&&g||n.includes(i);return h._open=!!(a===42?p:p&&(o||!v)),h._close=!!(a===42?v:v&&(g||!p)),t(d)}}function ag(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const B0={name:"autolink",tokenize:F0};function F0(e,t,n){let i=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 Sn(y)?(e.consume(y),l):y===64?n(y):h(y)}function l(y){return y===43||y===45||y===46||fn(y)?(i=1,u(y)):h(y)}function u(y){return y===58?(e.consume(y),i=0,d):(y===43||y===45||y===46||fn(y))&&i++<32?(e.consume(y),u):(i=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||Vl(y)?n(y):(e.consume(y),d)}function h(y){return y===64?(e.consume(y),g):N0(y)?(e.consume(y),h):n(y)}function g(y){return fn(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),i=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||fn(y))&&i++<63){const b=y===45?v:p;return e.consume(y),b}return n(y)}}const la={partial:!0,tokenize:z0};function z0(e,t,n){return i;function i(a){return Ye(a)?Je(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Me(a)?t(a):n(a)}}const xv={continuation:{tokenize:H0},exit:$0,name:"blockQuote",tokenize:U0};function U0(e,t,n){const i=this;return o;function o(l){if(l===62){const u=i.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 Ye(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function H0(e,t,n){const i=this;return o;function o(l){return Ye(l)?Je(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(xv,t,n)(l)}}function $0(e){e.exit("blockQuote")}const kv={name:"characterEscape",tokenize:j0};function j0(e,t,n){return i;function i(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return R0(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Ev={name:"characterReference",tokenize:W0};function W0(e,t,n){const i=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=fn,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=T0,g):(e.enter("characterReferenceValue"),a=7,l=jh,g(p))}function g(p){if(p===59&&o){const v=e.exit("characterReferenceValue");return l===fn&&!Vd(i.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 lg={partial:!0,tokenize:q0},cg={concrete:!0,name:"codeFenced",tokenize:K0};function K0(e,t,n){const i=this,o={partial:!0,tokenize:H};let a=0,l=0,u;return d;function d(D){return h(D)}function h(D){const se=i.events[i.events.length-1];return a=se&&se[1].type==="linePrefix"?se[2].sliceSerialize(se[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"),Ye(D)?Je(e,p,"whitespace")(D):p(D))}function p(D){return D===null||Me(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(lg,x,A)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):Ye(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,y,"whitespace")(D)):D===96&&D===u?n(D):(e.consume(D),v)}function y(D){return D===null||Me(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===u?n(D):(e.consume(D),b)}function x(D){return e.attempt(o,A,k)(D)}function k(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),E}function E(D){return a>0&&Ye(D)?Je(e,O,"linePrefix",a+1)(D):O(D)}function O(D){return D===null||Me(D)?e.check(lg,x,A)(D):(e.enter("codeFlowValue"),L(D))}function L(D){return D===null||Me(D)?(e.exit("codeFlowValue"),O(D)):(e.consume(D),L)}function A(D){return e.exit("codeFenced"),t(D)}function H(D,se,W){let ee=0;return R;function R(z){return D.enter("lineEnding"),D.consume(z),D.exit("lineEnding"),Y}function Y(z){return D.enter("codeFencedFence"),Ye(z)?Je(D,$,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):$(z)}function $(z){return z===u?(D.enter("codeFencedFenceSequence"),K(z)):W(z)}function K(z){return z===u?(ee++,D.consume(z),K):ee>=l?(D.exit("codeFencedFenceSequence"),Ye(z)?Je(D,q,"whitespace")(z):q(z)):W(z)}function q(z){return z===null||Me(z)?(D.exit("codeFencedFence"),se(z)):W(z)}}}function q0(e,t,n){const i=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 i.parser.lazy[i.now().line]?n(l):t(l)}}const ah={name:"codeIndented",tokenize:G0},V0={partial:!0,tokenize:Y0};function G0(e,t,n){const i=this;return o;function o(h){return e.enter("codeIndented"),Je(e,a,"linePrefix",5)(h)}function a(h){const g=i.events[i.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):Me(h)?e.attempt(V0,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||Me(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function Y0(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):Me(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):Je(e,a,"linePrefix",5)(l)}function a(l){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Me(l)?o(l):n(l)}}const X0={name:"codeText",previous:Q0,resolve:Z0,tokenize:J0};function Z0(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)o===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(o=i):(i===t||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),t-=i-o-2,i=o+2),o=void 0);return e}function Q0(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function J0(e,t,n){let i=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),i++,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)):Me(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||Me(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function g(p){return p===96?(e.consume(p),o++,g):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",h(p))}}class e1{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 i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Po(this.left,i),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),Po(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Po(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);Po(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Po(this.left,n.reverse())}}}function Po(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 Cv(e){const t={};let n=-1,i,o,a,l,u,d,h;const g=new e1(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(i=g.get(n),n&&i[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(d=i[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(i[0]==="enter")i[1].contentType&&(Object.assign(t,t1(g,n)),n=t[n],h=!0);else if(i[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&&(i[1].end={...g.get(o)[1].start},u=g.slice(o,n),u.unshift(i),g.splice(o,n-o+1,u))}}return jn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function t1(e,t){const n=e.get(t)[1],i=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],h={};let g,p,v=-1,y=n,b=0,x=0;const k=[x];for(;y;){for(;e.get(++o)[1]!==y;);a.push(o),y._tokenizer||(g=i.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&&(x=v+1,k.push(x),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):k.pop(),v=k.length;v--;){const E=u.slice(k[v],k[v+1]),O=a.pop();d.push([O,O+E.length-1]),e.splice(O,2,E)}for(d.reverse(),v=-1;++v<d.length;)h[b+d[v][0]]=b+d[v][1],b+=d[v][1]-d[v][0]-1;return h}const n1={resolve:i1,tokenize:s1},r1={partial:!0,tokenize:o1};function i1(e){return Cv(e),e}function s1(e,t){let n;return i;function i(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(u)}function o(u){return u===null?a(u):Me(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 o1(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Je(e,a,"linePrefix")}function a(l){if(l===null||Me(l))return n(l);const u=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function Nv(e,t,n,i,o,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let g=0;return p;function p(E){return E===60?(e.enter(i),e.enter(o),e.enter(a),e.consume(E),e.exit(a),v):E===null||E===32||E===41||Vl(E)?n(E):(e.enter(i),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(E))}function v(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(o),e.exit(i),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===62?(e.exit("chunkString"),e.exit(u),v(E)):E===null||E===60||Me(E)?n(E):(e.consume(E),E===92?b:y)}function b(E){return E===60||E===62||E===92?(e.consume(E),y):y(E)}function x(E){return!g&&(E===null||E===41||lt(E))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(i),t(E)):g<h&&E===40?(e.consume(E),g++,x):E===41?(e.consume(E),g--,x):E===null||E===32||E===40||Vl(E)?n(E):(e.consume(E),E===92?k:x)}function k(E){return E===40||E===41||E===92?(e.consume(E),x):x(E)}}function Tv(e,t,n,i,o,a){const l=this;let u=0,d;return h;function h(y){return e.enter(i),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(i),t):Me(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||Me(y)||u++>999?(e.exit("chunkString"),g(y)):(e.consume(y),d||(d=!Ye(y)),y===92?v:p)}function v(y){return y===91||y===92||y===93?(e.consume(y),u++,p):p(y)}}function Rv(e,t,n,i,o,a){let l;return u;function u(v){return v===34||v===39||v===40?(e.enter(i),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(i),t):(e.enter(a),h(v))}function h(v){return v===l?(e.exit(a),d(l)):v===null?n(v):Me(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Je(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||Me(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 Jo(e,t){let n;return i;function i(o){return Me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ye(o)?Je(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const a1={name:"definition",tokenize:c1},l1={partial:!0,tokenize:u1};function c1(e,t,n){const i=this;let o;return a;function a(y){return e.enter("definition"),l(y)}function l(y){return Tv.call(i,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return o=gr(i.sliceSerialize(i.events[i.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 lt(y)?Jo(e,h)(y):h(y)}function h(y){return Nv(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(l1,p,p)(y)}function p(y){return Ye(y)?Je(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Me(y)?(e.exit("definition"),i.parser.defined.push(o),t(y)):n(y)}}function u1(e,t,n){return i;function i(u){return lt(u)?Jo(e,o)(u):n(u)}function o(u){return Rv(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Ye(u)?Je(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Me(u)?t(u):n(u)}}const h1={name:"hardBreakEscape",tokenize:d1};function d1(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Me(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const f1={name:"headingAtx",resolve:p1,tokenize:m1};function p1(e,t){let n=e.length-2,i=3,o,a;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},jn(e,i,n-i+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function m1(e,t,n){let i=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&&i++<6?(e.consume(g),l):g===null||lt(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),d(g)):g===null||Me(g)?(e.exit("atxHeading"),t(g)):Ye(g)?Je(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||lt(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),h)}}const g1=["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"],ug=["pre","script","style","textarea"],_1={concrete:!0,name:"htmlFlow",resolveTo:b1,tokenize:S1},v1={partial:!0,tokenize:x1},y1={partial:!0,tokenize:w1};function b1(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 S1(e,t,n){const i=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,x):N===63?(e.consume(N),o=3,i.interrupt?t:C):Sn(N)?(e.consume(N),l=String.fromCharCode(N),k):n(N)}function v(N){return N===45?(e.consume(N),o=2,y):N===91?(e.consume(N),o=5,u=0,b):Sn(N)?(e.consume(N),o=4,i.interrupt?t:C):n(N)}function y(N){return N===45?(e.consume(N),i.interrupt?t:C):n(N)}function b(N){const ye="CDATA[";return N===ye.charCodeAt(u++)?(e.consume(N),u===ye.length?i.interrupt?t:$:b):n(N)}function x(N){return Sn(N)?(e.consume(N),l=String.fromCharCode(N),k):n(N)}function k(N){if(N===null||N===47||N===62||lt(N)){const ye=N===47,Ne=l.toLowerCase();return!ye&&!a&&ug.includes(Ne)?(o=1,i.interrupt?t(N):$(N)):g1.includes(l.toLowerCase())?(o=6,ye?(e.consume(N),E):i.interrupt?t(N):$(N)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(N):a?O(N):L(N))}return N===45||fn(N)?(e.consume(N),l+=String.fromCharCode(N),k):n(N)}function E(N){return N===62?(e.consume(N),i.interrupt?t:$):n(N)}function O(N){return Ye(N)?(e.consume(N),O):R(N)}function L(N){return N===47?(e.consume(N),R):N===58||N===95||Sn(N)?(e.consume(N),A):Ye(N)?(e.consume(N),L):R(N)}function A(N){return N===45||N===46||N===58||N===95||fn(N)?(e.consume(N),A):H(N)}function H(N){return N===61?(e.consume(N),D):Ye(N)?(e.consume(N),H):L(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,se):Ye(N)?(e.consume(N),D):W(N)}function se(N){return N===d?(e.consume(N),d=null,ee):N===null||Me(N)?n(N):(e.consume(N),se)}function W(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||lt(N)?H(N):(e.consume(N),W)}function ee(N){return N===47||N===62||Ye(N)?L(N):n(N)}function R(N){return N===62?(e.consume(N),Y):n(N)}function Y(N){return N===null||Me(N)?$(N):Ye(N)?(e.consume(N),Y):n(N)}function $(N){return N===45&&o===2?(e.consume(N),Z):N===60&&o===1?(e.consume(N),oe):N===62&&o===4?(e.consume(N),I):N===63&&o===3?(e.consume(N),C):N===93&&o===5?(e.consume(N),te):Me(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(v1,G,K)(N)):N===null||Me(N)?(e.exit("htmlFlowData"),K(N)):(e.consume(N),$)}function K(N){return e.check(y1,q,G)(N)}function q(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),z}function z(N){return N===null||Me(N)?K(N):(e.enter("htmlFlowData"),$(N))}function Z(N){return N===45?(e.consume(N),C):$(N)}function oe(N){return N===47?(e.consume(N),l="",F):$(N)}function F(N){if(N===62){const ye=l.toLowerCase();return ug.includes(ye)?(e.consume(N),I):$(N)}return Sn(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),F):$(N)}function te(N){return N===93?(e.consume(N),C):$(N)}function C(N){return N===62?(e.consume(N),I):N===45&&o===2?(e.consume(N),C):$(N)}function I(N){return N===null||Me(N)?(e.exit("htmlFlowData"),G(N)):(e.consume(N),I)}function G(N){return e.exit("htmlFlow"),t(N)}}function w1(e,t,n){const i=this;return o;function o(l){return Me(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function x1(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(la,t,n)}}const k1={name:"htmlText",tokenize:E1};function E1(e,t,n){const i=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),H):C===63?(e.consume(C),L):Sn(C)?(e.consume(C),W):n(C)}function h(C){return C===45?(e.consume(C),g):C===91?(e.consume(C),a=0,b):Sn(C)?(e.consume(C),O):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):Me(C)?(l=p,oe(C)):(e.consume(C),p)}function v(C){return C===45?(e.consume(C),y):p(C)}function y(C){return C===62?Z(C):C===45?v(C):p(C)}function b(C){const I="CDATA[";return C===I.charCodeAt(a++)?(e.consume(C),a===I.length?x:b):n(C)}function x(C){return C===null?n(C):C===93?(e.consume(C),k):Me(C)?(l=x,oe(C)):(e.consume(C),x)}function k(C){return C===93?(e.consume(C),E):x(C)}function E(C){return C===62?Z(C):C===93?(e.consume(C),E):x(C)}function O(C){return C===null||C===62?Z(C):Me(C)?(l=O,oe(C)):(e.consume(C),O)}function L(C){return C===null?n(C):C===63?(e.consume(C),A):Me(C)?(l=L,oe(C)):(e.consume(C),L)}function A(C){return C===62?Z(C):L(C)}function H(C){return Sn(C)?(e.consume(C),D):n(C)}function D(C){return C===45||fn(C)?(e.consume(C),D):se(C)}function se(C){return Me(C)?(l=se,oe(C)):Ye(C)?(e.consume(C),se):Z(C)}function W(C){return C===45||fn(C)?(e.consume(C),W):C===47||C===62||lt(C)?ee(C):n(C)}function ee(C){return C===47?(e.consume(C),Z):C===58||C===95||Sn(C)?(e.consume(C),R):Me(C)?(l=ee,oe(C)):Ye(C)?(e.consume(C),ee):Z(C)}function R(C){return C===45||C===46||C===58||C===95||fn(C)?(e.consume(C),R):Y(C)}function Y(C){return C===61?(e.consume(C),$):Me(C)?(l=Y,oe(C)):Ye(C)?(e.consume(C),Y):ee(C)}function $(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),o=C,K):Me(C)?(l=$,oe(C)):Ye(C)?(e.consume(C),$):(e.consume(C),q)}function K(C){return C===o?(e.consume(C),o=void 0,z):C===null?n(C):Me(C)?(l=K,oe(C)):(e.consume(C),K)}function q(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||lt(C)?ee(C):(e.consume(C),q)}function z(C){return C===47||C===62||lt(C)?ee(C):n(C)}function Z(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function oe(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),F}function F(C){return Ye(C)?Je(e,te,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):te(C)}function te(C){return e.enter("htmlTextData"),l(C)}}const Gd={name:"labelEnd",resolveAll:R1,resolveTo:A1,tokenize:M1},C1={tokenize:O1},N1={tokenize:D1},T1={tokenize:L1};function R1(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",t+=o}}return e.length!==n.length&&jn(e,0,e.length,n),e}function A1(e,t){let n=e.length,i=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")){i=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+i+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=rr(u,e.slice(a+1,a+i+3)),u=rr(u,[["enter",g,t]]),u=rr(u,cc(t.parser.constructs.insideSpan.null,e.slice(a+i+4,l-3),t)),u=rr(u,[["exit",g,t],e[l-2],e[l-1],["exit",h,t]]),u=rr(u,e.slice(l+1)),u=rr(u,[["exit",d,t]]),jn(e,a,e.length,u),e}function M1(e,t,n){const i=this;let o=i.events.length,a,l;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){a=i.events[o][1];break}return u;function u(v){return a?a._inactive?p(v):(l=i.parser.defined.includes(gr(i.sliceSerialize({start:a.end,end:i.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(C1,g,l?g:p)(v):v===91?e.attempt(N1,g,l?h:p)(v):l?g(v):p(v)}function h(v){return e.attempt(T1,g,p)(v)}function g(v){return t(v)}function p(v){return a._balanced=!0,n(v)}}function O1(e,t,n){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),o}function o(p){return lt(p)?Jo(e,a)(p):a(p)}function a(p){return p===41?g(p):Nv(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return lt(p)?Jo(e,d)(p):g(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?Rv(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function h(p){return lt(p)?Jo(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 i=this;return o;function o(u){return Tv.call(i,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return i.parser.defined.includes(gr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function L1(e,t,n){return i;function i(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 I1={name:"labelStartImage",resolveAll:Gd.resolveAll,tokenize:P1};function P1(e,t,n){const i=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 i.parser.constructs?n(u):t(u)}}const B1={name:"labelStartLink",resolveAll:Gd.resolveAll,tokenize:F1};function F1(e,t,n){const i=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 i.parser.constructs?n(l):t(l)}}const lh={name:"lineEnding",tokenize:z1};function z1(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Je(e,t,"linePrefix")}}const Fl={name:"thematicBreak",tokenize:U1};function U1(e,t,n){let i=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)):i>=3&&(h===null||Me(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===o?(e.consume(h),i++,d):(e.exit("thematicBreakSequence"),Ye(h)?Je(e,u,"whitespace")(h):u(h))}}const On={continuation:{tokenize:W1},exit:q1,name:"list",tokenize:j1},H1={partial:!0,tokenize:V1},$1={partial:!0,tokenize:K1};function j1(e,t,n){const i=this,o=i.events[i.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 b=i.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!i.containerState.marker||y===i.containerState.marker:jh(y)){if(i.containerState.type||(i.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Fl,n,h)(y):h(y);if(!i.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return jh(y)&&++l<10?(e.consume(y),d):(!i.interrupt||l<2)&&(i.containerState.marker?y===i.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"),i.containerState.marker=i.containerState.marker||y,e.check(la,i.interrupt?n:g,e.attempt(H1,v,p))}function g(y){return i.containerState.initialBlankLine=!0,a++,v(y)}function p(y){return Ye(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function W1(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(la,o,a);function o(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Je(e,t,"listItemIndent",i.containerState.size+1)(u)}function a(u){return i.containerState.furtherBlankLines||!Ye(u)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(u)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt($1,t,l)(u))}function l(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,Je(e,e.attempt(On,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function K1(e,t,n){const i=this;return Je(e,o,"listItemIndent",i.containerState.size+1);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(a):n(a)}}function q1(e){e.exit(this.containerState.type)}function V1(e,t,n){const i=this;return Je(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=i.events[i.events.length-1];return!Ye(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const hg={name:"setextUnderline",resolveTo:G1,tokenize:Y1};function G1(e,t){let n=e.length,i,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=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[i][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[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function Y1(e,t,n){const i=this;let o;return a;function a(h){let g=i.events.length,p;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){p=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.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"),Ye(h)?Je(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Me(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const X1={tokenize:Z1};function Z1(e){const t=this,n=e.attempt(la,i,e.attempt(this.parser.constructs.flowInitial,o,Je(e,e.attempt(this.parser.constructs.flow,o,e.attempt(n1,o)),"linePrefix")));return n;function i(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 Q1={resolveAll:Mv()},J1=Av("string"),ex=Av("text");function Av(e){return{resolveAll:Mv(e==="text"?tx:void 0),tokenize:t};function t(n){const i=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(i,i.previous))return!0}return!1}}}function Mv(e){return t;function t(n,i){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,i):n}}function tx(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 i=e[n-1][1],o=t.sliceStream(i);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:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const nx={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:xv},rx={91:a1},ix={[-2]:ah,[-1]:ah,32:ah},sx={35:f1,42:Fl,45:[hg,Fl],60:_1,61:hg,95:Fl,96:cg,126:cg},ox={38:Ev,92:kv},ax={[-5]:lh,[-4]:lh,[-3]:lh,33:I1,38:Ev,42:Wh,60:[B0,k1],91:B1,92:[h1,kv],93:Gd,95:Wh,96:X0},lx={null:[Wh,Q1]},cx={null:[42,95]},ux={null:[]},hx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cx,contentInitial:rx,disable:ux,document:nx,flow:sx,flowInitial:ix,insideSpan:lx,string:ox,text:ax},Symbol.toStringTag,{value:"Module"}));function dx(e,t,n){let i={_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:se(H),check:se(D),consume:O,enter:L,exit:A,interrupt:se(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:b,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(Y){return l=rr(l,Y),k(),l[l.length-1]!==null?[]:(W(t,0),h.events=cc(a,h.events,h),h.events)}function v(Y,$){return px(y(Y),$)}function y(Y){return fx(l,Y)}function b(){const{_bufferIndex:Y,_index:$,line:K,column:q,offset:z}=i;return{_bufferIndex:Y,_index:$,line:K,column:q,offset:z}}function x(Y){o[Y.line]=Y.column,R()}function k(){let Y;for(;i._index<l.length;){const $=l[i._index];if(typeof $=="string")for(Y=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===Y&&i._bufferIndex<$.length;)E($.charCodeAt(i._bufferIndex));else E($)}}function E(Y){g=g(Y)}function O(Y){Me(Y)?(i.line++,i.column=1,i.offset+=Y===-3?2:1,R()):Y!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=Y}function L(Y,$){const K=$||{};return K.type=Y,K.start=b(),h.events.push(["enter",K,h]),u.push(K),K}function A(Y){const $=u.pop();return $.end=b(),h.events.push(["exit",$,h]),$}function H(Y,$){W(Y,$.from)}function D(Y,$){$.restore()}function se(Y,$){return K;function K(q,z,Z){let oe,F,te,C;return Array.isArray(q)?G(q):"tokenize"in q?G([q]):I(q);function I(_e){return Ue;function Ue(Le){const He=Le!==null&&_e[Le],nt=Le!==null&&_e.null,Ft=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray(nt)?nt:nt?[nt]:[]];return G(Ft)(Le)}}function G(_e){return oe=_e,F=0,_e.length===0?Z:N(_e[F])}function N(_e){return Ue;function Ue(Le){return C=ee(),te=_e,_e.partial||(h.currentConstruct=_e),_e.name&&h.parser.constructs.disable.null.includes(_e.name)?Ne():_e.tokenize.call($?Object.assign(Object.create(h),$):h,d,ye,Ne)(Le)}}function ye(_e){return Y(te,C),z}function Ne(_e){return C.restore(),++F<oe.length?N(oe[F]):Z}}}function W(Y,$){Y.resolveAll&&!a.includes(Y)&&a.push(Y),Y.resolve&&jn(h.events,$,h.events.length-$,Y.resolve(h.events.slice($),h)),Y.resolveTo&&(h.events=Y.resolveTo(h.events,h))}function ee(){const Y=b(),$=h.previous,K=h.currentConstruct,q=h.events.length,z=Array.from(u);return{from:q,restore:Z};function Z(){i=Y,h.previous=$,h.currentConstruct=K,h.events.length=q,u=z,R()}}function R(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function fx(e,t){const n=t.start._index,i=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(i,a)];else{if(l=e.slice(n,o),i>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(i):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function px(e,t){let n=-1;const i=[];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=`
|
|
40
|
+
`+_.stack}return{value:r,source:s,stack:m,digest:null}}function Su(r,s,c){return{value:r,source:null,stack:c??null,digest:s??null}}function wu(r,s){try{console.error(s.value)}catch(c){setTimeout(function(){throw c})}}var AS=typeof WeakMap=="function"?WeakMap:Map;function $p(r,s,c){c=Kr(-1,c),c.tag=3,c.payload={element:null};var f=s.value;return c.callback=function(){ll||(ll=!0,Bu=f),wu(r,s)},c}function jp(r,s,c){c=Kr(-1,c),c.tag=3;var f=r.type.getDerivedStateFromError;if(typeof f=="function"){var m=s.value;c.payload=function(){return f(m)},c.callback=function(){wu(r,s)}}var _=r.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(c.callback=function(){wu(r,s),typeof f!="function"&&(pi===null?pi=new Set([this]):pi.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})}),c}function Wp(r,s,c){var f=r.pingCache;if(f===null){f=r.pingCache=new AS;var m=new Set;f.set(s,m)}else m=f.get(s),m===void 0&&(m=new Set,f.set(s,m));m.has(c)||(m.add(c),r=WS.bind(null,r,s,c),s.then(r,r))}function Kp(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function qp(r,s,c,f,m){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(s=Kr(-1,1),s.tag=2,di(c,s,1))),c.lanes|=1),r):(r.flags|=65536,r.lanes=m,r)}var MS=A.ReactCurrentOwner,Nn=!1;function _n(r,s,c,f){s.child=r===null?dp(s,null,c,f):Ts(s,r.child,c,f)}function Vp(r,s,c,f,m){c=c.render;var _=s.ref;return As(s,m),f=fu(r,s,c,f,_,m),c=pu(),r!==null&&!Nn?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~m,qr(r,s,m)):(gt&&c&&Xc(s),s.flags|=1,_n(r,s,f,m),s.child)}function Gp(r,s,c,f,m){if(r===null){var _=c.type;return typeof _=="function"&&!Wu(_)&&_.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(s.tag=15,s.type=_,Yp(r,s,_,f,m)):(r=pl(c.type,null,f,s,s.mode,m),r.ref=s.ref,r.return=s,s.child=r)}if(_=r.child,(r.lanes&m)===0){var w=_.memoizedProps;if(c=c.compare,c=c!==null?c:ho,c(w,f)&&r.ref===s.ref)return qr(r,s,m)}return s.flags|=1,r=vi(_,f),r.ref=s.ref,r.return=s,s.child=r}function Yp(r,s,c,f,m){if(r!==null){var _=r.memoizedProps;if(ho(_,f)&&r.ref===s.ref)if(Nn=!1,s.pendingProps=f=_,(r.lanes&m)!==0)(r.flags&131072)!==0&&(Nn=!0);else return s.lanes=r.lanes,qr(r,s,m)}return xu(r,s,c,f,m)}function Xp(r,s,c){var f=s.pendingProps,m=f.children,_=r!==null?r.memoizedState:null;if(f.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Ls,zn),zn|=c;else{if((c&1073741824)===0)return r=_!==null?_.baseLanes|c:c,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,ut(Ls,zn),zn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=_!==null?_.baseLanes:c,ut(Ls,zn),zn|=f}else _!==null?(f=_.baseLanes|c,s.memoizedState=null):f=c,ut(Ls,zn),zn|=f;return _n(r,s,m,c),s.child}function Zp(r,s){var c=s.ref;(r===null&&c!==null||r!==null&&r.ref!==c)&&(s.flags|=512,s.flags|=2097152)}function xu(r,s,c,f,m){var _=Cn(c)?Fi:ln.current;return _=ks(s,_),As(s,m),c=fu(r,s,c,f,_,m),f=pu(),r!==null&&!Nn?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~m,qr(r,s,m)):(gt&&f&&Xc(s),s.flags|=1,_n(r,s,c,m),s.child)}function Qp(r,s,c,f,m){if(Cn(c)){var _=!0;za(s)}else _=!1;if(As(s,m),s.stateNode===null)rl(r,s),Up(s,c,f),bu(s,c,f,m),f=!0;else if(r===null){var w=s.stateNode,T=s.memoizedProps;w.props=T;var P=w.context,V=c.contextType;typeof V=="object"&&V!==null?V=Xn(V):(V=Cn(c)?Fi:ln.current,V=ks(s,V));var re=c.getDerivedStateFromProps,ae=typeof re=="function"||typeof w.getSnapshotBeforeUpdate=="function";ae||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==f||P!==V)&&Hp(s,w,f,V),hi=!1;var ne=s.memoizedState;w.state=ne,Ga(s,f,w,m),P=s.memoizedState,T!==f||ne!==P||En.current||hi?(typeof re=="function"&&(yu(s,c,re,f),P=s.memoizedState),(T=hi||zp(s,c,T,f,ne,P,V))?(ae||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=P),w.props=f,w.state=P,w.context=V,f=T):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{w=s.stateNode,pp(r,s),T=s.memoizedProps,V=s.type===s.elementType?T:hr(s.type,T),w.props=V,ae=s.pendingProps,ne=w.context,P=c.contextType,typeof P=="object"&&P!==null?P=Xn(P):(P=Cn(c)?Fi:ln.current,P=ks(s,P));var ge=c.getDerivedStateFromProps;(re=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==ae||ne!==P)&&Hp(s,w,f,P),hi=!1,ne=s.memoizedState,w.state=ne,Ga(s,f,w,m);var xe=s.memoizedState;T!==ae||ne!==xe||En.current||hi?(typeof ge=="function"&&(yu(s,c,ge,f),xe=s.memoizedState),(V=hi||zp(s,c,V,f,ne,xe,P)||!1)?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(f,xe,P),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(f,xe,P)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=xe),w.props=f,w.state=xe,w.context=P,f=V):(typeof w.componentDidUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&ne===r.memoizedState||(s.flags|=1024),f=!1)}return ku(r,s,c,f,_,m)}function ku(r,s,c,f,m,_){Zp(r,s);var w=(s.flags&128)!==0;if(!f&&!w)return m&&rp(s,c,!1),qr(r,s,_);f=s.stateNode,MS.current=s;var T=w&&typeof c.getDerivedStateFromError!="function"?null:f.render();return s.flags|=1,r!==null&&w?(s.child=Ts(s,r.child,null,_),s.child=Ts(s,null,T,_)):_n(r,s,T,_),s.memoizedState=f.state,m&&rp(s,c,!0),s.child}function Jp(r){var s=r.stateNode;s.pendingContext?tp(r,s.pendingContext,s.pendingContext!==s.context):s.context&&tp(r,s.context,!1),au(r,s.containerInfo)}function em(r,s,c,f,m){return Ns(),eu(m),s.flags|=256,_n(r,s,c,f),s.child}var Eu={dehydrated:null,treeContext:null,retryLane:0};function Cu(r){return{baseLanes:r,cachePool:null,transitions:null}}function tm(r,s,c){var f=s.pendingProps,m=St.current,_=!1,w=(s.flags&128)!==0,T;if((T=w)||(T=r!==null&&r.memoizedState===null?!1:(m&2)!==0),T?(_=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(m|=1),ut(St,m&1),r===null)return Jc(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(w=f.children,r=f.fallback,_?(f=s.mode,_=s.child,w={mode:"hidden",children:w},(f&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=w):_=ml(w,f,0,null),r=Gi(r,f,c,null),_.return=s,r.return=s,_.sibling=r,s.child=_,s.child.memoizedState=Cu(c),s.memoizedState=Eu,r):Nu(s,w));if(m=r.memoizedState,m!==null&&(T=m.dehydrated,T!==null))return OS(r,s,w,f,T,m,c);if(_){_=f.fallback,w=s.mode,m=r.child,T=m.sibling;var P={mode:"hidden",children:f.children};return(w&1)===0&&s.child!==m?(f=s.child,f.childLanes=0,f.pendingProps=P,s.deletions=null):(f=vi(m,P),f.subtreeFlags=m.subtreeFlags&14680064),T!==null?_=vi(T,_):(_=Gi(_,w,c,null),_.flags|=2),_.return=s,f.return=s,f.sibling=_,s.child=f,f=_,_=s.child,w=r.child.memoizedState,w=w===null?Cu(c):{baseLanes:w.baseLanes|c,cachePool:null,transitions:w.transitions},_.memoizedState=w,_.childLanes=r.childLanes&~c,s.memoizedState=Eu,f}return _=r.child,r=_.sibling,f=vi(_,{mode:"visible",children:f.children}),(s.mode&1)===0&&(f.lanes=c),f.return=s,f.sibling=null,r!==null&&(c=s.deletions,c===null?(s.deletions=[r],s.flags|=16):c.push(r)),s.child=f,s.memoizedState=null,f}function Nu(r,s){return s=ml({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function nl(r,s,c,f){return f!==null&&eu(f),Ts(s,r.child,null,c),r=Nu(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function OS(r,s,c,f,m,_,w){if(c)return s.flags&256?(s.flags&=-257,f=Su(Error(n(422))),nl(r,s,w,f)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(_=f.fallback,m=s.mode,f=ml({mode:"visible",children:f.children},m,0,null),_=Gi(_,m,w,null),_.flags|=2,f.return=s,_.return=s,f.sibling=_,s.child=f,(s.mode&1)!==0&&Ts(s,r.child,null,w),s.child.memoizedState=Cu(w),s.memoizedState=Eu,_);if((s.mode&1)===0)return nl(r,s,w,null);if(m.data==="$!"){if(f=m.nextSibling&&m.nextSibling.dataset,f)var T=f.dgst;return f=T,_=Error(n(419)),f=Su(_,f,void 0),nl(r,s,w,f)}if(T=(w&r.childLanes)!==0,Nn||T){if(f=Gt,f!==null){switch(w&-w){case 4:m=2;break;case 16:m=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:m=32;break;case 536870912:m=268435456;break;default:m=0}m=(m&(f.suspendedLanes|w))!==0?0:m,m!==0&&m!==_.retryLane&&(_.retryLane=m,Wr(r,m),pr(f,r,m,-1))}return ju(),f=Su(Error(n(421))),nl(r,s,w,f)}return m.data==="$?"?(s.flags|=128,s.child=r.child,s=KS.bind(null,r),m._reactRetry=s,null):(r=_.treeContext,Fn=ai(m.nextSibling),Bn=s,gt=!0,ur=null,r!==null&&(Gn[Yn++]=$r,Gn[Yn++]=jr,Gn[Yn++]=zi,$r=r.id,jr=r.overflow,zi=s),s=Nu(s,f.children),s.flags|=4096,s)}function nm(r,s,c){r.lanes|=s;var f=r.alternate;f!==null&&(f.lanes|=s),iu(r.return,s,c)}function Tu(r,s,c,f,m){var _=r.memoizedState;_===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:m}:(_.isBackwards=s,_.rendering=null,_.renderingStartTime=0,_.last=f,_.tail=c,_.tailMode=m)}function rm(r,s,c){var f=s.pendingProps,m=f.revealOrder,_=f.tail;if(_n(r,s,f.children,c),f=St.current,(f&2)!==0)f=f&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&nm(r,c,s);else if(r.tag===19)nm(r,c,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}f&=1}if(ut(St,f),(s.mode&1)===0)s.memoizedState=null;else switch(m){case"forwards":for(c=s.child,m=null;c!==null;)r=c.alternate,r!==null&&Ya(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=s.child,s.child=null):(m=c.sibling,c.sibling=null),Tu(s,!1,m,c,_);break;case"backwards":for(c=null,m=s.child,s.child=null;m!==null;){if(r=m.alternate,r!==null&&Ya(r)===null){s.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}Tu(s,!0,c,null,_);break;case"together":Tu(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function rl(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function qr(r,s,c){if(r!==null&&(s.dependencies=r.dependencies),Wi|=s.lanes,(c&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,c=vi(r,r.pendingProps),s.child=c,c.return=s;r.sibling!==null;)r=r.sibling,c=c.sibling=vi(r,r.pendingProps),c.return=s;c.sibling=null}return s.child}function DS(r,s,c){switch(s.tag){case 3:Jp(s),Ns();break;case 5:_p(s);break;case 1:Cn(s.type)&&za(s);break;case 4:au(s,s.stateNode.containerInfo);break;case 10:var f=s.type._context,m=s.memoizedProps.value;ut(Ka,f._currentValue),f._currentValue=m;break;case 13:if(f=s.memoizedState,f!==null)return f.dehydrated!==null?(ut(St,St.current&1),s.flags|=128,null):(c&s.child.childLanes)!==0?tm(r,s,c):(ut(St,St.current&1),r=qr(r,s,c),r!==null?r.sibling:null);ut(St,St.current&1);break;case 19:if(f=(c&s.childLanes)!==0,(r.flags&128)!==0){if(f)return rm(r,s,c);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ut(St,St.current),f)break;return null;case 22:case 23:return s.lanes=0,Xp(r,s,c)}return qr(r,s,c)}var im,Ru,sm,om;im=function(r,s){for(var c=s.child;c!==null;){if(c.tag===5||c.tag===6)r.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}},Ru=function(){},sm=function(r,s,c,f){var m=r.memoizedProps;if(m!==f){r=s.stateNode,$i(xr.current);var _=null;switch(c){case"input":m=Ln(r,m),f=Ln(r,f),_=[];break;case"select":m=E({},m,{value:void 0}),f=E({},f,{value:void 0}),_=[];break;case"textarea":m=Ti(r,m),f=Ti(r,f),_=[];break;default:typeof m.onClick!="function"&&typeof f.onClick=="function"&&(r.onclick=Pa)}Ut(c,f);var w;c=null;for(V in m)if(!f.hasOwnProperty(V)&&m.hasOwnProperty(V)&&m[V]!=null)if(V==="style"){var T=m[V];for(w in T)T.hasOwnProperty(w)&&(c||(c={}),c[w]="")}else V!=="dangerouslySetInnerHTML"&&V!=="children"&&V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&V!=="autoFocus"&&(o.hasOwnProperty(V)?_||(_=[]):(_=_||[]).push(V,null));for(V in f){var P=f[V];if(T=m!=null?m[V]:void 0,f.hasOwnProperty(V)&&P!==T&&(P!=null||T!=null))if(V==="style")if(T){for(w in T)!T.hasOwnProperty(w)||P&&P.hasOwnProperty(w)||(c||(c={}),c[w]="");for(w in P)P.hasOwnProperty(w)&&T[w]!==P[w]&&(c||(c={}),c[w]=P[w])}else c||(_||(_=[]),_.push(V,c)),c=P;else V==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,T=T?T.__html:void 0,P!=null&&T!==P&&(_=_||[]).push(V,P)):V==="children"?typeof P!="string"&&typeof P!="number"||(_=_||[]).push(V,""+P):V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&(o.hasOwnProperty(V)?(P!=null&&V==="onScroll"&&dt("scroll",r),_||T===P||(_=[])):(_=_||[]).push(V,P))}c&&(_=_||[]).push("style",c);var V=_;(s.updateQueue=V)&&(s.flags|=4)}},om=function(r,s,c,f){c!==f&&(s.flags|=4)};function No(r,s){if(!gt)switch(r.tailMode){case"hidden":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function un(r){var s=r.alternate!==null&&r.alternate.child===r.child,c=0,f=0;if(s)for(var m=r.child;m!==null;)c|=m.lanes|m.childLanes,f|=m.subtreeFlags&14680064,f|=m.flags&14680064,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)c|=m.lanes|m.childLanes,f|=m.subtreeFlags,f|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=f,r.childLanes=c,s}function LS(r,s,c){var f=s.pendingProps;switch(Zc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(s),null;case 1:return Cn(s.type)&&Fa(),un(s),null;case 3:return f=s.stateNode,Ms(),ft(En),ft(ln),uu(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(r===null||r.child===null)&&(ja(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ur!==null&&(Uu(ur),ur=null))),Ru(r,s),un(s),null;case 5:lu(s);var m=$i(wo.current);if(c=s.type,r!==null&&s.stateNode!=null)sm(r,s,c,f,m),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!f){if(s.stateNode===null)throw Error(n(166));return un(s),null}if(r=$i(xr.current),ja(s)){f=s.stateNode,c=s.type;var _=s.memoizedProps;switch(f[wr]=s,f[_o]=_,r=(s.mode&1)!==0,c){case"dialog":dt("cancel",f),dt("close",f);break;case"iframe":case"object":case"embed":dt("load",f);break;case"video":case"audio":for(m=0;m<po.length;m++)dt(po[m],f);break;case"source":dt("error",f);break;case"img":case"image":case"link":dt("error",f),dt("load",f);break;case"details":dt("toggle",f);break;case"input":Ir(f,_),dt("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!_.multiple},dt("invalid",f);break;case"textarea":Ri(f,_),dt("invalid",f)}Ut(c,_),m=null;for(var w in _)if(_.hasOwnProperty(w)){var T=_[w];w==="children"?typeof T=="string"?f.textContent!==T&&(_.suppressHydrationWarning!==!0&&Ia(f.textContent,T,r),m=["children",T]):typeof T=="number"&&f.textContent!==""+T&&(_.suppressHydrationWarning!==!0&&Ia(f.textContent,T,r),m=["children",""+T]):o.hasOwnProperty(w)&&T!=null&&w==="onScroll"&&dt("scroll",f)}switch(c){case"input":Ft(f),Wn(f,_,!0);break;case"textarea":Ft(f),Ai(f);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(f.onclick=Pa)}f=m,s.updateQueue=f,f!==null&&(s.flags|=4)}else{w=m.nodeType===9?m:m.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=X(c)),r==="http://www.w3.org/1999/xhtml"?c==="script"?(r=w.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof f.is=="string"?r=w.createElement(c,{is:f.is}):(r=w.createElement(c),c==="select"&&(w=r,f.multiple?w.multiple=!0:f.size&&(w.size=f.size))):r=w.createElementNS(r,c),r[wr]=s,r[_o]=f,im(r,s,!1,!1),s.stateNode=r;e:{switch(w=qn(c,f),c){case"dialog":dt("cancel",r),dt("close",r),m=f;break;case"iframe":case"object":case"embed":dt("load",r),m=f;break;case"video":case"audio":for(m=0;m<po.length;m++)dt(po[m],r);m=f;break;case"source":dt("error",r),m=f;break;case"img":case"image":case"link":dt("error",r),dt("load",r),m=f;break;case"details":dt("toggle",r),m=f;break;case"input":Ir(r,f),m=Ln(r,f),dt("invalid",r);break;case"option":m=f;break;case"select":r._wrapperState={wasMultiple:!!f.multiple},m=E({},f,{value:void 0}),dt("invalid",r);break;case"textarea":Ri(r,f),m=Ti(r,f),dt("invalid",r);break;default:m=f}Ut(c,m),T=m;for(_ in T)if(T.hasOwnProperty(_)){var P=T[_];_==="style"?ar(r,P):_==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,P!=null&&je(r,P)):_==="children"?typeof P=="string"?(c!=="textarea"||P!=="")&&Xe(r,P):typeof P=="number"&&Xe(r,""+P):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?P!=null&&_==="onScroll"&&dt("scroll",r):P!=null&&L(r,_,P,w))}switch(c){case"input":Ft(r),Wn(r,f,!1);break;case"textarea":Ft(r),Ai(r);break;case"option":f.value!=null&&r.setAttribute("value",""+Le(f.value));break;case"select":r.multiple=!!f.multiple,_=f.value,_!=null?vr(r,!!f.multiple,_,!1):f.defaultValue!=null&&vr(r,!!f.multiple,f.defaultValue,!0);break;default:typeof m.onClick=="function"&&(r.onclick=Pa)}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 un(s),null;case 6:if(r&&s.stateNode!=null)om(r,s,r.memoizedProps,f);else{if(typeof f!="string"&&s.stateNode===null)throw Error(n(166));if(c=$i(wo.current),$i(xr.current),ja(s)){if(f=s.stateNode,c=s.memoizedProps,f[wr]=s,(_=f.nodeValue!==c)&&(r=Bn,r!==null))switch(r.tag){case 3:Ia(f.nodeValue,c,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Ia(f.nodeValue,c,(r.mode&1)!==0)}_&&(s.flags|=4)}else f=(c.nodeType===9?c:c.ownerDocument).createTextNode(f),f[wr]=s,s.stateNode=f}return un(s),null;case 13:if(ft(St),f=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(gt&&Fn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)cp(),Ns(),s.flags|=98560,_=!1;else if(_=ja(s),f!==null&&f.dehydrated!==null){if(r===null){if(!_)throw Error(n(318));if(_=s.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[wr]=s}else Ns(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;un(s),_=!1}else ur!==null&&(Uu(ur),ur=null),_=!0;if(!_)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=c,s):(f=f!==null,f!==(r!==null&&r.memoizedState!==null)&&f&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(St.current&1)!==0?$t===0&&($t=3):ju())),s.updateQueue!==null&&(s.flags|=4),un(s),null);case 4:return Ms(),Ru(r,s),r===null&&mo(s.stateNode.containerInfo),un(s),null;case 10:return ru(s.type._context),un(s),null;case 17:return Cn(s.type)&&Fa(),un(s),null;case 19:if(ft(St),_=s.memoizedState,_===null)return un(s),null;if(f=(s.flags&128)!==0,w=_.rendering,w===null)if(f)No(_,!1);else{if($t!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(w=Ya(r),w!==null){for(s.flags|=128,No(_,!1),f=w.updateQueue,f!==null&&(s.updateQueue=f,s.flags|=4),s.subtreeFlags=0,f=c,c=s.child;c!==null;)_=c,r=f,_.flags&=14680066,w=_.alternate,w===null?(_.childLanes=0,_.lanes=r,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=w.childLanes,_.lanes=w.lanes,_.child=w.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=w.memoizedProps,_.memoizedState=w.memoizedState,_.updateQueue=w.updateQueue,_.type=w.type,r=w.dependencies,_.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),c=c.sibling;return ut(St,St.current&1|2),s.child}r=r.sibling}_.tail!==null&&yt()>Is&&(s.flags|=128,f=!0,No(_,!1),s.lanes=4194304)}else{if(!f)if(r=Ya(w),r!==null){if(s.flags|=128,f=!0,c=r.updateQueue,c!==null&&(s.updateQueue=c,s.flags|=4),No(_,!0),_.tail===null&&_.tailMode==="hidden"&&!w.alternate&&!gt)return un(s),null}else 2*yt()-_.renderingStartTime>Is&&c!==1073741824&&(s.flags|=128,f=!0,No(_,!1),s.lanes=4194304);_.isBackwards?(w.sibling=s.child,s.child=w):(c=_.last,c!==null?c.sibling=w:s.child=w,_.last=w)}return _.tail!==null?(s=_.tail,_.rendering=s,_.tail=s.sibling,_.renderingStartTime=yt(),s.sibling=null,c=St.current,ut(St,f?c&1|2:c&1),s):(un(s),null);case 22:case 23:return $u(),f=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==f&&(s.flags|=8192),f&&(s.mode&1)!==0?(zn&1073741824)!==0&&(un(s),s.subtreeFlags&6&&(s.flags|=8192)):un(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function IS(r,s){switch(Zc(s),s.tag){case 1:return Cn(s.type)&&Fa(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Ms(),ft(En),ft(ln),uu(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return lu(s),null;case 13:if(ft(St),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Ns()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return ft(St),null;case 4:return Ms(),null;case 10:return ru(s.type._context),null;case 22:case 23:return $u(),null;case 24:return null;default:return null}}var il=!1,hn=!1,PS=typeof WeakSet=="function"?WeakSet:Set,we=null;function Ds(r,s){var c=r.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(f){Ct(r,s,f)}else c.current=null}function Au(r,s,c){try{c()}catch(f){Ct(r,s,f)}}var am=!1;function BS(r,s){if($c=ka,r=zf(),Lc(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var m=f.anchorOffset,_=f.focusNode;f=f.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var w=0,T=-1,P=-1,V=0,re=0,ae=r,ne=null;t:for(;;){for(var ge;ae!==c||m!==0&&ae.nodeType!==3||(T=w+m),ae!==_||f!==0&&ae.nodeType!==3||(P=w+f),ae.nodeType===3&&(w+=ae.nodeValue.length),(ge=ae.firstChild)!==null;)ne=ae,ae=ge;for(;;){if(ae===r)break t;if(ne===c&&++V===m&&(T=w),ne===_&&++re===f&&(P=w),(ge=ae.nextSibling)!==null)break;ae=ne,ne=ae.parentNode}ae=ge}c=T===-1||P===-1?null:{start:T,end:P}}else c=null}c=c||{start:0,end:0}}else c=null;for(jc={focusedElem:r,selectionRange:c},ka=!1,we=s;we!==null;)if(s=we,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,we=r;else for(;we!==null;){s=we;try{var xe=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var ke=xe.memoizedProps,Mt=xe.memoizedState,U=s.stateNode,B=U.getSnapshotBeforeUpdate(s.elementType===s.type?ke:hr(s.type,ke),Mt);U.__reactInternalSnapshotBeforeUpdate=B}break;case 3:var j=s.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ue){Ct(s,s.return,ue)}if(r=s.sibling,r!==null){r.return=s.return,we=r;break}we=s.return}return xe=am,am=!1,xe}function To(r,s,c){var f=s.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var m=f=f.next;do{if((m.tag&r)===r){var _=m.destroy;m.destroy=void 0,_!==void 0&&Au(s,c,_)}m=m.next}while(m!==f)}}function sl(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&r)===r){var f=c.create;c.destroy=f()}c=c.next}while(c!==s)}}function Mu(r){var s=r.ref;if(s!==null){var c=r.stateNode;switch(r.tag){case 5:r=c;break;default:r=c}typeof s=="function"?s(r):s.current=r}}function lm(r){var s=r.alternate;s!==null&&(r.alternate=null,lm(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[wr],delete s[_o],delete s[Vc],delete s[yS],delete s[bS])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function cm(r){return r.tag===5||r.tag===3||r.tag===4}function um(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||cm(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Ou(r,s,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?c.nodeType===8?c.parentNode.insertBefore(r,s):c.insertBefore(r,s):(c.nodeType===8?(s=c.parentNode,s.insertBefore(r,c)):(s=c,s.appendChild(r)),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=Pa));else if(f!==4&&(r=r.child,r!==null))for(Ou(r,s,c),r=r.sibling;r!==null;)Ou(r,s,c),r=r.sibling}function Du(r,s,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?c.insertBefore(r,s):c.appendChild(r);else if(f!==4&&(r=r.child,r!==null))for(Du(r,s,c),r=r.sibling;r!==null;)Du(r,s,c),r=r.sibling}var rn=null,dr=!1;function fi(r,s,c){for(c=c.child;c!==null;)hm(r,s,c),c=c.sibling}function hm(r,s,c){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(We,c)}catch{}switch(c.tag){case 5:hn||Ds(c,s);case 6:var f=rn,m=dr;rn=null,fi(r,s,c),rn=f,dr=m,rn!==null&&(dr?(r=rn,c=c.stateNode,r.nodeType===8?r.parentNode.removeChild(c):r.removeChild(c)):rn.removeChild(c.stateNode));break;case 18:rn!==null&&(dr?(r=rn,c=c.stateNode,r.nodeType===8?qc(r.parentNode,c):r.nodeType===1&&qc(r,c),so(r)):qc(rn,c.stateNode));break;case 4:f=rn,m=dr,rn=c.stateNode.containerInfo,dr=!0,fi(r,s,c),rn=f,dr=m;break;case 0:case 11:case 14:case 15:if(!hn&&(f=c.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){m=f=f.next;do{var _=m,w=_.destroy;_=_.tag,w!==void 0&&((_&2)!==0||(_&4)!==0)&&Au(c,s,w),m=m.next}while(m!==f)}fi(r,s,c);break;case 1:if(!hn&&(Ds(c,s),f=c.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=c.memoizedProps,f.state=c.memoizedState,f.componentWillUnmount()}catch(T){Ct(c,s,T)}fi(r,s,c);break;case 21:fi(r,s,c);break;case 22:c.mode&1?(hn=(f=hn)||c.memoizedState!==null,fi(r,s,c),hn=f):fi(r,s,c);break;default:fi(r,s,c)}}function dm(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var c=r.stateNode;c===null&&(c=r.stateNode=new PS),s.forEach(function(f){var m=qS.bind(null,r,f);c.has(f)||(c.add(f),f.then(m,m))})}}function fr(r,s){var c=s.deletions;if(c!==null)for(var f=0;f<c.length;f++){var m=c[f];try{var _=r,w=s,T=w;e:for(;T!==null;){switch(T.tag){case 5:rn=T.stateNode,dr=!1;break e;case 3:rn=T.stateNode.containerInfo,dr=!0;break e;case 4:rn=T.stateNode.containerInfo,dr=!0;break e}T=T.return}if(rn===null)throw Error(n(160));hm(_,w,m),rn=null,dr=!1;var P=m.alternate;P!==null&&(P.return=null),m.return=null}catch(V){Ct(m,s,V)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)fm(s,r),s=s.sibling}function fm(r,s){var c=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(fr(s,r),Er(r),f&4){try{To(3,r,r.return),sl(3,r)}catch(ke){Ct(r,r.return,ke)}try{To(5,r,r.return)}catch(ke){Ct(r,r.return,ke)}}break;case 1:fr(s,r),Er(r),f&512&&c!==null&&Ds(c,c.return);break;case 5:if(fr(s,r),Er(r),f&512&&c!==null&&Ds(c,c.return),r.flags&32){var m=r.stateNode;try{Xe(m,"")}catch(ke){Ct(r,r.return,ke)}}if(f&4&&(m=r.stateNode,m!=null)){var _=r.memoizedProps,w=c!==null?c.memoizedProps:_,T=r.type,P=r.updateQueue;if(r.updateQueue=null,P!==null)try{T==="input"&&_.type==="radio"&&_.name!=null&&Qe(m,_),qn(T,w);var V=qn(T,_);for(w=0;w<P.length;w+=2){var re=P[w],ae=P[w+1];re==="style"?ar(m,ae):re==="dangerouslySetInnerHTML"?je(m,ae):re==="children"?Xe(m,ae):L(m,re,ae,V)}switch(T){case"input":In(m,_);break;case"textarea":Kn(m,_);break;case"select":var ne=m._wrapperState.wasMultiple;m._wrapperState.wasMultiple=!!_.multiple;var ge=_.value;ge!=null?vr(m,!!_.multiple,ge,!1):ne!==!!_.multiple&&(_.defaultValue!=null?vr(m,!!_.multiple,_.defaultValue,!0):vr(m,!!_.multiple,_.multiple?[]:"",!1))}m[_o]=_}catch(ke){Ct(r,r.return,ke)}}break;case 6:if(fr(s,r),Er(r),f&4){if(r.stateNode===null)throw Error(n(162));m=r.stateNode,_=r.memoizedProps;try{m.nodeValue=_}catch(ke){Ct(r,r.return,ke)}}break;case 3:if(fr(s,r),Er(r),f&4&&c!==null&&c.memoizedState.isDehydrated)try{so(s.containerInfo)}catch(ke){Ct(r,r.return,ke)}break;case 4:fr(s,r),Er(r);break;case 13:fr(s,r),Er(r),m=r.child,m.flags&8192&&(_=m.memoizedState!==null,m.stateNode.isHidden=_,!_||m.alternate!==null&&m.alternate.memoizedState!==null||(Pu=yt())),f&4&&dm(r);break;case 22:if(re=c!==null&&c.memoizedState!==null,r.mode&1?(hn=(V=hn)||re,fr(s,r),hn=V):fr(s,r),Er(r),f&8192){if(V=r.memoizedState!==null,(r.stateNode.isHidden=V)&&!re&&(r.mode&1)!==0)for(we=r,re=r.child;re!==null;){for(ae=we=re;we!==null;){switch(ne=we,ge=ne.child,ne.tag){case 0:case 11:case 14:case 15:To(4,ne,ne.return);break;case 1:Ds(ne,ne.return);var xe=ne.stateNode;if(typeof xe.componentWillUnmount=="function"){f=ne,c=ne.return;try{s=f,xe.props=s.memoizedProps,xe.state=s.memoizedState,xe.componentWillUnmount()}catch(ke){Ct(f,c,ke)}}break;case 5:Ds(ne,ne.return);break;case 22:if(ne.memoizedState!==null){gm(ae);continue}}ge!==null?(ge.return=ne,we=ge):gm(ae)}re=re.sibling}e:for(re=null,ae=r;;){if(ae.tag===5){if(re===null){re=ae;try{m=ae.stateNode,V?(_=m.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(T=ae.stateNode,P=ae.memoizedProps.style,w=P!=null&&P.hasOwnProperty("display")?P.display:null,T.style.display=kn("display",w))}catch(ke){Ct(r,r.return,ke)}}}else if(ae.tag===6){if(re===null)try{ae.stateNode.nodeValue=V?"":ae.memoizedProps}catch(ke){Ct(r,r.return,ke)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===r)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===r)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===r)break e;re===ae&&(re=null),ae=ae.return}re===ae&&(re=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:fr(s,r),Er(r),f&4&&dm(r);break;case 21:break;default:fr(s,r),Er(r)}}function Er(r){var s=r.flags;if(s&2){try{e:{for(var c=r.return;c!==null;){if(cm(c)){var f=c;break e}c=c.return}throw Error(n(160))}switch(f.tag){case 5:var m=f.stateNode;f.flags&32&&(Xe(m,""),f.flags&=-33);var _=um(r);Du(r,_,m);break;case 3:case 4:var w=f.stateNode.containerInfo,T=um(r);Ou(r,T,w);break;default:throw Error(n(161))}}catch(P){Ct(r,r.return,P)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function FS(r,s,c){we=r,pm(r)}function pm(r,s,c){for(var f=(r.mode&1)!==0;we!==null;){var m=we,_=m.child;if(m.tag===22&&f){var w=m.memoizedState!==null||il;if(!w){var T=m.alternate,P=T!==null&&T.memoizedState!==null||hn;T=il;var V=hn;if(il=w,(hn=P)&&!V)for(we=m;we!==null;)w=we,P=w.child,w.tag===22&&w.memoizedState!==null?_m(m):P!==null?(P.return=w,we=P):_m(m);for(;_!==null;)we=_,pm(_),_=_.sibling;we=m,il=T,hn=V}mm(r)}else(m.subtreeFlags&8772)!==0&&_!==null?(_.return=m,we=_):mm(r)}}function mm(r){for(;we!==null;){var s=we;if((s.flags&8772)!==0){var c=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:hn||sl(5,s);break;case 1:var f=s.stateNode;if(s.flags&4&&!hn)if(c===null)f.componentDidMount();else{var m=s.elementType===s.type?c.memoizedProps:hr(s.type,c.memoizedProps);f.componentDidUpdate(m,c.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var _=s.updateQueue;_!==null&&gp(s,_,f);break;case 3:var w=s.updateQueue;if(w!==null){if(c=null,s.child!==null)switch(s.child.tag){case 5:c=s.child.stateNode;break;case 1:c=s.child.stateNode}gp(s,w,c)}break;case 5:var T=s.stateNode;if(c===null&&s.flags&4){c=T;var P=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":P.autoFocus&&c.focus();break;case"img":P.src&&(c.src=P.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var V=s.alternate;if(V!==null){var re=V.memoizedState;if(re!==null){var ae=re.dehydrated;ae!==null&&so(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}hn||s.flags&512&&Mu(s)}catch(ne){Ct(s,s.return,ne)}}if(s===r){we=null;break}if(c=s.sibling,c!==null){c.return=s.return,we=c;break}we=s.return}}function gm(r){for(;we!==null;){var s=we;if(s===r){we=null;break}var c=s.sibling;if(c!==null){c.return=s.return,we=c;break}we=s.return}}function _m(r){for(;we!==null;){var s=we;try{switch(s.tag){case 0:case 11:case 15:var c=s.return;try{sl(4,s)}catch(P){Ct(s,c,P)}break;case 1:var f=s.stateNode;if(typeof f.componentDidMount=="function"){var m=s.return;try{f.componentDidMount()}catch(P){Ct(s,m,P)}}var _=s.return;try{Mu(s)}catch(P){Ct(s,_,P)}break;case 5:var w=s.return;try{Mu(s)}catch(P){Ct(s,w,P)}}}catch(P){Ct(s,s.return,P)}if(s===r){we=null;break}var T=s.sibling;if(T!==null){T.return=s.return,we=T;break}we=s.return}}var zS=Math.ceil,ol=A.ReactCurrentDispatcher,Lu=A.ReactCurrentOwner,Qn=A.ReactCurrentBatchConfig,tt=0,Gt=null,Lt=null,sn=0,zn=0,Ls=li(0),$t=0,Ro=null,Wi=0,al=0,Iu=0,Ao=null,Tn=null,Pu=0,Is=1/0,Vr=null,ll=!1,Bu=null,pi=null,cl=!1,mi=null,ul=0,Mo=0,Fu=null,hl=-1,dl=0;function vn(){return(tt&6)!==0?yt():hl!==-1?hl:hl=yt()}function gi(r){return(r.mode&1)===0?1:(tt&2)!==0&&sn!==0?sn&-sn:wS.transition!==null?(dl===0&&(dl=Sa()),dl):(r=et,r!==0||(r=window.event,r=r===void 0?16:yf(r.type)),r)}function pr(r,s,c,f){if(50<Mo)throw Mo=0,Fu=null,Error(n(185));ri(r,c,f),((tt&2)===0||r!==Gt)&&(r===Gt&&((tt&2)===0&&(al|=c),$t===4&&_i(r,sn)),Rn(r,f),c===1&&tt===0&&(s.mode&1)===0&&(Is=yt()+500,Ua&&ui()))}function Rn(r,s){var c=r.callbackNode;Sc(r,s);var f=Li(r,r===Gt?sn:0);if(f===0)c!==null&&lr(c),r.callbackNode=null,r.callbackPriority=0;else if(s=f&-f,r.callbackPriority!==s){if(c!=null&&lr(c),s===1)r.tag===0?SS(ym.bind(null,r)):ip(ym.bind(null,r)),_S(function(){(tt&6)===0&&ui()}),c=null;else{switch(Fe(f)){case 1:c=Js;break;case 4:c=Oi;break;case 16:c=fs;break;case 536870912:c=Ce;break;default:c=fs}c=Nm(c,vm.bind(null,r))}r.callbackPriority=s,r.callbackNode=c}}function vm(r,s){if(hl=-1,dl=0,(tt&6)!==0)throw Error(n(327));var c=r.callbackNode;if(Ps()&&r.callbackNode!==c)return null;var f=Li(r,r===Gt?sn:0);if(f===0)return null;if((f&30)!==0||(f&r.expiredLanes)!==0||s)s=fl(r,f);else{s=f;var m=tt;tt|=2;var _=Sm();(Gt!==r||sn!==s)&&(Vr=null,Is=yt()+500,qi(r,s));do try{$S();break}catch(T){bm(r,T)}while(!0);nu(),ol.current=_,tt=m,Lt!==null?s=0:(Gt=null,sn=0,s=$t)}if(s!==0){if(s===2&&(m=eo(r),m!==0&&(f=m,s=zu(r,m))),s===1)throw c=Ro,qi(r,0),_i(r,f),Rn(r,yt()),c;if(s===6)_i(r,f);else{if(m=r.current.alternate,(f&30)===0&&!US(m)&&(s=fl(r,f),s===2&&(_=eo(r),_!==0&&(f=_,s=zu(r,_))),s===1))throw c=Ro,qi(r,0),_i(r,f),Rn(r,yt()),c;switch(r.finishedWork=m,r.finishedLanes=f,s){case 0:case 1:throw Error(n(345));case 2:Vi(r,Tn,Vr);break;case 3:if(_i(r,f),(f&130023424)===f&&(s=Pu+500-yt(),10<s)){if(Li(r,0)!==0)break;if(m=r.suspendedLanes,(m&f)!==f){vn(),r.pingedLanes|=r.suspendedLanes&m;break}r.timeoutHandle=Kc(Vi.bind(null,r,Tn,Vr),s);break}Vi(r,Tn,Vr);break;case 4:if(_i(r,f),(f&4194240)===f)break;for(s=r.eventTimes,m=-1;0<f;){var w=31-bt(f);_=1<<w,w=s[w],w>m&&(m=w),f&=~_}if(f=m,f=yt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*zS(f/1960))-f,10<f){r.timeoutHandle=Kc(Vi.bind(null,r,Tn,Vr),f);break}Vi(r,Tn,Vr);break;case 5:Vi(r,Tn,Vr);break;default:throw Error(n(329))}}}return Rn(r,yt()),r.callbackNode===c?vm.bind(null,r):null}function zu(r,s){var c=Ao;return r.current.memoizedState.isDehydrated&&(qi(r,s).flags|=256),r=fl(r,s),r!==2&&(s=Tn,Tn=c,s!==null&&Uu(s)),r}function Uu(r){Tn===null?Tn=r:Tn.push.apply(Tn,r)}function US(r){for(var s=r;;){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 m=c[f],_=m.getSnapshot;m=m.value;try{if(!cr(_(),m))return!1}catch{return!1}}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function _i(r,s){for(s&=~Iu,s&=~al,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var c=31-bt(s),f=1<<c;r[c]=-1,s&=~f}}function ym(r){if((tt&6)!==0)throw Error(n(327));Ps();var s=Li(r,0);if((s&1)===0)return Rn(r,yt()),null;var c=fl(r,s);if(r.tag!==0&&c===2){var f=eo(r);f!==0&&(s=f,c=zu(r,f))}if(c===1)throw c=Ro,qi(r,0),_i(r,s),Rn(r,yt()),c;if(c===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Vi(r,Tn,Vr),Rn(r,yt()),null}function Hu(r,s){var c=tt;tt|=1;try{return r(s)}finally{tt=c,tt===0&&(Is=yt()+500,Ua&&ui())}}function Ki(r){mi!==null&&mi.tag===0&&(tt&6)===0&&Ps();var s=tt;tt|=1;var c=Qn.transition,f=et;try{if(Qn.transition=null,et=1,r)return r()}finally{et=f,Qn.transition=c,tt=s,(tt&6)===0&&ui()}}function $u(){zn=Ls.current,ft(Ls)}function qi(r,s){r.finishedWork=null,r.finishedLanes=0;var c=r.timeoutHandle;if(c!==-1&&(r.timeoutHandle=-1,gS(c)),Lt!==null)for(c=Lt.return;c!==null;){var f=c;switch(Zc(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Fa();break;case 3:Ms(),ft(En),ft(ln),uu();break;case 5:lu(f);break;case 4:Ms();break;case 13:ft(St);break;case 19:ft(St);break;case 10:ru(f.type._context);break;case 22:case 23:$u()}c=c.return}if(Gt=r,Lt=r=vi(r.current,null),sn=zn=s,$t=0,Ro=null,Iu=al=Wi=0,Tn=Ao=null,Hi!==null){for(s=0;s<Hi.length;s++)if(c=Hi[s],f=c.interleaved,f!==null){c.interleaved=null;var m=f.next,_=c.pending;if(_!==null){var w=_.next;_.next=m,f.next=w}c.pending=f}Hi=null}return r}function bm(r,s){do{var c=Lt;try{if(nu(),Xa.current=el,Za){for(var f=wt.memoizedState;f!==null;){var m=f.queue;m!==null&&(m.pending=null),f=f.next}Za=!1}if(ji=0,Vt=Ht=wt=null,xo=!1,ko=0,Lu.current=null,c===null||c.return===null){$t=1,Ro=s,Lt=null;break}e:{var _=r,w=c.return,T=c,P=s;if(s=sn,T.flags|=32768,P!==null&&typeof P=="object"&&typeof P.then=="function"){var V=P,re=T,ae=re.tag;if((re.mode&1)===0&&(ae===0||ae===11||ae===15)){var ne=re.alternate;ne?(re.updateQueue=ne.updateQueue,re.memoizedState=ne.memoizedState,re.lanes=ne.lanes):(re.updateQueue=null,re.memoizedState=null)}var ge=Kp(w);if(ge!==null){ge.flags&=-257,qp(ge,w,T,_,s),ge.mode&1&&Wp(_,V,s),s=ge,P=V;var xe=s.updateQueue;if(xe===null){var ke=new Set;ke.add(P),s.updateQueue=ke}else xe.add(P);break e}else{if((s&1)===0){Wp(_,V,s),ju();break e}P=Error(n(426))}}else if(gt&&T.mode&1){var Mt=Kp(w);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),qp(Mt,w,T,_,s),eu(Os(P,T));break e}}_=P=Os(P,T),$t!==4&&($t=2),Ao===null?Ao=[_]:Ao.push(_),_=w;do{switch(_.tag){case 3:_.flags|=65536,s&=-s,_.lanes|=s;var U=$p(_,P,s);mp(_,U);break e;case 1:T=P;var B=_.type,j=_.stateNode;if((_.flags&128)===0&&(typeof B.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(pi===null||!pi.has(j)))){_.flags|=65536,s&=-s,_.lanes|=s;var ue=jp(_,T,s);mp(_,ue);break e}}_=_.return}while(_!==null)}xm(c)}catch(Ee){s=Ee,Lt===c&&c!==null&&(Lt=c=c.return);continue}break}while(!0)}function Sm(){var r=ol.current;return ol.current=el,r===null?el:r}function ju(){($t===0||$t===3||$t===2)&&($t=4),Gt===null||(Wi&268435455)===0&&(al&268435455)===0||_i(Gt,sn)}function fl(r,s){var c=tt;tt|=2;var f=Sm();(Gt!==r||sn!==s)&&(Vr=null,qi(r,s));do try{HS();break}catch(m){bm(r,m)}while(!0);if(nu(),tt=c,ol.current=f,Lt!==null)throw Error(n(261));return Gt=null,sn=0,$t}function HS(){for(;Lt!==null;)wm(Lt)}function $S(){for(;Lt!==null&&!ya();)wm(Lt)}function wm(r){var s=Cm(r.alternate,r,zn);r.memoizedProps=r.pendingProps,s===null?xm(r):Lt=s,Lu.current=null}function xm(r){var s=r;do{var c=s.alternate;if(r=s.return,(s.flags&32768)===0){if(c=LS(c,s,zn),c!==null){Lt=c;return}}else{if(c=IS(c,s),c!==null){c.flags&=32767,Lt=c;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{$t=6,Lt=null;return}}if(s=s.sibling,s!==null){Lt=s;return}Lt=s=r}while(s!==null);$t===0&&($t=5)}function Vi(r,s,c){var f=et,m=Qn.transition;try{Qn.transition=null,et=1,jS(r,s,c,f)}finally{Qn.transition=m,et=f}return null}function jS(r,s,c,f){do Ps();while(mi!==null);if((tt&6)!==0)throw Error(n(327));c=r.finishedWork;var m=r.finishedLanes;if(c===null)return null;if(r.finishedWork=null,r.finishedLanes=0,c===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var _=c.lanes|c.childLanes;if(Vn(r,_),r===Gt&&(Lt=Gt=null,sn=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||cl||(cl=!0,Nm(fs,function(){return Ps(),null})),_=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||_){_=Qn.transition,Qn.transition=null;var w=et;et=1;var T=tt;tt|=4,Lu.current=null,BS(r,c),fm(c,r),cS(jc),ka=!!$c,jc=$c=null,r.current=c,FS(c),ba(),tt=T,et=w,Qn.transition=_}else r.current=c;if(cl&&(cl=!1,mi=r,ul=m),_=r.pendingLanes,_===0&&(pi=null),Rt(c.stateNode),Rn(r,yt()),s!==null)for(f=r.onRecoverableError,c=0;c<s.length;c++)m=s[c],f(m.value,{componentStack:m.stack,digest:m.digest});if(ll)throw ll=!1,r=Bu,Bu=null,r;return(ul&1)!==0&&r.tag!==0&&Ps(),_=r.pendingLanes,(_&1)!==0?r===Fu?Mo++:(Mo=0,Fu=r):Mo=0,ui(),null}function Ps(){if(mi!==null){var r=Fe(ul),s=Qn.transition,c=et;try{if(Qn.transition=null,et=16>r?16:r,mi===null)var f=!1;else{if(r=mi,mi=null,ul=0,(tt&6)!==0)throw Error(n(331));var m=tt;for(tt|=4,we=r.current;we!==null;){var _=we,w=_.child;if((we.flags&16)!==0){var T=_.deletions;if(T!==null){for(var P=0;P<T.length;P++){var V=T[P];for(we=V;we!==null;){var re=we;switch(re.tag){case 0:case 11:case 15:To(8,re,_)}var ae=re.child;if(ae!==null)ae.return=re,we=ae;else for(;we!==null;){re=we;var ne=re.sibling,ge=re.return;if(lm(re),re===V){we=null;break}if(ne!==null){ne.return=ge,we=ne;break}we=ge}}}var xe=_.alternate;if(xe!==null){var ke=xe.child;if(ke!==null){xe.child=null;do{var Mt=ke.sibling;ke.sibling=null,ke=Mt}while(ke!==null)}}we=_}}if((_.subtreeFlags&2064)!==0&&w!==null)w.return=_,we=w;else e:for(;we!==null;){if(_=we,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:To(9,_,_.return)}var U=_.sibling;if(U!==null){U.return=_.return,we=U;break e}we=_.return}}var B=r.current;for(we=B;we!==null;){w=we;var j=w.child;if((w.subtreeFlags&2064)!==0&&j!==null)j.return=w,we=j;else e:for(w=B;we!==null;){if(T=we,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:sl(9,T)}}catch(Ee){Ct(T,T.return,Ee)}if(T===w){we=null;break e}var ue=T.sibling;if(ue!==null){ue.return=T.return,we=ue;break e}we=T.return}}if(tt=m,ui(),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(We,r)}catch{}f=!0}return f}finally{et=c,Qn.transition=s}}return!1}function km(r,s,c){s=Os(c,s),s=$p(r,s,1),r=di(r,s,1),s=vn(),r!==null&&(ri(r,1,s),Rn(r,s))}function Ct(r,s,c){if(r.tag===3)km(r,r,c);else for(;s!==null;){if(s.tag===3){km(s,r,c);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(pi===null||!pi.has(f))){r=Os(c,r),r=jp(s,r,1),s=di(s,r,1),r=vn(),s!==null&&(ri(s,1,r),Rn(s,r));break}}s=s.return}}function WS(r,s,c){var f=r.pingCache;f!==null&&f.delete(s),s=vn(),r.pingedLanes|=r.suspendedLanes&c,Gt===r&&(sn&c)===c&&($t===4||$t===3&&(sn&130023424)===sn&&500>yt()-Pu?qi(r,0):Iu|=c),Rn(r,s)}function Em(r,s){s===0&&((r.mode&1)===0?s=1:(s=Di,Di<<=1,(Di&130023424)===0&&(Di=4194304)));var c=vn();r=Wr(r,s),r!==null&&(ri(r,s,c),Rn(r,c))}function KS(r){var s=r.memoizedState,c=0;s!==null&&(c=s.retryLane),Em(r,c)}function qS(r,s){var c=0;switch(r.tag){case 13:var f=r.stateNode,m=r.memoizedState;m!==null&&(c=m.retryLane);break;case 19:f=r.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(s),Em(r,c)}var Cm;Cm=function(r,s,c){if(r!==null)if(r.memoizedProps!==s.pendingProps||En.current)Nn=!0;else{if((r.lanes&c)===0&&(s.flags&128)===0)return Nn=!1,DS(r,s,c);Nn=(r.flags&131072)!==0}else Nn=!1,gt&&(s.flags&1048576)!==0&&sp(s,$a,s.index);switch(s.lanes=0,s.tag){case 2:var f=s.type;rl(r,s),r=s.pendingProps;var m=ks(s,ln.current);As(s,c),m=fu(null,s,f,r,m,c);var _=pu();return s.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Cn(f)?(_=!0,za(s)):_=!1,s.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,ou(s),m.updater=tl,s.stateNode=m,m._reactInternals=s,bu(s,f,r,c),s=ku(null,s,f,!0,_,c)):(s.tag=0,gt&&_&&Xc(s),_n(null,s,m,c),s=s.child),s;case 16:f=s.elementType;e:{switch(rl(r,s),r=s.pendingProps,m=f._init,f=m(f._payload),s.type=f,m=s.tag=GS(f),r=hr(f,r),m){case 0:s=xu(null,s,f,r,c);break e;case 1:s=Qp(null,s,f,r,c);break e;case 11:s=Vp(null,s,f,r,c);break e;case 14:s=Gp(null,s,f,hr(f.type,r),c);break e}throw Error(n(306,f,""))}return s;case 0:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),xu(r,s,f,m,c);case 1:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),Qp(r,s,f,m,c);case 3:e:{if(Jp(s),r===null)throw Error(n(387));f=s.pendingProps,_=s.memoizedState,m=_.element,pp(r,s),Ga(s,f,null,c);var w=s.memoizedState;if(f=w.element,_.isDehydrated)if(_={element:f,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},s.updateQueue.baseState=_,s.memoizedState=_,s.flags&256){m=Os(Error(n(423)),s),s=em(r,s,f,c,m);break e}else if(f!==m){m=Os(Error(n(424)),s),s=em(r,s,f,c,m);break e}else for(Fn=ai(s.stateNode.containerInfo.firstChild),Bn=s,gt=!0,ur=null,c=dp(s,null,f,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ns(),f===m){s=qr(r,s,c);break e}_n(r,s,f,c)}s=s.child}return s;case 5:return _p(s),r===null&&Jc(s),f=s.type,m=s.pendingProps,_=r!==null?r.memoizedProps:null,w=m.children,Wc(f,m)?w=null:_!==null&&Wc(f,_)&&(s.flags|=32),Zp(r,s),_n(r,s,w,c),s.child;case 6:return r===null&&Jc(s),null;case 13:return tm(r,s,c);case 4:return au(s,s.stateNode.containerInfo),f=s.pendingProps,r===null?s.child=Ts(s,null,f,c):_n(r,s,f,c),s.child;case 11:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),Vp(r,s,f,m,c);case 7:return _n(r,s,s.pendingProps,c),s.child;case 8:return _n(r,s,s.pendingProps.children,c),s.child;case 12:return _n(r,s,s.pendingProps.children,c),s.child;case 10:e:{if(f=s.type._context,m=s.pendingProps,_=s.memoizedProps,w=m.value,ut(Ka,f._currentValue),f._currentValue=w,_!==null)if(cr(_.value,w)){if(_.children===m.children&&!En.current){s=qr(r,s,c);break e}}else for(_=s.child,_!==null&&(_.return=s);_!==null;){var T=_.dependencies;if(T!==null){w=_.child;for(var P=T.firstContext;P!==null;){if(P.context===f){if(_.tag===1){P=Kr(-1,c&-c),P.tag=2;var V=_.updateQueue;if(V!==null){V=V.shared;var re=V.pending;re===null?P.next=P:(P.next=re.next,re.next=P),V.pending=P}}_.lanes|=c,P=_.alternate,P!==null&&(P.lanes|=c),iu(_.return,c,s),T.lanes|=c;break}P=P.next}}else if(_.tag===10)w=_.type===s.type?null:_.child;else if(_.tag===18){if(w=_.return,w===null)throw Error(n(341));w.lanes|=c,T=w.alternate,T!==null&&(T.lanes|=c),iu(w,c,s),w=_.sibling}else w=_.child;if(w!==null)w.return=_;else for(w=_;w!==null;){if(w===s){w=null;break}if(_=w.sibling,_!==null){_.return=w.return,w=_;break}w=w.return}_=w}_n(r,s,m.children,c),s=s.child}return s;case 9:return m=s.type,f=s.pendingProps.children,As(s,c),m=Xn(m),f=f(m),s.flags|=1,_n(r,s,f,c),s.child;case 14:return f=s.type,m=hr(f,s.pendingProps),m=hr(f.type,m),Gp(r,s,f,m,c);case 15:return Yp(r,s,s.type,s.pendingProps,c);case 17:return f=s.type,m=s.pendingProps,m=s.elementType===f?m:hr(f,m),rl(r,s),s.tag=1,Cn(f)?(r=!0,za(s)):r=!1,As(s,c),Up(s,f,m),bu(s,f,m,c),ku(null,s,f,!0,r,c);case 19:return rm(r,s,c);case 22:return Xp(r,s,c)}throw Error(n(156,s.tag))};function Nm(r,s){return va(r,s)}function VS(r,s,c,f){this.tag=r,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 Jn(r,s,c,f){return new VS(r,s,c,f)}function Wu(r){return r=r.prototype,!(!r||!r.isReactComponent)}function GS(r){if(typeof r=="function")return Wu(r)?1:0;if(r!=null){if(r=r.$$typeof,r===$)return 11;if(r===z)return 14}return 2}function vi(r,s){var c=r.alternate;return c===null?(c=Jn(r.tag,s,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=s,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&14680064,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,s=r.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c}function pl(r,s,c,f,m,_){var w=2;if(f=r,typeof r=="function")Wu(r)&&(w=1);else if(typeof r=="string")w=5;else e:switch(r){case se:return Gi(c.children,m,_,s);case W:w=8,m|=8;break;case ee:return r=Jn(12,c,s,m|2),r.elementType=ee,r.lanes=_,r;case K:return r=Jn(13,c,s,m),r.elementType=K,r.lanes=_,r;case q:return r=Jn(19,c,s,m),r.elementType=q,r.lanes=_,r;case oe:return ml(c,m,_,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:w=10;break e;case Y:w=9;break e;case $:w=11;break e;case z:w=14;break e;case Z:w=16,f=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Jn(w,c,s,m),s.elementType=r,s.type=f,s.lanes=_,s}function Gi(r,s,c,f){return r=Jn(7,r,f,s),r.lanes=c,r}function ml(r,s,c,f){return r=Jn(22,r,f,s),r.elementType=oe,r.lanes=c,r.stateNode={isHidden:!1},r}function Ku(r,s,c){return r=Jn(6,r,null,s),r.lanes=c,r}function qu(r,s,c){return s=Jn(4,r.children!==null?r.children:[],r.key,s),s.lanes=c,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function YS(r,s,c,f,m){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ni(0),this.expirationTimes=ni(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ni(0),this.identifierPrefix=f,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function Vu(r,s,c,f,m,_,w,T,P){return r=new YS(r,s,c,T,P),s===1?(s=1,_===!0&&(s|=8)):s=0,_=Jn(3,null,null,s),r.current=_,_.stateNode=r,_.memoizedState={element:f,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},ou(_),r}function XS(r,s,c){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:f==null?null:""+f,children:r,containerInfo:s,implementation:c}}function Tm(r){if(!r)return ci;r=r._reactInternals;e:{if(zr(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Cn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var c=r.type;if(Cn(c))return np(r,c,s)}return s}function Rm(r,s,c,f,m,_,w,T,P){return r=Vu(c,f,!0,r,m,_,w,T,P),r.context=Tm(null),c=r.current,f=vn(),m=gi(c),_=Kr(f,m),_.callback=s??null,di(c,_,m),r.current.lanes=m,ri(r,m,f),Rn(r,f),r}function gl(r,s,c,f){var m=s.current,_=vn(),w=gi(m);return c=Tm(c),s.context===null?s.context=c:s.pendingContext=c,s=Kr(_,w),s.payload={element:r},f=f===void 0?null:f,f!==null&&(s.callback=f),r=di(m,s,w),r!==null&&(pr(r,m,w,_),Va(r,m,w)),w}function _l(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Am(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<s?c:s}}function Gu(r,s){Am(r,s),(r=r.alternate)&&Am(r,s)}function ZS(){return null}var Mm=typeof reportError=="function"?reportError:function(r){console.error(r)};function Yu(r){this._internalRoot=r}vl.prototype.render=Yu.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));gl(r,s,null,null)},vl.prototype.unmount=Yu.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Ki(function(){gl(null,r,null,null)}),s[Ur]=null}};function vl(r){this._internalRoot=r}vl.prototype.unstable_scheduleHydration=function(r){if(r){var s=Ii();r={blockedOn:null,target:r,priority:s};for(var c=0;c<qt.length&&s!==0&&s<qt[c].priority;c++);qt.splice(c,0,r),c===0&&_f(r)}};function Xu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function yl(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Om(){}function QS(r,s,c,f,m){if(m){if(typeof f=="function"){var _=f;f=function(){var V=_l(w);_.call(V)}}var w=Rm(s,f,r,0,null,!1,!1,"",Om);return r._reactRootContainer=w,r[Ur]=w.current,mo(r.nodeType===8?r.parentNode:r),Ki(),w}for(;m=r.lastChild;)r.removeChild(m);if(typeof f=="function"){var T=f;f=function(){var V=_l(P);T.call(V)}}var P=Vu(r,0,!1,null,null,!1,!1,"",Om);return r._reactRootContainer=P,r[Ur]=P.current,mo(r.nodeType===8?r.parentNode:r),Ki(function(){gl(s,P,c,f)}),P}function bl(r,s,c,f,m){var _=c._reactRootContainer;if(_){var w=_;if(typeof m=="function"){var T=m;m=function(){var P=_l(w);T.call(P)}}gl(s,w,r,m)}else w=QS(c,s,r,m,f);return _l(w)}no=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var c=ti(s.pendingLanes);c!==0&&(to(s,c|1),Rn(s,yt()),(tt&6)===0&&(Is=yt()+500,ui()))}break;case 13:Ki(function(){var f=Wr(r,1);if(f!==null){var m=vn();pr(f,r,1,m)}}),Gu(r,1)}},At=function(r){if(r.tag===13){var s=Wr(r,134217728);if(s!==null){var c=vn();pr(s,r,134217728,c)}Gu(r,134217728)}},it=function(r){if(r.tag===13){var s=gi(r),c=Wr(r,s);if(c!==null){var f=vn();pr(c,r,s,f)}Gu(r,s)}},Ii=function(){return et},Sr=function(r,s){var c=et;try{return et=r,s()}finally{et=c}},hs=function(r,s,c){switch(s){case"input":if(In(r,c),s=c.name,c.type==="radio"&&s!=null){for(c=r;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!==r&&f.form===r.form){var m=Ba(f);if(!m)throw Error(n(90));tn(f),In(f,m)}}}break;case"textarea":Kn(r,c);break;case"select":s=c.value,s!=null&&vr(r,!!c.multiple,s,!1)}},pe=Hu,Ie=Ki;var JS={usingClientEntryPoint:!1,Events:[vo,ws,Ba,M,Q,Hu]},Oo={findFiberByHostInstance:Bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ew={bundleType:Oo.bundleType,version:Oo.version,rendererPackageName:Oo.rendererPackageName,rendererConfig:Oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=ga(r),r===null?null:r.stateNode},findFiberByHostInstance:Oo.findFiberByHostInstance||ZS,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 Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sl.isDisabled&&Sl.supportsFiber)try{We=Sl.inject(ew),Ge=Sl}catch{}}return An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=JS,An.createPortal=function(r,s){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xu(s))throw Error(n(200));return XS(r,s,null,c)},An.createRoot=function(r,s){if(!Xu(r))throw Error(n(299));var c=!1,f="",m=Mm;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onRecoverableError!==void 0&&(m=s.onRecoverableError)),s=Vu(r,1,!1,null,null,c,!1,f,m),r[Ur]=s.current,mo(r.nodeType===8?r.parentNode:r),new Yu(s)},An.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=ga(s),r=r===null?null:r.stateNode,r},An.flushSync=function(r){return Ki(r)},An.hydrate=function(r,s,c){if(!yl(s))throw Error(n(200));return bl(null,r,s,!0,c)},An.hydrateRoot=function(r,s,c){if(!Xu(r))throw Error(n(405));var f=c!=null&&c.hydratedSources||null,m=!1,_="",w=Mm;if(c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onRecoverableError!==void 0&&(w=c.onRecoverableError)),s=Rm(s,null,r,1,c??null,m,!1,_,w),r[Ur]=s.current,mo(r),f)for(r=0;r<f.length;r++)c=f[r],m=c._getVersion,m=m(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,m]:s.mutableSourceEagerHydrationData.push(c,m);return new vl(s)},An.render=function(r,s,c){if(!yl(s))throw Error(n(200));return bl(null,r,s,!1,c)},An.unmountComponentAtNode=function(r){if(!yl(r))throw Error(n(40));return r._reactRootContainer?(Ki(function(){bl(null,null,r,!1,function(){r._reactRootContainer=null,r[Ur]=null})}),!0):!1},An.unstable_batchedUpdates=Hu,An.unstable_renderSubtreeIntoContainer=function(r,s,c,f){if(!yl(c))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return bl(r,s,c,!1,f)},An.version="18.3.1-next-f1338f8080-20240426",An}var Um;function lw(){if(Um)return Ju.exports;Um=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(),Ju.exports=aw(),Ju.exports}var Hm;function cw(){if(Hm)return wl;Hm=1;var e=lw();return wl.createRoot=e.createRoot,wl.hydrateRoot=e.hydrateRoot,wl}var uw=cw(),J_={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$m=ts.createContext&&ts.createContext(J_),hw=["attr","size","title"];function dw(e,t){if(e==null)return{};var n,i,o=fw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function fw(e,t){if(e==null)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;n[i]=e[i]}return n}function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Kl.apply(null,arguments)}function jm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jm(Object(n),!0).forEach(function(i){pw(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jm(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function pw(e,t,n){return(t=mw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mw(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 i=n.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ev(e){return e&&e.map((t,n)=>ts.createElement(t.tag,ql({key:n},t.attr),ev(t.child)))}function vt(e){return t=>ts.createElement(_w,Kl({attr:ql({},e.attr)},t),ev(e.child))}function _w(e){var t=n=>{var i=e.attr,o=e.size,a=e.title,l=dw(e,hw),u=o||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),ts.createElement("svg",Kl({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,l,{className:d,style:ql(ql({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&ts.createElement("title",null,a),e.children)};return $m!==void 0?ts.createElement($m.Consumer,null,n=>t(n)):t(J_)}function vw(e){return vt({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 Pd(e){return vt({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 tv(e){return vt({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 Fh(e){return vt({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 Bd(e){return vt({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 nv(e){return vt({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 yw(e){return vt({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 Fd(e){return vt({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 Ws(e){return vt({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 bw(e){return vt({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 rv(e){return vt({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 Wm(e){return vt({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 Sw(e){return vt({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 nh(e){return vt({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 Km(e){return vt({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 ww(e){return vt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"},child:[]},{tag:"polyline",attr:{points:"14 2 14 8 20 8"},child:[]},{tag:"line",attr:{x1:"16",y1:"13",x2:"8",y2:"13"},child:[]},{tag:"line",attr:{x1:"16",y1:"17",x2:"8",y2:"17"},child:[]},{tag:"polyline",attr:{points:"10 9 9 9 8 9"},child:[]}]})(e)}function iv(e){return vt({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 zd(e){return vt({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 sv(e){return vt({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 oc(e){return vt({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 ac(e){return vt({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 xw(e){return vt({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 kw(e){return vt({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 Ew(e){return vt({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 rh({trigger:e,open:t,onOpenChange:n,children:i,align:o="right"}){const a=ie.useRef(null);return ie.useEffect(()=>{if(!t)return;const l=d=>{a.current&&!a.current.contains(d.target)&&n(!1)},u=d=>{d.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",u)}},[t,n]),S.jsxs("div",{className:`dropdown ${o}`,ref:a,children:[S.jsxs("button",{type:"button",className:"chip",onClick:()=>n(!t),"aria-expanded":t,children:[e,S.jsx(ac,{className:`dd-caret ${t?"up":""}`})]}),t&&S.jsx("div",{className:"dd-menu",children:i})]})}function qm({active:e,onClick:t,children:n}){return S.jsx("button",{type:"button",className:`dd-item ${e?"active":""}`,onClick:t,children:n})}const Cw=[{kind:"question",label:"问卷弹出",desc:"ask_user_question 出现时"},{kind:"done",label:"回复结束",desc:"智能体完成一轮回答时"},{kind:"start",label:"回复开始",desc:"智能体开始新一轮时"},{kind:"error",label:"出错",desc:"出现错误提示时"}];function Nw({settings:e,onChange:t,onPreview:n}){const i=o=>t({...e,...o});return S.jsxs("div",{className:"sound-menu",children:[S.jsx("div",{className:"dd-header",children:"声音提示"}),S.jsxs("label",{className:"sound-row sound-master",children:[S.jsxs("span",{className:"sound-label",children:[S.jsx(tv,{className:"sound-icon"}),S.jsx("span",{children:"启用声音"})]}),S.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>i({enabled:o.target.checked})})]}),Cw.map(({kind:o,label:a,desc:l})=>S.jsxs("label",{className:`sound-row ${e.enabled?"":"disabled"}`,children:[S.jsxs("span",{className:"sound-label",children:[S.jsx("span",{className:"sound-name",children:a}),S.jsx("span",{className:"sound-desc",children:l})]}),S.jsxs("span",{className:"sound-right",children:[S.jsx("button",{type:"button",className:"sound-preview",title:"试听",disabled:!e.enabled,onClick:u=>{u.preventDefault(),n(o)},children:"试听"}),S.jsx("input",{type:"checkbox",checked:e[o],disabled:!e.enabled,onChange:u=>i({[o]:u.target.checked})})]})]},o)),S.jsxs("div",{className:`sound-volume ${e.enabled?"":"disabled"}`,children:[S.jsx("span",{className:"sound-name",children:"音量"}),S.jsx("input",{type:"range",min:0,max:100,step:5,value:e.volume,disabled:!e.enabled,onChange:o=>i({volume:Number(o.target.value)})}),S.jsxs("span",{className:"sound-vol-num",children:[e.volume,"%"]})]})]})}const ov=[{value:"off",label:"关闭"},{value:"minimal",label:"极简"},{value:"low",label:"低"},{value:"medium",label:"中"},{value:"high",label:"高"},{value:"xhigh",label:"极高"},{value:"max",label:"最大"}];function Tw(e){var t;return((t=ov.find(n=>n.value===e))==null?void 0:t.label)??e}function Rw({chat:e,send:t,view:n,onViewChange:i,onManageModels:o,sound:a,onSoundChange:l,onSoundPreview:u}){const d=e.state,h=d==null?void 0:d.model,g=h?`${h.provider}/${h.id}`:null,[p,v]=ie.useState(!1),[y,b]=ie.useState(!1),[x,k]=ie.useState(!1),[C,O]=ie.useState(!1);ie.useEffect(()=>{p&&e.models.length===0&&!C&&(O(!0),t({type:"list_models"}))},[p,e.models.length,C,t]),ie.useEffect(()=>{e.models.length>0&&O(!1)},[e.models.length]);const L=e.ready?"已连接":e.status==="closed"?"重连中…":"连接中…",A=e.ready?"ok":"busy";return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"brand",children:[S.jsx("span",{className:"brand-logo",children:"π"}),S.jsx("span",{className:"brand-name",children:"pi-web-ui"}),S.jsx("span",{className:`conn-dot ${A}`,title:L}),S.jsx("span",{className:"conn-label",children:L})]}),S.jsxs("div",{className:"topbar-actions",children:[S.jsxs("div",{className:"view-switch",role:"tablist","aria-label":"视图切换",children:[S.jsxs("button",{type:"button",role:"tab","aria-selected":n==="chat",className:n==="chat"?"active":"",onClick:()=>i("chat"),children:[S.jsx(rv,{}),S.jsx("span",{children:"对话"})]}),S.jsxs("button",{type:"button",role:"tab","aria-selected":n==="terminal",className:n==="terminal"?"active":"",onClick:()=>i("terminal"),children:[S.jsx(Bd,{}),S.jsx("span",{children:"终端"})]})]}),S.jsxs(rh,{trigger:S.jsxs(S.Fragment,{children:[S.jsx(zd,{}),S.jsx("span",{className:"chip-model",children:h?h.name:"选择模型"}),h&&S.jsx("span",{className:"chip-sub",children:h.provider})]}),open:p,onOpenChange:v,children:[S.jsx("div",{className:"dd-header",children:"可用模型"}),(C||e.modelsLoading)&&S.jsx("div",{className:"dd-loading",children:"加载中…"}),e.models.length===0&&!C&&!e.modelsLoading&&S.jsx("div",{className:"dd-loading",children:"暂无可用模型(请先配置 API 密钥)"}),e.models.map(H=>S.jsxs(qm,{active:g===H.id,onClick:()=>{g!==H.id&&t({type:"set_model",modelId:H.id}),v(!1)},children:[S.jsx("span",{className:"dd-model-name",children:H.name}),S.jsxs("span",{className:"dd-model-sub",children:[H.provider,H.reasoning?" · 推理":""]})]},H.id)),S.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>t({type:"list_models"}),children:"刷新模型列表"}),S.jsx("button",{type:"button",className:"dd-refresh",onClick:()=>{v(!1),o()},children:"⚙ 管理模型(新增 / 修改)"})]}),S.jsxs(rh,{trigger:S.jsxs(S.Fragment,{children:[S.jsx(vw,{}),S.jsxs("span",{className:"chip-sub",children:["思考:",d?Tw(d.thinkingLevel):"—"]})]}),open:y,onOpenChange:b,children:[S.jsx("div",{className:"dd-header",children:"思考强度"}),ov.map(H=>S.jsx(qm,{active:(d==null?void 0:d.thinkingLevel)===H.value,onClick:()=>{(d==null?void 0:d.thinkingLevel)!==H.value&&t({type:"set_thinking",level:H.value}),b(!1)},children:H.label},H.value))]}),S.jsx(rh,{trigger:S.jsxs(S.Fragment,{children:[S.jsx(tv,{}),S.jsx("span",{className:"chip-sub",children:"声音"})]}),open:x,onOpenChange:k,children:S.jsx(Nw,{settings:a,onChange:l,onPreview:u})}),S.jsxs("button",{type:"button",className:"chip newchat","data-tip":"新建对话(每个浏览器独立保存会话)",onClick:()=>t({type:"new_chat"}),children:[S.jsx(Ws,{}),S.jsx("span",{children:"新对话"})]})]})]})}function Aw(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 Mw({chat:e,send:t}){var a;const n=(a=e.state)==null?void 0:a.sessionFile,i=e.sessions,o=l=>{const u=l.name||l.firstMessage.trim();return u.length>0?u:"空对话"};return S.jsxs("aside",{className:"panel panel-left",children:[S.jsxs("div",{className:"panel-header",children:[S.jsx("span",{className:"panel-title",children:"对话"}),S.jsx("button",{type:"button",className:"panel-new",title:"新建对话",onClick:()=>t({type:"new_chat"}),children:S.jsx(nv,{})})]}),S.jsxs("div",{className:"panel-body",children:[i.length===0&&S.jsx("div",{className:"panel-empty",children:"还没有历史对话"}),i.map(l=>{const u=n===l.path;return S.jsxs("button",{type:"button",className:`session-item ${u?"active":""}`,title:l.path,onClick:()=>{u||t({type:"switch_session",path:l.path})},children:[S.jsx(rv,{className:"session-icon"}),S.jsxs("span",{className:"session-info",children:[S.jsx("span",{className:"session-title",children:o(l)}),S.jsxs("span",{className:"session-sub",children:[u?"当前":`${l.messageCount} 条消息`,l.source==="tui"&&S.jsx("span",{className:"session-src",title:"pi 终端(TUI)中的对话",children:"TUI"})]})]}),S.jsx("span",{className:"session-time",children:Aw(l.modified)})]},l.path)})]}),S.jsx("div",{className:"panel-footer",children:S.jsx("button",{type:"button",className:"panel-refresh",onClick:()=>t({type:"list_sessions"}),children:"刷新列表"})})]})}function Ow({chat:e,send:t,onAttach:n}){var W,ee;const[i,o]=ie.useState(""),[a,l]=ie.useState(!1),[u,d]=ie.useState(!1),[h,g]=ie.useState(""),[p,v]=ie.useState(0),y=ie.useRef(null),b=e.files;ie.useEffect(()=>{if(!u)return;const R=setTimeout(()=>{t({type:"complete_path",path:h})},150);return()=>clearTimeout(R)},[h,u,t]),ie.useEffect(()=>v(0),[e.pathCompletions]);const x=e.pathCompletions,k=ie.useRef(null);ie.useEffect(()=>{var Y;const R=(Y=k.current)==null?void 0:Y.querySelector(`.pc-item[data-idx="${p}"]`);R==null||R.scrollIntoView({block:"nearest"})},[p]);const C=(R,Y)=>{var $;g(Y?`${R}/`:R),v(0),($=y.current)==null||$.focus()},O=R=>{if(R.key==="ArrowDown")R.preventDefault(),v(Y=>Math.min(Y+1,x.length-1));else if(R.key==="ArrowUp")R.preventDefault(),v(Y=>Math.max(Y-1,0));else if(R.key==="Tab"&&x.length>0){R.preventDefault();const Y=x[Math.min(p,x.length-1)];C(Y.path,Y.type==="dir")}else if(R.key==="Enter"&&!R.nativeEvent.isComposing){const Y=h.trim();if(Y.endsWith("/"))d(!1),t({type:"set_cwd",path:Y});else if(x.some($=>$.path===Y))d(!1),t({type:"set_cwd",path:Y});else if(x.length>0&&x[p]){R.preventDefault();const $=x[p];C($.path,$.type==="dir")}else d(!1),Y&&t({type:"set_cwd",path:Y})}else R.key==="Escape"&&(x.length>0?(R.stopPropagation(),g(h),t({type:"complete_path",path:""})):d(!1))},L=ie.useRef(0),A=ie.useCallback(R=>{const Y=++L.current;o(R),l(!0),t({type:"list_files",path:R===""?void 0:R})||L.current===Y&&l(!1)},[t]);ie.useEffect(()=>{b&&b.path===i&&l(!1)},[b,i]);const H=R=>A(R),D=()=>{(b==null?void 0:b.parent)!==null&&(b==null?void 0:b.parent)!==void 0&&A(b.parent)},se=i.split("/").filter(Boolean);return S.jsxs("aside",{className:"panel panel-right",children:[S.jsxs("div",{className:"panel-header",children:[S.jsx("span",{className:"panel-title",children:"文件"}),S.jsx("button",{type:"button",className:"panel-refresh",title:"刷新文件列表",onClick:()=>A(i),children:S.jsx(Fd,{})})]}),S.jsxs("div",{className:"panel-crumbs",children:[S.jsx("button",{type:"button",className:`crumb ${i===""?"active":""}`,onClick:()=>A(""),children:"根目录"}),se.map((R,Y)=>{const $=se.slice(0,Y+1).join("/");return S.jsxs("span",{className:"crumb-seg",children:[S.jsx(oc,{}),S.jsx("button",{type:"button",className:`crumb ${$===i?"active":""}`,onClick:()=>A($),children:R})]},$)})]}),S.jsxs("div",{className:"panel-body",children:[a&&S.jsx("div",{className:"panel-empty",children:"加载中…"}),!a&&b&&b.path===i&&S.jsxs(S.Fragment,{children:[b.path!==""&&S.jsxs("button",{type:"button",className:"file-item dir",onClick:D,children:[S.jsx(nh,{className:"file-icon"}),S.jsx("span",{className:"file-name",children:".."})]}),b.entries.map(R=>R.type==="dir"?S.jsxs("div",{className:"file-item dir",children:[S.jsxs("button",{type:"button",className:"file-dir-main",onClick:()=>H(R.path),children:[S.jsx(nh,{className:"file-icon"}),S.jsx("span",{className:"file-name",children:R.name})]}),S.jsx("button",{type:"button",className:"file-attach ref","data-tip":"链接文件夹路径到对话",onClick:()=>n(R.path,R.name,"reference",!0),children:S.jsx(Wm,{})})]},R.path):S.jsxs("div",{className:"file-item file",children:[S.jsx(Km,{className:"file-icon"}),S.jsx("span",{className:"file-name",title:R.path,children:R.name}),S.jsx("button",{type:"button",className:"file-attach inline","data-tip":"附加内容到对话",onClick:()=>n(R.path,R.name,"inline"),children:S.jsx(Ws,{})}),S.jsx("button",{type:"button",className:"file-attach ref","data-tip":"仅引用路径(AI 按需读取)",onClick:()=>n(R.path,R.name,"reference"),children:S.jsx(Wm,{})})]},R.path))]}),!a&&!b&&S.jsx("div",{className:"panel-empty",children:"暂无文件"})]}),e.widgets.filter(R=>R.lines.length>0).length>0&&S.jsx("div",{className:"panel-widgets",children:e.widgets.filter(R=>R.lines.length>0).map(R=>S.jsxs("div",{className:"widget",children:[S.jsx("div",{className:"widget-title",children:R.key}),S.jsx("pre",{className:"widget-lines",children:R.lines.join(`
|
|
41
|
+
`)})]},R.key))}),S.jsx("div",{className:"panel-footer",children:u?S.jsxs("div",{className:"cwd-edit-wrap",children:[S.jsx("input",{ref:y,className:"cwd-input",value:h,autoFocus:!0,placeholder:"输入路径,Enter 切换",onChange:R=>g(R.target.value),onKeyDown:O,onBlur:()=>d(!1)}),x.length>0&&S.jsx("ul",{ref:k,className:"path-completions",onMouseDown:R=>R.preventDefault(),children:x.map((R,Y)=>S.jsx("li",{children:S.jsxs("button",{type:"button","data-idx":Y,className:`pc-item ${Y===p?"sel":""}`,onMouseEnter:()=>v(Y),onClick:()=>C(R.path,R.type==="dir"),children:[S.jsx("span",{className:"pc-icon",children:R.type==="dir"?S.jsx(nh,{}):S.jsx(Km,{})}),S.jsxs("span",{className:"pc-body",children:[S.jsx("span",{className:"pc-name",children:R.name}),S.jsx("span",{className:"pc-path",children:R.path})]})]})},R.path))})]}):S.jsxs("button",{type:"button",className:"cwd-bar",title:"点击切换工作目录",onClick:()=>{var R;g(((R=e.state)==null?void 0:R.cwd)??""),d(!0)},children:[S.jsx("span",{className:"cwd-label",children:"目录"}),S.jsx("span",{className:"panel-cwd",title:(W=e.state)==null?void 0:W.cwd,children:(ee=e.state)==null?void 0:ee.cwd}),S.jsx("span",{className:"cwd-edit",children:"✎"})]})})]})}function Dw(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Lw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Iw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pw={};function Vm(e,t){return(Pw.jsx?Iw:Lw).test(e)}const Bw=/[ \t\n\f\r]/g;function Fw(e){return typeof e=="object"?e.type==="text"?Gm(e.value):!1:Gm(e)}function Gm(e){return e.replace(Bw,"")===""}class aa{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}aa.prototype.normal={};aa.prototype.property={};aa.prototype.space=void 0;function av(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new aa(n,i,t)}function zh(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 zw=0;const ze=as(),It=as(),Uh=as(),le=as(),at=as(),ns=as(),$n=as();function as(){return 2**++zw}const Hh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:It,commaOrSpaceSeparated:$n,commaSeparated:ns,number:le,overloadedBoolean:Uh,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),ih=Object.keys(Hh);class Ud extends Dn{constructor(t,n,i,o){let a=-1;if(super(t,n),Ym(this,"space",o),typeof i=="number")for(;++a<ih.length;){const l=ih[a];Ym(this,ih[a],(i&Hh[l])===Hh[l])}}}Ud.prototype.defined=!0;function Ym(e,t,n){n&&(e[t]=n)}function Vs(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const a=new Ud(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[zh(i)]=i,n[zh(a.attribute)]=i}return new aa(t,n,e.space)}const lv=Vs({properties:{ariaActiveDescendant:null,ariaAtomic:It,ariaAutoComplete:null,ariaBusy:It,ariaChecked:It,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:It,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:It,ariaFlowTo:at,ariaGrabbed:It,ariaHasPopup:null,ariaHidden:It,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:le,ariaLive:null,ariaModal:It,ariaMultiLine:It,ariaMultiSelectable:It,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:It,ariaReadOnly:It,ariaRelevant:null,ariaRequired:It,ariaRoleDescription:at,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:It,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cv(e,t){return t in e?e[t]:t}function uv(e,t){return cv(e,t.toLowerCase())}const Uw=Vs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ns,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:at,autoFocus:ze,autoPlay:ze,blocking:at,capture:null,charSet:null,checked:ze,cite:null,className:at,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:It,controls:ze,controlsList:at,coords:le|ns,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Uh,draggable:It,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:at,height:le,hidden:Uh,high:le,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:at,itemRef:at,itemScope:ze,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,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:ze,optimum:le,pattern:null,ping:at,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:at,required:ze,reversed:ze,rows:le,rowSpan:le,sandbox:at,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:It,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:It,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:It,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:ns,part:at,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:uv}),Hw=Vs({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:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:at,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:ns,g2:ns,glyphName:ns,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:$n,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:$n,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$n,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,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:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cv}),hv=Vs({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()}}),dv=Vs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uv}),fv=Vs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$w={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"},jw=/[A-Z]/g,Xm=/-[a-z]/g,Ww=/^data[-\w.:]+$/i;function Kw(e,t){const n=zh(t);let i=t,o=Dn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ww.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Xm,Vw);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Xm.test(a)){let l=a.replace(jw,qw);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Ud}return new o(i,t)}function qw(e){return"-"+e.toLowerCase()}function Vw(e){return e.charAt(1).toUpperCase()}const Gw=av([lv,Uw,hv,dv,fv],"html"),Hd=av([lv,Hw,hv,dv,fv],"svg");function Yw(e){return e.join(" ").trim()}var Bs={},sh,Zm;function Xw(){if(Zm)return sh;Zm=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
42
|
+
`,h="/",g="*",p="",v="comment",y="declaration";function b(k,C){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];C=C||{};var O=1,L=1;function A(q){var z=q.match(t);z&&(O+=z.length);var Z=q.lastIndexOf(d);L=~Z?q.length-Z:L+q.length}function H(){var q={line:O,column:L};return function(z){return z.position=new D(q),ee(),z}}function D(q){this.start=q,this.end={line:O,column:L},this.source=C.source}D.prototype.content=k;function se(q){var z=new Error(C.source+":"+O+":"+L+": "+q);if(z.reason=q,z.filename=C.source,z.line=O,z.column=L,z.source=k,!C.silent)throw z}function W(q){var z=q.exec(k);if(z){var Z=z[0];return A(Z),k=k.slice(Z.length),z}}function ee(){W(n)}function R(q){var z;for(q=q||[];z=Y();)z!==!1&&q.push(z);return q}function Y(){var q=H();if(!(h!=k.charAt(0)||g!=k.charAt(1))){for(var z=2;p!=k.charAt(z)&&(g!=k.charAt(z)||h!=k.charAt(z+1));)++z;if(z+=2,p===k.charAt(z-1))return se("End of comment missing");var Z=k.slice(2,z-2);return L+=2,A(Z),k=k.slice(z),L+=2,q({type:v,comment:Z})}}function $(){var q=H(),z=W(i);if(z){if(Y(),!W(o))return se("property missing ':'");var Z=W(a),oe=q({type:y,property:x(z[0].replace(e,p)),value:Z?x(Z[0].replace(e,p)):p});return W(l),oe}}function K(){var q=[];R(q);for(var z;z=$();)z!==!1&&(q.push(z),R(q));return q}return ee(),K()}function x(k){return k?k.replace(u,p):p}return sh=b,sh}var Qm;function Zw(){if(Qm)return Bs;Qm=1;var e=Bs&&Bs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.default=n;const t=e(Xw());function n(i,o){let a=null;if(!i||typeof i!="string")return a;const l=(0,t.default)(i),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 Bs}var Lo={},Jm;function Qw(){if(Jm)return Lo;Jm=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(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(i,u),h.replace(t,l))};return Lo.camelCase=d,Lo}var Io,eg;function Jw(){if(eg)return Io;eg=1;var e=Io&&Io.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Zw()),n=Qw();function i(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 i.default=i,Io=i,Io}var e0=Jw();const t0=sc(e0),pv=mv("end"),$d=mv("start");function mv(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function n0(e){const t=$d(e),n=pv(e);if(t&&n)return{start:t,end:n}}function Qo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tg(e.position):"start"in e||"end"in e?tg(e):"line"in e||"column"in e?$h(e):""}function $h(e){return ng(e&&e.line)+":"+ng(e&&e.column)}function tg(e){return $h(e&&e.start)+"-"+$h(e&&e.end)}function ng(e){return e&&typeof e=="number"?e:1}class pn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=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 i=="string"){const d=i.indexOf(":");d===-1?a.ruleId=i:(a.source=i.slice(0,d),a.ruleId=i.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=Qo(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}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const jd={}.hasOwnProperty,r0=new Map,i0=/[A-Z]/g,s0=new Set(["table","tbody","thead","tfoot","tr"]),o0=new Set(["td","th"]),gv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function a0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=m0(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");i=p0(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?Hd:Gw,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=_v(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function _v(e,t,n){if(t.type==="element")return l0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return c0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return h0(e,t,n);if(t.type==="mdxjsEsm")return u0(e,t);if(t.type==="root")return d0(e,t,n);if(t.type==="text")return f0(e,t)}function l0(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Hd,e.schema=o),e.ancestors.push(t);const a=yv(e,t.tagName,!1),l=g0(e,t);let u=Kd(e,t);return s0.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!Fw(d):!0})),vv(e,l,a,t),Wd(l,u),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function c0(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}na(e,t.position)}function u0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);na(e,t.position)}function h0(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Hd,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:yv(e,t.name,!0),l=_0(e,t),u=Kd(e,t);return vv(e,l,a,t),Wd(l,u),e.ancestors.pop(),e.schema=i,e.create(t,a,l,n)}function d0(e,t,n){const i={};return Wd(i,Kd(e,t)),e.create(t,e.Fragment,i,n)}function f0(e,t){return t.value}function vv(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Wd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function p0(e,t,n){return i;function i(o,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function m0(e,t){return n;function n(i,o,a,l){const u=Array.isArray(a.children),d=$d(i);return t(o,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function g0(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&jd.call(t.properties,o)){const a=v0(e,o,t.properties[o]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&o0.has(t.tagName)?i=u:n[l]=u}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function _0(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.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 na(e,t.position);else{const o=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const u=i.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else na(e,t.position);else a=i.value===null?!0:i.value;n[o]=a}return n}function Kd(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:r0;for(;++i<t.children.length;){const a=t.children[i];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=_v(e,a,l);u!==void 0&&n.push(u)}return n}function v0(e,t,n){const i=Kw(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?Dw(n):Yw(n)),i.property==="style"){let o=typeof n=="object"?n:y0(e,String(n));return e.stylePropertyNameCase==="css"&&(o=b0(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?$w[i.property]||i.property:i.attribute,n]}}function y0(e,t){try{return t0(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=gv+"#cannot-parse-style-attribute",o}}function yv(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const u=Vm(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}i=l}else i=Vm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return jd.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);na(e)}function na(e,t){const n=new pn("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=gv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function b0(e){const t={};let n;for(n in e)jd.call(e,n)&&(t[S0(n)]=e[n]);return t}function S0(e){let t=e.replace(i0,w0);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function w0(e){return"-"+e.toLowerCase()}const oh={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"]},x0={};function qd(e,t){const n=x0,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bv(e,i,o)}function bv(e,t,n){if(k0(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 rg(e.children,t,n)}return Array.isArray(e)?rg(e,t,n):""}function rg(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=bv(e[o],t,n);return i.join("")}function k0(e){return!!(e&&typeof e=="object")}const ig=document.createElement("i");function Vd(e){const t="&"+e+";";ig.innerHTML=t;const n=ig.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function jn(e,t,n,i){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,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<i.length;)l=i.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function rr(e,t){return e.length>0?(jn(e,e.length,0,t),e):t}const sg={}.hasOwnProperty;function Sv(e){const t={};let n=-1;for(;++n<e.length;)E0(t,e[n]);return t}function E0(e,t){let n;for(n in t){const o=(sg.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){sg.call(o,l)||(o[l]=[]);const u=a[l];C0(o[l],Array.isArray(u)?u:u?[u]:[])}}}function C0(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);jn(e,0,0,i)}function wv(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 gr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=Ni(/[A-Za-z]/),fn=Ni(/[\dA-Za-z]/),N0=Ni(/[#-'*+\--9=?A-Z^-~]/);function Vl(e){return e!==null&&(e<32||e===127)}const jh=Ni(/\d/),T0=Ni(/[\dA-Fa-f]/),R0=Ni(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const lc=Ni(new RegExp("\\p{P}|\\p{S}","u")),is=Ni(/\s/);function Ni(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gs(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&fn(e.charCodeAt(n+1))&&fn(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(i,n),encodeURIComponent(l)),i=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}function Je(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Ye(d)?(e.enter(n),u(d)):t(d)}function u(d){return Ye(d)&&a++<o?(e.consume(d),u):(e.exit(n),t(d))}}const A0={tokenize:M0};function M0(e){const t=e.attempt(this.parser.constructs.contentInitial,i,o);let n;return t;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Je(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 Me(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const O0={tokenize:D0},og={tokenize:L0};function D0(e){const t=this,n=[];let i=0,o,a,l;return u;function u(L){if(i<n.length){const A=n[i];return t.containerState=A[1],e.attempt(A[0].continuation,d,h)(L)}return h(L)}function d(L){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&O();const A=t.events.length;let H=A,D;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){D=t.events[H][1].end;break}C(i);let se=A;for(;se<t.events.length;)t.events[se][1].end={...D},se++;return jn(t.events,H+1,0,t.events.slice(A)),t.events.length=se,h(L)}return u(L)}function h(L){if(i===n.length){if(!o)return v(L);if(o.currentConstruct&&o.currentConstruct.concrete)return b(L);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(og,g,p)(L)}function g(L){return o&&O(),C(i),v(L)}function p(L){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,b(L)}function v(L){return t.containerState={},e.attempt(og,y,b)(L)}function y(L){return i++,n.push([t.currentConstruct,t.containerState]),v(L)}function b(L){if(L===null){o&&O(),C(0),e.consume(L);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),x(L)}function x(L){if(L===null){k(e.exit("chunkFlow"),!0),C(0),e.consume(L);return}return Me(L)?(e.consume(L),k(e.exit("chunkFlow")),i=0,t.interrupt=void 0,u):(e.consume(L),x)}function k(L,A){const H=t.sliceStream(L);if(A&&H.push(null),L.previous=a,a&&(a.next=L),a=L,o.defineSkip(L.start),o.write(H),t.parser.lazy[L.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 se=t.events.length;let W=se,ee,R;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){if(ee){R=t.events[W][1].end;break}ee=!0}for(C(i),D=se;D<t.events.length;)t.events[D][1].end={...R},D++;jn(t.events,W+1,0,t.events.slice(se)),t.events.length=D}}function C(L){let A=n.length;for(;A-- >L;){const H=n[A];t.containerState=H[1],H[0].exit.call(t,e)}n.length=L}function O(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function L0(e,t,n){return Je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ks(e){if(e===null||lt(e)||is(e))return 1;if(lc(e))return 2}function cc(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!i.includes(a)&&(t=a(t,n),i.push(a))}return t}const Wh={name:"attention",resolveAll:I0,tokenize:P0};function I0(e,t){let n=-1,i,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(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[i][1].end},v={...e[n][1].start};ag(p,-d),ag(v,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},a={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[i][1].end={...l.start},e[n][1].start={...u.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=rr(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=rr(h,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=rr(h,cc(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=rr(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=rr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,jn(e,i-1,n-i+3,h),n=i+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function P0(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Ks(i);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=Ks(d),p=!g||g===2&&o||n.includes(d),v=!o||o===2&&g||n.includes(i);return h._open=!!(a===42?p:p&&(o||!v)),h._close=!!(a===42?v:v&&(g||!p)),t(d)}}function ag(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const B0={name:"autolink",tokenize:F0};function F0(e,t,n){let i=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 Sn(y)?(e.consume(y),l):y===64?n(y):h(y)}function l(y){return y===43||y===45||y===46||fn(y)?(i=1,u(y)):h(y)}function u(y){return y===58?(e.consume(y),i=0,d):(y===43||y===45||y===46||fn(y))&&i++<32?(e.consume(y),u):(i=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||Vl(y)?n(y):(e.consume(y),d)}function h(y){return y===64?(e.consume(y),g):N0(y)?(e.consume(y),h):n(y)}function g(y){return fn(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),i=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||fn(y))&&i++<63){const b=y===45?v:p;return e.consume(y),b}return n(y)}}const la={partial:!0,tokenize:z0};function z0(e,t,n){return i;function i(a){return Ye(a)?Je(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Me(a)?t(a):n(a)}}const xv={continuation:{tokenize:H0},exit:$0,name:"blockQuote",tokenize:U0};function U0(e,t,n){const i=this;return o;function o(l){if(l===62){const u=i.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 Ye(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function H0(e,t,n){const i=this;return o;function o(l){return Ye(l)?Je(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(xv,t,n)(l)}}function $0(e){e.exit("blockQuote")}const kv={name:"characterEscape",tokenize:j0};function j0(e,t,n){return i;function i(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return R0(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Ev={name:"characterReference",tokenize:W0};function W0(e,t,n){const i=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=fn,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=T0,g):(e.enter("characterReferenceValue"),a=7,l=jh,g(p))}function g(p){if(p===59&&o){const v=e.exit("characterReferenceValue");return l===fn&&!Vd(i.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 lg={partial:!0,tokenize:q0},cg={concrete:!0,name:"codeFenced",tokenize:K0};function K0(e,t,n){const i=this,o={partial:!0,tokenize:H};let a=0,l=0,u;return d;function d(D){return h(D)}function h(D){const se=i.events[i.events.length-1];return a=se&&se[1].type==="linePrefix"?se[2].sliceSerialize(se[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"),Ye(D)?Je(e,p,"whitespace")(D):p(D))}function p(D){return D===null||Me(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(lg,x,A)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):Ye(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,y,"whitespace")(D)):D===96&&D===u?n(D):(e.consume(D),v)}function y(D){return D===null||Me(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===u?n(D):(e.consume(D),b)}function x(D){return e.attempt(o,A,k)(D)}function k(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),C}function C(D){return a>0&&Ye(D)?Je(e,O,"linePrefix",a+1)(D):O(D)}function O(D){return D===null||Me(D)?e.check(lg,x,A)(D):(e.enter("codeFlowValue"),L(D))}function L(D){return D===null||Me(D)?(e.exit("codeFlowValue"),O(D)):(e.consume(D),L)}function A(D){return e.exit("codeFenced"),t(D)}function H(D,se,W){let ee=0;return R;function R(z){return D.enter("lineEnding"),D.consume(z),D.exit("lineEnding"),Y}function Y(z){return D.enter("codeFencedFence"),Ye(z)?Je(D,$,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):$(z)}function $(z){return z===u?(D.enter("codeFencedFenceSequence"),K(z)):W(z)}function K(z){return z===u?(ee++,D.consume(z),K):ee>=l?(D.exit("codeFencedFenceSequence"),Ye(z)?Je(D,q,"whitespace")(z):q(z)):W(z)}function q(z){return z===null||Me(z)?(D.exit("codeFencedFence"),se(z)):W(z)}}}function q0(e,t,n){const i=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 i.parser.lazy[i.now().line]?n(l):t(l)}}const ah={name:"codeIndented",tokenize:G0},V0={partial:!0,tokenize:Y0};function G0(e,t,n){const i=this;return o;function o(h){return e.enter("codeIndented"),Je(e,a,"linePrefix",5)(h)}function a(h){const g=i.events[i.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):Me(h)?e.attempt(V0,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||Me(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function Y0(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):Me(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):Je(e,a,"linePrefix",5)(l)}function a(l){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Me(l)?o(l):n(l)}}const X0={name:"codeText",previous:Q0,resolve:Z0,tokenize:J0};function Z0(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)o===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(o=i):(i===t||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),t-=i-o-2,i=o+2),o=void 0);return e}function Q0(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function J0(e,t,n){let i=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),i++,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)):Me(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||Me(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function g(p){return p===96?(e.consume(p),o++,g):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",h(p))}}class e1{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 i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Po(this.left,i),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),Po(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Po(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);Po(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Po(this.left,n.reverse())}}}function Po(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 Cv(e){const t={};let n=-1,i,o,a,l,u,d,h;const g=new e1(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(i=g.get(n),n&&i[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(d=i[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(i[0]==="enter")i[1].contentType&&(Object.assign(t,t1(g,n)),n=t[n],h=!0);else if(i[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&&(i[1].end={...g.get(o)[1].start},u=g.slice(o,n),u.unshift(i),g.splice(o,n-o+1,u))}}return jn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function t1(e,t){const n=e.get(t)[1],i=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],h={};let g,p,v=-1,y=n,b=0,x=0;const k=[x];for(;y;){for(;e.get(++o)[1]!==y;);a.push(o),y._tokenizer||(g=i.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&&(x=v+1,k.push(x),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):k.pop(),v=k.length;v--;){const C=u.slice(k[v],k[v+1]),O=a.pop();d.push([O,O+C.length-1]),e.splice(O,2,C)}for(d.reverse(),v=-1;++v<d.length;)h[b+d[v][0]]=b+d[v][1],b+=d[v][1]-d[v][0]-1;return h}const n1={resolve:i1,tokenize:s1},r1={partial:!0,tokenize:o1};function i1(e){return Cv(e),e}function s1(e,t){let n;return i;function i(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(u)}function o(u){return u===null?a(u):Me(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 o1(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Je(e,a,"linePrefix")}function a(l){if(l===null||Me(l))return n(l);const u=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function Nv(e,t,n,i,o,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let g=0;return p;function p(C){return C===60?(e.enter(i),e.enter(o),e.enter(a),e.consume(C),e.exit(a),v):C===null||C===32||C===41||Vl(C)?n(C):(e.enter(i),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(a),e.consume(C),e.exit(a),e.exit(o),e.exit(i),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Me(C)?n(C):(e.consume(C),C===92?b:y)}function b(C){return C===60||C===62||C===92?(e.consume(C),y):y(C)}function x(C){return!g&&(C===null||C===41||lt(C))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(i),t(C)):g<h&&C===40?(e.consume(C),g++,x):C===41?(e.consume(C),g--,x):C===null||C===32||C===40||Vl(C)?n(C):(e.consume(C),C===92?k:x)}function k(C){return C===40||C===41||C===92?(e.consume(C),x):x(C)}}function Tv(e,t,n,i,o,a){const l=this;let u=0,d;return h;function h(y){return e.enter(i),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(i),t):Me(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||Me(y)||u++>999?(e.exit("chunkString"),g(y)):(e.consume(y),d||(d=!Ye(y)),y===92?v:p)}function v(y){return y===91||y===92||y===93?(e.consume(y),u++,p):p(y)}}function Rv(e,t,n,i,o,a){let l;return u;function u(v){return v===34||v===39||v===40?(e.enter(i),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(i),t):(e.enter(a),h(v))}function h(v){return v===l?(e.exit(a),d(l)):v===null?n(v):Me(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Je(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||Me(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 Jo(e,t){let n;return i;function i(o){return Me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ye(o)?Je(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const a1={name:"definition",tokenize:c1},l1={partial:!0,tokenize:u1};function c1(e,t,n){const i=this;let o;return a;function a(y){return e.enter("definition"),l(y)}function l(y){return Tv.call(i,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return o=gr(i.sliceSerialize(i.events[i.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 lt(y)?Jo(e,h)(y):h(y)}function h(y){return Nv(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(l1,p,p)(y)}function p(y){return Ye(y)?Je(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Me(y)?(e.exit("definition"),i.parser.defined.push(o),t(y)):n(y)}}function u1(e,t,n){return i;function i(u){return lt(u)?Jo(e,o)(u):n(u)}function o(u){return Rv(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Ye(u)?Je(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Me(u)?t(u):n(u)}}const h1={name:"hardBreakEscape",tokenize:d1};function d1(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Me(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const f1={name:"headingAtx",resolve:p1,tokenize:m1};function p1(e,t){let n=e.length-2,i=3,o,a;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},jn(e,i,n-i+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function m1(e,t,n){let i=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&&i++<6?(e.consume(g),l):g===null||lt(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),d(g)):g===null||Me(g)?(e.exit("atxHeading"),t(g)):Ye(g)?Je(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||lt(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),h)}}const g1=["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"],ug=["pre","script","style","textarea"],_1={concrete:!0,name:"htmlFlow",resolveTo:b1,tokenize:S1},v1={partial:!0,tokenize:x1},y1={partial:!0,tokenize:w1};function b1(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 S1(e,t,n){const i=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,x):N===63?(e.consume(N),o=3,i.interrupt?t:E):Sn(N)?(e.consume(N),l=String.fromCharCode(N),k):n(N)}function v(N){return N===45?(e.consume(N),o=2,y):N===91?(e.consume(N),o=5,u=0,b):Sn(N)?(e.consume(N),o=4,i.interrupt?t:E):n(N)}function y(N){return N===45?(e.consume(N),i.interrupt?t:E):n(N)}function b(N){const ye="CDATA[";return N===ye.charCodeAt(u++)?(e.consume(N),u===ye.length?i.interrupt?t:$:b):n(N)}function x(N){return Sn(N)?(e.consume(N),l=String.fromCharCode(N),k):n(N)}function k(N){if(N===null||N===47||N===62||lt(N)){const ye=N===47,Ne=l.toLowerCase();return!ye&&!a&&ug.includes(Ne)?(o=1,i.interrupt?t(N):$(N)):g1.includes(l.toLowerCase())?(o=6,ye?(e.consume(N),C):i.interrupt?t(N):$(N)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(N):a?O(N):L(N))}return N===45||fn(N)?(e.consume(N),l+=String.fromCharCode(N),k):n(N)}function C(N){return N===62?(e.consume(N),i.interrupt?t:$):n(N)}function O(N){return Ye(N)?(e.consume(N),O):R(N)}function L(N){return N===47?(e.consume(N),R):N===58||N===95||Sn(N)?(e.consume(N),A):Ye(N)?(e.consume(N),L):R(N)}function A(N){return N===45||N===46||N===58||N===95||fn(N)?(e.consume(N),A):H(N)}function H(N){return N===61?(e.consume(N),D):Ye(N)?(e.consume(N),H):L(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,se):Ye(N)?(e.consume(N),D):W(N)}function se(N){return N===d?(e.consume(N),d=null,ee):N===null||Me(N)?n(N):(e.consume(N),se)}function W(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||lt(N)?H(N):(e.consume(N),W)}function ee(N){return N===47||N===62||Ye(N)?L(N):n(N)}function R(N){return N===62?(e.consume(N),Y):n(N)}function Y(N){return N===null||Me(N)?$(N):Ye(N)?(e.consume(N),Y):n(N)}function $(N){return N===45&&o===2?(e.consume(N),Z):N===60&&o===1?(e.consume(N),oe):N===62&&o===4?(e.consume(N),I):N===63&&o===3?(e.consume(N),E):N===93&&o===5?(e.consume(N),te):Me(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(v1,G,K)(N)):N===null||Me(N)?(e.exit("htmlFlowData"),K(N)):(e.consume(N),$)}function K(N){return e.check(y1,q,G)(N)}function q(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),z}function z(N){return N===null||Me(N)?K(N):(e.enter("htmlFlowData"),$(N))}function Z(N){return N===45?(e.consume(N),E):$(N)}function oe(N){return N===47?(e.consume(N),l="",F):$(N)}function F(N){if(N===62){const ye=l.toLowerCase();return ug.includes(ye)?(e.consume(N),I):$(N)}return Sn(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),F):$(N)}function te(N){return N===93?(e.consume(N),E):$(N)}function E(N){return N===62?(e.consume(N),I):N===45&&o===2?(e.consume(N),E):$(N)}function I(N){return N===null||Me(N)?(e.exit("htmlFlowData"),G(N)):(e.consume(N),I)}function G(N){return e.exit("htmlFlow"),t(N)}}function w1(e,t,n){const i=this;return o;function o(l){return Me(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function x1(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(la,t,n)}}const k1={name:"htmlText",tokenize:E1};function E1(e,t,n){const i=this;let o,a,l;return u;function u(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),H):E===63?(e.consume(E),L):Sn(E)?(e.consume(E),W):n(E)}function h(E){return E===45?(e.consume(E),g):E===91?(e.consume(E),a=0,b):Sn(E)?(e.consume(E),O):n(E)}function g(E){return E===45?(e.consume(E),y):n(E)}function p(E){return E===null?n(E):E===45?(e.consume(E),v):Me(E)?(l=p,oe(E)):(e.consume(E),p)}function v(E){return E===45?(e.consume(E),y):p(E)}function y(E){return E===62?Z(E):E===45?v(E):p(E)}function b(E){const I="CDATA[";return E===I.charCodeAt(a++)?(e.consume(E),a===I.length?x:b):n(E)}function x(E){return E===null?n(E):E===93?(e.consume(E),k):Me(E)?(l=x,oe(E)):(e.consume(E),x)}function k(E){return E===93?(e.consume(E),C):x(E)}function C(E){return E===62?Z(E):E===93?(e.consume(E),C):x(E)}function O(E){return E===null||E===62?Z(E):Me(E)?(l=O,oe(E)):(e.consume(E),O)}function L(E){return E===null?n(E):E===63?(e.consume(E),A):Me(E)?(l=L,oe(E)):(e.consume(E),L)}function A(E){return E===62?Z(E):L(E)}function H(E){return Sn(E)?(e.consume(E),D):n(E)}function D(E){return E===45||fn(E)?(e.consume(E),D):se(E)}function se(E){return Me(E)?(l=se,oe(E)):Ye(E)?(e.consume(E),se):Z(E)}function W(E){return E===45||fn(E)?(e.consume(E),W):E===47||E===62||lt(E)?ee(E):n(E)}function ee(E){return E===47?(e.consume(E),Z):E===58||E===95||Sn(E)?(e.consume(E),R):Me(E)?(l=ee,oe(E)):Ye(E)?(e.consume(E),ee):Z(E)}function R(E){return E===45||E===46||E===58||E===95||fn(E)?(e.consume(E),R):Y(E)}function Y(E){return E===61?(e.consume(E),$):Me(E)?(l=Y,oe(E)):Ye(E)?(e.consume(E),Y):ee(E)}function $(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),o=E,K):Me(E)?(l=$,oe(E)):Ye(E)?(e.consume(E),$):(e.consume(E),q)}function K(E){return E===o?(e.consume(E),o=void 0,z):E===null?n(E):Me(E)?(l=K,oe(E)):(e.consume(E),K)}function q(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||lt(E)?ee(E):(e.consume(E),q)}function z(E){return E===47||E===62||lt(E)?ee(E):n(E)}function Z(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function oe(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),F}function F(E){return Ye(E)?Je(e,te,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):te(E)}function te(E){return e.enter("htmlTextData"),l(E)}}const Gd={name:"labelEnd",resolveAll:R1,resolveTo:A1,tokenize:M1},C1={tokenize:O1},N1={tokenize:D1},T1={tokenize:L1};function R1(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",t+=o}}return e.length!==n.length&&jn(e,0,e.length,n),e}function A1(e,t){let n=e.length,i=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")){i=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+i+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=rr(u,e.slice(a+1,a+i+3)),u=rr(u,[["enter",g,t]]),u=rr(u,cc(t.parser.constructs.insideSpan.null,e.slice(a+i+4,l-3),t)),u=rr(u,[["exit",g,t],e[l-2],e[l-1],["exit",h,t]]),u=rr(u,e.slice(l+1)),u=rr(u,[["exit",d,t]]),jn(e,a,e.length,u),e}function M1(e,t,n){const i=this;let o=i.events.length,a,l;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){a=i.events[o][1];break}return u;function u(v){return a?a._inactive?p(v):(l=i.parser.defined.includes(gr(i.sliceSerialize({start:a.end,end:i.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(C1,g,l?g:p)(v):v===91?e.attempt(N1,g,l?h:p)(v):l?g(v):p(v)}function h(v){return e.attempt(T1,g,p)(v)}function g(v){return t(v)}function p(v){return a._balanced=!0,n(v)}}function O1(e,t,n){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),o}function o(p){return lt(p)?Jo(e,a)(p):a(p)}function a(p){return p===41?g(p):Nv(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return lt(p)?Jo(e,d)(p):g(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?Rv(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function h(p){return lt(p)?Jo(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 i=this;return o;function o(u){return Tv.call(i,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return i.parser.defined.includes(gr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function L1(e,t,n){return i;function i(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 I1={name:"labelStartImage",resolveAll:Gd.resolveAll,tokenize:P1};function P1(e,t,n){const i=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 i.parser.constructs?n(u):t(u)}}const B1={name:"labelStartLink",resolveAll:Gd.resolveAll,tokenize:F1};function F1(e,t,n){const i=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 i.parser.constructs?n(l):t(l)}}const lh={name:"lineEnding",tokenize:z1};function z1(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Je(e,t,"linePrefix")}}const Fl={name:"thematicBreak",tokenize:U1};function U1(e,t,n){let i=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)):i>=3&&(h===null||Me(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===o?(e.consume(h),i++,d):(e.exit("thematicBreakSequence"),Ye(h)?Je(e,u,"whitespace")(h):u(h))}}const On={continuation:{tokenize:W1},exit:q1,name:"list",tokenize:j1},H1={partial:!0,tokenize:V1},$1={partial:!0,tokenize:K1};function j1(e,t,n){const i=this,o=i.events[i.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 b=i.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!i.containerState.marker||y===i.containerState.marker:jh(y)){if(i.containerState.type||(i.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Fl,n,h)(y):h(y);if(!i.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return jh(y)&&++l<10?(e.consume(y),d):(!i.interrupt||l<2)&&(i.containerState.marker?y===i.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"),i.containerState.marker=i.containerState.marker||y,e.check(la,i.interrupt?n:g,e.attempt(H1,v,p))}function g(y){return i.containerState.initialBlankLine=!0,a++,v(y)}function p(y){return Ye(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function W1(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(la,o,a);function o(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Je(e,t,"listItemIndent",i.containerState.size+1)(u)}function a(u){return i.containerState.furtherBlankLines||!Ye(u)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(u)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt($1,t,l)(u))}function l(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,Je(e,e.attempt(On,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function K1(e,t,n){const i=this;return Je(e,o,"listItemIndent",i.containerState.size+1);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(a):n(a)}}function q1(e){e.exit(this.containerState.type)}function V1(e,t,n){const i=this;return Je(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=i.events[i.events.length-1];return!Ye(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const hg={name:"setextUnderline",resolveTo:G1,tokenize:Y1};function G1(e,t){let n=e.length,i,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=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[i][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[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function Y1(e,t,n){const i=this;let o;return a;function a(h){let g=i.events.length,p;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){p=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.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"),Ye(h)?Je(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Me(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const X1={tokenize:Z1};function Z1(e){const t=this,n=e.attempt(la,i,e.attempt(this.parser.constructs.flowInitial,o,Je(e,e.attempt(this.parser.constructs.flow,o,e.attempt(n1,o)),"linePrefix")));return n;function i(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 Q1={resolveAll:Mv()},J1=Av("string"),ex=Av("text");function Av(e){return{resolveAll:Mv(e==="text"?tx:void 0),tokenize:t};function t(n){const i=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(i,i.previous))return!0}return!1}}}function Mv(e){return t;function t(n,i){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,i):n}}function tx(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 i=e[n-1][1],o=t.sliceStream(i);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:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const nx={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:xv},rx={91:a1},ix={[-2]:ah,[-1]:ah,32:ah},sx={35:f1,42:Fl,45:[hg,Fl],60:_1,61:hg,95:Fl,96:cg,126:cg},ox={38:Ev,92:kv},ax={[-5]:lh,[-4]:lh,[-3]:lh,33:I1,38:Ev,42:Wh,60:[B0,k1],91:B1,92:[h1,kv],93:Gd,95:Wh,96:X0},lx={null:[Wh,Q1]},cx={null:[42,95]},ux={null:[]},hx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cx,contentInitial:rx,disable:ux,document:nx,flow:sx,flowInitial:ix,insideSpan:lx,string:ox,text:ax},Symbol.toStringTag,{value:"Module"}));function dx(e,t,n){let i={_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:se(H),check:se(D),consume:O,enter:L,exit:A,interrupt:se(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:b,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(Y){return l=rr(l,Y),k(),l[l.length-1]!==null?[]:(W(t,0),h.events=cc(a,h.events,h),h.events)}function v(Y,$){return px(y(Y),$)}function y(Y){return fx(l,Y)}function b(){const{_bufferIndex:Y,_index:$,line:K,column:q,offset:z}=i;return{_bufferIndex:Y,_index:$,line:K,column:q,offset:z}}function x(Y){o[Y.line]=Y.column,R()}function k(){let Y;for(;i._index<l.length;){const $=l[i._index];if(typeof $=="string")for(Y=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===Y&&i._bufferIndex<$.length;)C($.charCodeAt(i._bufferIndex));else C($)}}function C(Y){g=g(Y)}function O(Y){Me(Y)?(i.line++,i.column=1,i.offset+=Y===-3?2:1,R()):Y!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=Y}function L(Y,$){const K=$||{};return K.type=Y,K.start=b(),h.events.push(["enter",K,h]),u.push(K),K}function A(Y){const $=u.pop();return $.end=b(),h.events.push(["exit",$,h]),$}function H(Y,$){W(Y,$.from)}function D(Y,$){$.restore()}function se(Y,$){return K;function K(q,z,Z){let oe,F,te,E;return Array.isArray(q)?G(q):"tokenize"in q?G([q]):I(q);function I(_e){return Ue;function Ue(Le){const He=Le!==null&&_e[Le],nt=Le!==null&&_e.null,Ft=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray(nt)?nt:nt?[nt]:[]];return G(Ft)(Le)}}function G(_e){return oe=_e,F=0,_e.length===0?Z:N(_e[F])}function N(_e){return Ue;function Ue(Le){return E=ee(),te=_e,_e.partial||(h.currentConstruct=_e),_e.name&&h.parser.constructs.disable.null.includes(_e.name)?Ne():_e.tokenize.call($?Object.assign(Object.create(h),$):h,d,ye,Ne)(Le)}}function ye(_e){return Y(te,E),z}function Ne(_e){return E.restore(),++F<oe.length?N(oe[F]):Z}}}function W(Y,$){Y.resolveAll&&!a.includes(Y)&&a.push(Y),Y.resolve&&jn(h.events,$,h.events.length-$,Y.resolve(h.events.slice($),h)),Y.resolveTo&&(h.events=Y.resolveTo(h.events,h))}function ee(){const Y=b(),$=h.previous,K=h.currentConstruct,q=h.events.length,z=Array.from(u);return{from:q,restore:Z};function Z(){i=Y,h.previous=$,h.currentConstruct=K,h.events.length=q,u=z,R()}}function R(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function fx(e,t){const n=t.start._index,i=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(i,a)];else{if(l=e.slice(n,o),i>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(i):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function px(e,t){let n=-1;const i=[];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=`
|
|
43
43
|
`;break}case-3:{l=`\r
|
|
44
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,i.push(l)}return i.join("")}function mx(e){const i={constructs:Sv([hx,...(e||{}).extensions||[]]),content:o(A0),defined:[],document:o(O0),flow:o(X1),lazy:{},string:o(J1),text:o(ex)};return i;function o(a){return l;function l(u){return dx(i,a,u)}}}function gx(e){for(;!Cv(e););return e}const dg=/[\0\t\n\r]/g;function _x(){let e=1,t="",n=!0,i;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(dg.lastIndex=p,h=dg.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&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=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:i=!0,e=1}p=v+1}return u&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const vx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yx(e){return e.replace(vx,bx)}function bx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return wv(n.slice(a?2:1),a?16:10)}return Vd(n)||e}const Ov={}.hasOwnProperty;function Sx(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),wx(n)(gx(mx(n).document().write(_x()(e,t,!0))))}function wx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(_r),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:a(Ir),blockQuote:a(nt),characterEscape:ee,characterReference:ee,codeFenced:a(Ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ft,l),codeText:a(tn,l),codeTextData:ee,data:ee,codeFlowValue:ee,definition:a($e),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Ln),hardBreakEscape:a(Qe),hardBreakTrailing:a(Qe),htmlFlow:a(In,l),htmlFlowData:ee,htmlText:a(In,l),htmlTextData:ee,image:a(Wn),label:l,link:a(_r),listItem:a(vr),listItemValue:v,listOrdered:a(sr,p),listUnordered:a(sr),paragraph:a(Ti),reference:N,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ir),strong:a(Ri),thematicBreak:a(Ai)},exit:{atxHeading:d(),atxHeadingSequence:H,autolink:d(),autolinkEmail:He,autolinkProtocol:Le,blockQuote:d(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:_e,characterReference:Ue,codeFenced:d(k),codeFencedFence:x,codeFencedFenceInfo:y,codeFencedFenceMeta:b,codeFlowValue:R,codeIndented:d(E),codeText:d(z),codeTextData:R,data:R,definition:d(),definitionDestinationString:A,definitionLabelString:O,definitionTitleString:L,emphasis:d(),hardBreakEscape:d($),hardBreakTrailing:d($),htmlFlow:d(K),htmlFlowData:R,htmlText:d(q),htmlTextData:R,image:d(oe),label:te,labelText:F,lineEnding:Y,link:d(Z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ye,resourceDestinationString:C,resourceTitleString:I,resource:G,setextHeading:d(W),setextHeadingLineSequence:se,setextHeadingText:D,strong:d(),thematicBreak:d()}};Dv(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(X){let he={type:"root",children:[]};const Oe={stack:[he],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:g,data:n},je=[];let Xe=-1;for(;++Xe<X.length;)if(X[Xe][1].type==="listOrdered"||X[Xe][1].type==="listUnordered")if(X[Xe][0]==="enter")je.push(Xe);else{const zt=je.pop();Xe=o(X,zt,Xe)}for(Xe=-1;++Xe<X.length;){const zt=t[X[Xe][0]];Ov.call(zt,X[Xe][1].type)&&zt[X[Xe][1].type].call(Object.assign({sliceSerialize:X[Xe][2].sliceSerialize},Oe),X[Xe][1])}if(Oe.tokenStack.length>0){const zt=Oe.tokenStack[Oe.tokenStack.length-1];(zt[1]||fg).call(Oe,void 0,zt[0])}for(he.position={start:bi(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:bi(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)he=t.transforms[Xe](he)||he;return he}function o(X,he,Oe){let je=he-1,Xe=-1,zt=!1,or,kn,ar,Pr;for(;++je<=Oe;){const Ut=X[je];switch(Ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ut[0]==="enter"?Xe++:Xe--,Pr=void 0;break}case"lineEndingBlank":{Ut[0]==="enter"&&(or&&!Pr&&!Xe&&!ar&&(ar=je),Pr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pr=void 0}if(!Xe&&Ut[0]==="enter"&&Ut[1].type==="listItemPrefix"||Xe===-1&&Ut[0]==="exit"&&(Ut[1].type==="listUnordered"||Ut[1].type==="listOrdered")){if(or){let qn=je;for(kn=void 0;qn--;){const nn=X[qn];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;kn&&(X[kn][1].type="lineEndingBlank",zt=!0),nn[1].type="lineEnding",kn=qn}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}ar&&(!kn||ar<kn)&&(or._spread=!0),or.end=Object.assign({},kn?X[kn][1].start:Ut[1].end),X.splice(kn||je,0,["exit",or,Ut[2]]),je++,Oe++}if(Ut[1].type==="listItemPrefix"){const qn={type:"listItem",_spread:!1,start:Object.assign({},Ut[1].start),end:void 0};or=qn,X.splice(je,0,["enter",qn,Ut[2]]),je++,Oe++,ar=void 0,Pr=!0}}}return X[he][1]._spread=zt,Oe}function a(X,he){return Oe;function Oe(je){u.call(this,X(je),je),he&&he.call(this,je)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(X,he,Oe){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([he,Oe||void 0]),X.position={start:bi(he.start),end:void 0}}function d(X){return he;function he(Oe){X&&X.call(this,Oe),h.call(this,Oe)}}function h(X,he){const Oe=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==X.type&&(he?he.call(this,X,je[0]):(je[1]||fg).call(this,X,je[0]));else throw new Error("Cannot close `"+X.type+"` ("+Qo({start:X.start,end:X.end})+"): it’s not open");Oe.position.end=bi(X.end)}function g(){return qd(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(X){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function y(){const X=this.resume(),he=this.stack[this.stack.length-1];he.lang=X}function b(){const X=this.resume(),he=this.stack[this.stack.length-1];he.meta=X}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X.replace(/(\r?\n|\r)$/g,"")}function O(X){const he=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=he,Oe.identifier=gr(this.sliceSerialize(X)).toLowerCase()}function L(){const X=this.resume(),he=this.stack[this.stack.length-1];he.title=X}function A(){const X=this.resume(),he=this.stack[this.stack.length-1];he.url=X}function H(X){const he=this.stack[this.stack.length-1];if(!he.depth){const Oe=this.sliceSerialize(X).length;he.depth=Oe}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function se(X){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(X){const Oe=this.stack[this.stack.length-1].children;let je=Oe[Oe.length-1];(!je||je.type!=="text")&&(je=Kn(),je.position={start:bi(X.start),end:void 0},Oe.push(je)),this.stack.push(je)}function R(X){const he=this.stack.pop();he.value+=this.sliceSerialize(X),he.position.end=bi(X.end)}function Y(X){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=he.children[he.children.length-1];Oe.position.end=bi(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(ee.call(this,X),R.call(this,X))}function $(){this.data.atHardBreak=!0}function K(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X}function q(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X}function z(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X}function Z(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=he,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function oe(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=he,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function F(X){const he=this.sliceSerialize(X),Oe=this.stack[this.stack.length-2];Oe.label=yx(he),Oe.identifier=gr(he).toLowerCase()}function te(){const X=this.stack[this.stack.length-1],he=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const je=X.children;Oe.children=je}else Oe.alt=he}function C(){const X=this.resume(),he=this.stack[this.stack.length-1];he.url=X}function I(){const X=this.resume(),he=this.stack[this.stack.length-1];he.title=X}function G(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ye(X){const he=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=he,Oe.identifier=gr(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function Ne(X){this.data.characterReferenceType=X.type}function _e(X){const he=this.sliceSerialize(X),Oe=this.data.characterReferenceType;let je;Oe?(je=wv(he,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Vd(he);const Xe=this.stack[this.stack.length-1];Xe.value+=je}function Ue(X){const he=this.stack.pop();he.position.end=bi(X.end)}function Le(X){R.call(this,X);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(X)}function He(X){R.call(this,X);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(X)}function nt(){return{type:"blockquote",children:[]}}function Ft(){return{type:"code",lang:null,meta:null,value:""}}function tn(){return{type:"inlineCode",value:""}}function $e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ln(){return{type:"emphasis",children:[]}}function Ir(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function In(){return{type:"html",value:""}}function Wn(){return{type:"image",title:null,url:"",alt:null}}function _r(){return{type:"link",title:null,url:"",children:[]}}function sr(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function vr(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function Ti(){return{type:"paragraph",children:[]}}function Ri(){return{type:"strong",children:[]}}function Kn(){return{type:"text",value:""}}function Ai(){return{type:"thematicBreak"}}}function bi(e){return{line:e.line,column:e.column,offset:e.offset}}function Dv(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Dv(e,i):xx(e,i)}}function xx(e,t){let n;for(n in t)if(Ov.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function fg(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is still open")}function kx(e){const t=this;t.parser=n;function n(i){return Sx(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ex(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 Cx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
44
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,i.push(l)}return i.join("")}function mx(e){const i={constructs:Sv([hx,...(e||{}).extensions||[]]),content:o(A0),defined:[],document:o(O0),flow:o(X1),lazy:{},string:o(J1),text:o(ex)};return i;function o(a){return l;function l(u){return dx(i,a,u)}}}function gx(e){for(;!Cv(e););return e}const dg=/[\0\t\n\r]/g;function _x(){let e=1,t="",n=!0,i;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(dg.lastIndex=p,h=dg.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&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=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:i=!0,e=1}p=v+1}return u&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const vx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yx(e){return e.replace(vx,bx)}function bx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return wv(n.slice(a?2:1),a?16:10)}return Vd(n)||e}const Ov={}.hasOwnProperty;function Sx(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),wx(n)(gx(mx(n).document().write(_x()(e,t,!0))))}function wx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(_r),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:a(Ir),blockQuote:a(nt),characterEscape:ee,characterReference:ee,codeFenced:a(Ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ft,l),codeText:a(tn,l),codeTextData:ee,data:ee,codeFlowValue:ee,definition:a($e),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Ln),hardBreakEscape:a(Qe),hardBreakTrailing:a(Qe),htmlFlow:a(In,l),htmlFlowData:ee,htmlText:a(In,l),htmlTextData:ee,image:a(Wn),label:l,link:a(_r),listItem:a(vr),listItemValue:v,listOrdered:a(sr,p),listUnordered:a(sr),paragraph:a(Ti),reference:N,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ir),strong:a(Ri),thematicBreak:a(Ai)},exit:{atxHeading:d(),atxHeadingSequence:H,autolink:d(),autolinkEmail:He,autolinkProtocol:Le,blockQuote:d(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:_e,characterReference:Ue,codeFenced:d(k),codeFencedFence:x,codeFencedFenceInfo:y,codeFencedFenceMeta:b,codeFlowValue:R,codeIndented:d(C),codeText:d(z),codeTextData:R,data:R,definition:d(),definitionDestinationString:A,definitionLabelString:O,definitionTitleString:L,emphasis:d(),hardBreakEscape:d($),hardBreakTrailing:d($),htmlFlow:d(K),htmlFlowData:R,htmlText:d(q),htmlTextData:R,image:d(oe),label:te,labelText:F,lineEnding:Y,link:d(Z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ye,resourceDestinationString:E,resourceTitleString:I,resource:G,setextHeading:d(W),setextHeadingLineSequence:se,setextHeadingText:D,strong:d(),thematicBreak:d()}};Dv(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(X){let he={type:"root",children:[]};const Oe={stack:[he],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:g,data:n},je=[];let Xe=-1;for(;++Xe<X.length;)if(X[Xe][1].type==="listOrdered"||X[Xe][1].type==="listUnordered")if(X[Xe][0]==="enter")je.push(Xe);else{const zt=je.pop();Xe=o(X,zt,Xe)}for(Xe=-1;++Xe<X.length;){const zt=t[X[Xe][0]];Ov.call(zt,X[Xe][1].type)&&zt[X[Xe][1].type].call(Object.assign({sliceSerialize:X[Xe][2].sliceSerialize},Oe),X[Xe][1])}if(Oe.tokenStack.length>0){const zt=Oe.tokenStack[Oe.tokenStack.length-1];(zt[1]||fg).call(Oe,void 0,zt[0])}for(he.position={start:bi(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:bi(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)he=t.transforms[Xe](he)||he;return he}function o(X,he,Oe){let je=he-1,Xe=-1,zt=!1,or,kn,ar,Pr;for(;++je<=Oe;){const Ut=X[je];switch(Ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ut[0]==="enter"?Xe++:Xe--,Pr=void 0;break}case"lineEndingBlank":{Ut[0]==="enter"&&(or&&!Pr&&!Xe&&!ar&&(ar=je),Pr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pr=void 0}if(!Xe&&Ut[0]==="enter"&&Ut[1].type==="listItemPrefix"||Xe===-1&&Ut[0]==="exit"&&(Ut[1].type==="listUnordered"||Ut[1].type==="listOrdered")){if(or){let qn=je;for(kn=void 0;qn--;){const nn=X[qn];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;kn&&(X[kn][1].type="lineEndingBlank",zt=!0),nn[1].type="lineEnding",kn=qn}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}ar&&(!kn||ar<kn)&&(or._spread=!0),or.end=Object.assign({},kn?X[kn][1].start:Ut[1].end),X.splice(kn||je,0,["exit",or,Ut[2]]),je++,Oe++}if(Ut[1].type==="listItemPrefix"){const qn={type:"listItem",_spread:!1,start:Object.assign({},Ut[1].start),end:void 0};or=qn,X.splice(je,0,["enter",qn,Ut[2]]),je++,Oe++,ar=void 0,Pr=!0}}}return X[he][1]._spread=zt,Oe}function a(X,he){return Oe;function Oe(je){u.call(this,X(je),je),he&&he.call(this,je)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(X,he,Oe){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([he,Oe||void 0]),X.position={start:bi(he.start),end:void 0}}function d(X){return he;function he(Oe){X&&X.call(this,Oe),h.call(this,Oe)}}function h(X,he){const Oe=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==X.type&&(he?he.call(this,X,je[0]):(je[1]||fg).call(this,X,je[0]));else throw new Error("Cannot close `"+X.type+"` ("+Qo({start:X.start,end:X.end})+"): it’s not open");Oe.position.end=bi(X.end)}function g(){return qd(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(X){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function y(){const X=this.resume(),he=this.stack[this.stack.length-1];he.lang=X}function b(){const X=this.resume(),he=this.stack[this.stack.length-1];he.meta=X}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X.replace(/(\r?\n|\r)$/g,"")}function O(X){const he=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=he,Oe.identifier=gr(this.sliceSerialize(X)).toLowerCase()}function L(){const X=this.resume(),he=this.stack[this.stack.length-1];he.title=X}function A(){const X=this.resume(),he=this.stack[this.stack.length-1];he.url=X}function H(X){const he=this.stack[this.stack.length-1];if(!he.depth){const Oe=this.sliceSerialize(X).length;he.depth=Oe}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function se(X){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(X){const Oe=this.stack[this.stack.length-1].children;let je=Oe[Oe.length-1];(!je||je.type!=="text")&&(je=Kn(),je.position={start:bi(X.start),end:void 0},Oe.push(je)),this.stack.push(je)}function R(X){const he=this.stack.pop();he.value+=this.sliceSerialize(X),he.position.end=bi(X.end)}function Y(X){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=he.children[he.children.length-1];Oe.position.end=bi(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(ee.call(this,X),R.call(this,X))}function $(){this.data.atHardBreak=!0}function K(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X}function q(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X}function z(){const X=this.resume(),he=this.stack[this.stack.length-1];he.value=X}function Z(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=he,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function oe(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=he,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function F(X){const he=this.sliceSerialize(X),Oe=this.stack[this.stack.length-2];Oe.label=yx(he),Oe.identifier=gr(he).toLowerCase()}function te(){const X=this.stack[this.stack.length-1],he=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const je=X.children;Oe.children=je}else Oe.alt=he}function E(){const X=this.resume(),he=this.stack[this.stack.length-1];he.url=X}function I(){const X=this.resume(),he=this.stack[this.stack.length-1];he.title=X}function G(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ye(X){const he=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=he,Oe.identifier=gr(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function Ne(X){this.data.characterReferenceType=X.type}function _e(X){const he=this.sliceSerialize(X),Oe=this.data.characterReferenceType;let je;Oe?(je=wv(he,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Vd(he);const Xe=this.stack[this.stack.length-1];Xe.value+=je}function Ue(X){const he=this.stack.pop();he.position.end=bi(X.end)}function Le(X){R.call(this,X);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(X)}function He(X){R.call(this,X);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(X)}function nt(){return{type:"blockquote",children:[]}}function Ft(){return{type:"code",lang:null,meta:null,value:""}}function tn(){return{type:"inlineCode",value:""}}function $e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ln(){return{type:"emphasis",children:[]}}function Ir(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function In(){return{type:"html",value:""}}function Wn(){return{type:"image",title:null,url:"",alt:null}}function _r(){return{type:"link",title:null,url:"",children:[]}}function sr(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function vr(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function Ti(){return{type:"paragraph",children:[]}}function Ri(){return{type:"strong",children:[]}}function Kn(){return{type:"text",value:""}}function Ai(){return{type:"thematicBreak"}}}function bi(e){return{line:e.line,column:e.column,offset:e.offset}}function Dv(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Dv(e,i):xx(e,i)}}function xx(e,t){let n;for(n in t)if(Ov.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function fg(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is still open")}function kx(e){const t=this;t.parser=n;function n(i){return Sx(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ex(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 Cx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
45
45
|
`}]}function Nx(e,t){const n=t.value?t.value+`
|
|
46
46
|
`:"",i={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:i,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 Tx(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rx(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ax(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=Gs(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let l,u=e.footnoteCounts.get(i);u===void 0?(u=0,e.footnoteOrder.push(i),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(i,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 Mx(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 Ox(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Lv(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];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+=i:o.push({type:"text",value:i}),o}function Dx(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Lv(e,t);const o={src:Gs(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function Lx(e,t){const n={src:Gs(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 i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function Ix(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function Px(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Lv(e,t);const o={href:Gs(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Bx(e,t){const n={href:Gs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Fx(e,t,n){const i=e.all(t),o=n?zx(n):Iv(t),a={},l=[];if(typeof t.checked=="boolean"){const g=i[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},i.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<i.length;){const g=i[u];(o||u!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
47
47
|
`}),g.type==="element"&&g.tagName==="p"&&!o?l.push(...g.children):l.push(g)}const d=i[i.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
48
|
-
`});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function zx(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=Iv(n[i])}return t}function Iv(e){const t=e.spread;return t??e.children.length>1}function Ux(e,t){const n={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<i.length;){const l=i[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(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Hx(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $x(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jx(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wx(e,t){const n=e.all(t),i=n.shift(),o=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!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=$d(t.children[1]),d=pv(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 Kx(e,t,n){const i=n?n.children:void 0,a=(i?i.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 b={type:"element",tagName:a,properties:v,children:[]};p&&(b.children=e.all(p),e.patch(p,b),b=e.applyData(p,b)),h.push(b)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function qx(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const pg=9,mg=32;function Vx(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const a=[];for(;i;)a.push(gg(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return a.push(gg(t.slice(o),o>0,!1)),a.join("")}function gg(e,t,n){let i=0,o=e.length;if(t){let a=e.codePointAt(i);for(;a===pg||a===mg;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(o-1);for(;a===pg||a===mg;)o--,a=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function Gx(e,t){const n={type:"text",value:Vx(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yx(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Xx={blockquote:Ex,break:Cx,code:Nx,delete:Tx,emphasis:Rx,footnoteReference:Ax,heading:Mx,html:Ox,imageReference:Dx,image:Lx,inlineCode:Ix,linkReference:Px,link:Bx,listItem:Fx,list:Ux,paragraph:Hx,root:$x,strong:jx,table:Wx,tableCell:qx,tableRow:Kx,text:Gx,thematicBreak:Yx,toml:xl,yaml:xl,definition:xl,footnoteDefinition:xl};function xl(){}const Pv=-1,uc=0,ea=1,Gl=2,Yd=3,Xd=4,Zd=5,Qd=6,Bv=7,Fv=8,zv=typeof self=="object"?self:globalThis,_g=(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 zv[e](t)},Zx=(e,t)=>{const n=(o,a)=>(e.set(a,o),o),i=o=>{if(e.has(o))return e.get(o);const[a,l]=t[o];switch(a){case uc:case Pv:return n(l,o);case ea:{const u=n([],o);for(const d of l)u.push(i(d));return u}case Gl:{const u=n({},o);for(const[d,h]of l)u[i(d)]=i(h);return u}case Yd:return n(new Date(l),o);case Xd:{const{source:u,flags:d}=l;return n(new RegExp(u,d),o)}case Zd:{const u=n(new Map,o);for(const[d,h]of l)u.set(i(d),i(h));return u}case Qd:{const u=n(new Set,o);for(const d of l)u.add(i(d));return u}case Bv:{const{name:u,message:d}=l;return n(typeof zv[u]=="function"?_g(u,d):new Error(d),o)}case Fv: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(_g(a,l),o)};return i},vg=e=>Zx(new Map,e)(0),Zi="",{toString:Qx}={},{keys:Jx}=Object,Bo=e=>{const t=typeof e;if(t!=="object"||!e)return[uc,t];const n=Qx.call(e).slice(8,-1);switch(n){case"Array":return[ea,Zi];case"Object":return[Gl,Zi];case"Date":return[Yd,Zi];case"RegExp":return[Xd,Zi];case"Map":return[Zd,Zi];case"Set":return[Qd,Zi];case"DataView":return[ea,n]}return n.includes("Array")?[ea,n]:e instanceof Error?[Bv,e.name||"Error"]:[Gl,n]},kl=([e,t])=>e===uc&&(t==="function"||t==="symbol"),ek=(e,t,n,i)=>{const o=(l,u)=>{const d=i.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=Bo(l);switch(u){case uc:{let g=l;switch(d){case"bigint":u=Fv,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return o([Pv],l)}return o([u,g],l)}case ea:{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 Gl:{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 Jx(l))(e||!kl(Bo(l[v])))&&g.push([a(v),a(l[v])]);return p}case Yd:return o([u,isNaN(l.getTime())?Zi:l.toISOString()],l);case Xd:{const{source:g,flags:p}=l;return o([u,{source:g,flags:p}],l)}case Zd:{const g=[],p=o([u,g],l);for(const[v,y]of l)(e||!(kl(Bo(v))||kl(Bo(y))))&&g.push([a(v),a(y)]);return p}case Qd:{const g=[],p=o([u,g],l);for(const v of l)(e||!kl(Bo(v)))&&g.push(a(v));return p}}const{message:h}=l;return o([u,{name:d,message:h}],l)};return a},yg=(e,{json:t,lossy:n}={})=>{const i=[];return ek(!(t||n),!!t,new Map,i)(e),i},Yl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?vg(yg(e,t)):structuredClone(e):(e,t)=>vg(yg(e,t));function tk(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 nk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rk(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tk,i=e.options.footnoteBackLabel||nk,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=Gs(p.toLowerCase());let y=0;const b=[],x=e.footnoteCounts.get(p);for(;x!==void 0&&++y<=x;){b.length>0&&b.push({type:"text",value:" "});let O=typeof n=="string"?n:n(d,y);typeof O=="string"&&(O={type:"text",value:O}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,y),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const k=g[g.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const O=k.children[k.children.length-1];O&&O.type==="text"?O.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else g.push(...b);const
|
|
48
|
+
`});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function zx(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=Iv(n[i])}return t}function Iv(e){const t=e.spread;return t??e.children.length>1}function Ux(e,t){const n={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<i.length;){const l=i[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(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Hx(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $x(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jx(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wx(e,t){const n=e.all(t),i=n.shift(),o=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!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=$d(t.children[1]),d=pv(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 Kx(e,t,n){const i=n?n.children:void 0,a=(i?i.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 b={type:"element",tagName:a,properties:v,children:[]};p&&(b.children=e.all(p),e.patch(p,b),b=e.applyData(p,b)),h.push(b)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function qx(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const pg=9,mg=32;function Vx(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const a=[];for(;i;)a.push(gg(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return a.push(gg(t.slice(o),o>0,!1)),a.join("")}function gg(e,t,n){let i=0,o=e.length;if(t){let a=e.codePointAt(i);for(;a===pg||a===mg;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(o-1);for(;a===pg||a===mg;)o--,a=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function Gx(e,t){const n={type:"text",value:Vx(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yx(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Xx={blockquote:Ex,break:Cx,code:Nx,delete:Tx,emphasis:Rx,footnoteReference:Ax,heading:Mx,html:Ox,imageReference:Dx,image:Lx,inlineCode:Ix,linkReference:Px,link:Bx,listItem:Fx,list:Ux,paragraph:Hx,root:$x,strong:jx,table:Wx,tableCell:qx,tableRow:Kx,text:Gx,thematicBreak:Yx,toml:xl,yaml:xl,definition:xl,footnoteDefinition:xl};function xl(){}const Pv=-1,uc=0,ea=1,Gl=2,Yd=3,Xd=4,Zd=5,Qd=6,Bv=7,Fv=8,zv=typeof self=="object"?self:globalThis,_g=(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 zv[e](t)},Zx=(e,t)=>{const n=(o,a)=>(e.set(a,o),o),i=o=>{if(e.has(o))return e.get(o);const[a,l]=t[o];switch(a){case uc:case Pv:return n(l,o);case ea:{const u=n([],o);for(const d of l)u.push(i(d));return u}case Gl:{const u=n({},o);for(const[d,h]of l)u[i(d)]=i(h);return u}case Yd:return n(new Date(l),o);case Xd:{const{source:u,flags:d}=l;return n(new RegExp(u,d),o)}case Zd:{const u=n(new Map,o);for(const[d,h]of l)u.set(i(d),i(h));return u}case Qd:{const u=n(new Set,o);for(const d of l)u.add(i(d));return u}case Bv:{const{name:u,message:d}=l;return n(typeof zv[u]=="function"?_g(u,d):new Error(d),o)}case Fv: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(_g(a,l),o)};return i},vg=e=>Zx(new Map,e)(0),Zi="",{toString:Qx}={},{keys:Jx}=Object,Bo=e=>{const t=typeof e;if(t!=="object"||!e)return[uc,t];const n=Qx.call(e).slice(8,-1);switch(n){case"Array":return[ea,Zi];case"Object":return[Gl,Zi];case"Date":return[Yd,Zi];case"RegExp":return[Xd,Zi];case"Map":return[Zd,Zi];case"Set":return[Qd,Zi];case"DataView":return[ea,n]}return n.includes("Array")?[ea,n]:e instanceof Error?[Bv,e.name||"Error"]:[Gl,n]},kl=([e,t])=>e===uc&&(t==="function"||t==="symbol"),ek=(e,t,n,i)=>{const o=(l,u)=>{const d=i.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=Bo(l);switch(u){case uc:{let g=l;switch(d){case"bigint":u=Fv,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return o([Pv],l)}return o([u,g],l)}case ea:{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 Gl:{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 Jx(l))(e||!kl(Bo(l[v])))&&g.push([a(v),a(l[v])]);return p}case Yd:return o([u,isNaN(l.getTime())?Zi:l.toISOString()],l);case Xd:{const{source:g,flags:p}=l;return o([u,{source:g,flags:p}],l)}case Zd:{const g=[],p=o([u,g],l);for(const[v,y]of l)(e||!(kl(Bo(v))||kl(Bo(y))))&&g.push([a(v),a(y)]);return p}case Qd:{const g=[],p=o([u,g],l);for(const v of l)(e||!kl(Bo(v)))&&g.push(a(v));return p}}const{message:h}=l;return o([u,{name:d,message:h}],l)};return a},yg=(e,{json:t,lossy:n}={})=>{const i=[];return ek(!(t||n),!!t,new Map,i)(e),i},Yl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?vg(yg(e,t)):structuredClone(e):(e,t)=>vg(yg(e,t));function tk(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 nk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rk(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tk,i=e.options.footnoteBackLabel||nk,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=Gs(p.toLowerCase());let y=0;const b=[],x=e.footnoteCounts.get(p);for(;x!==void 0&&++y<=x;){b.length>0&&b.push({type:"text",value:" "});let O=typeof n=="string"?n:n(d,y);typeof O=="string"&&(O={type:"text",value:O}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,y),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const k=g[g.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const O=k.children[k.children.length-1];O&&O.type==="text"?O.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else g.push(...b);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(h,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Yl(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
49
49
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
50
|
-
`}]}}const ca=(function(e){if(e==null)return ak;if(typeof e=="function")return hc(e);if(typeof e=="object")return Array.isArray(e)?ik(e):sk(e);if(typeof e=="string")return ok(e);throw new Error("Expected function, string, or object as test")});function ik(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ca(e[n]);return hc(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function sk(e){const t=e;return hc(n);function n(i){const o=i;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function ok(e){return hc(t);function t(n){return n&&n.type===e}}function hc(e){return t;function t(n,i,o){return!!(lk(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function ak(){return!0}function lk(e){return e!==null&&typeof e=="object"&&"type"in e}const Uv=[],ck=!0,Kh=!1,uk="skip";function Hv(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const a=ca(o),l=i?-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=Uv,b,x,k;if((!t||a(d,h,g[g.length-1]||void 0))&&(y=hk(n(d,g)),y[0]===Kh))return y;if("children"in d&&d.children){const
|
|
50
|
+
`}]}}const ca=(function(e){if(e==null)return ak;if(typeof e=="function")return hc(e);if(typeof e=="object")return Array.isArray(e)?ik(e):sk(e);if(typeof e=="string")return ok(e);throw new Error("Expected function, string, or object as test")});function ik(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ca(e[n]);return hc(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function sk(e){const t=e;return hc(n);function n(i){const o=i;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function ok(e){return hc(t);function t(n){return n&&n.type===e}}function hc(e){return t;function t(n,i,o){return!!(lk(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function ak(){return!0}function lk(e){return e!==null&&typeof e=="object"&&"type"in e}const Uv=[],ck=!0,Kh=!1,uk="skip";function Hv(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const a=ca(o),l=i?-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=Uv,b,x,k;if((!t||a(d,h,g[g.length-1]||void 0))&&(y=hk(n(d,g)),y[0]===Kh))return y;if("children"in d&&d.children){const C=d;if(C.children&&y[0]!==uk)for(x=(i?C.children.length:-1)+l,k=g.concat(C);x>-1&&x<C.children.length;){const O=C.children[x];if(b=u(O,x,k)(),b[0]===Kh)return b;x=typeof b[1]=="number"?b[1]:x+l}}return y}}}function hk(e){return Array.isArray(e)?e:typeof e=="number"?[ck,e]:e==null?Uv:[e]}function dc(e,t,n,i){let o,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,o=n):(a=t,l=n,o=i),Hv(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 qh={}.hasOwnProperty,dk={};function fk(e,t){const n=t||dk,i=new Map,o=new Map,a=new Map,l={...Xx,...n.handlers},u={all:h,applyData:mk,definitionById:i,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:pk,wrap:_k};return dc(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?i: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(qh.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:x,...k}=g,C=Yl(k);return C.children=u.all(g),C}return Yl(g)}return(u.options.unknownHandler||gk)(u,g,p)}function h(g){const p=[];if("children"in g){const v=g.children;let y=-1;for(;++y<v.length;){const b=u.one(v[y],g);if(b){if(y&&v[y-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=bg(b.value)),!Array.isArray(b)&&b.type==="element")){const x=b.children[0];x&&x.type==="text"&&(x.value=bg(x.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function pk(e,t){e.position&&(t.position=n0(e))}function mk(e,t){let n=t;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Yl(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function gk(e,t){const n=t.data||{},i="value"in t&&!(qh.call(n,"hProperties")||qh.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function _k(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
51
51
|
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
52
52
|
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
53
53
|
`}),n}function bg(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Sg(e,t){const n=fk(e,t),i=n.one(e,void 0),o=rk(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
54
|
-
`},o),a}function vk(e,t){return e&&"run"in e?async function(n,i){const o=Sg(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Sg(n,{file:i,...e||t})}}function wg(e){if(e)throw e}var ch,xg;function yk(){if(xg)return ch;xg=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=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(i)return i(h,g).value}else return;return h[g]};return ch=function d(){var h,g,p,v,y,b,x=arguments[0],k=1,E=arguments.length,O=!1;for(typeof x=="boolean"&&(O=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k<E;++k)if(h=arguments[k],h!=null)for(g in h)p=u(x,g),v=u(h,g),x!==v&&(O&&v&&(a(v)||(y=o(v)))?(y?(y=!1,b=p&&o(p)?p:[]):b=p&&a(p)?p:{},l(x,{name:g,newValue:d(O,b,v)})):typeof v<"u"&&l(x,{name:g,newValue:v}));return x},ch}var bk=yk();const uh=sc(bk);function Vh(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 Sk(){const e=[],t={run:n,use:i};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?wk(g,u)(...h):l(null,...h)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function wk(e,t){let n;return i;function i(...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 Ar={basename:xk,dirname:kk,extname:Ek,join:Ck,sep:"/"};function xk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ua(e);let n=0,i=-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 i<0&&(a=!0,i=o+1);return i<0?"":e.slice(n,i)}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&&(i=o):(u=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function kk(e){if(ua(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Ek(e){ua(e);let t=e.length,n=-1,i=0,o=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){i=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===i+1?"":e.slice(o,n)}function Ck(...e){let t=-1,n;for(;++t<e.length;)ua(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Nk(n)}function Nk(e){ua(e);const t=e.codePointAt(0)===47;let n=Tk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Tk(e,t){let n="",i=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||i!==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="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",i=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),i=l-o-1;o=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function ua(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Rk={cwd:Ak};function Ak(){return"/"}function Gh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Mk(e){if(typeof e=="string")e=new URL(e);else if(!Gh(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 Ok(e)}function Ok(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===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 hh=["history","path","basename","stem","extname","dirname"];class $v{constructor(t){let n;t?Gh(t)?n={path:t}:typeof t=="string"||Dk(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Rk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<hh.length;){const a=hh[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)hh.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Ar.basename(this.path):void 0}set basename(t){fh(t,"basename"),dh(t,"basename"),this.path=Ar.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ar.dirname(this.path):void 0}set dirname(t){kg(this.basename,"dirname"),this.path=Ar.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ar.extname(this.path):void 0}set extname(t){if(dh(t,"extname"),kg(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=Ar.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Gh(t)&&(t=Mk(t)),fh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ar.basename(this.path,this.extname):void 0}set stem(t){fh(t,"stem"),dh(t,"stem"),this.path=Ar.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const o=this.message(t,n,i);throw o.fatal=!0,o}info(t,n,i){const o=this.message(t,n,i);return o.fatal=void 0,o}message(t,n,i){const o=new pn(t,n,i);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 dh(e,t){if(e&&e.includes(Ar.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ar.sep+"`")}function fh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kg(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Dk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Lk=(function(e){const i=this.constructor.prototype,o=i[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),Ik={}.hasOwnProperty;class Jd extends Lk{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=Sk()}copy(){const t=new Jd;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(uh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(gh("data",this.frozen),this.namespace[t]=n,this):Ik.call(this.namespace,t)&&this.namespace[t]||void 0:t?(gh("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,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=n.call(t,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=El(t),i=this.parser||this.Parser;return ph("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),ph("process",this.parser||this.Parser),mh("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const u=El(t),d=i.parse(u);i.run(d,u,function(g,p,v){if(g||!p||!v)return h(g);const y=p,b=i.stringify(y,v);Fk(b)?v.value=b:v.result=b,h(g,v)});function h(g,p){g||!p?l(g):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),ph("processSync",this.parser||this.Parser),mh("processSync",this.compiler||this.Compiler),this.process(t,o),Cg("processSync","process",n),i;function o(a,l){n=!0,wg(a),i=l}}run(t,n,i){Eg(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(l,u){const d=El(n);o.run(t,d,h);function h(g,p,v){const y=p||t;g?u(g):l?l(y):i(void 0,y,v)}}}runSync(t,n){let i=!1,o;return this.run(t,n,a),Cg("runSync","run",i),o;function a(l,u){wg(l),o=u,i=!0}}stringify(t,n){this.freeze();const i=El(n),o=this.compiler||this.Compiler;return mh("stringify",o),Eg(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(gh("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=uh(!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<i.length;)if(i[p][0]===h){v=p;break}if(v===-1)i.push([h,...g]);else if(g.length>0){let[y,...b]=g;const x=i[v][1];Vh(x)&&Vh(y)&&(y=uh(!0,x,y)),i[v]=[h,y,...b]}}}}const Pk=new Jd().freeze();function ph(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gh(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 Eg(e){if(!Vh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Cg(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function El(e){return Bk(e)?e:new $v(e)}function Bk(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fk(e){return typeof e=="string"||zk(e)}function zk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Uk="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ng=[],Tg={allowDangerousHtml:!0},Hk=/^(https?|ircs?|mailto|xmpp)$/i,$k=[{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 jk(e){const t=Wk(e),n=Kk(e);return qk(t.runSync(t.parse(n),n),e)}function Wk(e){const t=e.rehypePlugins||Ng,n=e.remarkPlugins||Ng,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Tg}:Tg;return Pk().use(kx).use(n).use(vk,i).use(t)}function Kk(e){const t=e.children||"",n=new $v;return typeof t=="string"&&(n.value=t),n}function qk(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Vk;for(const g of $k)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+Uk+g.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),dc(e,h),a0(e,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.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 oh)if(Object.hasOwn(oh,y)&&Object.hasOwn(g.properties,y)){const b=g.properties[y],x=oh[y];(x===null||x.includes(g.tagName))&&(g.properties[y]=d(String(b||""),y,g))}}if(g.type==="element"){let y=n?!n.includes(g.tagName):a?a.includes(g.tagName):!1;if(!y&&i&&typeof p=="number"&&(y=!i(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 Vk(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||i!==-1&&t>i||Hk.test(e.slice(0,t))?e:""}function Rg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=n.indexOf(t);for(;o!==-1;)i++,o=n.indexOf(t,o+t.length);return i}function Gk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yk(e,t,n){const o=ca((n||{}).ignore||[]),a=Xk(t);let l=-1;for(;++l<a.length;)Hv(e,"text",u);function u(h,g){let p=-1,v;for(;++p<g.length;){const y=g[p],b=v?v.children:void 0;if(o(y,b?b.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 b=0;const k=p.children.indexOf(h);let E=!1,O=[];v.lastIndex=0;let L=v.exec(h.value);for(;L;){const A=L.index,H={index:L.index,input:L.input,stack:[...g,h]};let D=y(...L,H);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=A+1:(b!==A&&O.push({type:"text",value:h.value.slice(b,A)}),Array.isArray(D)?O.push(...D):D&&O.push(D),b=A+L[0].length,E=!0),!v.global)break;L=v.exec(h.value)}return E?(b<h.value.length&&O.push({type:"text",value:h.value.slice(b)}),p.children.splice(k,1,...O)):O=[h],k+O.length}}function Xk(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 i=-1;for(;++i<n.length;){const o=n[i];t.push([Zk(o[0]),Qk(o[1])])}return t}function Zk(e){return typeof e=="string"?new RegExp(Gk(e),"g"):e}function Qk(e){return typeof e=="function"?e:function(){return e}}const _h="phrasing",vh=["autolink","link","image","label"];function Jk(){return{transforms:[oE],enter:{literalAutolink:tE,literalAutolinkEmail:yh,literalAutolinkHttp:yh,literalAutolinkWww:yh},exit:{literalAutolink:sE,literalAutolinkEmail:iE,literalAutolinkHttp:nE,literalAutolinkWww:rE}}}function eE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:_h,notInConstruct:vh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:_h,notInConstruct:vh},{character:":",before:"[ps]",after:"\\/",inConstruct:_h,notInConstruct:vh}]}}function tE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function yh(e){this.config.enter.autolinkProtocol.call(this,e)}function nE(e){this.config.exit.autolinkProtocol.call(this,e)}function rE(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 iE(e){this.config.exit.autolinkEmail.call(this,e)}function sE(e){this.exit(e)}function oE(e){Yk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lE]],{ignore:["link","linkReference"]})}function aE(e,t,n,i,o){let a="";if(!jv(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!cE(n)))return!1;const l=uE(n+i);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 lE(e,t,n,i){return!jv(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cE(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 uE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const o=Rg(e,"(");let a=Rg(e,")");for(;i!==-1&&o>a;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[e,n]}function jv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||is(n)||lc(n))&&(!t||n!==47)}Wv.peek=yE;function hE(){this.buffer()}function dE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fE(){this.buffer()}function pE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gE(e){this.exit(e)}function _E(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vE(e){this.exit(e)}function yE(){return"["}function Wv(e,t,n,i){const o=n.createTracker(i);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 bE(){return{enter:{gfmFootnoteCallString:hE,gfmFootnoteCall:dE,gfmFootnoteDefinitionLabelString:fE,gfmFootnoteDefinition:pE},exit:{gfmFootnoteCallString:mE,gfmFootnoteCall:gE,gfmFootnoteDefinitionLabelString:_E,gfmFootnoteDefinition:vE}}}function SE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Wv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,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(i),{before:d,after:"]"})),g(),d+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),d+=u.move((t?`
|
|
55
|
-
`:" ")+a.indentLines(a.containerFlow(i,u.current()),t?Kv:wE))),h(),d}}function wE(e,t,n){return t===0?e:Kv(e,t,n)}function Kv(e,t,n){return(n?"":" ")+e}const xE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qv.peek=TE;function kE(){return{canContainEols:["delete"],enter:{strikethrough:CE},exit:{strikethrough:NE}}}function EE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xE}],handlers:{delete:qv}}}function CE(e){this.enter({type:"delete",children:[]},e)}function NE(e){this.exit(e)}function qv(e,t,n,i){const o=n.createTracker(i),a=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),a(),l}function TE(){return"~"}function RE(e){return e.length}function AE(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||RE,a=[],l=[],u=[],d=[];let h=0,g=-1;for(;++g<e.length;){const x=[],k=[];let
|
|
54
|
+
`},o),a}function vk(e,t){return e&&"run"in e?async function(n,i){const o=Sg(n,{file:i,...t});await e.run(o,i)}:function(n,i){return Sg(n,{file:i,...e||t})}}function wg(e){if(e)throw e}var ch,xg;function yk(){if(xg)return ch;xg=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=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(i)return i(h,g).value}else return;return h[g]};return ch=function d(){var h,g,p,v,y,b,x=arguments[0],k=1,C=arguments.length,O=!1;for(typeof x=="boolean"&&(O=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k<C;++k)if(h=arguments[k],h!=null)for(g in h)p=u(x,g),v=u(h,g),x!==v&&(O&&v&&(a(v)||(y=o(v)))?(y?(y=!1,b=p&&o(p)?p:[]):b=p&&a(p)?p:{},l(x,{name:g,newValue:d(O,b,v)})):typeof v<"u"&&l(x,{name:g,newValue:v}));return x},ch}var bk=yk();const uh=sc(bk);function Vh(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 Sk(){const e=[],t={run:n,use:i};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?wk(g,u)(...h):l(null,...h)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function wk(e,t){let n;return i;function i(...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 Ar={basename:xk,dirname:kk,extname:Ek,join:Ck,sep:"/"};function xk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ua(e);let n=0,i=-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 i<0&&(a=!0,i=o+1);return i<0?"":e.slice(n,i)}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&&(i=o):(u=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function kk(e){if(ua(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Ek(e){ua(e);let t=e.length,n=-1,i=0,o=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){i=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===i+1?"":e.slice(o,n)}function Ck(...e){let t=-1,n;for(;++t<e.length;)ua(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Nk(n)}function Nk(e){ua(e);const t=e.codePointAt(0)===47;let n=Tk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Tk(e,t){let n="",i=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||i!==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="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",i=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),i=l-o-1;o=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function ua(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Rk={cwd:Ak};function Ak(){return"/"}function Gh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Mk(e){if(typeof e=="string")e=new URL(e);else if(!Gh(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 Ok(e)}function Ok(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===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 hh=["history","path","basename","stem","extname","dirname"];class $v{constructor(t){let n;t?Gh(t)?n={path:t}:typeof t=="string"||Dk(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Rk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<hh.length;){const a=hh[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)hh.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Ar.basename(this.path):void 0}set basename(t){fh(t,"basename"),dh(t,"basename"),this.path=Ar.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ar.dirname(this.path):void 0}set dirname(t){kg(this.basename,"dirname"),this.path=Ar.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ar.extname(this.path):void 0}set extname(t){if(dh(t,"extname"),kg(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=Ar.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Gh(t)&&(t=Mk(t)),fh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ar.basename(this.path,this.extname):void 0}set stem(t){fh(t,"stem"),dh(t,"stem"),this.path=Ar.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const o=this.message(t,n,i);throw o.fatal=!0,o}info(t,n,i){const o=this.message(t,n,i);return o.fatal=void 0,o}message(t,n,i){const o=new pn(t,n,i);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 dh(e,t){if(e&&e.includes(Ar.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ar.sep+"`")}function fh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kg(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Dk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Lk=(function(e){const i=this.constructor.prototype,o=i[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),Ik={}.hasOwnProperty;class Jd extends Lk{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=Sk()}copy(){const t=new Jd;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(uh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(gh("data",this.frozen),this.namespace[t]=n,this):Ik.call(this.namespace,t)&&this.namespace[t]||void 0:t?(gh("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,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=n.call(t,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=El(t),i=this.parser||this.Parser;return ph("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),ph("process",this.parser||this.Parser),mh("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const u=El(t),d=i.parse(u);i.run(d,u,function(g,p,v){if(g||!p||!v)return h(g);const y=p,b=i.stringify(y,v);Fk(b)?v.value=b:v.result=b,h(g,v)});function h(g,p){g||!p?l(g):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),ph("processSync",this.parser||this.Parser),mh("processSync",this.compiler||this.Compiler),this.process(t,o),Cg("processSync","process",n),i;function o(a,l){n=!0,wg(a),i=l}}run(t,n,i){Eg(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(l,u){const d=El(n);o.run(t,d,h);function h(g,p,v){const y=p||t;g?u(g):l?l(y):i(void 0,y,v)}}}runSync(t,n){let i=!1,o;return this.run(t,n,a),Cg("runSync","run",i),o;function a(l,u){wg(l),o=u,i=!0}}stringify(t,n){this.freeze();const i=El(n),o=this.compiler||this.Compiler;return mh("stringify",o),Eg(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(gh("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=uh(!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<i.length;)if(i[p][0]===h){v=p;break}if(v===-1)i.push([h,...g]);else if(g.length>0){let[y,...b]=g;const x=i[v][1];Vh(x)&&Vh(y)&&(y=uh(!0,x,y)),i[v]=[h,y,...b]}}}}const Pk=new Jd().freeze();function ph(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gh(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 Eg(e){if(!Vh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Cg(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function El(e){return Bk(e)?e:new $v(e)}function Bk(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fk(e){return typeof e=="string"||zk(e)}function zk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Uk="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ng=[],Tg={allowDangerousHtml:!0},Hk=/^(https?|ircs?|mailto|xmpp)$/i,$k=[{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 jk(e){const t=Wk(e),n=Kk(e);return qk(t.runSync(t.parse(n),n),e)}function Wk(e){const t=e.rehypePlugins||Ng,n=e.remarkPlugins||Ng,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Tg}:Tg;return Pk().use(kx).use(n).use(vk,i).use(t)}function Kk(e){const t=e.children||"",n=new $v;return typeof t=="string"&&(n.value=t),n}function qk(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Vk;for(const g of $k)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+Uk+g.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),dc(e,h),a0(e,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.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 oh)if(Object.hasOwn(oh,y)&&Object.hasOwn(g.properties,y)){const b=g.properties[y],x=oh[y];(x===null||x.includes(g.tagName))&&(g.properties[y]=d(String(b||""),y,g))}}if(g.type==="element"){let y=n?!n.includes(g.tagName):a?a.includes(g.tagName):!1;if(!y&&i&&typeof p=="number"&&(y=!i(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 Vk(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||i!==-1&&t>i||Hk.test(e.slice(0,t))?e:""}function Rg(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=n.indexOf(t);for(;o!==-1;)i++,o=n.indexOf(t,o+t.length);return i}function Gk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yk(e,t,n){const o=ca((n||{}).ignore||[]),a=Xk(t);let l=-1;for(;++l<a.length;)Hv(e,"text",u);function u(h,g){let p=-1,v;for(;++p<g.length;){const y=g[p],b=v?v.children:void 0;if(o(y,b?b.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 b=0;const k=p.children.indexOf(h);let C=!1,O=[];v.lastIndex=0;let L=v.exec(h.value);for(;L;){const A=L.index,H={index:L.index,input:L.input,stack:[...g,h]};let D=y(...L,H);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=A+1:(b!==A&&O.push({type:"text",value:h.value.slice(b,A)}),Array.isArray(D)?O.push(...D):D&&O.push(D),b=A+L[0].length,C=!0),!v.global)break;L=v.exec(h.value)}return C?(b<h.value.length&&O.push({type:"text",value:h.value.slice(b)}),p.children.splice(k,1,...O)):O=[h],k+O.length}}function Xk(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 i=-1;for(;++i<n.length;){const o=n[i];t.push([Zk(o[0]),Qk(o[1])])}return t}function Zk(e){return typeof e=="string"?new RegExp(Gk(e),"g"):e}function Qk(e){return typeof e=="function"?e:function(){return e}}const _h="phrasing",vh=["autolink","link","image","label"];function Jk(){return{transforms:[oE],enter:{literalAutolink:tE,literalAutolinkEmail:yh,literalAutolinkHttp:yh,literalAutolinkWww:yh},exit:{literalAutolink:sE,literalAutolinkEmail:iE,literalAutolinkHttp:nE,literalAutolinkWww:rE}}}function eE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:_h,notInConstruct:vh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:_h,notInConstruct:vh},{character:":",before:"[ps]",after:"\\/",inConstruct:_h,notInConstruct:vh}]}}function tE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function yh(e){this.config.enter.autolinkProtocol.call(this,e)}function nE(e){this.config.exit.autolinkProtocol.call(this,e)}function rE(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 iE(e){this.config.exit.autolinkEmail.call(this,e)}function sE(e){this.exit(e)}function oE(e){Yk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lE]],{ignore:["link","linkReference"]})}function aE(e,t,n,i,o){let a="";if(!jv(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!cE(n)))return!1;const l=uE(n+i);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 lE(e,t,n,i){return!jv(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cE(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 uE(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const o=Rg(e,"(");let a=Rg(e,")");for(;i!==-1&&o>a;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[e,n]}function jv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||is(n)||lc(n))&&(!t||n!==47)}Wv.peek=yE;function hE(){this.buffer()}function dE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fE(){this.buffer()}function pE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gE(e){this.exit(e)}function _E(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vE(e){this.exit(e)}function yE(){return"["}function Wv(e,t,n,i){const o=n.createTracker(i);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 bE(){return{enter:{gfmFootnoteCallString:hE,gfmFootnoteCall:dE,gfmFootnoteDefinitionLabelString:fE,gfmFootnoteDefinition:pE},exit:{gfmFootnoteCallString:mE,gfmFootnoteCall:gE,gfmFootnoteDefinitionLabelString:_E,gfmFootnoteDefinition:vE}}}function SE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Wv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,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(i),{before:d,after:"]"})),g(),d+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),d+=u.move((t?`
|
|
55
|
+
`:" ")+a.indentLines(a.containerFlow(i,u.current()),t?Kv:wE))),h(),d}}function wE(e,t,n){return t===0?e:Kv(e,t,n)}function Kv(e,t,n){return(n?"":" ")+e}const xE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qv.peek=TE;function kE(){return{canContainEols:["delete"],enter:{strikethrough:CE},exit:{strikethrough:NE}}}function EE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xE}],handlers:{delete:qv}}}function CE(e){this.enter({type:"delete",children:[]},e)}function NE(e){this.exit(e)}function qv(e,t,n,i){const o=n.createTracker(i),a=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),a(),l}function TE(){return"~"}function RE(e){return e.length}function AE(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||RE,a=[],l=[],u=[],d=[];let h=0,g=-1;for(;++g<e.length;){const x=[],k=[];let C=-1;for(e[g].length>h&&(h=e[g].length);++C<e[g].length;){const O=ME(e[g][C]);if(n.alignDelimiters!==!1){const L=o(O);k[C]=L,(d[C]===void 0||L>d[C])&&(d[C]=L)}x.push(O)}l[g]=x,u[g]=k}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<h;)a[p]=Ag(i[p]);else{const x=Ag(i);for(;++p<h;)a[p]=x}p=-1;const v=[],y=[];for(;++p<h;){const x=a[p];let k="",C="";x===99?(k=":",C=":"):x===108?k=":":x===114&&(C=":");let O=n.alignDelimiters===!1?1:Math.max(1,d[p]-k.length-C.length);const L=k+"-".repeat(O)+C;n.alignDelimiters!==!1&&(O=k.length+O+C.length,O>d[p]&&(d[p]=O),y[p]=O),v[p]=L}l.splice(1,0,v),u.splice(1,0,y),g=-1;const b=[];for(;++g<l.length;){const x=l[g],k=u[g];p=-1;const C=[];for(;++p<h;){const O=x[p]||"";let L="",A="";if(n.alignDelimiters!==!1){const H=d[p]-(k[p]||0),D=a[p];D===114?L=" ".repeat(H):D===99?H%2?(L=" ".repeat(H/2+.5),A=" ".repeat(H/2-.5)):(L=" ".repeat(H/2),A=L):A=" ".repeat(H)}n.delimiterStart!==!1&&!p&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&O==="")&&(n.delimiterStart!==!1||p)&&C.push(" "),n.alignDelimiters!==!1&&C.push(L),C.push(O),n.alignDelimiters!==!1&&C.push(A),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&C.push("|")}b.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return b.join(`
|
|
56
56
|
`)}function ME(e){return e==null?"":String(e)}function Ag(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 OE(e,t,n,i){const o=n.enter("blockquote"),a=n.createTracker(i);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),DE);return o(),l}function DE(e,t,n){return">"+(n?"":" ")+e}function LE(e,t){return Mg(e,t.inConstruct,!0)&&!Mg(e,t.notInConstruct,!1)}function Mg(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Og(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
57
57
|
`&&LE(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
58
58
|
`}function IE(e,t){const n=String(e);let i=n.indexOf(t),o=i,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++a>l&&(l=a):a=1,o=i+t.length,i=n.indexOf(t,o);return l}function PE(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 BE(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 FE(e,t,n,i){const o=BE(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(PE(e,n)){const p=n.enter("codeIndented"),v=n.indentLines(a,zE);return p(),v}const u=n.createTracker(i),d=o.repeat(Math.max(IE(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:`
|
|
@@ -65,17 +65,17 @@ Error generating stack: `+_.message+`
|
|
|
65
65
|
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
66
66
|
`))+1))}const l="#".repeat(o),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
67
67
|
`,...a.current()});return/^[\t ]/.test(h)&&(h=ra(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),u(),h}Gv.peek=KE;function Gv(e){return e.value||""}function KE(){return"<"}Yv.peek=qE;function Yv(e,t,n,i){const o=ef(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(i);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 qE(){return"!"}Xv.peek=VE;function Xv(e,t,n,i){const o=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(i);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 VE(){return"!"}Zv.peek=GE;function Zv(e,t,n){let i=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(i);){let h=d.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(d.index+1)}}return o+i+o}function GE(){return"`"}function Qv(e,t){const n=qd(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))}Jv.peek=YE;function Jv(e,t,n,i){const o=ef(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let u,d;if(Qv(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 YE(e,t,n){return Qv(e,n)?"<":"["}ey.peek=XE;function ey(e,t,n,i){const o=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(i);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 XE(){return"["}function tf(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 ZE(e){const t=tf(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 QE(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 ty(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 JE(e,t,n,i){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?QE(n):tf(n);const u=e.ordered?l==="."?")":".":ZE(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),ty(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,i);return n.bulletLastUsed=l,n.bulletCurrent=a,o(),h}function eC(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 tC(e,t,n,i){const o=eC(n);let a=n.bulletCurrent||tf(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(i);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 nC(e,t,n,i){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,i);return a(),o(),l}const rC=ca(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function iC(e,t,n,i){return(e.children.some(function(l){return rC(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function sC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ny.peek=oC;function ny(e,t,n,i){const o=sC(n),a=n.enter("strong"),l=n.createTracker(i),u=l.move(o+o);let d=l.move(n.containerPhrasing(e,{after:o,before:u,...l.current()}));const h=d.charCodeAt(0),g=Xl(i.before.charCodeAt(i.before.length-1),h,o);g.inside&&(d=ra(h)+d.slice(1));const p=d.charCodeAt(d.length-1),v=Xl(i.after.charCodeAt(0),p,o);v.inside&&(d=d.slice(0,-1)+ra(p));const y=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+d+y}function oC(e,t,n){return n.options.strong||"*"}function aC(e,t,n,i){return n.safe(e.value,i)}function lC(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 cC(e,t,n){const i=(ty(n)+(n.options.ruleSpaces?" ":"")).repeat(lC(n));return n.options.ruleSpaces?i.slice(0,-1):i}const ry={blockquote:OE,break:Og,code:FE,definition:UE,emphasis:Vv,hardBreak:Og,heading:WE,html:Gv,image:Yv,imageReference:Xv,inlineCode:Zv,link:Jv,linkReference:ey,list:JE,listItem:tC,paragraph:nC,root:iC,strong:ny,text:aC,thematicBreak:cC};function uC(){return{enter:{table:hC,tableData:Dg,tableHeader:Dg,tableRow:fC},exit:{codeText:pC,table:dC,tableData:bh,tableHeader:bh,tableRow:bh}}}function hC(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 dC(e){this.exit(e),this.data.inTable=void 0}function fC(e){this.enter({type:"tableRow",children:[]},e)}function bh(e){this.exit(e)}function Dg(e){this.enter({type:"tableCell",children:[]},e)}function pC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,mC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function mC(e,t){return t==="|"?t:e}function gC(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
68
|
-
`,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,b,x,k){return h(g(y,x,k),y.align)}function u(y,b,x,k){const
|
|
69
|
-
`))}function d(y,b,x,k){const E=x.enter("tableCell"),O=x.enter("phrasing"),L=x.containerPhrasing(y,{...k,before:a,after:a});return O(),E(),L}function h(y,b){return AE(y,{align:b,alignDelimiters:i,padding:n,stringLength:o})}function g(y,b,x){const k=y.children;let E=-1;const O=[],L=b.enter("table");for(;++E<k.length;)O[E]=p(k[E],b,x);return L(),O}function p(y,b,x){const k=y.children;let E=-1;const O=[],L=b.enter("tableRow");for(;++E<k.length;)O[E]=d(k[E],y,b,x);return L(),O}function v(y,b,x){let k=ry.inlineCode(y,b,x);return x.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function _C(){return{exit:{taskListCheckValueChecked:Lg,taskListCheckValueUnchecked:Lg,paragraph:yC}}}function vC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bC}}}function Lg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function yC(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 i=n.children[0];if(i&&i.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&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function bC(e,t,n,i){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(i);a&&u.move(l);let d=ry.listItem(e,t,n,{...i,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(g){return g+l}}function SC(){return[Jk(),bE(),kE(),uC(),_C()]}function wC(e){return{extensions:[eE(),SE(e),EE(),gC(e),vC()]}}const xC={tokenize:RC,partial:!0},iy={tokenize:AC,partial:!0},sy={tokenize:MC,partial:!0},oy={tokenize:OC,partial:!0},kC={tokenize:DC,partial:!0},ay={name:"wwwAutolink",tokenize:NC,previous:cy},ly={name:"protocolAutolink",tokenize:TC,previous:uy},Xr={name:"emailAutolink",tokenize:CC,previous:hy},Lr={};function EC(){return{text:Lr}}let Yi=48;for(;Yi<123;)Lr[Yi]=Xr,Yi++,Yi===58?Yi=65:Yi===91&&(Yi=97);Lr[43]=Xr;Lr[45]=Xr;Lr[46]=Xr;Lr[95]=Xr;Lr[72]=[Xr,ly];Lr[104]=[Xr,ly];Lr[87]=[Xr,ay];Lr[119]=[Xr,ay];function CC(e,t,n){const i=this;let o,a;return l;function l(p){return!Yh(p)||!hy.call(i,i.previous)||nf(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return Yh(p)?(e.consume(p),u):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(kC,g,h)(p):p===45||p===95||fn(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&&Sn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function NC(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!cy.call(i,i.previous)||nf(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(xC,e.attempt(iy,e.attempt(sy,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function TC(e,t,n){const i=this;let o="",a=!1;return l;function l(p){return(p===72||p===104)&&uy.call(i,i.previous)&&!nf(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(Sn(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||Vl(p)||lt(p)||is(p)||lc(p)?n(p):e.attempt(iy,e.attempt(sy,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function RC(e,t,n){let i=0;return o;function o(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),o):l===46&&i===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function AC(e,t,n){let i,o,a;return l;function l(h){return h===46||h===95?e.check(oy,d,u)(h):h===null||lt(h)||is(h)||h!==45&&lc(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?i=!0:(o=i,i=void 0),e.consume(h),l}function d(h){return o||i||!a?n(h):t(h)}}function MC(e,t){let n=0,i=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&i<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(oy,t,a)(l):l===null||lt(l)||is(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&i++,e.consume(l),o}}function OC(e,t,n){return i;function i(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),i):u===38?(e.consume(u),a):u===93?(e.consume(u),o):u===60||u===null||lt(u)||is(u)?t(u):n(u)}function o(u){return u===null||u===40||u===91||lt(u)||is(u)?t(u):i(u)}function a(u){return Sn(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),i):Sn(u)?(e.consume(u),l):n(u)}}function DC(e,t,n){return i;function i(a){return e.consume(a),o}function o(a){return fn(a)?n(a):t(a)}}function cy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||lt(e)}function uy(e){return!Sn(e)}function hy(e){return!(e===47||Yh(e))}function Yh(e){return e===43||e===45||e===46||e===95||fn(e)}function nf(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const LC={tokenize:$C,partial:!0};function IC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zC,continuation:{tokenize:UC},exit:HC}},text:{91:{name:"gfmFootnoteCall",tokenize:FC},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PC,resolveTo:BC}}}}function PC(e,t,n){const i=this;let o=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;o--;){const d=i.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=gr(i.sliceSerialize({start:l.end,end:i.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 BC(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 i={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",i,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",i,t]];return e.splice(n,e.length-n+1,...u),e}function FC(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.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||lt(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(gr(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return lt(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 zC(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(b)}function g(b){if(l>999||b===93&&!u||b===null||b===91||lt(b))return n(b);if(b===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=gr(i.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return lt(b)||(u=!0),l++,e.consume(b),b===92?p:g}function p(b){return b===91||b===92||b===93?(e.consume(b),l++,g):g(b)}function v(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),o.includes(a)||o.push(a),Je(e,y,"gfmFootnoteDefinitionWhitespace")):n(b)}function y(b){return t(b)}}function UC(e,t,n){return e.check(la,t,e.attempt(LC,t,n))}function HC(e){e.exit("gfmFootnoteDefinition")}function $C(e,t,n){const i=this;return Je(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function jC(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},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&&jn(v,v.length,0,cc(y,l.slice(h+1,d),u)),jn(v,v.length,0,[["exit",p,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",g,u]]),jn(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(b){return h===126&&g[g.length-1][1].type!=="characterEscape"?d(b):(l.enter("strikethroughSequenceTemporary"),y(b))}function y(b){const x=Ks(h);if(b===126)return p>1?d(b):(l.consume(b),p++,y);if(p<2&&!n)return d(b);const k=l.exit("strikethroughSequenceTemporary"),E=Ks(b);return k._open=!E||E===2&&!!x,k._close=!x||x===2&&!!E,u(b)}}}class WC{constructor(){this.map=[]}add(t,n,i){KC(this,t,n,i)}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 i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const a of o)t.push(a);o=i.pop()}this.map.length=0}}function KC(e,t,n,i){let o=0;if(!(n===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...i);return}o+=1}e.map.push([t,n,i])}}function qC(e,t){let n=!1;const i=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=i.length-1;i[a]=i[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function VC(){return{flow:{null:{name:"table",tokenize:GC,resolveAll:YC}}}}function GC(e,t,n){const i=this;let o=0,a=0,l;return u;function u(R){let Y=i.events.length-1;for(;Y>-1;){const q=i.events[Y][1].type;if(q==="lineEnding"||q==="linePrefix")Y--;else break}const $=Y>-1?i.events[Y][1].type:null,K=$==="tableHead"||$==="tableRow"?D:d;return K===D&&i.parser.lazy[i.now().line]?n(R):K(R)}function d(R){return e.enter("tableHead"),e.enter("tableRow"),h(R)}function h(R){return R===124||(l=!0,a+=1),g(R)}function g(R){return R===null?n(R):Me(R)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),y):n(R):Ye(R)?Je(e,g,"whitespace")(R):(a+=1,l&&(l=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),p(R)))}function p(R){return R===null||R===124||lt(R)?(e.exit("data"),g(R)):(e.consume(R),R===92?v:p)}function v(R){return R===92||R===124?(e.consume(R),p):p(R)}function y(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),l=!1,Ye(R)?Je(e,b,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):b(R))}function b(R){return R===45||R===58?k(R):R===124?(l=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),x):H(R)}function x(R){return Ye(R)?Je(e,k,"whitespace")(R):k(R)}function k(R){return R===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),E):R===45?(a+=1,E(R)):R===null||Me(R)?A(R):H(R)}function E(R){return R===45?(e.enter("tableDelimiterFiller"),O(R)):H(R)}function O(R){return R===45?(e.consume(R),O):R===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),L):(e.exit("tableDelimiterFiller"),L(R))}function L(R){return Ye(R)?Je(e,A,"whitespace")(R):A(R)}function A(R){return R===124?b(R):R===null||Me(R)?!l||o!==a?H(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):H(R)}function H(R){return n(R)}function D(R){return e.enter("tableRow"),se(R)}function se(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),se):R===null||Me(R)?(e.exit("tableRow"),t(R)):Ye(R)?Je(e,se,"whitespace")(R):(e.enter("data"),W(R))}function W(R){return R===null||R===124||lt(R)?(e.exit("data"),se(R)):(e.consume(R),R===92?ee:W)}function ee(R){return R===92||R===124?(e.consume(R),W):W(R)}}function YC(e,t){let n=-1,i=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,g,p;const v=new WC;for(;++n<e.length;){const y=e[n],b=y[1];y[0]==="enter"?b.type==="tableHead"?(u=!1,d!==0&&(Ig(v,t,d,h,g),g=void 0,d=0),h={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},v.add(n,0,[["enter",h,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(i=!0,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},v.add(n,0,[["enter",g,t]])),o=b.type==="tableDelimiterRow"?2:g?3:1):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=Cl(v,t,a,o,void 0,p),a=[0,0,0,0]),l[2]=n)):b.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],p=Cl(v,t,a,o,void 0,p)),a=l,l=[a[1],n,0,0])):b.type==="tableHead"?(u=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],p=Cl(v,t,a,o,n,p)):l[1]!==0&&(p=Cl(v,t,l,o,n,p)),o=0):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&Ig(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=qC(t.events,n))}return e}function Cl(e,t,n,i,o,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Us(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Us(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=Us(t.events,n[2]),g=Us(t.events,n[3]),p={type:u,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),i!==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 b=n[2]+1,x=n[3]-n[2]-1;e.add(b,x,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return o!==void 0&&(a.end=Object.assign({},Us(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function Ig(e,t,n,i,o){const a=[],l=Us(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),i.end=Object.assign({},l),a.push(["exit",i,t]),e.add(n+1,0,a)}function Us(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const XC={name:"tasklistCheck",tokenize:QC};function ZC(){return{text:{91:XC}}}function QC(e,t,n){const i=this;return o;function o(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return lt(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 Me(d)?t(d):Ye(d)?e.check({tokenize:JC},t,n)(d):n(d)}}function JC(e,t,n){return Je(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function eN(e){return Sv([EC(),IC(),jC(e),VC(),ZC()])}const tN={};function nN(e){const t=this,n=e||tN,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(eN(n)),a.push(SC()),l.push(wC(n))}const Pg=(function(e,t,n){const i=ca(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(i(e.children[t],t,e))return e.children[t]}),ls=(function(e){if(e==null)return sN;if(typeof e=="string")return iN(e);if(typeof e=="object")return rN(e);if(typeof e=="function")return rf(e);throw new Error("Expected function, string, or array as `test`")});function rN(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ls(e[n]);return rf(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function iN(e){return rf(t);function t(n){return n.tagName===e}}function rf(e){return t;function t(n,i,o){return!!(oN(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function sN(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function oN(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Bg=/\n/g,Fg=/[\t ]+/g,Xh=ls("br"),zg=ls(pN),aN=ls("p"),Ug=ls("tr"),lN=ls(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",fN,mN]),dy=ls(["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 cN(e,t){const n=t||{},i="children"in e?e.children:[],o=dy(e),a=my(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...py(e,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<i.length;)l.push(...fy(i[u],e,{whitespace:a,breakBefore:u?void 0:o,breakAfter:u<i.length-1?Xh(i[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(`
|
|
68
|
+
`,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,b,x,k){return h(g(y,x,k),y.align)}function u(y,b,x,k){const C=p(y,x,k),O=h([C]);return O.slice(0,O.indexOf(`
|
|
69
|
+
`))}function d(y,b,x,k){const C=x.enter("tableCell"),O=x.enter("phrasing"),L=x.containerPhrasing(y,{...k,before:a,after:a});return O(),C(),L}function h(y,b){return AE(y,{align:b,alignDelimiters:i,padding:n,stringLength:o})}function g(y,b,x){const k=y.children;let C=-1;const O=[],L=b.enter("table");for(;++C<k.length;)O[C]=p(k[C],b,x);return L(),O}function p(y,b,x){const k=y.children;let C=-1;const O=[],L=b.enter("tableRow");for(;++C<k.length;)O[C]=d(k[C],y,b,x);return L(),O}function v(y,b,x){let k=ry.inlineCode(y,b,x);return x.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function _C(){return{exit:{taskListCheckValueChecked:Lg,taskListCheckValueUnchecked:Lg,paragraph:yC}}}function vC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bC}}}function Lg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function yC(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 i=n.children[0];if(i&&i.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&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function bC(e,t,n,i){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(i);a&&u.move(l);let d=ry.listItem(e,t,n,{...i,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(g){return g+l}}function SC(){return[Jk(),bE(),kE(),uC(),_C()]}function wC(e){return{extensions:[eE(),SE(e),EE(),gC(e),vC()]}}const xC={tokenize:RC,partial:!0},iy={tokenize:AC,partial:!0},sy={tokenize:MC,partial:!0},oy={tokenize:OC,partial:!0},kC={tokenize:DC,partial:!0},ay={name:"wwwAutolink",tokenize:NC,previous:cy},ly={name:"protocolAutolink",tokenize:TC,previous:uy},Xr={name:"emailAutolink",tokenize:CC,previous:hy},Lr={};function EC(){return{text:Lr}}let Yi=48;for(;Yi<123;)Lr[Yi]=Xr,Yi++,Yi===58?Yi=65:Yi===91&&(Yi=97);Lr[43]=Xr;Lr[45]=Xr;Lr[46]=Xr;Lr[95]=Xr;Lr[72]=[Xr,ly];Lr[104]=[Xr,ly];Lr[87]=[Xr,ay];Lr[119]=[Xr,ay];function CC(e,t,n){const i=this;let o,a;return l;function l(p){return!Yh(p)||!hy.call(i,i.previous)||nf(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return Yh(p)?(e.consume(p),u):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(kC,g,h)(p):p===45||p===95||fn(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&&Sn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function NC(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!cy.call(i,i.previous)||nf(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(xC,e.attempt(iy,e.attempt(sy,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function TC(e,t,n){const i=this;let o="",a=!1;return l;function l(p){return(p===72||p===104)&&uy.call(i,i.previous)&&!nf(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(Sn(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||Vl(p)||lt(p)||is(p)||lc(p)?n(p):e.attempt(iy,e.attempt(sy,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function RC(e,t,n){let i=0;return o;function o(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),o):l===46&&i===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function AC(e,t,n){let i,o,a;return l;function l(h){return h===46||h===95?e.check(oy,d,u)(h):h===null||lt(h)||is(h)||h!==45&&lc(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?i=!0:(o=i,i=void 0),e.consume(h),l}function d(h){return o||i||!a?n(h):t(h)}}function MC(e,t){let n=0,i=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&i<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(oy,t,a)(l):l===null||lt(l)||is(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&i++,e.consume(l),o}}function OC(e,t,n){return i;function i(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),i):u===38?(e.consume(u),a):u===93?(e.consume(u),o):u===60||u===null||lt(u)||is(u)?t(u):n(u)}function o(u){return u===null||u===40||u===91||lt(u)||is(u)?t(u):i(u)}function a(u){return Sn(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),i):Sn(u)?(e.consume(u),l):n(u)}}function DC(e,t,n){return i;function i(a){return e.consume(a),o}function o(a){return fn(a)?n(a):t(a)}}function cy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||lt(e)}function uy(e){return!Sn(e)}function hy(e){return!(e===47||Yh(e))}function Yh(e){return e===43||e===45||e===46||e===95||fn(e)}function nf(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const LC={tokenize:$C,partial:!0};function IC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zC,continuation:{tokenize:UC},exit:HC}},text:{91:{name:"gfmFootnoteCall",tokenize:FC},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PC,resolveTo:BC}}}}function PC(e,t,n){const i=this;let o=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;o--;){const d=i.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=gr(i.sliceSerialize({start:l.end,end:i.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 BC(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 i={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",i,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",i,t]];return e.splice(n,e.length-n+1,...u),e}function FC(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.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||lt(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(gr(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return lt(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 zC(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(b)}function g(b){if(l>999||b===93&&!u||b===null||b===91||lt(b))return n(b);if(b===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=gr(i.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return lt(b)||(u=!0),l++,e.consume(b),b===92?p:g}function p(b){return b===91||b===92||b===93?(e.consume(b),l++,g):g(b)}function v(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),o.includes(a)||o.push(a),Je(e,y,"gfmFootnoteDefinitionWhitespace")):n(b)}function y(b){return t(b)}}function UC(e,t,n){return e.check(la,t,e.attempt(LC,t,n))}function HC(e){e.exit("gfmFootnoteDefinition")}function $C(e,t,n){const i=this;return Je(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function jC(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},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&&jn(v,v.length,0,cc(y,l.slice(h+1,d),u)),jn(v,v.length,0,[["exit",p,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",g,u]]),jn(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(b){return h===126&&g[g.length-1][1].type!=="characterEscape"?d(b):(l.enter("strikethroughSequenceTemporary"),y(b))}function y(b){const x=Ks(h);if(b===126)return p>1?d(b):(l.consume(b),p++,y);if(p<2&&!n)return d(b);const k=l.exit("strikethroughSequenceTemporary"),C=Ks(b);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(b)}}}class WC{constructor(){this.map=[]}add(t,n,i){KC(this,t,n,i)}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 i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const a of o)t.push(a);o=i.pop()}this.map.length=0}}function KC(e,t,n,i){let o=0;if(!(n===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...i);return}o+=1}e.map.push([t,n,i])}}function qC(e,t){let n=!1;const i=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=i.length-1;i[a]=i[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function VC(){return{flow:{null:{name:"table",tokenize:GC,resolveAll:YC}}}}function GC(e,t,n){const i=this;let o=0,a=0,l;return u;function u(R){let Y=i.events.length-1;for(;Y>-1;){const q=i.events[Y][1].type;if(q==="lineEnding"||q==="linePrefix")Y--;else break}const $=Y>-1?i.events[Y][1].type:null,K=$==="tableHead"||$==="tableRow"?D:d;return K===D&&i.parser.lazy[i.now().line]?n(R):K(R)}function d(R){return e.enter("tableHead"),e.enter("tableRow"),h(R)}function h(R){return R===124||(l=!0,a+=1),g(R)}function g(R){return R===null?n(R):Me(R)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),y):n(R):Ye(R)?Je(e,g,"whitespace")(R):(a+=1,l&&(l=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),p(R)))}function p(R){return R===null||R===124||lt(R)?(e.exit("data"),g(R)):(e.consume(R),R===92?v:p)}function v(R){return R===92||R===124?(e.consume(R),p):p(R)}function y(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),l=!1,Ye(R)?Je(e,b,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):b(R))}function b(R){return R===45||R===58?k(R):R===124?(l=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),x):H(R)}function x(R){return Ye(R)?Je(e,k,"whitespace")(R):k(R)}function k(R){return R===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):R===45?(a+=1,C(R)):R===null||Me(R)?A(R):H(R)}function C(R){return R===45?(e.enter("tableDelimiterFiller"),O(R)):H(R)}function O(R){return R===45?(e.consume(R),O):R===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),L):(e.exit("tableDelimiterFiller"),L(R))}function L(R){return Ye(R)?Je(e,A,"whitespace")(R):A(R)}function A(R){return R===124?b(R):R===null||Me(R)?!l||o!==a?H(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):H(R)}function H(R){return n(R)}function D(R){return e.enter("tableRow"),se(R)}function se(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),se):R===null||Me(R)?(e.exit("tableRow"),t(R)):Ye(R)?Je(e,se,"whitespace")(R):(e.enter("data"),W(R))}function W(R){return R===null||R===124||lt(R)?(e.exit("data"),se(R)):(e.consume(R),R===92?ee:W)}function ee(R){return R===92||R===124?(e.consume(R),W):W(R)}}function YC(e,t){let n=-1,i=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,g,p;const v=new WC;for(;++n<e.length;){const y=e[n],b=y[1];y[0]==="enter"?b.type==="tableHead"?(u=!1,d!==0&&(Ig(v,t,d,h,g),g=void 0,d=0),h={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},v.add(n,0,[["enter",h,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(i=!0,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},v.add(n,0,[["enter",g,t]])),o=b.type==="tableDelimiterRow"?2:g?3:1):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=Cl(v,t,a,o,void 0,p),a=[0,0,0,0]),l[2]=n)):b.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(l[0]=l[1],p=Cl(v,t,a,o,void 0,p)),a=l,l=[a[1],n,0,0])):b.type==="tableHead"?(u=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],p=Cl(v,t,a,o,n,p)):l[1]!==0&&(p=Cl(v,t,l,o,n,p)),o=0):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&Ig(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=qC(t.events,n))}return e}function Cl(e,t,n,i,o,a){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Us(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Us(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=Us(t.events,n[2]),g=Us(t.events,n[3]),p={type:u,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),i!==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 b=n[2]+1,x=n[3]-n[2]-1;e.add(b,x,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return o!==void 0&&(a.end=Object.assign({},Us(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function Ig(e,t,n,i,o){const a=[],l=Us(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),i.end=Object.assign({},l),a.push(["exit",i,t]),e.add(n+1,0,a)}function Us(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const XC={name:"tasklistCheck",tokenize:QC};function ZC(){return{text:{91:XC}}}function QC(e,t,n){const i=this;return o;function o(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return lt(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 Me(d)?t(d):Ye(d)?e.check({tokenize:JC},t,n)(d):n(d)}}function JC(e,t,n){return Je(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function eN(e){return Sv([EC(),IC(),jC(e),VC(),ZC()])}const tN={};function nN(e){const t=this,n=e||tN,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(eN(n)),a.push(SC()),l.push(wC(n))}const Pg=(function(e,t,n){const i=ca(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(i(e.children[t],t,e))return e.children[t]}),ls=(function(e){if(e==null)return sN;if(typeof e=="string")return iN(e);if(typeof e=="object")return rN(e);if(typeof e=="function")return rf(e);throw new Error("Expected function, string, or array as `test`")});function rN(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ls(e[n]);return rf(i);function i(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function iN(e){return rf(t);function t(n){return n.tagName===e}}function rf(e){return t;function t(n,i,o){return!!(oN(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function sN(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function oN(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Bg=/\n/g,Fg=/[\t ]+/g,Xh=ls("br"),zg=ls(pN),aN=ls("p"),Ug=ls("tr"),lN=ls(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",fN,mN]),dy=ls(["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 cN(e,t){const n=t||{},i="children"in e?e.children:[],o=dy(e),a=my(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...py(e,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<i.length;)l.push(...fy(i[u],e,{whitespace:a,breakBefore:u?void 0:o,breakAfter:u<i.length-1?Xh(i[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(`
|
|
70
70
|
`.repeat(h)||" "),h=-1,d.push(g))}return d.join("")}function fy(e,t,n){return e.type==="element"?uN(e,t,n):e.type==="text"?n.whitespace==="normal"?py(e,n):hN(e):[]}function uN(e,t,n){const i=my(e,n),o=e.children||[];let a=-1,l=[];if(lN(e))return l;let u,d;for(Xh(e)||Ug(e)&&Pg(t,e,Ug)?d=`
|
|
71
|
-
`:aN(e)?(u=2,d=2):dy(e)&&(u=1,d=1);++a<o.length;)l=l.concat(fy(o[a],e,{whitespace:i,breakBefore:a?void 0:u,breakAfter:a<o.length-1?Xh(o[a+1]):d}));return zg(e)&&Pg(t,e,zg)&&l.push(" "),u&&l.unshift(u),d&&l.push(d),l}function py(e,t){const n=String(e.value),i=[],o=[];let a=0;for(;a<=n.length;){Bg.lastIndex=a;const d=Bg.exec(n),h=d&&"index"in d?d.index:n.length;i.push(dN(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<i.length;)i[l].charCodeAt(i[l].length-1)===8203||l<i.length-1&&i[l+1].charCodeAt(0)===8203?(o.push(i[l]),u=void 0):i[l]?(typeof u=="number"&&o.push(u),o.push(i[l]),u=0):(l===0||l===i.length-1)&&o.push(0);return o}function hN(e){return[String(e.value)]}function dN(e,t,n){const i=[];let o=0,a;for(;o<e.length;){Fg.lastIndex=o;const l=Fg.exec(e);a=l?l.index:e.length,!o&&!a&&l&&!t&&i.push(""),o!==a&&i.push(e.slice(o,a)),o=l?a+l[0].length:a}return o!==a&&!n&&i.push(""),i.join(" ")}function my(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 fN(e){return!!(e.properties||{}).hidden}function pN(e){return e.tagName==="td"||e.tagName==="th"}function mN(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function gN(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+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*\\(",b=["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"],x=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],k=["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"],E=["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:x,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:k},H={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[H,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],se={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},W={className:"function",begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,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(se,W,H,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 _N(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=gN(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vN(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});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}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],k=["true","false"],E={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],L=["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"],H=["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:x,literal:k,built_in:[...O,...L,"set","shopt",...A,...H]},contains:[y,e.SHEBANG(),b,p,a,l,E,u,d,h,g,n]}}function yN(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="("+i+"|"+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*\\(",k={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"},E=[p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:E.concat([{begin:/\(/,end:/\)/,keywords:k,contains:E.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,relevance:0},{begin:y,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:k,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:k,disableAutodetect:!0,illegal:"</",contains:[].concat(O,L,E,[p,{begin:e.IDENT_RE+"::",keywords:k},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:h,keywords:k}}}function bN(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+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*\\(",b=["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"],x=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],k=["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"],E=["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:x,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:k},H={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[H,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],se={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},W={className:"function",begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,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(se,W,H,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 SN(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"],i=["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:i},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/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,y]},x={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},k=e.inherit(x,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});v.contains=[x,b,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],y.contains=[k,b,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const E={variants:[h,x,b,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},O={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},L=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"}},E,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,O,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,O,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:"("+L+"\\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,O],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[E,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},A]}}const wN=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_-]*/}}),xN=["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"],kN=["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"],EN=[...xN,...kN],CN=["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(),NN=["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(),TN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),RN=["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 AN(e){const t=e.regex,n=wN(e),i={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,i,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:":("+NN.join("|")+")"},{begin:":(:)?("+TN.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+RN.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:CN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+EN.join("|")+")\\b"}]}}function MN(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 ON(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 DN(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 LN(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.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:[i,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:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[i,u,a,o,l,n]}}]}}var Hs="[0-9](_*[0-9])*",Nl=`\\.(${Hs})`,Tl="[0-9a-fA-F](_*[0-9a-fA-F])*",Hg={className:"number",variants:[{begin:`(\\b(${Hs})((${Nl})|\\.)?|(${Nl}))[eE][+-]?(${Hs})[fFdD]?\\b`},{begin:`\\b(${Hs})((${Nl})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nl})[fFdD]?\\b`},{begin:`\\b(${Hs})[fFdD]\\b`},{begin:`\\b0[xX]((${Tl})\\.?|(${Tl})?\\.(${Tl}))[pP][+-]?(${Hs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Tl})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function gy(e,t,n){return n===-1?"":e.replace(t,i=>gy(e,t,n-1))}function IN(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+gy("(?:<"+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:["(?:"+i+"\\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,Hg,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Hg,h]}}const $g="[A-Za-z$_][0-9A-Za-z$_]*",PN=["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"],BN=["true","false","null","undefined","NaN","Infinity"],_y=["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"],vy=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],yy=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],FN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zN=[].concat(yy,_y,vy);function UN(e){const t=e.regex,n=(F,{after:te})=>{const C="</"+F[0].slice(1);return F.input.indexOf(C,te)!==-1},i=$g,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const C=F[0].length+F.index,I=F.input[C];if(I==="<"||I===","){te.ignoreMatch();return}I===">"&&(n(F,{after:C})||te.ignoreMatch());let G;const N=F.input.substring(C);if(G=N.match(/^\s*=/)){te.ignoreMatch();return}if((G=N.match(/^\s+extends\s+/))&&G.index===0){te.ignoreMatch();return}}},u={$pattern:$g,keyword:PN,literal:BN,built_in:zN,"variable.language":FN},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"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},L=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,{match:/\$\d+/},p];v.contains=L.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(L)});const A=[].concat(O,v.contains),H=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H},se={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={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:{_:[..._y,...vy]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(F){return t.concat("(?!",F.join("|"),")")}const K={match:t.concat(/\b/,$([...yy,"super","import"].map(F=>`${F}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,O,{match:/\$\d+/},p,W,{scope:"attr",match:i+t.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:Z,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:H}]}]},{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"]}]}]},R,{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:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},K,Y,se,z,{match:/\$[(.]/}]}}function HN(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],o={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},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 $s="[0-9](_*[0-9])*",Rl=`\\.(${$s})`,Al="[0-9a-fA-F](_*[0-9a-fA-F])*",$N={className:"number",variants:[{begin:`(\\b(${$s})((${Rl})|\\.)?|(${Rl}))[eE][+-]?(${$s})[fFdD]?\\b`},{begin:`\\b(${$s})((${Rl})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rl})[fFdD]?\\b`},{begin:`\\b(${$s})[fFdD]\\b`},{begin:`\\b0[xX]((${Al})\\.?|(${Al})?\\.(${Al}))[pP][+-]?(${$s})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Al})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jN(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+/}]}},i={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=$N,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,i,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:`
|
|
72
|
-
`},h]}}const WN=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_-]*/}}),KN=["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"],qN=["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"],VN=[...KN,...qN],GN=["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(),by=["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(),Sy=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),YN=["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(),XN=by.concat(Sy).sort().reverse();function ZN(e){const t=WN(e),n=XN,i="and or not only",o="[\\w-]+",a="("+o+"|@\\{"+o+"\\})",l=[],u=[],d=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},h=function(L,A,H){return{className:L,begin:A,relevance:H}},g={$pattern:/[a-z-]+/,keyword:i,attribute:GN.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)},b={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+YN.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:u}}]},x={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}},k={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},E={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("+VN.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:":("+by.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Sy.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},t.FUNCTION_DISPATCH]},O={begin:o+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[E]};return l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,k,O,b,E,y,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function QN(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],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:[i],relevance:5}])}}function JN(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]},i={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,i,o,a,l]}}function eT(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={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(E=>{E.contains=E.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,i,d,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tT(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 nT(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"],i=/[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=(x,k,E="\\1")=>{const O=E==="\\1"?E:t.concat(E,k);return t.concat(t.concat("(?:",x,")"),k,/(?:\\.|[^\\\/])*?/,O,/(?:\\.|[^\\\/])*?/,E,i)},y=(x,k,E)=>t.concat(t.concat("(?:",x,")"),k,/(?:\\.|[^\\\/])*?/,E,i),b=[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=b,l.contains=b,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:b}}function rT(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=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:"\\$+"+i},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,z)=>{z.data._beginMatch=q[1]||q[2]},"on:end":(q,z)=>{z.data._beginMatch!==q[1]&&z.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
73
|
-
]`,b={scope:"string",variants:[g,h,p,v]},x={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},k=["false","null","true"],E=["__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"],O=["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:E,literal:(q=>{const z=[];return q.forEach(Z=>{z.push(Z),Z.toLowerCase()===Z?z.push(Z.toUpperCase()):z.push(Z.toLowerCase())}),z})(k),built_in:O},H=q=>q.map(z=>z.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,t.concat(y,"+"),t.concat("(?!",H(O).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},se=t.concat(i,"\\b(?!\\()"),W={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),se],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),se],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(i,t.lookahead(":"),t.lookahead(/(?!::)/))},R={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[ee,l,W,e.C_BLOCK_COMMENT_MODE,b,x,D]},Y={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",H(E).join("\\b|"),"|",H(O).join("\\b|"),"\\b)"),i,t.concat(y,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[R]};R.contains.push(Y);const $=[ee,W,e.C_BLOCK_COMMENT_MODE,b,x,D],K={begin:t.concat(/#\[\s*\\?/,t.either(o,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:k,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:k,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:o},{match:a}]}]};return{case_insensitive:!1,keywords:A,contains:[K,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,Y,W,{match:[/const/,/\s/,i],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",K,l,W,e.C_BLOCK_COMMENT_MODE,b,x]}]},{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]},b,x]}}function iT(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 sT(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function oT(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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:i,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})\\.`,b=`\\b|${i.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${y}))[eE][+-]?(${v})[jJ]?(?=${b})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${v})[jJ](?=${b})`}]},k={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,x,p,e.HASH_COMMENT_MODE]}]};return h.contains=[p,x,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,k,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{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:[x,E,p]}]}}function aT(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function lT(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=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,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[a,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{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 cT(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(i,/(::\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])*",b={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"}]},x={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:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},b,{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,x.contains=D;const R=[{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(R).concat(h).concat(D)}}function uT(e){const t=e.regex,n=/(r#)?/,i=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+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:g}},{className:"punctuation",begin:"->"},a]}}const hT=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_-]*/}}),dT=["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"],fT=["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"],pT=[...dT,...fT],mT=["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(),gT=["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(),_T=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vT=["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 yT(e){const t=hT(e),n=_T,i=gT,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("+pT.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},u,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vT.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:mT.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 bT(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ST(e){const t=e.regex,n=e.COMMENT("--","$"),i={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,b=[...h,...d].filter(H=>!g.includes(H)),x={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},k={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:t.concat(/\b/,t.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function O(H){return t.concat(/\b/,t.either(...H.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const L={scope:"keyword",match:O(v),relevance:0};function A(H,{exceptions:D,when:se}={}){const W=se;return D=D||[],H.map(ee=>ee.match(/\|\d+$/)||D.includes(ee)?ee:W(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(b,{when:H=>H.length<3}),literal:a,type:u,built_in:p},contains:[{scope:"type",match:O(l)},L,E,x,i,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,k]}}function wy(e){return e?typeof e=="string"?e:e.source:null}function Fo(e){return ot("(?=",e,")")}function ot(...e){return e.map(n=>wy(n)).join("")}function wT(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function bn(...e){return"("+(wT(e).capture?"":"?:")+e.map(i=>wy(i)).join("|")+")"}const sf=e=>ot(/\b/,e,/\w$/.test(e)?/\b/:/\B/),xT=["Protocol","Type"].map(sf),jg=["init","self"].map(sf),kT=["Any","Self"],Sh=["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"],Wg=["false","nil","true"],ET=["assignment","associativity","higherThan","left","lowerThan","none","right"],CT=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Kg=["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"],xy=bn(/[/=\-+!*%<>&|^~?]/,/[\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]/),ky=bn(xy,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),wh=ot(xy,ky,"*"),Ey=bn(/[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]/),Zl=bn(Ey,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Tr=ot(Ey,Zl,"*"),Ml=ot(/[A-Z]/,Zl,"*"),NT=["attached","autoclosure",ot(/convention\(/,bn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ot(/objc\(/,Tr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],TT=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function RT(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,bn(...xT,...jg)],className:{2:"keyword"}},a={match:ot(/\./,bn(...Sh)),relevance:0},l=Sh.filter(Qe=>typeof Qe=="string").concat(["_|0"]),u=Sh.filter(Qe=>typeof Qe!="string").concat(kT).map(sf),d={variants:[{className:"keyword",match:bn(...u,...jg)}]},h={$pattern:bn(/\b\w+/,/#\w+/),keyword:l.concat(CT),literal:Wg},g=[o,a,d],p={match:ot(/\./,bn(...Kg)),relevance:0},v={className:"built_in",match:ot(/\b/,bn(...Kg),/(?=\()/)},y=[p,v],b={match:/->/,relevance:0},x={className:"operator",relevance:0,variants:[{match:wh},{match:`\\.(\\.|${ky})+`}]},k=[b,x],E="([0-9]_*)+",O="([0-9a-fA-F]_*)+",L={className:"number",relevance:0,variants:[{match:`\\b(${E})(\\.(${E}))?([eE][+-]?(${E}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${E}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(Qe="")=>({className:"subst",variants:[{match:ot(/\\/,Qe,/[0\\tnr"']/)},{match:ot(/\\/,Qe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),H=(Qe="")=>({className:"subst",match:ot(/\\/,Qe,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(Qe="")=>({className:"subst",label:"interpol",begin:ot(/\\/,Qe,/\(/),end:/\)/}),se=(Qe="")=>({begin:ot(Qe,/"""/),end:ot(/"""/,Qe),contains:[A(Qe),H(Qe),D(Qe)]}),W=(Qe="")=>({begin:ot(Qe,/"/),end:ot(/"/,Qe),contains:[A(Qe),D(Qe)]}),ee={className:"string",variants:[se(),se("#"),se("##"),se("###"),W(),W("#"),W("##"),W("###")]},R=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],Y={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:R},$=Qe=>{const In=ot(Qe,/\//),Wn=ot(/\//,Qe);return{begin:In,end:Wn,contains:[...R,{scope:"comment",begin:`#(?!.*${Wn})`,end:/$/}]}},K={scope:"regexp",variants:[$("###"),$("##"),$("#"),Y]},q={match:ot(/`/,Tr,/`/)},z={className:"variable",match:/\$\d+/},Z={className:"variable",match:`\\$${Zl}+`},oe=[q,z,Z],F={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:TT,contains:[...k,L,ee]}]}},te={scope:"keyword",match:ot(/@/,bn(...NT),Fo(bn(/\(/,/\s+/)))},C={scope:"meta",match:ot(/@/,Tr)},I=[F,te,C],G={match:Fo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ot(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Zl,"+")},{className:"type",match:Ml,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ot(/\s+&\s+/,Fo(Ml)),relevance:0}]},N={begin:/</,end:/>/,keywords:h,contains:[...i,...g,...I,b,G]};G.contains.push(N);const ye={match:ot(Tr,/\s*:/),keywords:"_|0",relevance:0},Ne={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",ye,...i,K,...g,...y,...k,L,ee,...oe,...I,G]},_e={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,G]},Ue={begin:bn(Fo(ot(Tr,/\s*:/)),Fo(ot(Tr,/\s+/,Tr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Tr}]},Le={begin:/\(/,end:/\)/,keywords:h,contains:[Ue,...i,...g,...k,L,ee,...I,G,Ne],endsParent:!0,illegal:/["']/},He={match:[/(func|macro)/,/\s+/,bn(q.match,Tr,wh)],className:{1:"keyword",3:"title.function"},contains:[_e,Le,t],illegal:[/\[/,/%/]},nt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[_e,Le,t],illegal:/\[|%/},Ft={match:[/operator/,/\s+/,wh],className:{1:"keyword",3:"title"}},tn={begin:[/precedencegroup/,/\s+/,Ml],className:{1:"keyword",3:"title"},contains:[G],keywords:[...ET,...Wg],end:/}/},$e={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ln={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ir={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Tr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[_e,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Ml},...g],relevance:0}]};for(const Qe of ee.variants){const In=Qe.contains.find(_r=>_r.label==="interpol");In.keywords=h;const Wn=[...g,...y,...k,L,ee,...oe];In.contains=[...Wn,{begin:/\(/,end:/\)/,contains:["self",...Wn]}]}return{name:"Swift",keywords:h,contains:[...i,He,nt,$e,Ln,Ir,Ft,tn,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},K,...g,...y,...k,L,ee,...oe,...I,G,Ne]}}const Ql="[A-Za-z$_][0-9A-Za-z$_]*",Cy=["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"],Ny=["true","false","null","undefined","NaN","Infinity"],Ty=["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"],Ry=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ay=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],My=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Oy=[].concat(Ay,Ty,Ry);function AT(e){const t=e.regex,n=(F,{after:te})=>{const C="</"+F[0].slice(1);return F.input.indexOf(C,te)!==-1},i=Ql,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const C=F[0].length+F.index,I=F.input[C];if(I==="<"||I===","){te.ignoreMatch();return}I===">"&&(n(F,{after:C})||te.ignoreMatch());let G;const N=F.input.substring(C);if(G=N.match(/^\s*=/)){te.ignoreMatch();return}if((G=N.match(/^\s+extends\s+/))&&G.index===0){te.ignoreMatch();return}}},u={$pattern:Ql,keyword:Cy,literal:Ny,built_in:Oy,"variable.language":My},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"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},L=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,{match:/\$\d+/},p];v.contains=L.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(L)});const A=[].concat(O,v.contains),H=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H},se={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={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:{_:[...Ty,...Ry]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(F){return t.concat("(?!",F.join("|"),")")}const K={match:t.concat(/\b/,$([...Ay,"super","import"].map(F=>`${F}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,O,{match:/\$\d+/},p,W,{scope:"attr",match:i+t.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:Z,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:H}]}]},{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"]}]}]},R,{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:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},K,Y,se,z,{match:/\$[(.]/}]}}function MT(e){const t=e.regex,n=AT(e),i=Ql,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:Ql,keyword:Cy.concat(d),literal:Ny,built_in:Oy.concat(o),"variable.language":My},g={className:"meta",begin:"@"+i},p=(x,k,E)=>{const O=x.contains.findIndex(L=>L.label===k);if(O===-1)throw new Error("can not find mode to replace");x.contains.splice(O,1,E)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(g);const v=n.contains.find(x=>x.scope==="attr"),y=Object.assign({},v,{match:t.concat(i,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 b=n.contains.find(x=>x.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function OT(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={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,i,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 DT(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["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:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,l,o,e.QUOTE_STRING_MODE,d,h,u]}}function LT(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\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:i,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 IT(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={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},b={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},k=[i,{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},b,x,a,l],E=[...k];return E.pop(),E.push(u),y.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:k}}const PT={arduino:_N,bash:vN,c:yN,cpp:bN,csharp:SN,css:AN,diff:MN,go:ON,graphql:DN,ini:LN,java:IN,javascript:UN,json:HN,kotlin:jN,less:ZN,lua:QN,makefile:JN,markdown:eT,objectivec:tT,perl:nT,php:rT,"php-template":iT,plaintext:sT,python:oT,"python-repl":aT,r:lT,ruby:cT,rust:uT,scss:yT,shell:bT,sql:ST,swift:RT,typescript:MT,vbnet:OT,wasm:DT,xml:LT,yaml:IT};var xh,qg;function BT(){if(qg)return xh;qg=1;function e(M){return M instanceof Map?M.clear=M.delete=M.set=function(){throw new Error("map is read-only")}:M instanceof Set&&(M.add=M.clear=M.delete=function(){throw new Error("set is read-only")}),Object.freeze(M),Object.getOwnPropertyNames(M).forEach(Q=>{const pe=M[Q],Ie=typeof pe;(Ie==="object"||Ie==="function")&&!Object.isFrozen(pe)&&e(pe)}),M}class t{constructor(Q){Q.data===void 0&&(Q.data={}),this.data=Q.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(M){return M.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(M,...Q){const pe=Object.create(null);for(const Ie in M)pe[Ie]=M[Ie];return Q.forEach(function(Ie){for(const ht in Ie)pe[ht]=Ie[ht]}),pe}const o="</span>",a=M=>!!M.scope,l=(M,{prefix:Q})=>{if(M.startsWith("language:"))return M.replace("language:","language-");if(M.includes(".")){const pe=M.split(".");return[`${Q}${pe.shift()}`,...pe.map((Ie,ht)=>`${Ie}${"_".repeat(ht+1)}`)].join(" ")}return`${Q}${M}`};class u{constructor(Q,pe){this.buffer="",this.classPrefix=pe.classPrefix,Q.walk(this)}addText(Q){this.buffer+=n(Q)}openNode(Q){if(!a(Q))return;const pe=l(Q.scope,{prefix:this.classPrefix});this.span(pe)}closeNode(Q){a(Q)&&(this.buffer+=o)}value(){return this.buffer}span(Q){this.buffer+=`<span class="${Q}">`}}const d=(M={})=>{const Q={children:[]};return Object.assign(Q,M),Q};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(Q){this.top.children.push(Q)}openNode(Q){const pe=d({scope:Q});this.add(pe),this.stack.push(pe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Q){return this.constructor._walk(Q,this.rootNode)}static _walk(Q,pe){return typeof pe=="string"?Q.addText(pe):pe.children&&(Q.openNode(pe),pe.children.forEach(Ie=>this._walk(Q,Ie)),Q.closeNode(pe)),Q}static _collapse(Q){typeof Q!="string"&&Q.children&&(Q.children.every(pe=>typeof pe=="string")?Q.children=[Q.children.join("")]:Q.children.forEach(pe=>{h._collapse(pe)}))}}class g extends h{constructor(Q){super(),this.options=Q}addText(Q){Q!==""&&this.add(Q)}startScope(Q){this.openNode(Q)}endScope(){this.closeNode()}__addSublanguage(Q,pe){const Ie=Q.root;pe&&(Ie.scope=`language:${pe}`),this.add(Ie)}toHTML(){return new u(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(M){return M?typeof M=="string"?M:M.source:null}function v(M){return x("(?=",M,")")}function y(M){return x("(?:",M,")*")}function b(M){return x("(?:",M,")?")}function x(...M){return M.map(pe=>p(pe)).join("")}function k(M){const Q=M[M.length-1];return typeof Q=="object"&&Q.constructor===Object?(M.splice(M.length-1,1),Q):{}}function E(...M){return"("+(k(M).capture?"":"?:")+M.map(Ie=>p(Ie)).join("|")+")"}function O(M){return new RegExp(M.toString()+"|").exec("").length-1}function L(M,Q){const pe=M&&M.exec(Q);return pe&&pe.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function H(M,{joinWith:Q}){let pe=0;return M.map(Ie=>{pe+=1;const ht=pe;let mt=p(Ie),be="";for(;mt.length>0;){const ve=A.exec(mt);if(!ve){be+=mt;break}be+=mt.substring(0,ve.index),mt=mt.substring(ve.index+ve[0].length),ve[0][0]==="\\"&&ve[1]?be+="\\"+String(Number(ve[1])+ht):(be+=ve[0],ve[0]==="("&&pe++)}return be}).map(Ie=>`(${Ie})`).join(Q)}const D=/\b\B/,se="[a-zA-Z]\\w*",W="[a-zA-Z_]\\w*",ee="\\b\\d+(\\.\\d+)?",R="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y="\\b(0b[01]+)",$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",K=(M={})=>{const Q=/^#![ ]*\//;return M.binary&&(M.begin=x(Q,/.*\b/,M.binary,/\b.*/)),i({scope:"meta",begin:Q,end:/$/,relevance:0,"on:begin":(pe,Ie)=>{pe.index!==0&&Ie.ignoreMatch()}},M)},q={begin:"\\\\[\\s\\S]",relevance:0},z={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[q]},Z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[q]},oe={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/},F=function(M,Q,pe={}){const Ie=i({scope:"comment",begin:M,end:Q,contains:[]},pe);Ie.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 ht=E("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 Ie.contains.push({begin:x(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},te=F("//","$"),C=F("/\\*","\\*/"),I=F("#","$"),G={scope:"number",begin:ee,relevance:0},N={scope:"number",begin:R,relevance:0},ye={scope:"number",begin:Y,relevance:0},Ne={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[q,{begin:/\[/,end:/\]/,relevance:0,contains:[q]}]},_e={scope:"title",begin:se,relevance:0},Ue={scope:"title",begin:W,relevance:0},Le={begin:"\\.\\s*"+W,relevance:0};var nt=Object.freeze({__proto__:null,APOS_STRING_MODE:z,BACKSLASH_ESCAPE:q,BINARY_NUMBER_MODE:ye,BINARY_NUMBER_RE:Y,COMMENT:F,C_BLOCK_COMMENT_MODE:C,C_LINE_COMMENT_MODE:te,C_NUMBER_MODE:N,C_NUMBER_RE:R,END_SAME_AS_BEGIN:function(M){return Object.assign(M,{"on:begin":(Q,pe)=>{pe.data._beginMatch=Q[1]},"on:end":(Q,pe)=>{pe.data._beginMatch!==Q[1]&&pe.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:se,MATCH_NOTHING_RE:D,METHOD_GUARD:Le,NUMBER_MODE:G,NUMBER_RE:ee,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:Z,REGEXP_MODE:Ne,RE_STARTERS_RE:$,SHEBANG:K,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:W,UNDERSCORE_TITLE_MODE:Ue});function Ft(M,Q){M.input[M.index-1]==="."&&Q.ignoreMatch()}function tn(M,Q){M.className!==void 0&&(M.scope=M.className,delete M.className)}function $e(M,Q){Q&&M.beginKeywords&&(M.begin="\\b("+M.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",M.__beforeBegin=Ft,M.keywords=M.keywords||M.beginKeywords,delete M.beginKeywords,M.relevance===void 0&&(M.relevance=0))}function Ln(M,Q){Array.isArray(M.illegal)&&(M.illegal=E(...M.illegal))}function Ir(M,Q){if(M.match){if(M.begin||M.end)throw new Error("begin & end are not supported with match");M.begin=M.match,delete M.match}}function Qe(M,Q){M.relevance===void 0&&(M.relevance=1)}const In=(M,Q)=>{if(!M.beforeMatch)return;if(M.starts)throw new Error("beforeMatch cannot be used with starts");const pe=Object.assign({},M);Object.keys(M).forEach(Ie=>{delete M[Ie]}),M.keywords=pe.keywords,M.begin=x(pe.beforeMatch,v(pe.begin)),M.starts={relevance:0,contains:[Object.assign(pe,{endsParent:!0})]},M.relevance=0,delete pe.beforeMatch},Wn=["of","and","for","in","not","or","if","then","parent","list","value"],_r="keyword";function sr(M,Q,pe=_r){const Ie=Object.create(null);return typeof M=="string"?ht(pe,M.split(" ")):Array.isArray(M)?ht(pe,M):Object.keys(M).forEach(function(mt){Object.assign(Ie,sr(M[mt],Q,mt))}),Ie;function ht(mt,be){Q&&(be=be.map(ve=>ve.toLowerCase())),be.forEach(function(ve){const Te=ve.split("|");Ie[Te[0]]=[mt,vr(Te[0],Te[1])]})}}function vr(M,Q){return Q?Number(Q):Ti(M)?0:1}function Ti(M){return Wn.includes(M.toLowerCase())}const Ri={},Kn=M=>{console.error(M)},Ai=(M,...Q)=>{console.log(`WARN: ${M}`,...Q)},X=(M,Q)=>{Ri[`${M}/${Q}`]||(console.log(`Deprecated as of ${M}. ${Q}`),Ri[`${M}/${Q}`]=!0)},he=new Error;function Oe(M,Q,{key:pe}){let Ie=0;const ht=M[pe],mt={},be={};for(let ve=1;ve<=Q.length;ve++)be[ve+Ie]=ht[ve],mt[ve+Ie]=!0,Ie+=O(Q[ve-1]);M[pe]=be,M[pe]._emit=mt,M[pe]._multi=!0}function je(M){if(Array.isArray(M.begin)){if(M.skip||M.excludeBegin||M.returnBegin)throw Kn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),he;if(typeof M.beginScope!="object"||M.beginScope===null)throw Kn("beginScope must be object"),he;Oe(M,M.begin,{key:"beginScope"}),M.begin=H(M.begin,{joinWith:""})}}function Xe(M){if(Array.isArray(M.end)){if(M.skip||M.excludeEnd||M.returnEnd)throw Kn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),he;if(typeof M.endScope!="object"||M.endScope===null)throw Kn("endScope must be object"),he;Oe(M,M.end,{key:"endScope"}),M.end=H(M.end,{joinWith:""})}}function zt(M){M.scope&&typeof M.scope=="object"&&M.scope!==null&&(M.beginScope=M.scope,delete M.scope)}function or(M){zt(M),typeof M.beginScope=="string"&&(M.beginScope={_wrap:M.beginScope}),typeof M.endScope=="string"&&(M.endScope={_wrap:M.endScope}),je(M),Xe(M)}function kn(M){function Q(be,ve){return new RegExp(p(be),"m"+(M.case_insensitive?"i":"")+(M.unicodeRegex?"u":"")+(ve?"g":""))}class pe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ve,Te){Te.position=this.position++,this.matchIndexes[this.matchAt]=Te,this.regexes.push([Te,ve]),this.matchAt+=O(ve)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ve=this.regexes.map(Te=>Te[1]);this.matcherRe=Q(H(ve,{joinWith:"|"}),!0),this.lastIndex=0}exec(ve){this.matcherRe.lastIndex=this.lastIndex;const Te=this.matcherRe.exec(ve);if(!Te)return null;const Dt=Te.findIndex((yr,ei)=>ei>0&&yr!==void 0),ct=this.matchIndexes[Dt];return Te.splice(0,Dt),Object.assign(Te,ct)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ve){if(this.multiRegexes[ve])return this.multiRegexes[ve];const Te=new pe;return this.rules.slice(ve).forEach(([Dt,ct])=>Te.addRule(Dt,ct)),Te.compile(),this.multiRegexes[ve]=Te,Te}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ve,Te){this.rules.push([ve,Te]),Te.type==="begin"&&this.count++}exec(ve){const Te=this.getMatcher(this.regexIndex);Te.lastIndex=this.lastIndex;let Dt=Te.exec(ve);if(this.resumingScanAtSamePosition()&&!(Dt&&Dt.index===this.lastIndex)){const ct=this.getMatcher(0);ct.lastIndex=this.lastIndex+1,Dt=ct.exec(ve)}return Dt&&(this.regexIndex+=Dt.position+1,this.regexIndex===this.count&&this.considerAll()),Dt}}function ht(be){const ve=new Ie;return be.contains.forEach(Te=>ve.addRule(Te.begin,{rule:Te,type:"begin"})),be.terminatorEnd&&ve.addRule(be.terminatorEnd,{type:"end"}),be.illegal&&ve.addRule(be.illegal,{type:"illegal"}),ve}function mt(be,ve){const Te=be;if(be.isCompiled)return Te;[tn,Ir,or,In].forEach(ct=>ct(be,ve)),M.compilerExtensions.forEach(ct=>ct(be,ve)),be.__beforeBegin=null,[$e,Ln,Qe].forEach(ct=>ct(be,ve)),be.isCompiled=!0;let Dt=null;return typeof be.keywords=="object"&&be.keywords.$pattern&&(be.keywords=Object.assign({},be.keywords),Dt=be.keywords.$pattern,delete be.keywords.$pattern),Dt=Dt||/\w+/,be.keywords&&(be.keywords=sr(be.keywords,M.case_insensitive)),Te.keywordPatternRe=Q(Dt,!0),ve&&(be.begin||(be.begin=/\B|\b/),Te.beginRe=Q(Te.begin),!be.end&&!be.endsWithParent&&(be.end=/\B|\b/),be.end&&(Te.endRe=Q(Te.end)),Te.terminatorEnd=p(Te.end)||"",be.endsWithParent&&ve.terminatorEnd&&(Te.terminatorEnd+=(be.end?"|":"")+ve.terminatorEnd)),be.illegal&&(Te.illegalRe=Q(be.illegal)),be.contains||(be.contains=[]),be.contains=[].concat(...be.contains.map(function(ct){return Pr(ct==="self"?be:ct)})),be.contains.forEach(function(ct){mt(ct,Te)}),be.starts&&mt(be.starts,ve),Te.matcher=ht(Te),Te}if(M.compilerExtensions||(M.compilerExtensions=[]),M.contains&&M.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return M.classNameAliases=i(M.classNameAliases||{}),mt(M)}function ar(M){return M?M.endsWithParent||ar(M.starts):!1}function Pr(M){return M.variants&&!M.cachedVariants&&(M.cachedVariants=M.variants.map(function(Q){return i(M,{variants:null},Q)})),M.cachedVariants?M.cachedVariants:ar(M)?i(M,{starts:M.starts?i(M.starts):null}):Object.isFrozen(M)?i(M):M}var Ut="11.11.1";class qn extends Error{constructor(Q,pe){super(Q),this.name="HTMLInjectionError",this.html=pe}}const nn=n,us=i,hs=Symbol("nomatch"),Jr=7,Br=function(M){const Q=Object.create(null),pe=Object.create(null),Ie=[];let ht=!0;const mt="Could not find the language '{}', did you forget to load/include a language module?",be={disableAutodetect:!0,name:"Plain text",contains:[]};let ve={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Te(ce){return ve.noHighlightRe.test(ce)}function Dt(ce){let Ce=ce.className+" ";Ce+=ce.parentNode?ce.parentNode.className:"";const We=ve.languageDetectRe.exec(Ce);if(We){const Ge=lr(We[1]);return Ge||(Ai(mt.replace("{}",We[1])),Ai("Falling back to no-highlight mode for this block.",ce)),Ge?We[1]:"no-highlight"}return Ce.split(/\s+/).find(Ge=>Te(Ge)||lr(Ge))}function ct(ce,Ce,We){let Ge="",Rt="";typeof Ce=="object"?(Ge=ce,We=Ce.ignoreIllegals,Rt=Ce.language):(X("10.7.0","highlight(lang, code, ...args) has been deprecated."),X("10.7.0",`Please use highlight(code, options) instead.
|
|
71
|
+
`:aN(e)?(u=2,d=2):dy(e)&&(u=1,d=1);++a<o.length;)l=l.concat(fy(o[a],e,{whitespace:i,breakBefore:a?void 0:u,breakAfter:a<o.length-1?Xh(o[a+1]):d}));return zg(e)&&Pg(t,e,zg)&&l.push(" "),u&&l.unshift(u),d&&l.push(d),l}function py(e,t){const n=String(e.value),i=[],o=[];let a=0;for(;a<=n.length;){Bg.lastIndex=a;const d=Bg.exec(n),h=d&&"index"in d?d.index:n.length;i.push(dN(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<i.length;)i[l].charCodeAt(i[l].length-1)===8203||l<i.length-1&&i[l+1].charCodeAt(0)===8203?(o.push(i[l]),u=void 0):i[l]?(typeof u=="number"&&o.push(u),o.push(i[l]),u=0):(l===0||l===i.length-1)&&o.push(0);return o}function hN(e){return[String(e.value)]}function dN(e,t,n){const i=[];let o=0,a;for(;o<e.length;){Fg.lastIndex=o;const l=Fg.exec(e);a=l?l.index:e.length,!o&&!a&&l&&!t&&i.push(""),o!==a&&i.push(e.slice(o,a)),o=l?a+l[0].length:a}return o!==a&&!n&&i.push(""),i.join(" ")}function my(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 fN(e){return!!(e.properties||{}).hidden}function pN(e){return e.tagName==="td"||e.tagName==="th"}function mN(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function gN(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+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*\\(",b=["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"],x=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],k=["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"],C=["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:x,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:k},H={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[H,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],se={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},W={className:"function",begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,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(se,W,H,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 _N(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=gN(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vN(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});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}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],k=["true","false"],C={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],L=["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"],H=["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:x,literal:k,built_in:[...O,...L,"set","shopt",...A,...H]},contains:[y,e.SHEBANG(),b,p,a,l,C,u,d,h,g,n]}}function yN(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="("+i+"|"+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*\\(",k={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"},C=[p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:C.concat([{begin:/\(/,end:/\)/,keywords:k,contains:C.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,relevance:0},{begin:y,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:k,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:k,disableAutodetect:!0,illegal:"</",contains:[].concat(O,L,C,[p,{begin:e.IDENT_RE+"::",keywords:k},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:h,keywords:k}}}function bN(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+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*\\(",b=["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"],x=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],k=["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"],C=["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:x,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:k},H={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},D=[H,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],se={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},W={className:"function",begin:"("+l+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,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(se,W,H,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 SN(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"],i=["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:i},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/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,y]},x={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},k=e.inherit(x,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});v.contains=[x,b,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],y.contains=[k,b,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const C={variants:[h,x,b,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},O={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},L=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"}},C,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,O,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,O,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:"("+L+"\\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,O],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[C,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},A]}}const wN=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_-]*/}}),xN=["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"],kN=["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"],EN=[...xN,...kN],CN=["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(),NN=["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(),TN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),RN=["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 AN(e){const t=e.regex,n=wN(e),i={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,i,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:":("+NN.join("|")+")"},{begin:":(:)?("+TN.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+RN.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:CN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+EN.join("|")+")\\b"}]}}function MN(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 ON(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 DN(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 LN(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.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:[i,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:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[i,u,a,o,l,n]}}]}}var Hs="[0-9](_*[0-9])*",Nl=`\\.(${Hs})`,Tl="[0-9a-fA-F](_*[0-9a-fA-F])*",Hg={className:"number",variants:[{begin:`(\\b(${Hs})((${Nl})|\\.)?|(${Nl}))[eE][+-]?(${Hs})[fFdD]?\\b`},{begin:`\\b(${Hs})((${Nl})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nl})[fFdD]?\\b`},{begin:`\\b(${Hs})[fFdD]\\b`},{begin:`\\b0[xX]((${Tl})\\.?|(${Tl})?\\.(${Tl}))[pP][+-]?(${Hs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Tl})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function gy(e,t,n){return n===-1?"":e.replace(t,i=>gy(e,t,n-1))}function IN(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+gy("(?:<"+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:["(?:"+i+"\\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,Hg,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Hg,h]}}const $g="[A-Za-z$_][0-9A-Za-z$_]*",PN=["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"],BN=["true","false","null","undefined","NaN","Infinity"],_y=["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"],vy=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],yy=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],FN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zN=[].concat(yy,_y,vy);function UN(e){const t=e.regex,n=(F,{after:te})=>{const E="</"+F[0].slice(1);return F.input.indexOf(E,te)!==-1},i=$g,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const E=F[0].length+F.index,I=F.input[E];if(I==="<"||I===","){te.ignoreMatch();return}I===">"&&(n(F,{after:E})||te.ignoreMatch());let G;const N=F.input.substring(E);if(G=N.match(/^\s*=/)){te.ignoreMatch();return}if((G=N.match(/^\s+extends\s+/))&&G.index===0){te.ignoreMatch();return}}},u={$pattern:$g,keyword:PN,literal:BN,built_in:zN,"variable.language":FN},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"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},L=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,{match:/\$\d+/},p];v.contains=L.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(L)});const A=[].concat(O,v.contains),H=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H},se={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={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:{_:[..._y,...vy]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(F){return t.concat("(?!",F.join("|"),")")}const K={match:t.concat(/\b/,$([...yy,"super","import"].map(F=>`${F}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,O,{match:/\$\d+/},p,W,{scope:"attr",match:i+t.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:Z,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:H}]}]},{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"]}]}]},R,{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:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},K,Y,se,z,{match:/\$[(.]/}]}}function HN(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],o={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},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 $s="[0-9](_*[0-9])*",Rl=`\\.(${$s})`,Al="[0-9a-fA-F](_*[0-9a-fA-F])*",$N={className:"number",variants:[{begin:`(\\b(${$s})((${Rl})|\\.)?|(${Rl}))[eE][+-]?(${$s})[fFdD]?\\b`},{begin:`\\b(${$s})((${Rl})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rl})[fFdD]?\\b`},{begin:`\\b(${$s})[fFdD]\\b`},{begin:`\\b0[xX]((${Al})\\.?|(${Al})?\\.(${Al}))[pP][+-]?(${$s})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Al})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jN(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+/}]}},i={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=$N,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,i,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:`
|
|
72
|
+
`},h]}}const WN=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_-]*/}}),KN=["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"],qN=["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"],VN=[...KN,...qN],GN=["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(),by=["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(),Sy=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),YN=["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(),XN=by.concat(Sy).sort().reverse();function ZN(e){const t=WN(e),n=XN,i="and or not only",o="[\\w-]+",a="("+o+"|@\\{"+o+"\\})",l=[],u=[],d=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},h=function(L,A,H){return{className:L,begin:A,relevance:H}},g={$pattern:/[a-z-]+/,keyword:i,attribute:GN.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)},b={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+YN.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:u}}]},x={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}},k={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},C={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("+VN.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:":("+by.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Sy.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},t.FUNCTION_DISPATCH]},O={begin:o+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[C]};return l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,k,O,b,C,y,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function QN(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],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:[i],relevance:5}])}}function JN(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]},i={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,i,o,a,l]}}function eT(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={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(C=>{C.contains=C.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,i,d,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tT(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 nT(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"],i=/[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=(x,k,C="\\1")=>{const O=C==="\\1"?C:t.concat(C,k);return t.concat(t.concat("(?:",x,")"),k,/(?:\\.|[^\\\/])*?/,O,/(?:\\.|[^\\\/])*?/,C,i)},y=(x,k,C)=>t.concat(t.concat("(?:",x,")"),k,/(?:\\.|[^\\\/])*?/,C,i),b=[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=b,l.contains=b,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:b}}function rT(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=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:"\\$+"+i},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,z)=>{z.data._beginMatch=q[1]||q[2]},"on:end":(q,z)=>{z.data._beginMatch!==q[1]&&z.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
73
|
+
]`,b={scope:"string",variants:[g,h,p,v]},x={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},k=["false","null","true"],C=["__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"],O=["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:C,literal:(q=>{const z=[];return q.forEach(Z=>{z.push(Z),Z.toLowerCase()===Z?z.push(Z.toUpperCase()):z.push(Z.toLowerCase())}),z})(k),built_in:O},H=q=>q.map(z=>z.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,t.concat(y,"+"),t.concat("(?!",H(O).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},se=t.concat(i,"\\b(?!\\()"),W={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),se],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),se],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(i,t.lookahead(":"),t.lookahead(/(?!::)/))},R={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[ee,l,W,e.C_BLOCK_COMMENT_MODE,b,x,D]},Y={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",H(C).join("\\b|"),"|",H(O).join("\\b|"),"\\b)"),i,t.concat(y,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[R]};R.contains.push(Y);const $=[ee,W,e.C_BLOCK_COMMENT_MODE,b,x,D],K={begin:t.concat(/#\[\s*\\?/,t.either(o,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:k,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:k,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:o},{match:a}]}]};return{case_insensitive:!1,keywords:A,contains:[K,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,Y,W,{match:[/const/,/\s/,i],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",K,l,W,e.C_BLOCK_COMMENT_MODE,b,x]}]},{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]},b,x]}}function iT(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 sT(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function oT(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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:i,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})\\.`,b=`\\b|${i.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${y}))[eE][+-]?(${v})[jJ]?(?=${b})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${v})[jJ](?=${b})`}]},k={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},C={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,x,p,e.HASH_COMMENT_MODE]}]};return h.contains=[p,x,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,k,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[C]},{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:[x,C,p]}]}}function aT(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function lT(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=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,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[a,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{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 cT(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(i,/(::\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])*",b={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"}]},x={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:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},b,{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,x.contains=D;const R=[{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(R).concat(h).concat(D)}}function uT(e){const t=e.regex,n=/(r#)?/,i=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+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:g}},{className:"punctuation",begin:"->"},a]}}const hT=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_-]*/}}),dT=["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"],fT=["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"],pT=[...dT,...fT],mT=["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(),gT=["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(),_T=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vT=["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 yT(e){const t=hT(e),n=_T,i=gT,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("+pT.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},u,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vT.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:mT.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 bT(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ST(e){const t=e.regex,n=e.COMMENT("--","$"),i={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,b=[...h,...d].filter(H=>!g.includes(H)),x={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},k={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},C={match:t.concat(/\b/,t.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function O(H){return t.concat(/\b/,t.either(...H.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const L={scope:"keyword",match:O(v),relevance:0};function A(H,{exceptions:D,when:se}={}){const W=se;return D=D||[],H.map(ee=>ee.match(/\|\d+$/)||D.includes(ee)?ee:W(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(b,{when:H=>H.length<3}),literal:a,type:u,built_in:p},contains:[{scope:"type",match:O(l)},L,C,x,i,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,k]}}function wy(e){return e?typeof e=="string"?e:e.source:null}function Fo(e){return ot("(?=",e,")")}function ot(...e){return e.map(n=>wy(n)).join("")}function wT(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function bn(...e){return"("+(wT(e).capture?"":"?:")+e.map(i=>wy(i)).join("|")+")"}const sf=e=>ot(/\b/,e,/\w$/.test(e)?/\b/:/\B/),xT=["Protocol","Type"].map(sf),jg=["init","self"].map(sf),kT=["Any","Self"],Sh=["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"],Wg=["false","nil","true"],ET=["assignment","associativity","higherThan","left","lowerThan","none","right"],CT=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Kg=["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"],xy=bn(/[/=\-+!*%<>&|^~?]/,/[\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]/),ky=bn(xy,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),wh=ot(xy,ky,"*"),Ey=bn(/[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]/),Zl=bn(Ey,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Tr=ot(Ey,Zl,"*"),Ml=ot(/[A-Z]/,Zl,"*"),NT=["attached","autoclosure",ot(/convention\(/,bn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ot(/objc\(/,Tr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],TT=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function RT(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,bn(...xT,...jg)],className:{2:"keyword"}},a={match:ot(/\./,bn(...Sh)),relevance:0},l=Sh.filter(Qe=>typeof Qe=="string").concat(["_|0"]),u=Sh.filter(Qe=>typeof Qe!="string").concat(kT).map(sf),d={variants:[{className:"keyword",match:bn(...u,...jg)}]},h={$pattern:bn(/\b\w+/,/#\w+/),keyword:l.concat(CT),literal:Wg},g=[o,a,d],p={match:ot(/\./,bn(...Kg)),relevance:0},v={className:"built_in",match:ot(/\b/,bn(...Kg),/(?=\()/)},y=[p,v],b={match:/->/,relevance:0},x={className:"operator",relevance:0,variants:[{match:wh},{match:`\\.(\\.|${ky})+`}]},k=[b,x],C="([0-9]_*)+",O="([0-9a-fA-F]_*)+",L={className:"number",relevance:0,variants:[{match:`\\b(${C})(\\.(${C}))?([eE][+-]?(${C}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${C}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(Qe="")=>({className:"subst",variants:[{match:ot(/\\/,Qe,/[0\\tnr"']/)},{match:ot(/\\/,Qe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),H=(Qe="")=>({className:"subst",match:ot(/\\/,Qe,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(Qe="")=>({className:"subst",label:"interpol",begin:ot(/\\/,Qe,/\(/),end:/\)/}),se=(Qe="")=>({begin:ot(Qe,/"""/),end:ot(/"""/,Qe),contains:[A(Qe),H(Qe),D(Qe)]}),W=(Qe="")=>({begin:ot(Qe,/"/),end:ot(/"/,Qe),contains:[A(Qe),D(Qe)]}),ee={className:"string",variants:[se(),se("#"),se("##"),se("###"),W(),W("#"),W("##"),W("###")]},R=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],Y={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:R},$=Qe=>{const In=ot(Qe,/\//),Wn=ot(/\//,Qe);return{begin:In,end:Wn,contains:[...R,{scope:"comment",begin:`#(?!.*${Wn})`,end:/$/}]}},K={scope:"regexp",variants:[$("###"),$("##"),$("#"),Y]},q={match:ot(/`/,Tr,/`/)},z={className:"variable",match:/\$\d+/},Z={className:"variable",match:`\\$${Zl}+`},oe=[q,z,Z],F={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:TT,contains:[...k,L,ee]}]}},te={scope:"keyword",match:ot(/@/,bn(...NT),Fo(bn(/\(/,/\s+/)))},E={scope:"meta",match:ot(/@/,Tr)},I=[F,te,E],G={match:Fo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ot(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Zl,"+")},{className:"type",match:Ml,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ot(/\s+&\s+/,Fo(Ml)),relevance:0}]},N={begin:/</,end:/>/,keywords:h,contains:[...i,...g,...I,b,G]};G.contains.push(N);const ye={match:ot(Tr,/\s*:/),keywords:"_|0",relevance:0},Ne={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",ye,...i,K,...g,...y,...k,L,ee,...oe,...I,G]},_e={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,G]},Ue={begin:bn(Fo(ot(Tr,/\s*:/)),Fo(ot(Tr,/\s+/,Tr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Tr}]},Le={begin:/\(/,end:/\)/,keywords:h,contains:[Ue,...i,...g,...k,L,ee,...I,G,Ne],endsParent:!0,illegal:/["']/},He={match:[/(func|macro)/,/\s+/,bn(q.match,Tr,wh)],className:{1:"keyword",3:"title.function"},contains:[_e,Le,t],illegal:[/\[/,/%/]},nt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[_e,Le,t],illegal:/\[|%/},Ft={match:[/operator/,/\s+/,wh],className:{1:"keyword",3:"title"}},tn={begin:[/precedencegroup/,/\s+/,Ml],className:{1:"keyword",3:"title"},contains:[G],keywords:[...ET,...Wg],end:/}/},$e={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ln={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ir={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Tr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[_e,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Ml},...g],relevance:0}]};for(const Qe of ee.variants){const In=Qe.contains.find(_r=>_r.label==="interpol");In.keywords=h;const Wn=[...g,...y,...k,L,ee,...oe];In.contains=[...Wn,{begin:/\(/,end:/\)/,contains:["self",...Wn]}]}return{name:"Swift",keywords:h,contains:[...i,He,nt,$e,Ln,Ir,Ft,tn,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},K,...g,...y,...k,L,ee,...oe,...I,G,Ne]}}const Ql="[A-Za-z$_][0-9A-Za-z$_]*",Cy=["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"],Ny=["true","false","null","undefined","NaN","Infinity"],Ty=["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"],Ry=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ay=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],My=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Oy=[].concat(Ay,Ty,Ry);function AT(e){const t=e.regex,n=(F,{after:te})=>{const E="</"+F[0].slice(1);return F.input.indexOf(E,te)!==-1},i=Ql,o={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const E=F[0].length+F.index,I=F.input[E];if(I==="<"||I===","){te.ignoreMatch();return}I===">"&&(n(F,{after:E})||te.ignoreMatch());let G;const N=F.input.substring(E);if(G=N.match(/^\s*=/)){te.ignoreMatch();return}if((G=N.match(/^\s+extends\s+/))&&G.index===0){te.ignoreMatch();return}}},u={$pattern:Ql,keyword:Cy,literal:Ny,built_in:Oy,"variable.language":My},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"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},L=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,{match:/\$\d+/},p];v.contains=L.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(L)});const A=[].concat(O,v.contains),H=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:H},se={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={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:{_:[...Ty,...Ry]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(F){return t.concat("(?!",F.join("|"),")")}const K={match:t.concat(/\b/,$([...Ay,"super","import"].map(F=>`${F}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,x,k,O,{match:/\$\d+/},p,W,{scope:"attr",match:i+t.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:Z,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:H}]}]},{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"]}]}]},R,{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:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},K,Y,se,z,{match:/\$[(.]/}]}}function MT(e){const t=e.regex,n=AT(e),i=Ql,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:Ql,keyword:Cy.concat(d),literal:Ny,built_in:Oy.concat(o),"variable.language":My},g={className:"meta",begin:"@"+i},p=(x,k,C)=>{const O=x.contains.findIndex(L=>L.label===k);if(O===-1)throw new Error("can not find mode to replace");x.contains.splice(O,1,C)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(g);const v=n.contains.find(x=>x.scope==="attr"),y=Object.assign({},v,{match:t.concat(i,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 b=n.contains.find(x=>x.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function OT(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={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,i,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 DT(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["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:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,l,o,e.QUOTE_STRING_MODE,d,h,u]}}function LT(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\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:i,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 IT(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={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},b={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},k=[i,{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},b,x,a,l],C=[...k];return C.pop(),C.push(u),y.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:k}}const PT={arduino:_N,bash:vN,c:yN,cpp:bN,csharp:SN,css:AN,diff:MN,go:ON,graphql:DN,ini:LN,java:IN,javascript:UN,json:HN,kotlin:jN,less:ZN,lua:QN,makefile:JN,markdown:eT,objectivec:tT,perl:nT,php:rT,"php-template":iT,plaintext:sT,python:oT,"python-repl":aT,r:lT,ruby:cT,rust:uT,scss:yT,shell:bT,sql:ST,swift:RT,typescript:MT,vbnet:OT,wasm:DT,xml:LT,yaml:IT};var xh,qg;function BT(){if(qg)return xh;qg=1;function e(M){return M instanceof Map?M.clear=M.delete=M.set=function(){throw new Error("map is read-only")}:M instanceof Set&&(M.add=M.clear=M.delete=function(){throw new Error("set is read-only")}),Object.freeze(M),Object.getOwnPropertyNames(M).forEach(Q=>{const pe=M[Q],Ie=typeof pe;(Ie==="object"||Ie==="function")&&!Object.isFrozen(pe)&&e(pe)}),M}class t{constructor(Q){Q.data===void 0&&(Q.data={}),this.data=Q.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(M){return M.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(M,...Q){const pe=Object.create(null);for(const Ie in M)pe[Ie]=M[Ie];return Q.forEach(function(Ie){for(const ht in Ie)pe[ht]=Ie[ht]}),pe}const o="</span>",a=M=>!!M.scope,l=(M,{prefix:Q})=>{if(M.startsWith("language:"))return M.replace("language:","language-");if(M.includes(".")){const pe=M.split(".");return[`${Q}${pe.shift()}`,...pe.map((Ie,ht)=>`${Ie}${"_".repeat(ht+1)}`)].join(" ")}return`${Q}${M}`};class u{constructor(Q,pe){this.buffer="",this.classPrefix=pe.classPrefix,Q.walk(this)}addText(Q){this.buffer+=n(Q)}openNode(Q){if(!a(Q))return;const pe=l(Q.scope,{prefix:this.classPrefix});this.span(pe)}closeNode(Q){a(Q)&&(this.buffer+=o)}value(){return this.buffer}span(Q){this.buffer+=`<span class="${Q}">`}}const d=(M={})=>{const Q={children:[]};return Object.assign(Q,M),Q};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(Q){this.top.children.push(Q)}openNode(Q){const pe=d({scope:Q});this.add(pe),this.stack.push(pe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Q){return this.constructor._walk(Q,this.rootNode)}static _walk(Q,pe){return typeof pe=="string"?Q.addText(pe):pe.children&&(Q.openNode(pe),pe.children.forEach(Ie=>this._walk(Q,Ie)),Q.closeNode(pe)),Q}static _collapse(Q){typeof Q!="string"&&Q.children&&(Q.children.every(pe=>typeof pe=="string")?Q.children=[Q.children.join("")]:Q.children.forEach(pe=>{h._collapse(pe)}))}}class g extends h{constructor(Q){super(),this.options=Q}addText(Q){Q!==""&&this.add(Q)}startScope(Q){this.openNode(Q)}endScope(){this.closeNode()}__addSublanguage(Q,pe){const Ie=Q.root;pe&&(Ie.scope=`language:${pe}`),this.add(Ie)}toHTML(){return new u(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(M){return M?typeof M=="string"?M:M.source:null}function v(M){return x("(?=",M,")")}function y(M){return x("(?:",M,")*")}function b(M){return x("(?:",M,")?")}function x(...M){return M.map(pe=>p(pe)).join("")}function k(M){const Q=M[M.length-1];return typeof Q=="object"&&Q.constructor===Object?(M.splice(M.length-1,1),Q):{}}function C(...M){return"("+(k(M).capture?"":"?:")+M.map(Ie=>p(Ie)).join("|")+")"}function O(M){return new RegExp(M.toString()+"|").exec("").length-1}function L(M,Q){const pe=M&&M.exec(Q);return pe&&pe.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function H(M,{joinWith:Q}){let pe=0;return M.map(Ie=>{pe+=1;const ht=pe;let mt=p(Ie),be="";for(;mt.length>0;){const ve=A.exec(mt);if(!ve){be+=mt;break}be+=mt.substring(0,ve.index),mt=mt.substring(ve.index+ve[0].length),ve[0][0]==="\\"&&ve[1]?be+="\\"+String(Number(ve[1])+ht):(be+=ve[0],ve[0]==="("&&pe++)}return be}).map(Ie=>`(${Ie})`).join(Q)}const D=/\b\B/,se="[a-zA-Z]\\w*",W="[a-zA-Z_]\\w*",ee="\\b\\d+(\\.\\d+)?",R="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y="\\b(0b[01]+)",$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",K=(M={})=>{const Q=/^#![ ]*\//;return M.binary&&(M.begin=x(Q,/.*\b/,M.binary,/\b.*/)),i({scope:"meta",begin:Q,end:/$/,relevance:0,"on:begin":(pe,Ie)=>{pe.index!==0&&Ie.ignoreMatch()}},M)},q={begin:"\\\\[\\s\\S]",relevance:0},z={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[q]},Z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[q]},oe={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/},F=function(M,Q,pe={}){const Ie=i({scope:"comment",begin:M,end:Q,contains:[]},pe);Ie.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 ht=C("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 Ie.contains.push({begin:x(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},te=F("//","$"),E=F("/\\*","\\*/"),I=F("#","$"),G={scope:"number",begin:ee,relevance:0},N={scope:"number",begin:R,relevance:0},ye={scope:"number",begin:Y,relevance:0},Ne={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[q,{begin:/\[/,end:/\]/,relevance:0,contains:[q]}]},_e={scope:"title",begin:se,relevance:0},Ue={scope:"title",begin:W,relevance:0},Le={begin:"\\.\\s*"+W,relevance:0};var nt=Object.freeze({__proto__:null,APOS_STRING_MODE:z,BACKSLASH_ESCAPE:q,BINARY_NUMBER_MODE:ye,BINARY_NUMBER_RE:Y,COMMENT:F,C_BLOCK_COMMENT_MODE:E,C_LINE_COMMENT_MODE:te,C_NUMBER_MODE:N,C_NUMBER_RE:R,END_SAME_AS_BEGIN:function(M){return Object.assign(M,{"on:begin":(Q,pe)=>{pe.data._beginMatch=Q[1]},"on:end":(Q,pe)=>{pe.data._beginMatch!==Q[1]&&pe.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:se,MATCH_NOTHING_RE:D,METHOD_GUARD:Le,NUMBER_MODE:G,NUMBER_RE:ee,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:Z,REGEXP_MODE:Ne,RE_STARTERS_RE:$,SHEBANG:K,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:W,UNDERSCORE_TITLE_MODE:Ue});function Ft(M,Q){M.input[M.index-1]==="."&&Q.ignoreMatch()}function tn(M,Q){M.className!==void 0&&(M.scope=M.className,delete M.className)}function $e(M,Q){Q&&M.beginKeywords&&(M.begin="\\b("+M.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",M.__beforeBegin=Ft,M.keywords=M.keywords||M.beginKeywords,delete M.beginKeywords,M.relevance===void 0&&(M.relevance=0))}function Ln(M,Q){Array.isArray(M.illegal)&&(M.illegal=C(...M.illegal))}function Ir(M,Q){if(M.match){if(M.begin||M.end)throw new Error("begin & end are not supported with match");M.begin=M.match,delete M.match}}function Qe(M,Q){M.relevance===void 0&&(M.relevance=1)}const In=(M,Q)=>{if(!M.beforeMatch)return;if(M.starts)throw new Error("beforeMatch cannot be used with starts");const pe=Object.assign({},M);Object.keys(M).forEach(Ie=>{delete M[Ie]}),M.keywords=pe.keywords,M.begin=x(pe.beforeMatch,v(pe.begin)),M.starts={relevance:0,contains:[Object.assign(pe,{endsParent:!0})]},M.relevance=0,delete pe.beforeMatch},Wn=["of","and","for","in","not","or","if","then","parent","list","value"],_r="keyword";function sr(M,Q,pe=_r){const Ie=Object.create(null);return typeof M=="string"?ht(pe,M.split(" ")):Array.isArray(M)?ht(pe,M):Object.keys(M).forEach(function(mt){Object.assign(Ie,sr(M[mt],Q,mt))}),Ie;function ht(mt,be){Q&&(be=be.map(ve=>ve.toLowerCase())),be.forEach(function(ve){const Te=ve.split("|");Ie[Te[0]]=[mt,vr(Te[0],Te[1])]})}}function vr(M,Q){return Q?Number(Q):Ti(M)?0:1}function Ti(M){return Wn.includes(M.toLowerCase())}const Ri={},Kn=M=>{console.error(M)},Ai=(M,...Q)=>{console.log(`WARN: ${M}`,...Q)},X=(M,Q)=>{Ri[`${M}/${Q}`]||(console.log(`Deprecated as of ${M}. ${Q}`),Ri[`${M}/${Q}`]=!0)},he=new Error;function Oe(M,Q,{key:pe}){let Ie=0;const ht=M[pe],mt={},be={};for(let ve=1;ve<=Q.length;ve++)be[ve+Ie]=ht[ve],mt[ve+Ie]=!0,Ie+=O(Q[ve-1]);M[pe]=be,M[pe]._emit=mt,M[pe]._multi=!0}function je(M){if(Array.isArray(M.begin)){if(M.skip||M.excludeBegin||M.returnBegin)throw Kn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),he;if(typeof M.beginScope!="object"||M.beginScope===null)throw Kn("beginScope must be object"),he;Oe(M,M.begin,{key:"beginScope"}),M.begin=H(M.begin,{joinWith:""})}}function Xe(M){if(Array.isArray(M.end)){if(M.skip||M.excludeEnd||M.returnEnd)throw Kn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),he;if(typeof M.endScope!="object"||M.endScope===null)throw Kn("endScope must be object"),he;Oe(M,M.end,{key:"endScope"}),M.end=H(M.end,{joinWith:""})}}function zt(M){M.scope&&typeof M.scope=="object"&&M.scope!==null&&(M.beginScope=M.scope,delete M.scope)}function or(M){zt(M),typeof M.beginScope=="string"&&(M.beginScope={_wrap:M.beginScope}),typeof M.endScope=="string"&&(M.endScope={_wrap:M.endScope}),je(M),Xe(M)}function kn(M){function Q(be,ve){return new RegExp(p(be),"m"+(M.case_insensitive?"i":"")+(M.unicodeRegex?"u":"")+(ve?"g":""))}class pe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ve,Te){Te.position=this.position++,this.matchIndexes[this.matchAt]=Te,this.regexes.push([Te,ve]),this.matchAt+=O(ve)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ve=this.regexes.map(Te=>Te[1]);this.matcherRe=Q(H(ve,{joinWith:"|"}),!0),this.lastIndex=0}exec(ve){this.matcherRe.lastIndex=this.lastIndex;const Te=this.matcherRe.exec(ve);if(!Te)return null;const Dt=Te.findIndex((yr,ei)=>ei>0&&yr!==void 0),ct=this.matchIndexes[Dt];return Te.splice(0,Dt),Object.assign(Te,ct)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ve){if(this.multiRegexes[ve])return this.multiRegexes[ve];const Te=new pe;return this.rules.slice(ve).forEach(([Dt,ct])=>Te.addRule(Dt,ct)),Te.compile(),this.multiRegexes[ve]=Te,Te}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ve,Te){this.rules.push([ve,Te]),Te.type==="begin"&&this.count++}exec(ve){const Te=this.getMatcher(this.regexIndex);Te.lastIndex=this.lastIndex;let Dt=Te.exec(ve);if(this.resumingScanAtSamePosition()&&!(Dt&&Dt.index===this.lastIndex)){const ct=this.getMatcher(0);ct.lastIndex=this.lastIndex+1,Dt=ct.exec(ve)}return Dt&&(this.regexIndex+=Dt.position+1,this.regexIndex===this.count&&this.considerAll()),Dt}}function ht(be){const ve=new Ie;return be.contains.forEach(Te=>ve.addRule(Te.begin,{rule:Te,type:"begin"})),be.terminatorEnd&&ve.addRule(be.terminatorEnd,{type:"end"}),be.illegal&&ve.addRule(be.illegal,{type:"illegal"}),ve}function mt(be,ve){const Te=be;if(be.isCompiled)return Te;[tn,Ir,or,In].forEach(ct=>ct(be,ve)),M.compilerExtensions.forEach(ct=>ct(be,ve)),be.__beforeBegin=null,[$e,Ln,Qe].forEach(ct=>ct(be,ve)),be.isCompiled=!0;let Dt=null;return typeof be.keywords=="object"&&be.keywords.$pattern&&(be.keywords=Object.assign({},be.keywords),Dt=be.keywords.$pattern,delete be.keywords.$pattern),Dt=Dt||/\w+/,be.keywords&&(be.keywords=sr(be.keywords,M.case_insensitive)),Te.keywordPatternRe=Q(Dt,!0),ve&&(be.begin||(be.begin=/\B|\b/),Te.beginRe=Q(Te.begin),!be.end&&!be.endsWithParent&&(be.end=/\B|\b/),be.end&&(Te.endRe=Q(Te.end)),Te.terminatorEnd=p(Te.end)||"",be.endsWithParent&&ve.terminatorEnd&&(Te.terminatorEnd+=(be.end?"|":"")+ve.terminatorEnd)),be.illegal&&(Te.illegalRe=Q(be.illegal)),be.contains||(be.contains=[]),be.contains=[].concat(...be.contains.map(function(ct){return Pr(ct==="self"?be:ct)})),be.contains.forEach(function(ct){mt(ct,Te)}),be.starts&&mt(be.starts,ve),Te.matcher=ht(Te),Te}if(M.compilerExtensions||(M.compilerExtensions=[]),M.contains&&M.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return M.classNameAliases=i(M.classNameAliases||{}),mt(M)}function ar(M){return M?M.endsWithParent||ar(M.starts):!1}function Pr(M){return M.variants&&!M.cachedVariants&&(M.cachedVariants=M.variants.map(function(Q){return i(M,{variants:null},Q)})),M.cachedVariants?M.cachedVariants:ar(M)?i(M,{starts:M.starts?i(M.starts):null}):Object.isFrozen(M)?i(M):M}var Ut="11.11.1";class qn extends Error{constructor(Q,pe){super(Q),this.name="HTMLInjectionError",this.html=pe}}const nn=n,us=i,hs=Symbol("nomatch"),Jr=7,Br=function(M){const Q=Object.create(null),pe=Object.create(null),Ie=[];let ht=!0;const mt="Could not find the language '{}', did you forget to load/include a language module?",be={disableAutodetect:!0,name:"Plain text",contains:[]};let ve={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Te(ce){return ve.noHighlightRe.test(ce)}function Dt(ce){let Ce=ce.className+" ";Ce+=ce.parentNode?ce.parentNode.className:"";const We=ve.languageDetectRe.exec(Ce);if(We){const Ge=lr(We[1]);return Ge||(Ai(mt.replace("{}",We[1])),Ai("Falling back to no-highlight mode for this block.",ce)),Ge?We[1]:"no-highlight"}return Ce.split(/\s+/).find(Ge=>Te(Ge)||lr(Ge))}function ct(ce,Ce,We){let Ge="",Rt="";typeof Ce=="object"?(Ge=ce,We=Ce.ignoreIllegals,Rt=Ce.language):(X("10.7.0","highlight(lang, code, ...args) has been deprecated."),X("10.7.0",`Please use highlight(code, options) instead.
|
|
74
74
|
https://github.com/highlightjs/highlight.js/issues/2277`),Rt=ce,Ge=Ce),We===void 0&&(We=!0);const bt={code:Ge,language:Rt};Oi("before:highlight",bt);const br=bt.result?bt.result:yr(bt.language,bt.code,We);return br.code=bt.code,Oi("after:highlight",br),br}function yr(ce,Ce,We,Ge){const Rt=Object.create(null);function bt(fe,Se){return fe.keywords[Se]}function br(){if(!Fe.keywords){At.addText(it);return}let fe=0;Fe.keywordPatternRe.lastIndex=0;let Se=Fe.keywordPatternRe.exec(it),De="";for(;Se;){De+=it.substring(fe,Se.index);const Ze=Vn.case_insensitive?Se[0].toLowerCase():Se[0],Et=bt(Fe,Ze);if(Et){const[qt,wc]=Et;if(At.addText(De),De="",Rt[Ze]=(Rt[Ze]||0)+1,Rt[Ze]<=Jr&&(Ii+=wc),qt.startsWith("_"))De+=Se[0];else{const wa=Vn.classNameAliases[qt]||qt;gn(Se[0],wa)}}else De+=Se[0];fe=Fe.keywordPatternRe.lastIndex,Se=Fe.keywordPatternRe.exec(it)}De+=it.substring(fe),At.addText(De)}function ps(){if(it==="")return;let fe=null;if(typeof Fe.subLanguage=="string"){if(!Q[Fe.subLanguage]){At.addText(it);return}fe=yr(Fe.subLanguage,it,!0,no[Fe.subLanguage]),no[Fe.subLanguage]=fe._top}else fe=Mi(it,Fe.subLanguage.length?Fe.subLanguage:null);Fe.relevance>0&&(Ii+=fe.relevance),At.__addSublanguage(fe._emitter,fe.language)}function mn(){Fe.subLanguage!=null?ps():br(),it=""}function gn(fe,Se){fe!==""&&(At.startScope(Se),At.addText(fe),At.endScope())}function Di(fe,Se){let De=1;const Ze=Se.length-1;for(;De<=Ze;){if(!fe._emit[De]){De++;continue}const Et=Vn.classNameAliases[fe[De]]||fe[De],qt=Se[De];Et?gn(qt,Et):(it=qt,br(),it=""),De++}}function ti(fe,Se){return fe.scope&&typeof fe.scope=="string"&&At.openNode(Vn.classNameAliases[fe.scope]||fe.scope),fe.beginScope&&(fe.beginScope._wrap?(gn(it,Vn.classNameAliases[fe.beginScope._wrap]||fe.beginScope._wrap),it=""):fe.beginScope._multi&&(Di(fe.beginScope,Se),it="")),Fe=Object.create(fe,{parent:{value:Fe}}),Fe}function Li(fe,Se,De){let Ze=L(fe.endRe,De);if(Ze){if(fe["on:end"]){const Et=new t(fe);fe["on:end"](Se,Et),Et.isMatchIgnored&&(Ze=!1)}if(Ze){for(;fe.endsParent&&fe.parent;)fe=fe.parent;return fe}}if(fe.endsWithParent)return Li(fe.parent,Se,De)}function bc(fe){return Fe.matcher.regexIndex===0?(it+=fe[0],1):(ii=!0,0)}function Sc(fe){const Se=fe[0],De=fe.rule,Ze=new t(De),Et=[De.__beforeBegin,De["on:begin"]];for(const qt of Et)if(qt&&(qt(fe,Ze),Ze.isMatchIgnored))return bc(Se);return De.skip?it+=Se:(De.excludeBegin&&(it+=Se),mn(),!De.returnBegin&&!De.excludeBegin&&(it=Se)),ti(De,fe),De.returnBegin?0:Se.length}function eo(fe){const Se=fe[0],De=Ce.substring(fe.index),Ze=Li(Fe,fe,De);if(!Ze)return hs;const Et=Fe;Fe.endScope&&Fe.endScope._wrap?(mn(),gn(Se,Fe.endScope._wrap)):Fe.endScope&&Fe.endScope._multi?(mn(),Di(Fe.endScope,fe)):Et.skip?it+=Se:(Et.returnEnd||Et.excludeEnd||(it+=Se),mn(),Et.excludeEnd&&(it=Se));do Fe.scope&&At.closeNode(),!Fe.skip&&!Fe.subLanguage&&(Ii+=Fe.relevance),Fe=Fe.parent;while(Fe!==Ze.parent);return Ze.starts&&ti(Ze.starts,fe),Et.returnEnd?0:Se.length}function Sa(){const fe=[];for(let Se=Fe;Se!==Vn;Se=Se.parent)Se.scope&&fe.unshift(Se.scope);fe.forEach(Se=>At.openNode(Se))}let ni={};function ri(fe,Se){const De=Se&&Se[0];if(it+=fe,De==null)return mn(),0;if(ni.type==="begin"&&Se.type==="end"&&ni.index===Se.index&&De===""){if(it+=Ce.slice(Se.index,Se.index+1),!ht){const Ze=new Error(`0 width match regex (${ce})`);throw Ze.languageName=ce,Ze.badRule=ni.rule,Ze}return 1}if(ni=Se,Se.type==="begin")return Sc(Se);if(Se.type==="illegal"&&!We){const Ze=new Error('Illegal lexeme "'+De+'" for mode "'+(Fe.scope||"<unnamed>")+'"');throw Ze.mode=Fe,Ze}else if(Se.type==="end"){const Ze=eo(Se);if(Ze!==hs)return Ze}if(Se.type==="illegal"&&De==="")return it+=`
|
|
75
|
-
`,1;if(Pi>1e5&&Pi>Se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return it+=De,De.length}const Vn=lr(ce);if(!Vn)throw Kn(mt.replace("{}",ce)),new Error('Unknown language: "'+ce+'"');const to=kn(Vn);let et="",Fe=Ge||to;const no={},At=new ve.__emitter(ve);Sa();let it="",Ii=0,Sr=0,Pi=0,ii=!1;try{if(Vn.__emitTokens)Vn.__emitTokens(Ce,At);else{for(Fe.matcher.considerAll();;){Pi++,ii?ii=!1:Fe.matcher.considerAll(),Fe.matcher.lastIndex=Sr;const fe=Fe.matcher.exec(Ce);if(!fe)break;const Se=Ce.substring(Sr,fe.index),De=ri(Se,fe);Sr=fe.index+De}ri(Ce.substring(Sr))}return At.finalize(),et=At.toHTML(),{language:ce,value:et,relevance:Ii,illegal:!1,_emitter:At,_top:Fe}}catch(fe){if(fe.message&&fe.message.includes("Illegal"))return{language:ce,value:nn(Ce),illegal:!0,relevance:0,_illegalBy:{message:fe.message,index:Sr,context:Ce.slice(Sr-100,Sr+100),mode:fe.mode,resultSoFar:et},_emitter:At};if(ht)return{language:ce,value:nn(Ce),illegal:!1,relevance:0,errorRaised:fe,_emitter:At,_top:Fe};throw fe}}function ei(ce){const Ce={value:nn(ce),illegal:!1,relevance:0,_top:be,_emitter:new ve.__emitter(ve)};return Ce._emitter.addText(ce),Ce}function Mi(ce,Ce){Ce=Ce||ve.languages||Object.keys(Q);const We=ei(ce),Ge=Ce.filter(lr).filter(ba).map(mn=>yr(mn,ce,!1));Ge.unshift(We);const Rt=Ge.sort((mn,gn)=>{if(mn.relevance!==gn.relevance)return gn.relevance-mn.relevance;if(mn.language&&gn.language){if(lr(mn.language).supersetOf===gn.language)return 1;if(lr(gn.language).supersetOf===mn.language)return-1}return 0}),[bt,br]=Rt,ps=bt;return ps.secondBest=br,ps}function _c(ce,Ce,We){const Ge=Ce&&pe[Ce]||We;ce.classList.add("hljs"),ce.classList.add(`language-${Ge}`)}function Zs(ce){let Ce=null;const We=Dt(ce);if(Te(We))return;if(Oi("before:highlightElement",{el:ce,language:We}),ce.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ce);return}if(ce.children.length>0&&(ve.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(ce)),ve.throwUnescapedHTML))throw new qn("One of your code blocks includes unescaped HTML.",ce.innerHTML);Ce=ce;const Ge=Ce.textContent,Rt=We?ct(Ge,{language:We,ignoreIllegals:!0}):Mi(Ge);ce.innerHTML=Rt.value,ce.dataset.highlighted="yes",_c(ce,We,Rt.language),ce.result={language:Rt.language,re:Rt.relevance,relevance:Rt.relevance},Rt.secondBest&&(ce.secondBest={language:Rt.secondBest.language,relevance:Rt.secondBest.relevance}),Oi("after:highlightElement",{el:ce,result:Rt,text:Ge})}function vc(ce){ve=us(ve,ce)}const zr=()=>{ds(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ma(){ds(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Qs=!1;function ds(){function ce(){ds()}if(document.readyState==="loading"){Qs||window.addEventListener("DOMContentLoaded",ce,!1),Qs=!0;return}document.querySelectorAll(ve.cssSelector).forEach(Zs)}function ga(ce,Ce){let We=null;try{We=Ce(M)}catch(Ge){if(Kn("Language definition for '{}' could not be registered.".replace("{}",ce)),ht)Kn(Ge);else throw Ge;We=be}We.name||(We.name=ce),Q[ce]=We,We.rawDefinition=Ce.bind(null,M),We.aliases&&ya(We.aliases,{languageName:ce})}function _a(ce){delete Q[ce];for(const Ce of Object.keys(pe))pe[Ce]===ce&&delete pe[Ce]}function va(){return Object.keys(Q)}function lr(ce){return ce=(ce||"").toLowerCase(),Q[ce]||Q[pe[ce]]}function ya(ce,{languageName:Ce}){typeof ce=="string"&&(ce=[ce]),ce.forEach(We=>{pe[We.toLowerCase()]=Ce})}function ba(ce){const Ce=lr(ce);return Ce&&!Ce.disableAutodetect}function yt(ce){ce["before:highlightBlock"]&&!ce["before:highlightElement"]&&(ce["before:highlightElement"]=Ce=>{ce["before:highlightBlock"](Object.assign({block:Ce.el},Ce))}),ce["after:highlightBlock"]&&!ce["after:highlightElement"]&&(ce["after:highlightElement"]=Ce=>{ce["after:highlightBlock"](Object.assign({block:Ce.el},Ce))})}function yc(ce){yt(ce),Ie.push(ce)}function Js(ce){const Ce=Ie.indexOf(ce);Ce!==-1&&Ie.splice(Ce,1)}function Oi(ce,Ce){const We=ce;Ie.forEach(function(Ge){Ge[We]&&Ge[We](Ce)})}function fs(ce){return X("10.7.0","highlightBlock will be removed entirely in v12.0"),X("10.7.0","Please use highlightElement now."),Zs(ce)}Object.assign(M,{highlight:ct,highlightAuto:Mi,highlightAll:ds,highlightElement:Zs,highlightBlock:fs,configure:vc,initHighlighting:zr,initHighlightingOnLoad:ma,registerLanguage:ga,unregisterLanguage:_a,listLanguages:va,getLanguage:lr,registerAliases:ya,autoDetection:ba,inherit:us,addPlugin:yc,removePlugin:Js}),M.debugMode=function(){ht=!1},M.safeMode=function(){ht=!0},M.versionString=Ut,M.regex={concat:x,lookahead:v,either:
|
|
75
|
+
`,1;if(Pi>1e5&&Pi>Se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return it+=De,De.length}const Vn=lr(ce);if(!Vn)throw Kn(mt.replace("{}",ce)),new Error('Unknown language: "'+ce+'"');const to=kn(Vn);let et="",Fe=Ge||to;const no={},At=new ve.__emitter(ve);Sa();let it="",Ii=0,Sr=0,Pi=0,ii=!1;try{if(Vn.__emitTokens)Vn.__emitTokens(Ce,At);else{for(Fe.matcher.considerAll();;){Pi++,ii?ii=!1:Fe.matcher.considerAll(),Fe.matcher.lastIndex=Sr;const fe=Fe.matcher.exec(Ce);if(!fe)break;const Se=Ce.substring(Sr,fe.index),De=ri(Se,fe);Sr=fe.index+De}ri(Ce.substring(Sr))}return At.finalize(),et=At.toHTML(),{language:ce,value:et,relevance:Ii,illegal:!1,_emitter:At,_top:Fe}}catch(fe){if(fe.message&&fe.message.includes("Illegal"))return{language:ce,value:nn(Ce),illegal:!0,relevance:0,_illegalBy:{message:fe.message,index:Sr,context:Ce.slice(Sr-100,Sr+100),mode:fe.mode,resultSoFar:et},_emitter:At};if(ht)return{language:ce,value:nn(Ce),illegal:!1,relevance:0,errorRaised:fe,_emitter:At,_top:Fe};throw fe}}function ei(ce){const Ce={value:nn(ce),illegal:!1,relevance:0,_top:be,_emitter:new ve.__emitter(ve)};return Ce._emitter.addText(ce),Ce}function Mi(ce,Ce){Ce=Ce||ve.languages||Object.keys(Q);const We=ei(ce),Ge=Ce.filter(lr).filter(ba).map(mn=>yr(mn,ce,!1));Ge.unshift(We);const Rt=Ge.sort((mn,gn)=>{if(mn.relevance!==gn.relevance)return gn.relevance-mn.relevance;if(mn.language&&gn.language){if(lr(mn.language).supersetOf===gn.language)return 1;if(lr(gn.language).supersetOf===mn.language)return-1}return 0}),[bt,br]=Rt,ps=bt;return ps.secondBest=br,ps}function _c(ce,Ce,We){const Ge=Ce&&pe[Ce]||We;ce.classList.add("hljs"),ce.classList.add(`language-${Ge}`)}function Zs(ce){let Ce=null;const We=Dt(ce);if(Te(We))return;if(Oi("before:highlightElement",{el:ce,language:We}),ce.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ce);return}if(ce.children.length>0&&(ve.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(ce)),ve.throwUnescapedHTML))throw new qn("One of your code blocks includes unescaped HTML.",ce.innerHTML);Ce=ce;const Ge=Ce.textContent,Rt=We?ct(Ge,{language:We,ignoreIllegals:!0}):Mi(Ge);ce.innerHTML=Rt.value,ce.dataset.highlighted="yes",_c(ce,We,Rt.language),ce.result={language:Rt.language,re:Rt.relevance,relevance:Rt.relevance},Rt.secondBest&&(ce.secondBest={language:Rt.secondBest.language,relevance:Rt.secondBest.relevance}),Oi("after:highlightElement",{el:ce,result:Rt,text:Ge})}function vc(ce){ve=us(ve,ce)}const zr=()=>{ds(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ma(){ds(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Qs=!1;function ds(){function ce(){ds()}if(document.readyState==="loading"){Qs||window.addEventListener("DOMContentLoaded",ce,!1),Qs=!0;return}document.querySelectorAll(ve.cssSelector).forEach(Zs)}function ga(ce,Ce){let We=null;try{We=Ce(M)}catch(Ge){if(Kn("Language definition for '{}' could not be registered.".replace("{}",ce)),ht)Kn(Ge);else throw Ge;We=be}We.name||(We.name=ce),Q[ce]=We,We.rawDefinition=Ce.bind(null,M),We.aliases&&ya(We.aliases,{languageName:ce})}function _a(ce){delete Q[ce];for(const Ce of Object.keys(pe))pe[Ce]===ce&&delete pe[Ce]}function va(){return Object.keys(Q)}function lr(ce){return ce=(ce||"").toLowerCase(),Q[ce]||Q[pe[ce]]}function ya(ce,{languageName:Ce}){typeof ce=="string"&&(ce=[ce]),ce.forEach(We=>{pe[We.toLowerCase()]=Ce})}function ba(ce){const Ce=lr(ce);return Ce&&!Ce.disableAutodetect}function yt(ce){ce["before:highlightBlock"]&&!ce["before:highlightElement"]&&(ce["before:highlightElement"]=Ce=>{ce["before:highlightBlock"](Object.assign({block:Ce.el},Ce))}),ce["after:highlightBlock"]&&!ce["after:highlightElement"]&&(ce["after:highlightElement"]=Ce=>{ce["after:highlightBlock"](Object.assign({block:Ce.el},Ce))})}function yc(ce){yt(ce),Ie.push(ce)}function Js(ce){const Ce=Ie.indexOf(ce);Ce!==-1&&Ie.splice(Ce,1)}function Oi(ce,Ce){const We=ce;Ie.forEach(function(Ge){Ge[We]&&Ge[We](Ce)})}function fs(ce){return X("10.7.0","highlightBlock will be removed entirely in v12.0"),X("10.7.0","Please use highlightElement now."),Zs(ce)}Object.assign(M,{highlight:ct,highlightAuto:Mi,highlightAll:ds,highlightElement:Zs,highlightBlock:fs,configure:vc,initHighlighting:zr,initHighlightingOnLoad:ma,registerLanguage:ga,unregisterLanguage:_a,listLanguages:va,getLanguage:lr,registerAliases:ya,autoDetection:ba,inherit:us,addPlugin:yc,removePlugin:Js}),M.debugMode=function(){ht=!1},M.safeMode=function(){ht=!0},M.versionString=Ut,M.regex={concat:x,lookahead:v,either:C,optional:b,anyNumberOfTimes:y};for(const ce in nt)typeof nt[ce]=="object"&&e(nt[ce]);return Object.assign(M,nt),M},Fr=Br({});return Fr.newInstance=()=>Br({}),xh=Fr,Fr.HighlightJS=Fr,Fr.default=Fr,xh}var FT=BT();const zT=sc(FT),Vg={},UT="hljs-";function HT(e){const t=zT.newInstance();return e&&a(e),{highlight:n,highlightAuto:i,listLanguages:o,register:a,registerAlias:l,registered:u};function n(d,h,g){const p=g||Vg,v=typeof p.prefix=="string"?p.prefix:UT;if(!t.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");t.configure({__emitter:$T,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 b=y._emitter.root,x=b.data;return x.language=y.language,x.relevance=y.relevance,b}function i(d,h){const p=(h||Vg).subset||o();let v=-1,y=0,b;for(;++v<p.length;){const x=p[v];if(!t.getLanguage(x))continue;const k=n(x,d,h);k.data&&k.data.relevance!==void 0&&k.data.relevance>y&&(y=k.data.relevance,b=k)}return b||{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 $T{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],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],o=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:o}):i.children.push(...o)}openNode(t){const n=this,i=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:i},children:[]};o.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const jT={};function WT(e){const t=e||jT,n=t.aliases,i=t.detect||!1,o=t.languages||PT,a=t.plainText,l=t.prefix,u=t.subset;let d="hljs";const h=HT(o);if(n&&h.registerAlias(n),l){const g=l.indexOf("-");d=g===-1?l:l.slice(0,g)}return function(g,p){dc(g,"element",function(v,y,b){if(v.tagName!=="code"||!b||b.type!=="element"||b.tagName!=="pre")return;const x=KT(v);if(x===!1||!x&&!i||x&&a&&a.includes(x))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(d)||v.properties.className.unshift(d);const k=cN(v,{whitespace:"pre"});let C;try{C=x?h.highlight(x,k,{prefix:l}):h.highlightAuto(k,{prefix:l,subset:u})}catch(O){const L=O;if(x&&/Unknown language/.test(L.message)){p.message("Cannot highlight as `"+x+"`, it’s not registered",{ancestors:[b,v],cause:L,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw L}!x&&C.data&&C.data.language&&v.properties.className.push("language-"+C.data.language),C.children.length>0&&(v.children=C.children)})}}function KT(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n<t.length;){const o=String(t[n]);if(o==="no-highlight"||o==="nohighlight")return!1;!i&&o.slice(0,5)==="lang-"&&(i=o.slice(5)),!i&&o.slice(0,9)==="language-"&&(i=o.slice(9))}return i}const qT=ie.memo(function({text:t}){const[n,i]=ie.useState(!1);return t?S.jsx("button",{type:"button",className:"copy-btn",title:"复制",onClick:()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1200)})},children:n?S.jsx(xw,{}):S.jsx(sv,{})}):null}),VT=ie.memo(function({text:t}){return S.jsx("div",{className:"md",children:S.jsx(jk,{remarkPlugins:[nN],rehypePlugins:[[WT,{detect:!0,ignoreMissing:!0}]],components:{pre:({children:n,...i})=>S.jsxs("div",{className:"codeblock",children:[S.jsx(qT,{text:Zh(n)}),S.jsx("pre",{...i,children:n})]})},children:t})})});function Zh(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Zh).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return Zh(t==null?void 0:t.children)}return""}function GT({thinking:e,streaming:t}){const[n,i]=ie.useState(t),o=e.split(`
|
|
76
76
|
`)[0].slice(0,80);return S.jsxs("div",{className:`thinking ${n?"open":""} ${t?"live":""}`,children:[S.jsxs("button",{type:"button",className:"thinking-toggle",onClick:()=>i(a=>!a),children:[n?S.jsx(ac,{}):S.jsx(oc,{}),S.jsx(zd,{className:"thinking-icon"}),S.jsx("span",{className:"thinking-label",children:t?S.jsxs("span",{className:"thinking-live-label",children:["思考中",S.jsx("span",{className:"dots"})]}):n?"思考":`思考:${o}`})]}),n&&S.jsx("div",{className:"thinking-body",children:e})]})}const YT={bash:"$",read:"📄",write:"✍️",edit:"✏️",grep:"🔍",find:"🧭",ls:"📂"};function XT(e){return YT[e]??"🛠"}const ZT=ie.memo(function({block:t,view:n}){var b;const[i,o]=ie.useState(!0),[a,l]=ie.useState(!1),u=!n.result&&n.streaming,d=n.result!==void 0,h=((b=n.result)==null?void 0:b.isError)??!1,g=n.result?n.result.content.map(x=>x.type==="text"?x.text:"").join(""):n.liveOutput??"",p=h?"err":d?"ok":u?"run":"idle",v=h?"出错":d?"完成":u?"执行中…":"排队中",y=()=>{t.argumentsText&&(navigator.clipboard.writeText(t.argumentsText),l(!0),setTimeout(()=>l(!1),1200))};return S.jsxs("div",{className:`toolcall ${p}`,children:[S.jsxs("div",{className:"toolcall-head",children:[S.jsx("span",{className:"toolcall-icon",children:XT(t.name)}),S.jsx("span",{className:"toolcall-name",children:t.name}),S.jsx("span",{className:"toolcall-status",children:v}),S.jsx("span",{className:"toolcall-spacer"}),S.jsx("button",{type:"button",className:"toolcall-copy",title:"复制参数",onClick:y,children:a?S.jsx(kw,{}):S.jsx(sv,{})}),S.jsx("button",{type:"button",className:"toolcall-toggle",onClick:()=>o(x=>!x),children:i?S.jsx(ac,{}):S.jsx(oc,{})})]}),i&&S.jsxs("div",{className:"toolcall-body",children:[t.argumentsText&&S.jsx("div",{className:"toolcall-args",children:t.name==="bash"&&t.argumentsText.startsWith("{")?S.jsx(QT,{args:t.argumentsText}):S.jsx("pre",{children:t.argumentsText})}),g.length>0&&S.jsxs("div",{className:"toolcall-output",children:[S.jsxs("div",{className:"toolcall-output-label",children:[h?"错误输出":"输出",u&&S.jsx("span",{className:"cursor"})]}),S.jsx("pre",{children:g})]}),u&&g.length===0&&S.jsxs("div",{className:"toolcall-waiting",children:[S.jsx("span",{className:"cursor"})," 等待输出…"]})]})]})});function QT({args:e}){let t=null;try{t=JSON.parse(e)}catch{return S.jsx("pre",{children:e})}return typeof t.command!="string"?S.jsx("pre",{children:e}):S.jsxs("div",{className:"termline",children:[S.jsx(Bd,{className:"termline-icon"}),S.jsx("code",{children:t.command}),typeof t.timeout=="number"&&S.jsxs("span",{className:"termline-timeout",children:["⏱ ",t.timeout,"s"]})]})}function JT(e){return e.type==="text"&&typeof e.text=="string"?e:null}function eR(e){return e.type==="thinking"&&typeof e.thinking=="string"?e:null}function tR(e){return e.type==="toolCall"&&typeof e.id=="string"&&typeof e.name=="string"?e:null}function nR(e){return e.type==="image"&&typeof e.dataUrl=="string"?e:null}function rR(e){return e.type==="bash"&&typeof e.command=="string"?e:null}const Gg=ie.memo(function({message:t,toolResults:n,liveOutputs:i,streaming:o,isLast:a}){if(t.role==="toolResult")return null;const l=t.role==="custom"&&t.customType==="file",u=o&&a&&t.content.length===0;return S.jsxs("div",{className:`msg msg-${t.role}`,"data-role":t.role,children:[S.jsxs("div",{className:"msg-meta",children:[S.jsx("span",{className:"msg-role",children:t.role==="custom"?t.customType==="file"?"附件":`插件 · ${t.customType??"未知"}`:aR(t.role)}),t.model&&S.jsx("span",{className:"msg-model",children:t.model}),t.timestamp&&S.jsx("span",{className:"msg-time",children:lR(t.timestamp)})]}),S.jsxs("div",{className:"msg-body",children:[t.errorMessage&&S.jsx("div",{className:"msg-error",children:t.errorMessage}),l?S.jsx(iR,{message:t}):t.content.map((d,h)=>S.jsx(oR,{block:d,toolResults:n,liveOutputs:i,streaming:o,isLast:a},`${t.id}-${h}`)),u&&S.jsxs("div",{className:"thinking-wait",children:["正在思考",S.jsx("span",{className:"dot"})]}),o&&a&&!u&&S.jsx("span",{className:"stream-cursor"})]})]})});function iR({message:e}){const[t,n]=ie.useState(!1),i=e.details??{},o=i.name??i.path??"附件",a=i.type==="folder",l=i.mode==="reference",u=e.content.filter(p=>p.type==="text").map(p=>p.text).join(`
|
|
77
77
|
`),d=sR(u),h=e.content.find(p=>p.type==="image"),g=d.split(`
|
|
78
|
-
`).length;return S.jsxs("div",{className:`attachcard ${l?"reference":""}`,children:[S.jsxs("button",{type:"button",className:"attachcard-head",onClick:()=>n(p=>!p),children:[S.jsx("span",{className:"attachcard-icon",children:a?"📁":"📎"}),S.jsx("span",{className:"attachcard-name",children:o}),i.path&&S.jsx("span",{className:"attachcard-path",children:i.path}),S.jsx("span",{className:`attachcard-mode ${l?"ref":"inline"}`,children:l?a?"文件夹 · 仅引用":`仅引用 · ${Yg(i.size)}`:h?"🖼 图片":`内联 · ${i.lines??g} 行`}),!l&&(t?S.jsx(ac,{}):S.jsx(oc,{}))]}),!l&&t&&(h!=null&&h.dataUrl?S.jsx("div",{className:"attachcard-image",children:S.jsx("img",{src:h.dataUrl,alt:o})}):S.jsx("pre",{className:"attachcard-content",children:d})),l&&S.jsx("div",{className:"attachcard-refnote",children:a?"文件夹,未展开内容 —— 智能体会按需浏览目录":`文件较大(${Yg(i.size)}),未展开内容 —— 智能体会按需读取`})]})}function Yg(e){return e===void 0?"":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function sR(e){const t=e.match(/^\s*<file path="[^"]*">\s*```\s*\n?([\s\S]*?)\n?```\s*<\/file>\s*$/);return t?t[1].trim():e.trim()}function oR({block:e,toolResults:t,liveOutputs:n,streaming:i,isLast:o}){const a=JT(e);if(a)return S.jsxs("div",{className:"msg-text",children:[S.jsx(VT,{text:a.text}),a.truncated&&S.jsx("div",{className:"trunc-note",children:"… 内容过长,当前视图已截断"})]});const l=eR(e);if(l)return S.jsx(GT,{thinking:l.thinking,streaming:i&&o});const u=tR(e);if(u){const g=t.get(u.id),p=n.get(u.id),v={result:g,liveOutput:p==null?void 0:p.text,streaming:i};return S.jsx(ZT,{block:u,view:v})}const d=nR(e);if(d&&d.dataUrl)return S.jsx("div",{className:"msg-image",children:S.jsx("img",{src:d.dataUrl,alt:"attachment"})});const h=rR(e);return h?S.jsxs("div",{className:"bashblock",children:[S.jsxs("div",{className:"bashblock-command",children:[S.jsx("span",{className:"bashblock-prompt",children:"$"}),S.jsx("code",{children:h.command}),h.exitCode!==void 0&&S.jsxs("span",{className:`bashblock-exit ${h.exitCode===0?"ok":"err"}`,children:["退出码 ",h.exitCode]}),h.cancelled&&S.jsx("span",{className:"bashblock-exit err",children:"已取消"})]}),h.output&&S.jsx("pre",{className:"bashblock-output",children:h.output}),h.truncated&&S.jsx("div",{className:"trunc-note",children:"… 输出过长,当前视图已截断"})]}):null}function aR(e){switch(e){case"user":return"你";case"assistant":return"pi";case"toolResult":return"工具";case"bashExecution":return"终端";case"branchSummary":return"分支摘要";case"compactionSummary":return"上下文已压缩";default:return e}}function lR(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return`${n}:${i}`}const Xg=new Map;function Zg(e){return e.content.some(t=>t.type==="toolCall")}const cR=[{icon:"🔍",text:"了解这个项目",prompt:"介绍一下这个项目:整体结构、主要模块和如何运行?"},{icon:"🐛",text:"排查一个问题",prompt:"帮我排查一个 bug,请先说明问题现象,我会补充细节。"},{icon:"🧪",text:"编写测试",prompt:"为项目的核心模块编写单元测试。"},{icon:"🧹",text:"代码审查",prompt:"审查最近改动的代码,指出潜在问题和改进建议。"}];function uR({state:e,liveOutputs:t}){const n=ie.useRef(null),[i,o]=ie.useState(!0),a=ie.useRef(!0),l=e.streamingMessage?[...e.messages,e.streamingMessage]:e.messages,u=ie.useMemo(()=>{const p=new Map;for(const v of e.messages)v.role==="toolResult"&&v.toolCallId&&p.set(v.toolCallId,v);return p},[e.messages]),d=l.length>0?l[l.length-1].id:null,h=ie.useCallback(()=>{const p=n.current;if(!p)return;const v=p.scrollHeight-p.scrollTop-p.clientHeight<80;a.current=v,o(v)},[]);ie.useEffect(()=>{const p=n.current;p&&a.current&&(p.scrollTop=p.scrollHeight)},[l,e.isStreaming,t]);const g=ie.useCallback(()=>{const p=n.current;p&&(p.scrollTop=p.scrollHeight),a.current=!0,o(!0)},[]);return S.jsxs("div",{className:"messages-wrap",children:[S.jsxs("div",{className:"messages",ref:n,onScroll:h,children:[e.messages.length===0&&!e.streamingMessage&&S.jsxs("div",{className:"empty-state",children:[S.jsx("div",{className:"empty-logo-wrap",children:S.jsx("div",{className:"empty-logo",children:"π"})}),S.jsx("h2",{className:"empty-title",children:"pi 编码智能体"}),S.jsx("p",{className:"empty-sub",children:"检查、编辑、运行 —— 随时待命"}),S.jsxs("div",{className:"empty-cwd",children:[S.jsx("span",{className:"empty-cwd-label",children:"目录"}),S.jsx("span",{className:"empty-cwd-path",children:e.cwd})]}),S.jsx("div",{className:"empty-examples",children:cR.map(p=>S.jsxs("button",{type:"button",className:"empty-example",title:"点击填入输入框",onClick:()=>window.dispatchEvent(new CustomEvent("pi-web:fill",{detail:p.prompt})),children:[S.jsx("span",{className:"empty-example-icon",children:p.icon}),S.jsx("span",{className:"empty-example-text",children:p.text})]},p.prompt))})]}),e.messages.map(p=>S.jsx(Gg,{message:p,toolResults:u,liveOutputs:Zg(p)?t:Xg,streaming:e.isStreaming,isLast:p.id===d},p.id)),e.streamingMessage&&S.jsx(Gg,{message:e.streamingMessage,toolResults:u,liveOutputs:Zg(e.streamingMessage)?t:Xg,streaming:!0,isLast:!0},e.streamingMessage.id),e.isStreaming&&l.length===0&&S.jsx("div",{className:"streaming-wait",children:"正在等待模型响应…"})]}),!i&&S.jsxs("button",{type:"button",className:"scroll-bottom",onClick:g,children:[S.jsx(Ew,{})," 回到底部"]})]})}function hR({chat:e,send:t,attachments:n,onRemoveAttachment:i,onSent:o}){const[a,l]=ie.useState(""),u=ie.useRef(null),d=e.state,h=(d==null?void 0:d.isStreaming)??!1,g=e.ready,p=d?d.queue.steering+d.queue.followUp:0;ie.useEffect(()=>{const b=x=>{var E;const k=x.detail;l(k),(E=u.current)==null||E.focus()};return window.addEventListener("pi-web:fill",b),()=>window.removeEventListener("pi-web:fill",b)},[]),ie.useEffect(()=>{const b=u.current;b&&(b.style.height="0px",b.style.height=`${Math.min(b.scrollHeight,220)}px`)},[a]);const v=()=>{var x;const b=a.trim();!b||!g||h||t({type:"prompt",text:b,attachments:n.map(k=>({path:k.path,mode:k.mode}))})&&(l(""),o(),(x=u.current)==null||x.focus())},y=b=>{b.key==="Enter"&&!b.shiftKey&&!b.nativeEvent.isComposing&&(b.preventDefault(),v())};return S.jsxs("div",{className:"inputbar",children:[n.length>0&&S.jsxs("div",{className:"attach-row",children:[n.map(b=>S.jsxs("span",{className:`attach-chip ${b.mode}`,title:b.isDir?`文件夹引用:${b.path}`:b.mode==="reference"?`仅引用:${b.path}`:`附加内容:${b.path}`,children:[b.isDir?"📁":b.mode==="reference"?"🔗":"📎"," ",b.name,S.jsx("button",{type:"button",className:"attach-remove",title:"移除附件",onClick:()=>i(b.path),children:"×"})]},b.path)),S.jsx("span",{className:"attach-hint",children:"将随下一条消息发送"})]}),h&&p>0&&d&&S.jsxs("div",{className:"queue-hint",children:[d.queue.followUp>0&&S.jsxs("span",{children:["⏳ ",d.queue.followUp," 条跟进消息排队中"]}),d.queue.steering>0&&S.jsxs("span",{children:["⏳ ",d.queue.steering," 条转向消息排队中"]})]}),S.jsxs("div",{className:"inputbox",children:[S.jsx("textarea",{ref:u,value:a,rows:1,placeholder:g?h?"智能体正在工作中…(消息可排队发送)":"给 pi 发送消息 — Enter 发送,Shift+Enter 换行":"正在连接服务器…",disabled:!g,onChange:b=>l(b.target.value),onKeyDown:y}),S.jsx("div",{className:"inputbox-actions",children:h?S.jsxs("button",{type:"button",className:"btn stop",title:"停止智能体",onClick:()=>t({type:"abort"}),children:[S.jsx(nv,{})," 停止"]}):S.jsx("button",{type:"button",className:"btn send",title:"发送(Enter)",disabled:!g||!a.trim(),onClick:v,children:S.jsx(yw,{})})})]})]})}function dR({chat:e}){const t=e.state;if(!t)return null;const n=t.stats,i=e.ready?"ok":"busy",o=e.ready?"已连接":"连接中…",a=n.contextUsage,l=a.tokens!==null&&a.percent!==null?`${Qg(a.tokens)} / ${Qg(a.contextWindow)}`:"—",u=a.percent??null,d=u===null?"":u>=80?"warn":u>=50?"mid":"ok",h=t.queue.steering+t.queue.followUp;return S.jsxs("footer",{className:"statusbar",children:[S.jsx("span",{className:`status-dot ${i}`,title:o}),S.jsx("span",{className:"status-item",children:o}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"上下文用量",children:["上下文",S.jsx("span",{className:`ctx-bar ${d}`,children:u!==null&&S.jsx("span",{className:"ctx-bar-fill",style:{width:`${Math.min(u,100)}%`}})}),l]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"累计成本",children:["$",fR(n.cost)]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"会话消息数",children:["消息 ",n.totalMessages]}),e.statuses.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsx("span",{className:"status-item ext-status",title:"插件状态",children:e.statuses.map(g=>g.text).join(" · ")})]}),t.isStreaming&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item working",children:[S.jsx("span",{className:"working-spin"}),"工作中",h>0&&S.jsxs("span",{className:"status-queue",children:["⏳ ",h," 排队"]})]})]})]})}function Qg(e){return e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:String(e)}function fR(e){return e<=0?"0":e<1e-4?"<0.0001":e.toFixed(4).replace(/\.?0+$/,"")}function pR({dialog:e,send:t}){const[n,i]=ie.useState(""),[o,a]=ie.useState(0),l=h=>{t({type:"dialog_response",id:e.id,value:h})};ie.useEffect(()=>{i(""),a(0);const h=g=>{g.key==="Escape"&&l(null)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e.id]);const u=Array.isArray(e.args[0])?e.args[0]:[],d=typeof e.args[0]=="string"?e.args[0]:"";return S.jsx("div",{className:"dialog-overlay",onMouseDown:h=>{h.target===h.currentTarget&&l(null)},children:S.jsxs("div",{className:"dialog",children:[S.jsx("div",{className:"dialog-title",children:e.title||"插件请求"}),e.kind==="select"&&S.jsxs("div",{className:"dialog-options",children:[u.map((h,g)=>S.jsx("button",{type:"button",className:`dialog-option ${g===o?"sel":""}`,onMouseEnter:()=>a(g),onClick:()=>l(h),children:h},g)),u.length===0&&S.jsx("div",{className:"dialog-hint",children:"(无选项)"})]}),e.kind==="confirm"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("p",{children:d}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(!1),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(!0),children:"确定"})]})]}),e.kind==="input"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("input",{className:"dialog-input",value:n,placeholder:d||"输入内容",autoFocus:!0,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.nativeEvent.isComposing&&l(n)}}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(null),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(n),children:"确定"})]})]})]})})}/**
|
|
78
|
+
`).length;return S.jsxs("div",{className:`attachcard ${l?"reference":""}`,children:[S.jsxs("button",{type:"button",className:"attachcard-head",onClick:()=>n(p=>!p),children:[S.jsx("span",{className:"attachcard-icon",children:a?"📁":"📎"}),S.jsx("span",{className:"attachcard-name",children:o}),i.path&&S.jsx("span",{className:"attachcard-path",children:i.path}),S.jsx("span",{className:`attachcard-mode ${l?"ref":"inline"}`,children:l?a?"文件夹 · 仅引用":`仅引用 · ${Yg(i.size)}`:h?"🖼 图片":`内联 · ${i.lines??g} 行`}),!l&&(t?S.jsx(ac,{}):S.jsx(oc,{}))]}),!l&&t&&(h!=null&&h.dataUrl?S.jsx("div",{className:"attachcard-image",children:S.jsx("img",{src:h.dataUrl,alt:o})}):S.jsx("pre",{className:"attachcard-content",children:d})),l&&S.jsx("div",{className:"attachcard-refnote",children:a?"文件夹,未展开内容 —— 智能体会按需浏览目录":`文件较大(${Yg(i.size)}),未展开内容 —— 智能体会按需读取`})]})}function Yg(e){return e===void 0?"":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function sR(e){const t=e.match(/^\s*<file path="[^"]*">\s*```\s*\n?([\s\S]*?)\n?```\s*<\/file>\s*$/);return t?t[1].trim():e.trim()}function oR({block:e,toolResults:t,liveOutputs:n,streaming:i,isLast:o}){const a=JT(e);if(a)return S.jsxs("div",{className:"msg-text",children:[S.jsx(VT,{text:a.text}),a.truncated&&S.jsx("div",{className:"trunc-note",children:"… 内容过长,当前视图已截断"})]});const l=eR(e);if(l)return S.jsx(GT,{thinking:l.thinking,streaming:i&&o});const u=tR(e);if(u){const g=t.get(u.id),p=n.get(u.id),v={result:g,liveOutput:p==null?void 0:p.text,streaming:i};return S.jsx(ZT,{block:u,view:v})}const d=nR(e);if(d&&d.dataUrl)return S.jsx("div",{className:"msg-image",children:S.jsx("img",{src:d.dataUrl,alt:"attachment"})});const h=rR(e);return h?S.jsxs("div",{className:"bashblock",children:[S.jsxs("div",{className:"bashblock-command",children:[S.jsx("span",{className:"bashblock-prompt",children:"$"}),S.jsx("code",{children:h.command}),h.exitCode!==void 0&&S.jsxs("span",{className:`bashblock-exit ${h.exitCode===0?"ok":"err"}`,children:["退出码 ",h.exitCode]}),h.cancelled&&S.jsx("span",{className:"bashblock-exit err",children:"已取消"})]}),h.output&&S.jsx("pre",{className:"bashblock-output",children:h.output}),h.truncated&&S.jsx("div",{className:"trunc-note",children:"… 输出过长,当前视图已截断"})]}):null}function aR(e){switch(e){case"user":return"你";case"assistant":return"pi";case"toolResult":return"工具";case"bashExecution":return"终端";case"branchSummary":return"分支摘要";case"compactionSummary":return"上下文已压缩";default:return e}}function lR(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return`${n}:${i}`}const Xg=new Map;function Zg(e){return e.content.some(t=>t.type==="toolCall")}const cR=[{icon:"🔍",text:"了解这个项目",prompt:"介绍一下这个项目:整体结构、主要模块和如何运行?"},{icon:"🐛",text:"排查一个问题",prompt:"帮我排查一个 bug,请先说明问题现象,我会补充细节。"},{icon:"🧪",text:"编写测试",prompt:"为项目的核心模块编写单元测试。"},{icon:"🧹",text:"代码审查",prompt:"审查最近改动的代码,指出潜在问题和改进建议。"}];function uR({state:e,liveOutputs:t}){const n=ie.useRef(null),[i,o]=ie.useState(!0),a=ie.useRef(!0),l=e.streamingMessage?[...e.messages,e.streamingMessage]:e.messages,u=ie.useMemo(()=>{const p=new Map;for(const v of e.messages)v.role==="toolResult"&&v.toolCallId&&p.set(v.toolCallId,v);return p},[e.messages]),d=l.length>0?l[l.length-1].id:null,h=ie.useCallback(()=>{const p=n.current;if(!p)return;const v=p.scrollHeight-p.scrollTop-p.clientHeight<80;a.current=v,o(v)},[]);ie.useEffect(()=>{const p=n.current;p&&a.current&&(p.scrollTop=p.scrollHeight)},[l,e.isStreaming,t]);const g=ie.useCallback(()=>{const p=n.current;p&&(p.scrollTop=p.scrollHeight),a.current=!0,o(!0)},[]);return S.jsxs("div",{className:"messages-wrap",children:[S.jsxs("div",{className:"messages",ref:n,onScroll:h,children:[e.messages.length===0&&!e.streamingMessage&&S.jsxs("div",{className:"empty-state",children:[S.jsx("div",{className:"empty-logo-wrap",children:S.jsx("div",{className:"empty-logo",children:"π"})}),S.jsx("h2",{className:"empty-title",children:"pi 编码智能体"}),S.jsx("p",{className:"empty-sub",children:"检查、编辑、运行 —— 随时待命"}),S.jsxs("div",{className:"empty-cwd",children:[S.jsx("span",{className:"empty-cwd-label",children:"目录"}),S.jsx("span",{className:"empty-cwd-path",children:e.cwd})]}),S.jsx("div",{className:"empty-examples",children:cR.map(p=>S.jsxs("button",{type:"button",className:"empty-example",title:"点击填入输入框",onClick:()=>window.dispatchEvent(new CustomEvent("pi-web:fill",{detail:p.prompt})),children:[S.jsx("span",{className:"empty-example-icon",children:p.icon}),S.jsx("span",{className:"empty-example-text",children:p.text})]},p.prompt))})]}),e.messages.map(p=>S.jsx(Gg,{message:p,toolResults:u,liveOutputs:Zg(p)?t:Xg,streaming:e.isStreaming,isLast:p.id===d},p.id)),e.streamingMessage&&S.jsx(Gg,{message:e.streamingMessage,toolResults:u,liveOutputs:Zg(e.streamingMessage)?t:Xg,streaming:!0,isLast:!0},e.streamingMessage.id),e.isStreaming&&l.length===0&&S.jsx("div",{className:"streaming-wait",children:"正在等待模型响应…"})]}),!i&&S.jsxs("button",{type:"button",className:"scroll-bottom",onClick:g,children:[S.jsx(Ew,{})," 回到底部"]})]})}function hR({chat:e,send:t,attachments:n,onRemoveAttachment:i,onSent:o}){const[a,l]=ie.useState(""),u=ie.useRef(null),d=e.state,h=(d==null?void 0:d.isStreaming)??!1,g=e.ready,p=d?d.queue.steering+d.queue.followUp:0;ie.useEffect(()=>{const b=x=>{var C;const k=x.detail;l(k),(C=u.current)==null||C.focus()};return window.addEventListener("pi-web:fill",b),()=>window.removeEventListener("pi-web:fill",b)},[]),ie.useEffect(()=>{const b=u.current;b&&(b.style.height="0px",b.style.height=`${Math.min(b.scrollHeight,220)}px`)},[a]);const v=()=>{var x;const b=a.trim();!b||!g||h||t({type:"prompt",text:b,attachments:n.map(k=>({path:k.path,mode:k.mode}))})&&(l(""),o(),(x=u.current)==null||x.focus())},y=b=>{b.key==="Enter"&&!b.shiftKey&&!b.nativeEvent.isComposing&&(b.preventDefault(),v())};return S.jsxs("div",{className:"inputbar",children:[n.length>0&&S.jsxs("div",{className:"attach-row",children:[n.map(b=>S.jsxs("span",{className:`attach-chip ${b.mode}`,title:b.isDir?`文件夹引用:${b.path}`:b.mode==="reference"?`仅引用:${b.path}`:`附加内容:${b.path}`,children:[b.isDir?"📁":b.mode==="reference"?"🔗":"📎"," ",b.name,S.jsx("button",{type:"button",className:"attach-remove",title:"移除附件",onClick:()=>i(b.path),children:"×"})]},b.path)),S.jsx("span",{className:"attach-hint",children:"将随下一条消息发送"})]}),h&&p>0&&d&&S.jsxs("div",{className:"queue-hint",children:[d.queue.followUp>0&&S.jsxs("span",{children:["⏳ ",d.queue.followUp," 条跟进消息排队中"]}),d.queue.steering>0&&S.jsxs("span",{children:["⏳ ",d.queue.steering," 条转向消息排队中"]})]}),S.jsxs("div",{className:"inputbox",children:[S.jsx("textarea",{ref:u,value:a,rows:1,placeholder:g?h?"智能体正在工作中…(消息可排队发送)":"给 pi 发送消息 — Enter 发送,Shift+Enter 换行":"正在连接服务器…",disabled:!g,onChange:b=>l(b.target.value),onKeyDown:y}),S.jsx("div",{className:"inputbox-actions",children:h?S.jsxs("button",{type:"button",className:"btn stop",title:"停止智能体",onClick:()=>t({type:"abort"}),children:[S.jsx(nv,{})," 停止"]}):S.jsx("button",{type:"button",className:"btn send",title:"发送(Enter)",disabled:!g||!a.trim(),onClick:v,children:S.jsx(yw,{})})})]})]})}function dR({chat:e}){const t=e.state;if(!t)return null;const n=t.stats,i=e.ready?"ok":"busy",o=e.ready?"已连接":"连接中…",a=n.contextUsage,l=a.tokens!==null&&a.percent!==null?`${Qg(a.tokens)} / ${Qg(a.contextWindow)}`:"—",u=a.percent??null,d=u===null?"":u>=80?"warn":u>=50?"mid":"ok",h=t.queue.steering+t.queue.followUp;return S.jsxs("footer",{className:"statusbar",children:[S.jsx("span",{className:`status-dot ${i}`,title:o}),S.jsx("span",{className:"status-item",children:o}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"上下文用量",children:["上下文",S.jsx("span",{className:`ctx-bar ${d}`,children:u!==null&&S.jsx("span",{className:"ctx-bar-fill",style:{width:`${Math.min(u,100)}%`}})}),l]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"累计成本",children:["$",fR(n.cost)]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"会话消息数",children:["消息 ",n.totalMessages]}),e.statuses.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsx("span",{className:"status-item ext-status",title:"插件状态",children:e.statuses.map(g=>g.text).join(" · ")})]}),t.isStreaming&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item working",children:[S.jsx("span",{className:"working-spin"}),"工作中",h>0&&S.jsxs("span",{className:"status-queue",children:["⏳ ",h," 排队"]})]})]})]})}function Qg(e){return e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:String(e)}function fR(e){return e<=0?"0":e<1e-4?"<0.0001":e.toFixed(4).replace(/\.?0+$/,"")}function pR({dialog:e,send:t}){const[n,i]=ie.useState(""),[o,a]=ie.useState(0),l=h=>{t({type:"dialog_response",id:e.id,value:h})};ie.useEffect(()=>{i(""),a(0);const h=g=>{g.key==="Escape"&&l(null)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e.id]);const u=Array.isArray(e.args[0])?e.args[0]:[],d=typeof e.args[0]=="string"?e.args[0]:"";return S.jsx("div",{className:"dialog-overlay",onMouseDown:h=>{h.target===h.currentTarget&&l(null)},children:S.jsxs("div",{className:"dialog",children:[S.jsx("div",{className:"dialog-title",children:e.title||"插件请求"}),e.kind==="select"&&S.jsxs("div",{className:"dialog-options",children:[u.map((h,g)=>S.jsx("button",{type:"button",className:`dialog-option ${g===o?"sel":""}`,onMouseEnter:()=>a(g),onClick:()=>l(h),children:h},g)),u.length===0&&S.jsx("div",{className:"dialog-hint",children:"(无选项)"})]}),e.kind==="confirm"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("p",{children:d}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(!1),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(!0),children:"确定"})]})]}),e.kind==="input"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("input",{className:"dialog-input",value:n,placeholder:d||"输入内容",autoFocus:!0,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.nativeEvent.isComposing&&l(n)}}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(null),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(n),children:"确定"})]})]})]})})}/**
|
|
79
79
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
80
80
|
* @license MIT
|
|
81
81
|
*
|
|
@@ -86,19 +86,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Rt=ce,Ge=Ce),We===void
|
|
|
86
86
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
87
87
|
* http://bellard.org/jslinux/
|
|
88
88
|
* Copyright (c) 2011 Fabrice Bellard
|
|
89
|
-
*/var Dy=Object.defineProperty,mR=Object.getOwnPropertyDescriptor,gR=(e,t)=>{for(var n in t)Dy(e,n,{get:t[n],enumerable:!0})},Tt=(e,t,n,i)=>{for(var o=i>1?void 0:i?mR(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=(i?l(t,n,o):l(o))||o);return i&&o&&Dy(t,n,o),o},me=(e,t)=>(n,i)=>t(n,i,e),Jg="Terminal input",Qh={get:()=>Jg,set:e=>Jg=e},e_="Too much output to announce, navigate to rows manually to read",Jh={get:()=>e_,set:e=>e_=e};function _R(e){return e.replace(/\r?\n/g,"\r")}function vR(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function yR(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function bR(e,t,n,i){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Ly(o,t,n,i)}}function Ly(e,t,n,i){e=_R(e),e=vR(e,n.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function Iy(e,t,n){let i=n.getBoundingClientRect(),o=e.clientX-i.left-10,a=e.clientY-i.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 t_(e,t,n,i,o){Iy(e,t,n),o&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function ki(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function fc(e,t=0,n=e.length){let i="";for(let o=t;o<n;++o){let a=e[o];a>65535?(a-=65536,i+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):i+=String.fromCharCode(a)}return i}var SR=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let i=0,o=0;if(this._interim){let a=e.charCodeAt(o++);56320<=a&&a<=57343?t[i++]=(this._interim-55296)*1024+a-56320+65536:(t[i++]=this._interim,t[i++]=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,i;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[i++]=(l-55296)*1024+u-56320+65536:(t[i++]=l,t[i++]=u);continue}l!==65279&&(t[i++]=l)}return i}},wR=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let i=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 b=0,x;for(;(x=this.interim[++b]&63)&&b<4;)y<<=6,y|=x;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,
|
|
89
|
+
*/var Dy=Object.defineProperty,mR=Object.getOwnPropertyDescriptor,gR=(e,t)=>{for(var n in t)Dy(e,n,{get:t[n],enumerable:!0})},Tt=(e,t,n,i)=>{for(var o=i>1?void 0:i?mR(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(o=(i?l(t,n,o):l(o))||o);return i&&o&&Dy(t,n,o),o},me=(e,t)=>(n,i)=>t(n,i,e),Jg="Terminal input",Qh={get:()=>Jg,set:e=>Jg=e},e_="Too much output to announce, navigate to rows manually to read",Jh={get:()=>e_,set:e=>e_=e};function _R(e){return e.replace(/\r?\n/g,"\r")}function vR(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function yR(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function bR(e,t,n,i){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Ly(o,t,n,i)}}function Ly(e,t,n,i){e=_R(e),e=vR(e,n.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function Iy(e,t,n){let i=n.getBoundingClientRect(),o=e.clientX-i.left-10,a=e.clientY-i.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 t_(e,t,n,i,o){Iy(e,t,n),o&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function ki(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function fc(e,t=0,n=e.length){let i="";for(let o=t;o<n;++o){let a=e[o];a>65535?(a-=65536,i+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):i+=String.fromCharCode(a)}return i}var SR=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let i=0,o=0;if(this._interim){let a=e.charCodeAt(o++);56320<=a&&a<=57343?t[i++]=(this._interim-55296)*1024+a-56320+65536:(t[i++]=this._interim,t[i++]=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,i;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[i++]=(l-55296)*1024+u-56320+65536:(t[i++]=l,t[i++]=u);continue}l!==65279&&(t[i++]=l)}return i}},wR=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let i=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 b=0,x;for(;(x=this.interim[++b]&63)&&b<4;)y<<=6,y|=x;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,C=k-b;for(;h<C;){if(h>=n)return 0;if(x=e[h++],(x&192)!==128){h--,v=!0;break}else this.interim[b++]=x,y<<=6,y|=x&63}v||(k===2?y<128?h--:t[i++]=y:k===3?y<2048||y>=55296&&y<=57343||y===65279||(t[i++]=y):y<65536||y>1114111||(t[i++]=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[i++]=o,t[i++]=a,t[i++]=l,t[i++]=u,p+=4;if(o=e[p++],o<128)t[i++]=o;else if((o&224)===192){if(p>=n)return this.interim[0]=o,i;if(a=e[p++],(a&192)!==128){p--;continue}if(d=(o&31)<<6|a&63,d<128){p--;continue}t[i++]=d}else if((o&240)===224){if(p>=n)return this.interim[0]=o,i;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=n)return this.interim[0]=o,this.interim[1]=a,i;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[i++]=d}else if((o&248)===240){if(p>=n)return this.interim[0]=o,i;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=n)return this.interim[0]=o,this.interim[1]=a,i;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,i;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[i++]=d}}return i}},Py="",Ei=" ",ha=class By{constructor(){this.fg=0,this.bg=0,this.extended=new Jl}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 By;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}},Jl=class Fy{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 Fy(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ir=class zy extends ha{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Jl,this.combinedData=""}static fromCharData(t){let n=new zy;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?ki(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 i=t[1].charCodeAt(0);if(55296<=i&&i<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(i-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()]}},n_="di$target",ed="di$dependencies",kh=new Map;function xR(e){return e[ed]||[]}function en(e){if(kh.has(e))return kh.get(e);let t=function(n,i,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");kR(t,n,o)};return t._id=e,kh.set(e,t),t}function kR(e,t,n){t[n_]===t?t[ed].push({id:e,index:n}):(t[ed]=[{id:e,index:n}],t[n_]=t)}var wn=en("BufferService"),Uy=en("CoreMouseService"),cs=en("CoreService"),ER=en("CharsetService"),of=en("InstantiationService"),Hy=en("LogService"),xn=en("OptionsService"),$y=en("OscLinkService"),CR=en("UnicodeService"),da=en("DecorationService"),td=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 i=[],o=this._optionsService.rawOptions.linkHandler,a=new ir,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}},b=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{let x=new URL(v);["http:","https:"].includes(x.protocol)||(b=!0)}catch{b=!0}b||i.push({text:v,range:y,activate:(x,k)=>o?o.activate(x,k,y):NR(x,k),hover:(x,k)=>{var C;return(C=o==null?void 0:o.hover)==null?void 0:C.call(o,x,k,y)},leave:(x,k)=>{var C;return(C=o==null?void 0:o.leave)==null?void 0:C.call(o,x,k,y)}})}h=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=p,u=a.extended.urlId):(d=-1,u=-1)}}t(i)}};td=Tt([me(0,wn),me(1,xn),me(2,$y)],td);function NR(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
90
90
|
|
|
91
91
|
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 pc=en("CharSizeService"),Zr=en("CoreBrowserService"),af=en("MouseService"),Qr=en("RenderService"),TR=en("SelectionService"),jy=en("CharacterJoinerService"),Ys=en("ThemeService"),Wy=en("LinkProviderService"),RR=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?r_.isErrorNoTelemetry(e)?new r_(e.message+`
|
|
92
92
|
|
|
93
93
|
`+e.stack):new Error(e.message+`
|
|
94
94
|
|
|
95
|
-
`+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)}},AR=new RR;function zl(e){MR(e)||AR.onUnexpectedError(e)}var nd="Canceled";function MR(e){return e instanceof OR?!0:e instanceof Error&&e.name===nd&&e.message===nd}var OR=class extends Error{constructor(){super(nd),this.name=this.message}};function DR(e){return new Error(`Illegal argument: ${e}`)}var r_=class rd extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof rd)return t;let n=new rd;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},id=class Ky extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ky.prototype)}};function Un(e,t=0){return e[e.length-(1+t)]}var LR;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function i(a){return a>0}e.isGreaterThan=i;function o(a){return a===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(LR||(LR={}));function IR(e,t){let n=this,i=!1,o;return function(){return i||(i=!0,t||(o=e.apply(n,arguments))),o}}var qy;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function i(){return n}e.empty=i;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 H=A.length-1;H>=0;H--)yield A[H]}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,H){let D=0;for(let se of A)if(H(se,D++))return!0;return!1}e.some=g;function p(A,H){for(let D of A)if(H(D))return D}e.find=p;function*v(A,H){for(let D of A)H(D)&&(yield D)}e.filter=v;function*y(A,H){let D=0;for(let se of A)yield H(se,D++)}e.map=y;function*b(A,H){let D=0;for(let se of A)yield*H(se,D++)}e.flatMap=b;function*x(...A){for(let H of A)yield*H}e.concat=x;function k(A,H,D){let se=D;for(let W of A)se=H(se,W);return se}e.reduce=k;function*E(A,H,D=A.length){for(H<0&&(H+=A.length),D<0?D+=A.length:D>A.length&&(D=A.length);H<D;H++)yield A[H]}e.slice=E;function O(A,H=Number.POSITIVE_INFINITY){let D=[];if(H===0)return[D,A];let se=A[Symbol.iterator]();for(let W=0;W<H;W++){let ee=se.next();if(ee.done)return[D,e.empty()];D.push(ee.value)}return[D,{[Symbol.iterator](){return se}}]}e.consume=O;async function L(A){let H=[];for await(let D of A)H.push(D);return Promise.resolve(H)}e.asyncToArray=L})(qy||(qy={}));function ss(e){if(qy.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(i){t.push(i)}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 PR(...e){return _t(()=>ss(e))}function _t(e){return{dispose:IR(()=>{e()})}}var Vy=class Gy{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{ss(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?Gy.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)}};Vy.DISABLE_DISPOSED_WARNING=!1;var Ci=Vy,qe=class{constructor(){this._store=new Ci,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)}};qe.None=Object.freeze({dispose(){}});var qs=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}},Yr=typeof window=="object"?window:globalThis,sd=class od{constructor(t){this.element=t,this.next=od.Undefined,this.prev=od.Undefined}};sd.Undefined=new sd(void 0);var xt=sd,i_=class{constructor(){this._first=xt.Undefined,this._last=xt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===xt.Undefined}clear(){let e=this._first;for(;e!==xt.Undefined;){let t=e.next;e.prev=xt.Undefined,e.next=xt.Undefined,e=t}this._first=xt.Undefined,this._last=xt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new xt(e);if(this._first===xt.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 i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==xt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==xt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==xt.Undefined&&e.next!==xt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===xt.Undefined&&e.next===xt.Undefined?(this._first=xt.Undefined,this._last=xt.Undefined):e.next===xt.Undefined?(this._last=this._last.prev,this._last.next=xt.Undefined):e.prev===xt.Undefined&&(this._first=this._first.next,this._first.prev=xt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==xt.Undefined;)yield e.element,e=e.next}},BR=globalThis.performance&&typeof globalThis.performance.now=="function",FR=class Yy{static create(t){return new Yy(t)}constructor(t){this._now=BR&&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}},an;(e=>{e.None=()=>qe.None;function t($,K){return p($,()=>{},0,void 0,!0,void 0,K)}e.defer=t;function n($){return(K,q=null,z)=>{let Z=!1,oe;return oe=$(F=>{if(!Z)return oe?oe.dispose():Z=!0,K.call(q,F)},null,z),Z&&oe.dispose(),oe}}e.once=n;function i($,K,q){return h((z,Z=null,oe)=>$(F=>z.call(Z,K(F)),null,oe),q)}e.map=i;function o($,K,q){return h((z,Z=null,oe)=>$(F=>{K(F),z.call(Z,F)},null,oe),q)}e.forEach=o;function a($,K,q){return h((z,Z=null,oe)=>$(F=>K(F)&&z.call(Z,F),null,oe),q)}e.filter=a;function l($){return $}e.signal=l;function u(...$){return(K,q=null,z)=>{let Z=PR(...$.map(oe=>oe(F=>K.call(q,F))));return g(Z,z)}}e.any=u;function d($,K,q,z){let Z=q;return i($,oe=>(Z=K(Z,oe),Z),z)}e.reduce=d;function h($,K){let q,z={onWillAddFirstListener(){q=$(Z.fire,Z)},onDidRemoveLastListener(){q==null||q.dispose()}},Z=new de(z);return K==null||K.add(Z),Z.event}function g($,K){return K instanceof Array?K.push($):K&&K.add($),$}function p($,K,q=100,z=!1,Z=!1,oe,F){let te,C,I,G=0,N,ye={leakWarningThreshold:oe,onWillAddFirstListener(){te=$(_e=>{G++,C=K(C,_e),z&&!I&&(Ne.fire(C),C=void 0),N=()=>{let Ue=C;C=void 0,I=void 0,(!z||G>1)&&Ne.fire(Ue),G=0},typeof q=="number"?(clearTimeout(I),I=setTimeout(N,q)):I===void 0&&(I=0,queueMicrotask(N))})},onWillRemoveListener(){Z&&G>0&&(N==null||N())},onDidRemoveLastListener(){N=void 0,te.dispose()}},Ne=new de(ye);return F==null||F.add(Ne),Ne.event}e.debounce=p;function v($,K=0,q){return e.debounce($,(z,Z)=>z?(z.push(Z),z):[Z],K,void 0,!0,void 0,q)}e.accumulate=v;function y($,K=(z,Z)=>z===Z,q){let z=!0,Z;return a($,oe=>{let F=z||!K(oe,Z);return z=!1,Z=oe,F},q)}e.latch=y;function b($,K,q){return[e.filter($,K,q),e.filter($,z=>!K(z),q)]}e.split=b;function x($,K=!1,q=[],z){let Z=q.slice(),oe=$(C=>{Z?Z.push(C):te.fire(C)});z&&z.add(oe);let F=()=>{Z==null||Z.forEach(C=>te.fire(C)),Z=null},te=new de({onWillAddFirstListener(){oe||(oe=$(C=>te.fire(C)),z&&z.add(oe))},onDidAddFirstListener(){Z&&(K?setTimeout(F):F())},onDidRemoveLastListener(){oe&&oe.dispose(),oe=null}});return z&&z.add(te),te.event}e.buffer=x;function k($,K){return(q,z,Z)=>{let oe=K(new O);return $(function(F){let te=oe.evaluate(F);te!==E&&q.call(z,te)},void 0,Z)}}e.chain=k;let E=Symbol("HaltChainable");class O{constructor(){this.steps=[]}map(K){return this.steps.push(K),this}forEach(K){return this.steps.push(q=>(K(q),q)),this}filter(K){return this.steps.push(q=>K(q)?q:E),this}reduce(K,q){let z=q;return this.steps.push(Z=>(z=K(z,Z),z)),this}latch(K=(q,z)=>q===z){let q=!0,z;return this.steps.push(Z=>{let oe=q||!K(Z,z);return q=!1,z=Z,oe?Z:E}),this}evaluate(K){for(let q of this.steps)if(K=q(K),K===E)break;return K}}function L($,K,q=z=>z){let z=(...te)=>F.fire(q(...te)),Z=()=>$.on(K,z),oe=()=>$.removeListener(K,z),F=new de({onWillAddFirstListener:Z,onDidRemoveLastListener:oe});return F.event}e.fromNodeEventEmitter=L;function A($,K,q=z=>z){let z=(...te)=>F.fire(q(...te)),Z=()=>$.addEventListener(K,z),oe=()=>$.removeEventListener(K,z),F=new de({onWillAddFirstListener:Z,onDidRemoveLastListener:oe});return F.event}e.fromDOMEventEmitter=A;function H($){return new Promise(K=>n($)(K))}e.toPromise=H;function D($){let K=new de;return $.then(q=>{K.fire(q)},()=>{K.fire(void 0)}).finally(()=>{K.dispose()}),K.event}e.fromPromise=D;function se($,K){return $(q=>K.fire(q))}e.forward=se;function W($,K,q){return K(q),$(z=>K(z))}e.runAndSubscribe=W;class ee{constructor(K,q){this._observable=K,this._counter=0,this._hasChanged=!1;let z={onWillAddFirstListener:()=>{K.addObserver(this)},onDidRemoveLastListener:()=>{K.removeObserver(this)}};this.emitter=new de(z),q&&q.add(this.emitter)}beginUpdate(K){this._counter++}handlePossibleChange(K){}handleChange(K,q){this._hasChanged=!0}endUpdate(K){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R($,K){return new ee($,K).emitter.event}e.fromObservable=R;function Y($){return(K,q,z)=>{let Z=0,oe=!1,F={beginUpdate(){Z++},endUpdate(){Z--,Z===0&&($.reportChanges(),oe&&(oe=!1,K.call(q)))},handlePossibleChange(){},handleChange(){oe=!0}};$.addObserver(F),$.reportChanges();let te={dispose(){$.removeObserver(F)}};return z instanceof Ci?z.add(te):Array.isArray(z)&&z.push(te),te}}e.fromObservableLight=Y})(an||(an={}));var ad=class ld{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${ld._idPool++}`,ld.all.add(this)}start(t){this._stopWatch=new FR,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}}};ad.all=new Set,ad._idPool=0;var zR=ad,UR=-1,Xy=class Zy{constructor(t,n,i=(Zy._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=i,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let i=this.threshold;if(i<=0||n<i)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=i*.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 jR(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[i,o]of this._stacks)(!t||n<o)&&(t=[i,o],n=o);return t}};Xy._idPool=1;var HR=Xy,$R=class Qy{constructor(t){this.value=t}static create(){let t=new Error;return new Qy(t.stack??"")}print(){console.warn(this.value.split(`
|
|
95
|
+
`+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)}},AR=new RR;function zl(e){MR(e)||AR.onUnexpectedError(e)}var nd="Canceled";function MR(e){return e instanceof OR?!0:e instanceof Error&&e.name===nd&&e.message===nd}var OR=class extends Error{constructor(){super(nd),this.name=this.message}};function DR(e){return new Error(`Illegal argument: ${e}`)}var r_=class rd extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof rd)return t;let n=new rd;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},id=class Ky extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ky.prototype)}};function Un(e,t=0){return e[e.length-(1+t)]}var LR;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function i(a){return a>0}e.isGreaterThan=i;function o(a){return a===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(LR||(LR={}));function IR(e,t){let n=this,i=!1,o;return function(){return i||(i=!0,t||(o=e.apply(n,arguments))),o}}var qy;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function i(){return n}e.empty=i;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 H=A.length-1;H>=0;H--)yield A[H]}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,H){let D=0;for(let se of A)if(H(se,D++))return!0;return!1}e.some=g;function p(A,H){for(let D of A)if(H(D))return D}e.find=p;function*v(A,H){for(let D of A)H(D)&&(yield D)}e.filter=v;function*y(A,H){let D=0;for(let se of A)yield H(se,D++)}e.map=y;function*b(A,H){let D=0;for(let se of A)yield*H(se,D++)}e.flatMap=b;function*x(...A){for(let H of A)yield*H}e.concat=x;function k(A,H,D){let se=D;for(let W of A)se=H(se,W);return se}e.reduce=k;function*C(A,H,D=A.length){for(H<0&&(H+=A.length),D<0?D+=A.length:D>A.length&&(D=A.length);H<D;H++)yield A[H]}e.slice=C;function O(A,H=Number.POSITIVE_INFINITY){let D=[];if(H===0)return[D,A];let se=A[Symbol.iterator]();for(let W=0;W<H;W++){let ee=se.next();if(ee.done)return[D,e.empty()];D.push(ee.value)}return[D,{[Symbol.iterator](){return se}}]}e.consume=O;async function L(A){let H=[];for await(let D of A)H.push(D);return Promise.resolve(H)}e.asyncToArray=L})(qy||(qy={}));function ss(e){if(qy.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(i){t.push(i)}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 PR(...e){return _t(()=>ss(e))}function _t(e){return{dispose:IR(()=>{e()})}}var Vy=class Gy{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{ss(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?Gy.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)}};Vy.DISABLE_DISPOSED_WARNING=!1;var Ci=Vy,qe=class{constructor(){this._store=new Ci,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)}};qe.None=Object.freeze({dispose(){}});var qs=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}},Yr=typeof window=="object"?window:globalThis,sd=class od{constructor(t){this.element=t,this.next=od.Undefined,this.prev=od.Undefined}};sd.Undefined=new sd(void 0);var xt=sd,i_=class{constructor(){this._first=xt.Undefined,this._last=xt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===xt.Undefined}clear(){let e=this._first;for(;e!==xt.Undefined;){let t=e.next;e.prev=xt.Undefined,e.next=xt.Undefined,e=t}this._first=xt.Undefined,this._last=xt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new xt(e);if(this._first===xt.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 i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==xt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==xt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==xt.Undefined&&e.next!==xt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===xt.Undefined&&e.next===xt.Undefined?(this._first=xt.Undefined,this._last=xt.Undefined):e.next===xt.Undefined?(this._last=this._last.prev,this._last.next=xt.Undefined):e.prev===xt.Undefined&&(this._first=this._first.next,this._first.prev=xt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==xt.Undefined;)yield e.element,e=e.next}},BR=globalThis.performance&&typeof globalThis.performance.now=="function",FR=class Yy{static create(t){return new Yy(t)}constructor(t){this._now=BR&&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}},an;(e=>{e.None=()=>qe.None;function t($,K){return p($,()=>{},0,void 0,!0,void 0,K)}e.defer=t;function n($){return(K,q=null,z)=>{let Z=!1,oe;return oe=$(F=>{if(!Z)return oe?oe.dispose():Z=!0,K.call(q,F)},null,z),Z&&oe.dispose(),oe}}e.once=n;function i($,K,q){return h((z,Z=null,oe)=>$(F=>z.call(Z,K(F)),null,oe),q)}e.map=i;function o($,K,q){return h((z,Z=null,oe)=>$(F=>{K(F),z.call(Z,F)},null,oe),q)}e.forEach=o;function a($,K,q){return h((z,Z=null,oe)=>$(F=>K(F)&&z.call(Z,F),null,oe),q)}e.filter=a;function l($){return $}e.signal=l;function u(...$){return(K,q=null,z)=>{let Z=PR(...$.map(oe=>oe(F=>K.call(q,F))));return g(Z,z)}}e.any=u;function d($,K,q,z){let Z=q;return i($,oe=>(Z=K(Z,oe),Z),z)}e.reduce=d;function h($,K){let q,z={onWillAddFirstListener(){q=$(Z.fire,Z)},onDidRemoveLastListener(){q==null||q.dispose()}},Z=new de(z);return K==null||K.add(Z),Z.event}function g($,K){return K instanceof Array?K.push($):K&&K.add($),$}function p($,K,q=100,z=!1,Z=!1,oe,F){let te,E,I,G=0,N,ye={leakWarningThreshold:oe,onWillAddFirstListener(){te=$(_e=>{G++,E=K(E,_e),z&&!I&&(Ne.fire(E),E=void 0),N=()=>{let Ue=E;E=void 0,I=void 0,(!z||G>1)&&Ne.fire(Ue),G=0},typeof q=="number"?(clearTimeout(I),I=setTimeout(N,q)):I===void 0&&(I=0,queueMicrotask(N))})},onWillRemoveListener(){Z&&G>0&&(N==null||N())},onDidRemoveLastListener(){N=void 0,te.dispose()}},Ne=new de(ye);return F==null||F.add(Ne),Ne.event}e.debounce=p;function v($,K=0,q){return e.debounce($,(z,Z)=>z?(z.push(Z),z):[Z],K,void 0,!0,void 0,q)}e.accumulate=v;function y($,K=(z,Z)=>z===Z,q){let z=!0,Z;return a($,oe=>{let F=z||!K(oe,Z);return z=!1,Z=oe,F},q)}e.latch=y;function b($,K,q){return[e.filter($,K,q),e.filter($,z=>!K(z),q)]}e.split=b;function x($,K=!1,q=[],z){let Z=q.slice(),oe=$(E=>{Z?Z.push(E):te.fire(E)});z&&z.add(oe);let F=()=>{Z==null||Z.forEach(E=>te.fire(E)),Z=null},te=new de({onWillAddFirstListener(){oe||(oe=$(E=>te.fire(E)),z&&z.add(oe))},onDidAddFirstListener(){Z&&(K?setTimeout(F):F())},onDidRemoveLastListener(){oe&&oe.dispose(),oe=null}});return z&&z.add(te),te.event}e.buffer=x;function k($,K){return(q,z,Z)=>{let oe=K(new O);return $(function(F){let te=oe.evaluate(F);te!==C&&q.call(z,te)},void 0,Z)}}e.chain=k;let C=Symbol("HaltChainable");class O{constructor(){this.steps=[]}map(K){return this.steps.push(K),this}forEach(K){return this.steps.push(q=>(K(q),q)),this}filter(K){return this.steps.push(q=>K(q)?q:C),this}reduce(K,q){let z=q;return this.steps.push(Z=>(z=K(z,Z),z)),this}latch(K=(q,z)=>q===z){let q=!0,z;return this.steps.push(Z=>{let oe=q||!K(Z,z);return q=!1,z=Z,oe?Z:C}),this}evaluate(K){for(let q of this.steps)if(K=q(K),K===C)break;return K}}function L($,K,q=z=>z){let z=(...te)=>F.fire(q(...te)),Z=()=>$.on(K,z),oe=()=>$.removeListener(K,z),F=new de({onWillAddFirstListener:Z,onDidRemoveLastListener:oe});return F.event}e.fromNodeEventEmitter=L;function A($,K,q=z=>z){let z=(...te)=>F.fire(q(...te)),Z=()=>$.addEventListener(K,z),oe=()=>$.removeEventListener(K,z),F=new de({onWillAddFirstListener:Z,onDidRemoveLastListener:oe});return F.event}e.fromDOMEventEmitter=A;function H($){return new Promise(K=>n($)(K))}e.toPromise=H;function D($){let K=new de;return $.then(q=>{K.fire(q)},()=>{K.fire(void 0)}).finally(()=>{K.dispose()}),K.event}e.fromPromise=D;function se($,K){return $(q=>K.fire(q))}e.forward=se;function W($,K,q){return K(q),$(z=>K(z))}e.runAndSubscribe=W;class ee{constructor(K,q){this._observable=K,this._counter=0,this._hasChanged=!1;let z={onWillAddFirstListener:()=>{K.addObserver(this)},onDidRemoveLastListener:()=>{K.removeObserver(this)}};this.emitter=new de(z),q&&q.add(this.emitter)}beginUpdate(K){this._counter++}handlePossibleChange(K){}handleChange(K,q){this._hasChanged=!0}endUpdate(K){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R($,K){return new ee($,K).emitter.event}e.fromObservable=R;function Y($){return(K,q,z)=>{let Z=0,oe=!1,F={beginUpdate(){Z++},endUpdate(){Z--,Z===0&&($.reportChanges(),oe&&(oe=!1,K.call(q)))},handlePossibleChange(){},handleChange(){oe=!0}};$.addObserver(F),$.reportChanges();let te={dispose(){$.removeObserver(F)}};return z instanceof Ci?z.add(te):Array.isArray(z)&&z.push(te),te}}e.fromObservableLight=Y})(an||(an={}));var ad=class ld{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${ld._idPool++}`,ld.all.add(this)}start(t){this._stopWatch=new FR,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}}};ad.all=new Set,ad._idPool=0;var zR=ad,UR=-1,Xy=class Zy{constructor(t,n,i=(Zy._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=i,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let i=this.threshold;if(i<=0||n<i)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=i*.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 jR(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[i,o]of this._stacks)(!t||n<o)&&(t=[i,o],n=o);return t}};Xy._idPool=1;var HR=Xy,$R=class Qy{constructor(t){this.value=t}static create(){let t=new Error;return new Qy(t.stack??"")}print(){console.warn(this.value.split(`
|
|
96
96
|
`).slice(2).join(`
|
|
97
97
|
`))}},jR=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},WR=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},KR=0,Eh=class{constructor(e){this.value=e,this.id=KR++}},qR=2,VR,de=class{constructor(e){var t,n,i,o;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new HR((e==null?void 0:e.onListenerError)??zl,((n=this._options)==null?void 0:n.leakWarningThreshold)??UR):void 0,this._perfMon=(i=this._options)!=null&&i._profName?new zR(this._options._profName):void 0,this._deliveryQueue=(o=this._options)==null?void 0:o.deliveryQueue}dispose(){var e,t,n,i;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),(i=this._leakageMon)==null||i.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 WR(`${p}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(((l=this._options)==null?void 0:l.onListenerError)||zl)(y),qe.None}if(this._disposed)return qe.None;t&&(e=e.bind(t));let i=new Eh(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=$R.create(),o=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Eh?(this._deliveryQueue??(this._deliveryQueue=new GR),this._listeners=[this._listeners,i]):this._listeners.push(i):((d=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||d.call(u,this),this._listeners=i,(g=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||g.call(h,this)),this._size++;let a=_t(()=>{o==null||o(),this._removeListener(i)});return n instanceof Ci?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 i=this._deliveryQueue.current===this;if(this._size*qR<=t.length){let d=0;for(let h=0;h<t.length;h++)t[h]?t[d++]=t[h]:i&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=d}}_deliver(e,t){var i;if(!e)return;let n=((i=this._options)==null?void 0:i.onListenerError)||zl;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,i,o;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(i=this._perfMon)==null||i.start(this._size),this._listeners)if(this._listeners instanceof Eh)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}},GR=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}},cd=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new de,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new de,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 i=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}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 i=this.getWindowId(n);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};cd.INSTANCE=new cd;var lf=cd;function YR(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}lf.INSTANCE.onDidChangeZoomLevel;function XR(e){return lf.INSTANCE.getZoomFactor(e)}lf.INSTANCE.onDidChangeFullscreen;var Xs=typeof navigator=="object"?navigator.userAgent:"",ud=Xs.indexOf("Firefox")>=0,ZR=Xs.indexOf("AppleWebKit")>=0,cf=Xs.indexOf("Chrome")>=0,QR=!cf&&Xs.indexOf("Safari")>=0;Xs.indexOf("Electron/")>=0;Xs.indexOf("Android")>=0;var Ch=!1;if(typeof Yr.matchMedia=="function"){let e=Yr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Yr.matchMedia("(display-mode: fullscreen)");Ch=e.matches,YR(Yr,e,({matches:n})=>{Ch&&t.matches||(Ch=n)})}var js="en",hd=!1,dd=!1,Ul=!1,Jy=!1,Ol,Hl=js,s_=js,JR,mr,rs=globalThis,on,X_;typeof rs.vscode<"u"&&typeof rs.vscode.process<"u"?on=rs.vscode.process:typeof process<"u"&&typeof((X_=process==null?void 0:process.versions)==null?void 0:X_.node)=="string"&&(on=process);var Z_,e2=typeof((Z_=on==null?void 0:on.versions)==null?void 0:Z_.electron)=="string",t2=e2&&(on==null?void 0:on.type)==="renderer",Q_;if(typeof on=="object"){hd=on.platform==="win32",dd=on.platform==="darwin",Ul=on.platform==="linux",Ul&&on.env.SNAP&&on.env.SNAP_REVISION,on.env.CI||on.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ol=js,Hl=js;let e=on.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Ol=t.userLocale,s_=t.osLocale,Hl=t.resolvedLanguage||js,JR=(Q_=t.languagePack)==null?void 0:Q_.translationsConfigFile}catch{}Jy=!0}else typeof navigator=="object"&&!t2?(mr=navigator.userAgent,hd=mr.indexOf("Windows")>=0,dd=mr.indexOf("Macintosh")>=0,(mr.indexOf("Macintosh")>=0||mr.indexOf("iPad")>=0||mr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ul=mr.indexOf("Linux")>=0,(mr==null?void 0:mr.indexOf("Mobi"))>=0,Hl=globalThis._VSCODE_NLS_LANGUAGE||js,Ol=navigator.language.toLowerCase(),s_=Ol):console.error("Unable to resolve platform.");var eb=hd,Or=dd,n2=Ul,o_=Jy,Dr=mr,Si=Hl,r2;(e=>{function t(){return Si}e.value=t;function n(){return Si.length===2?Si==="en":Si.length>=3?Si[0]==="e"&&Si[1]==="n"&&Si[2]==="-":!1}e.isDefaultVariant=n;function i(){return Si==="en"}e.isDefault=i})(r2||(r2={}));var i2=typeof rs.postMessage=="function"&&!rs.importScripts;(()=>{if(i2){let e=[];rs.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let i=0,o=e.length;i<o;i++){let a=e[i];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(i,1),a.callback();return}}});let t=0;return n=>{let i=++t;e.push({id:i,callback:n}),rs.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var s2=!!(Dr&&Dr.indexOf("Chrome")>=0);Dr&&Dr.indexOf("Firefox")>=0;!s2&&Dr&&Dr.indexOf("Safari")>=0;Dr&&Dr.indexOf("Edg/")>=0;Dr&&Dr.indexOf("Android")>=0;var Fs=typeof navigator=="object"?navigator:{};o_||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fs&&Fs.clipboard&&Fs.clipboard.writeText,o_||Fs&&Fs.clipboard&&Fs.clipboard.readText;var uf=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}},Nh=new uf,a_=new uf,l_=new uf,o2=new Array(230),tb;(e=>{function t(u){return Nh.keyCodeToStr(u)}e.toString=t;function n(u){return Nh.strToKeyCode(u)}e.fromString=n;function i(u){return a_.keyCodeToStr(u)}e.toUserSettingsUS=i;function o(u){return l_.keyCodeToStr(u)}e.toUserSettingsGeneral=o;function a(u){return a_.strToKeyCode(u)||l_.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 Nh.keyCodeToStr(u)}e.toElectronAccelerator=l})(tb||(tb={}));var a2=class nb{constructor(t,n,i,o,a){this.ctrlKey=t,this.shiftKey=n,this.altKey=i,this.metaKey=o,this.keyCode=a}equals(t){return t instanceof nb&&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",i=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${n}${i}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new l2([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},l2=class{constructor(e){if(e.length===0)throw DR("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 c2(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return tb.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(ud)switch(t){case 59:return 85;case 60:if(n2)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Or)return 57;break}else if(ZR&&(Or&&t===93||!Or&&t===92))return 57;return o2[t]||0}var u2=Or?256:2048,h2=512,d2=1024,f2=Or?2048:256,c_=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=c2(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|=u2),this.altKey&&(t|=h2),this.shiftKey&&(t|=d2),this.metaKey&&(t|=f2),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new a2(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},u_=new WeakMap;function p2(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 m2=class{static getSameOriginWindowChain(e){let t=u_.get(e);if(!t){t=[],u_.set(e,t);let n=e,i;do i=p2(n),i?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,i=0,o=this.getSameOriginWindowChain(e);for(let a of o){let l=a.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,i+=(l==null?void 0:l.scrollX)??0,l===t||!a.iframeElement)break;let u=a.iframeElement.getBoundingClientRect();n+=u.top,i+=u.left}return{top:n,left:i}}},Dl=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=m2.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},h_=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 i=!1;if(cf){let a=navigator.userAgent.match(/Chrome\/(\d+)/);i=(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")i?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?ud&&!Or?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")QR&&eb?this.deltaX=-(a.wheelDeltaX/120):i?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?ud&&!Or?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(i?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()}},rb=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),g2;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof _2?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:an.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:rb})})(g2||(g2={}));var _2=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?rb:(this._emitter||(this._emitter=new de),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},hf=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 id("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new id("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},v2=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 id("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=n.setInterval(()=>{e()},t);this.disposable=_t(()=>{n.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},y2;(e=>{async function t(i){let o,a=await Promise.all(i.map(l=>l.then(u=>u,u=>{o||(o=u)})));if(typeof o<"u")throw o;return a}e.settled=t;function n(i){return new Promise(async(o,a)=>{try{await i(o,a)}catch(l){a(l)}})}e.withAsyncBody=n})(y2||(y2={}));var d_=class tr{static fromArray(t){return new tr(n=>{n.emitMany(t)})}static fromPromise(t){return new tr(async n=>{n.emitMany(await t)})}static fromPromises(t){return new tr(async n=>{await Promise.all(t.map(async i=>n.emitOne(await i)))})}static merge(t){return new tr(async n=>{await Promise.all(t.map(async i=>{for await(let o of i)n.emitOne(o)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new de,queueMicrotask(async()=>{let i={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(i)),this.resolve()}catch(o){this.reject(o)}finally{i.emitOne=void 0,i.emitMany=void 0,i.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 an.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 tr(async i=>{for await(let o of t)i.emitOne(n(o))})}map(t){return tr.map(this,t)}static filter(t,n){return new tr(async i=>{for await(let o of t)n(o)&&i.emitOne(o)})}filter(t){return tr.filter(this,t)}static coalesce(t){return tr.filter(t,n=>!!n)}coalesce(){return tr.coalesce(this)}static async toPromise(t){let n=[];for await(let i of t)n.push(i);return n}toPromise(){return tr.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())}};d_.EMPTY=d_.fromArray([]);var{getWindow:Mr,getWindowId:b2,onDidRegisterWindow:S2}=(function(){let e=new Map,t={window:Yr,disposables:new Ci};e.set(Yr.vscodeWindowId,t);let n=new de,i=new de,o=new de;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:i.event,registerWindow(l){if(e.has(l.vscodeWindowId))return qe.None;let u=new Ci,d={window:l,disposables:u.add(new Ci)};return e.set(l.vscodeWindowId,d),u.add(_t(()=>{e.delete(l.vscodeWindowId),i.fire(l)})),u.add(Be(l,Xt.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:Yr},getDocument(l){return Mr(l).document}}})(),w2=class{constructor(e,t,n,i){this._node=e,this._type=t,this._handler=n,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Be(e,t,n,i){return new w2(e,t,n,i)}var f_=function(e,t,n,i){return Be(e,t,n,i)},df,x2=class extends v2{constructor(e){super(),this.defaultTarget=e&&Mr(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},p_=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){zl(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,i=new Map,o=a=>{n.set(a,!1);let l=e.get(a)??[];for(t.set(a,l),e.set(a,[]),i.set(a,!0);l.length>0;)l.sort(p_.sort),l.shift().execute();i.set(a,!1)};df=(a,l,u=0)=>{let d=b2(a),h=new p_(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 k2(e){let t=e.getBoundingClientRect(),n=Mr(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Xt={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"},E2=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=Mn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Mn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Mn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Mn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Mn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Mn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Mn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Mn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Mn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Mn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Mn(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=Mn(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=Mn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Mn(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 Mn(e){return typeof e=="number"?`${e}px`:e}function ta(e){return new E2(e)}var ib=class{constructor(){this._hooks=new Ci,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,i,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=i,this._onStopCallback=o;let a=e;try{e.setPointerCapture(t),this._hooks.add(_t(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=Mr(e)}this._hooks.add(Be(a,Xt.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Be(a,Xt.POINTER_UP,l=>this.stopMonitoring(!0)))}};function C2(e,t,n){let i=null,o=null;if(typeof n.value=="function"?(i="value",o=n.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(i="get",o=n.get),!o)throw new Error("not supported");let a=`$memoize$${t}`;n[i]=function(...l){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,l)}),this[a]}}var Rr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Rr||(Rr={}));var Vo=class dn extends qe{constructor(){super(),this.dispatched=!1,this.targets=new i_,this.ignoreTargets=new i_,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(an.runAndSubscribe(S2,({window:t,disposables:n})=>{n.add(Be(t.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),n.add(Be(t.document,"touchend",i=>this.onTouchEnd(t,i))),n.add(Be(t.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:Yr,disposables:this._store}))}static addTarget(t){if(!dn.isTouchDevice())return qe.None;dn.INSTANCE||(dn.INSTANCE=new dn);let n=dn.INSTANCE.targets.push(t);return _t(n)}static ignoreTarget(t){if(!dn.isTouchDevice())return qe.None;dn.INSTANCE||(dn.INSTANCE=new dn);let n=dn.INSTANCE.ignoreTargets.push(t);return _t(n)}static isTouchDevice(){return"ontouchstart"in Yr||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 i=0,o=t.targetTouches.length;i<o;i++){let a=t.targetTouches.item(i);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(Rr.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 i=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<dn.HOLD_DELAY&&Math.abs(d.initialPageX-Un(d.rollingPageX))<30&&Math.abs(d.initialPageY-Un(d.rollingPageY))<30){let g=this.newGestureEvent(Rr.Tap,d.initialTarget);g.pageX=Un(d.rollingPageX),g.pageY=Un(d.rollingPageY),this.dispatchEvent(g)}else if(h>=dn.HOLD_DELAY&&Math.abs(d.initialPageX-Un(d.rollingPageX))<30&&Math.abs(d.initialPageY-Un(d.rollingPageY))<30){let g=this.newGestureEvent(Rr.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],b=p-d.rollingPageY[0],x=[...this.targets].filter(k=>d.initialTarget instanceof Node&&k.contains(d.initialTarget));this.inertia(t,x,i,Math.abs(y)/v,y>0?1:-1,g,Math.abs(b)/v,b>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(Rr.End,d.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let i=document.createEvent("CustomEvent");return i.initEvent(t,!1,!0),i.initialTarget=n,i.tapCount=0,i}dispatchEvent(t){if(t.type===Rr.Tap){let n=new Date().getTime(),i=0;n-this._lastSetTapCountTime>dn.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=n,t.tapCount=i}else(t.type===Rr.Change||t.type===Rr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(t.initialTarget))return;let n=[];for(let i of this.targets)if(i.contains(t.initialTarget)){let o=0,a=t.initialTarget;for(;a&&a!==i;)o++,a=a.parentElement;n.push([o,i])}n.sort((i,o)=>i[0]-o[0]);for(let[i,o]of n)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,i,o,a,l,u,d,h){this.handle=df(t,()=>{let g=Date.now(),p=g-i,v=0,y=0,b=!0;o+=dn.SCROLL_FRICTION*p,u+=dn.SCROLL_FRICTION*p,o>0&&(b=!1,v=a*o*p),u>0&&(b=!1,y=d*u*p);let x=this.newGestureEvent(Rr.Change);x.translationX=v,x.translationY=y,n.forEach(k=>k.dispatchEvent(x)),b||this.inertia(t,n,g,o,a,l+v,u,d,h+y)})}onTouchMove(t){let n=Date.now();for(let i=0,o=t.changedTouches.length;i<o;i++){let a=t.changedTouches.item(i);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(Rr.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)}};Vo.SCROLL_FRICTION=-.005,Vo.HOLD_DELAY=700,Vo.CLEAR_TAP_COUNT_TIME=400,Tt([C2],Vo,"isTouchDevice",1);var N2=Vo,ff=class extends qe{onclick(e,t){this._register(Be(e,Xt.CLICK,n=>t(new Dl(Mr(e),n))))}onmousedown(e,t){this._register(Be(e,Xt.MOUSE_DOWN,n=>t(new Dl(Mr(e),n))))}onmouseover(e,t){this._register(Be(e,Xt.MOUSE_OVER,n=>t(new Dl(Mr(e),n))))}onmouseleave(e,t){this._register(Be(e,Xt.MOUSE_LEAVE,n=>t(new Dl(Mr(e),n))))}onkeydown(e,t){this._register(Be(e,Xt.KEY_DOWN,n=>t(new c_(n))))}onkeyup(e,t){this._register(Be(e,Xt.KEY_UP,n=>t(new c_(n))))}oninput(e,t){this._register(Be(e,Xt.INPUT,t))}onblur(e,t){this._register(Be(e,Xt.BLUR,t))}onfocus(e,t){this._register(Be(e,Xt.FOCUS,t))}onchange(e,t){this._register(Be(e,Xt.CHANGE,t))}ignoreGesture(e){return N2.ignoreTarget(e)}},m_=11,T2=class extends ff{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=m_+"px",this.domNode.style.height=m_+"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 ib),this._register(f_(this.bgDomNode,Xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(f_(this.domNode,Xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new x2),this._pointerdownScheduleRepeatTimer=this._register(new hf)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Mr(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()}},R2=class fd{constructor(t,n,i,o,a,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,i=i|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>i&&(o=i-n),o<0&&(o=0),a<0&&(a=0),u+a>l&&(u=l-a),u<0&&(u=0),this.width=n,this.scrollWidth=i,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 fd(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 fd(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 i=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:i,scrollWidthChanged:o,scrollLeftChanged:a,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:d}}},A2=class extends qe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new R2(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 i;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(i=this._smoothScrolling)==null||i.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 i;t?i=new __(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):i=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=__.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)))}},g_=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Th(e,t){let n=t-e;return function(i){return e+n*D2(i)}}function M2(e,t,n){return function(i){return i<n?e(i/n):t((i-n)/(1-n))}}var __=class pd{constructor(t,n,i,o){this.from=t,this.to=n,this.duration=o,this.startTime=i,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,i){if(Math.abs(t-n)>2.5*i){let o,a;return t<n?(o=t+.75*i,a=n-.75*i):(o=t-.75*i,a=n+.75*i),M2(Th(t,o),Th(a,n),.33)}return Th(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 i=this.scrollLeft(n),o=this.scrollTop(n);return new g_(i,o,!1)}return new g_(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,i){return pd.start(t,n,i)}static start(t,n,i){i=i+10;let o=Date.now()-10;return new pd(t,n,o,i)}};function O2(e){return Math.pow(e,3)}function D2(e){return 1-O2(1-e)}var L2=class extends qe{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 hf)}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":"")))}},I2=140,sb=class extends ff{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 L2(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new ib),this._shouldRender=!0,this.domNode=ta(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Be(this.domNode.domNode,Xt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new T2(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,i){this.slider=ta(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 i=="number"&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Be(this.slider.domNode,Xt.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(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=i?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=k2(this.domNode.domNode);t=e.pageX-o.left,n=e.pageY-o.top}let i=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),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),i=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(eb&&l>I2){this._setDesiredScrollPositionNow(i.getScrollPosition());return}let u=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(i.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()}},ob=class md{constructor(t,n,i,o,a,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(i),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 md(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,i,o,a){let l=Math.max(0,i-t),u=Math.max(0,l-2*n),d=o>0&&o>i;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(i*u/o))),g=(u-h)/(o-i),p=a*g;return{computedAvailableSize:Math.round(l),computedIsNeeded:d,computedSliderSize:Math.round(h),computedSliderRatio:g,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=md._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,i=this._scrollPosition;return n<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},P2=class extends sb{constructor(e,t,n){let i=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ob(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,i.width,i.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}},B2=class extends sb{constructor(e,t,n){let i=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ob(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,i.height,i.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}},F2=500,v_=50,z2=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},gd=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,i=1,o=this._rear;do{let a=o===this._front?t:Math.pow(2,-i);if(t-=a,n+=this._memory[o].score*a,o===this._front)break;o=(this._capacity+o-1)%this._capacity,i++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(cf){let n=Mr(t.browserEvent),i=XR(n);this.accept(Date.now(),t.deltaX*i,t.deltaY*i)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,i){let o=null,a=new z2(t,n,i);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 i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.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&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};gd.INSTANCE=new gd;var U2=gd,H2=class extends ff{constructor(e,t,n){super(),this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new de),this.onWillScroll=this._onWillScroll.event,this._options=j2(t),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let i={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new B2(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new P2(this._scrollable,this._options,i)),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=ta(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ta(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ta(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 hf),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ss(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,Or&&(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 h_(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ss(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new h_(n))};this._mouseWheelToDispose.push(Be(this._listenOnDomNode,Xt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let t=U2.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=!Or&&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=v_*a,p=d.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(h,p)}if(l){let g=v_*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 i=n;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(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,i=n?" left":"",o=t?" top":"",a=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${o}${i}`)}}_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(),F2)}},$2=class extends H2{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 j2(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,Or&&(t.className+=" mac"),t}var _d=class extends qe{constructor(e,t,n,i,o,a,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new de),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new A2({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>df(i.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new $2(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(an.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(_t(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=i.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(_t(()=>this._styleElement.remove())),this._register(an.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(`
|
|
98
98
|
`)})),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}};_d=Tt([me(2,wn),me(3,Zr),me(4,Uy),me(5,Ys),me(6,xn),me(7,Qr)],_d);var vd=class extends qe{constructor(e,t,n,i,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=i,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(_t(()=>{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 i;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((i=e==null?void 0:e.options)==null?void 0:i.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()}};vd=Tt([me(1,wn),me(2,Zr),me(3,da),me(4,Qr)],vd);var W2=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)}},Cr={full:0,left:0,center:0,right:0},wi={full:0,left:0,center:0,right:0},zo={full:0,left:0,center:0,right:0},ec=class extends qe{constructor(e,t,n,i,o,a,l,u){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=i,this._renderService=o,this._optionsService=a,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new W2,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(_t(()=>{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);wi.full=this._canvas.width,wi.left=e,wi.center=t,wi.right=e,this._refreshDrawHeightConstants(),zo.full=1,zo.left=1,zo.center=1+wi.left,zo.right=1+wi.left+wi.center}_refreshDrawHeightConstants(){Cr.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);Cr.left=t,Cr.center=t,Cr.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Cr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Cr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Cr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Cr.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(zo[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Cr[e.position||"full"]/2),wi[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Cr[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}))}};ec=Tt([me(2,wn),me(3,da),me(4,Qr),me(5,xn),me(6,Ys),me(7,Zr)],ec);var J;(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=`
|
|
99
|
-
`,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=""))(J||(J={}));var $l;(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=""))($l||($l={}));var ab;(e=>e.ST=`${J.ESC}\\`)(ab||(ab={}));var yd=class{constructor(e,t,n,i,o,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=i,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(`${J.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,i=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=i+"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=i+"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)}}};yd=Tt([me(2,wn),me(3,xn),me(4,cs),me(5,Qr)],yd);var Zt=0,Qt=0,Jt=0,Nt=0,y_={css:"#00000000",rgba:0},Bt;(e=>{function t(o,a,l,u){return u!==void 0?`#${Xi(o)}${Xi(a)}${Xi(l)}${Xi(u)}`:`#${Xi(o)}${Xi(a)}${Xi(l)}`}e.toCss=t;function n(o,a,l,u=255){return(o<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function i(o,a,l,u){return{css:e.toCss(o,a,l,u),rgba:e.toRgba(o,a,l,u)}}e.toColor=i})(Bt||(Bt={}));var pt;(e=>{function t(d,h){if(Nt=(h.rgba&255)/255,Nt===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,b=d.rgba>>16&255,x=d.rgba>>8&255;Zt=y+Math.round((g-y)*Nt),Qt=b+Math.round((p-b)*Nt),Jt=x+Math.round((v-x)*Nt);let k=Bt.toCss(Zt,Qt,Jt),E=Bt.toRgba(Zt,Qt,Jt);return{css:k,rgba:E}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function i(d,h,g){let p=jl.ensureContrastRatio(d.rgba,h.rgba,g);if(p)return Bt.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=i;function o(d){let h=(d.rgba|255)>>>0;return[Zt,Qt,Jt]=jl.toChannels(h),{css:Bt.toCss(Zt,Qt,Jt),rgba:h}}e.opaque=o;function a(d,h){return Nt=Math.round(h*255),[Zt,Qt,Jt]=jl.toChannels(d.rgba),{css:Bt.toCss(Zt,Qt,Jt,Nt),rgba:Bt.toRgba(Zt,Qt,Jt,Nt)}}e.opacity=a;function l(d,h){return Nt=d.rgba&255,a(d,Nt*h/255)}e.multiplyOpacity=l;function u(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=u})(pt||(pt={}));var kt;(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 i(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return Zt=parseInt(o.slice(1,2).repeat(2),16),Qt=parseInt(o.slice(2,3).repeat(2),16),Jt=parseInt(o.slice(3,4).repeat(2),16),Bt.toColor(Zt,Qt,Jt);case 5:return Zt=parseInt(o.slice(1,2).repeat(2),16),Qt=parseInt(o.slice(2,3).repeat(2),16),Jt=parseInt(o.slice(3,4).repeat(2),16),Nt=parseInt(o.slice(4,5).repeat(2),16),Bt.toColor(Zt,Qt,Jt,Nt);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 Zt=parseInt(a[1]),Qt=parseInt(a[2]),Jt=parseInt(a[3]),Nt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Bt.toColor(Zt,Qt,Jt,Nt);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),[Zt,Qt,Jt,Nt]=t.getImageData(0,0,1,1).data,Nt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Bt.toRgba(Zt,Qt,Jt,Nt),css:o}}e.toColor=i})(kt||(kt={}));var yn;(e=>{function t(i){return n(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function n(i,o,a){let l=i/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})(yn||(yn={}));var jl;(e=>{function t(l,u){if(Nt=(u&255)/255,Nt===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 Zt=p+Math.round((d-p)*Nt),Qt=v+Math.round((h-v)*Nt),Jt=y+Math.round((g-y)*Nt),Bt.toRgba(Zt,Qt,Jt)}e.blend=t;function n(l,u,d){let h=yn.relativeLuminance(l>>8),g=yn.relativeLuminance(u>>8);if(Gr(h,g)<d){if(g<h){let y=i(l,u,d),b=Gr(h,yn.relativeLuminance(y>>8));if(b<d){let x=o(l,u,d),k=Gr(h,yn.relativeLuminance(x>>8));return b>k?y:x}return y}let p=o(l,u,d),v=Gr(h,yn.relativeLuminance(p>>8));if(v<d){let y=i(l,u,d),b=Gr(h,yn.relativeLuminance(y>>8));return v>b?p:y}return p}}e.ensureContrastRatio=n;function i(l,u,d){let h=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,b=u>>8&255,x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));for(;x<d&&(v>0||y>0||b>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),b-=Math.max(0,Math.ceil(b*.1)),x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));return(v<<24|y<<16|b<<8|255)>>>0}e.reduceLuminance=i;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,b=u>>8&255,x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));for(;x<d&&(v<255||y<255||b<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));return(v<<24|y<<16|b<<8|255)>>>0}e.increaseLuminance=o;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(jl||(jl={}));function Xi(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Gr(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var K2=class extends ha{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()]}},tc=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ir}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=[],i=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(i,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||Ei.length}if(this._bufferService.cols-o>1){let h=this._getJoinedRanges(i,l,a,t,o);for(let g=0;g<h.length;g++)n.push(h[g])}return n}_getJoinedRanges(e,t,n,i,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++)tc._mergeRanges(l,d[h])}catch(d){console.error(d)}return this._stringRangesToCellRanges(l,i,o),l}_stringRangesToCellRanges(e,t,n){let i=0,o=!1,a=0,l=e[i];if(l){for(let u=n;u<this._bufferService.cols;u++){let d=t.getWidth(u),h=t.getString(u).length||Ei.length;if(d!==0){if(!o&&l[0]<=a&&(l[0]=u,o=!0),l[1]<=a){if(l[1]=u,l=e[++i],!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 i=0;i<e.length;i++){let o=e[i];if(n){if(t[1]<=o[0])return e[i-1][1]=t[1],e;if(t[1]<=o[1])return e[i-1][1]=Math.max(t[1],o[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=o[0])return e.splice(i,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}};tc=Tt([me(0,wn)],tc);function q2(e){return 57508<=e&&e<=57558}function V2(e){return 9472<=e&&e<=9631}function G2(e){return q2(e)||V2(e)}function Y2(){return{css:{canvas:Ll(),cell:Ll()},device:{canvas:Ll(),cell:Ll(),char:{width:0,height:0,left:0,top:0}}}}function Ll(){return{width:0,height:0}}var bd=class{constructor(e,t,n,i,o,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=i,this._coreService=o,this._decorationService=a,this._themeService=l,this._workCell=new ir,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,i,o,a,l,u,d,h,g){let p=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<a+1&&(b=a+1);let x,k=0,E="",O=0,L=0,A=0,H=0,D=!1,se=0,W=!1,ee=0,R=0,Y=[],$=h!==-1&&g!==-1;for(let K=0;K<b;K++){e.loadCell(K,this._workCell);let q=this._workCell.getWidth();if(q===0)continue;let z=!1,Z=K>=R,oe=K,F=this._workCell;if(v.length>0&&K===v[0][0]&&Z){let $e=v.shift(),Ln=this._isCellInSelection($e[0],t);for(O=$e[0]+1;O<$e[1];O++)Z&&(Z=Ln===this._isCellInSelection(O,t));Z&&(Z=!n||a<$e[0]||a>=$e[1]),Z?(z=!0,F=new K2(this._workCell,e.translateToString(!0,$e[0],$e[1]),$e[1]-$e[0]),oe=$e[1]-1,q=F.getWidth()):R=$e[1]}let te=this._isCellInSelection(K,t),C=n&&K===a,I=$&&K>=h&&K<=g,G=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,$e=>{G=!0});let N=F.getChars()||Ei;if(N===" "&&(F.isUnderline()||F.isOverline())&&(N=" "),ee=q*u-d.get(N,F.isBold(),F.isItalic()),!x)x=this._document.createElement("span");else if(k&&(te&&W||!te&&!W&&F.bg===L)&&(te&&W&&y.selectionForeground||F.fg===A)&&F.extended.ext===H&&I===D&&ee===se&&!C&&!z&&!G&&Z){F.isInvisible()?E+=Ei:E+=N,k++;continue}else k&&(x.textContent=E),x=this._document.createElement("span"),k=0,E="";if(L=F.bg,A=F.fg,H=F.extended.ext,D=I,se=ee,W=te,z&&a>=K&&a<=oe&&(a=K),!this._coreService.isCursorHidden&&C&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&Y.push("xterm-cursor-blink"),Y.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline");break}}if(F.isBold()&&Y.push("xterm-bold"),F.isItalic()&&Y.push("xterm-italic"),F.isDim()&&Y.push("xterm-dim"),F.isInvisible()?E=Ei:E=F.getChars()||Ei,F.isUnderline()&&(Y.push(`xterm-underline-${F.extended.underlineStyle}`),E===" "&&(E=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${ha.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let $e=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&$e<8&&($e+=8),x.style.textDecorationColor=y.ansi[$e].css}F.isOverline()&&(Y.push("xterm-overline"),E===" "&&(E=" ")),F.isStrikethrough()&&Y.push("xterm-strikethrough"),I&&(x.style.textDecoration="underline");let ye=F.getFgColor(),Ne=F.getFgColorMode(),_e=F.getBgColor(),Ue=F.getBgColorMode(),Le=!!F.isInverse();if(Le){let $e=ye;ye=_e,_e=$e;let Ln=Ne;Ne=Ue,Ue=Ln}let He,nt,Ft=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,$e=>{$e.options.layer!=="top"&&Ft||($e.backgroundColorRGB&&(Ue=50331648,_e=$e.backgroundColorRGB.rgba>>8&16777215,He=$e.backgroundColorRGB),$e.foregroundColorRGB&&(Ne=50331648,ye=$e.foregroundColorRGB.rgba>>8&16777215,nt=$e.foregroundColorRGB),Ft=$e.options.layer==="top")}),!Ft&&te&&(He=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,_e=He.rgba>>8&16777215,Ue=50331648,Ft=!0,y.selectionForeground&&(Ne=50331648,ye=y.selectionForeground.rgba>>8&16777215,nt=y.selectionForeground)),Ft&&Y.push("xterm-decoration-top");let tn;switch(Ue){case 16777216:case 33554432:tn=y.ansi[_e],Y.push(`xterm-bg-${_e}`);break;case 50331648:tn=Bt.toColor(_e>>16,_e>>8&255,_e&255),this._addStyle(x,`background-color:#${b_((_e>>>0).toString(16),"0",6)}`);break;case 0:default:Le?(tn=y.foreground,Y.push("xterm-bg-257")):tn=y.background}switch(He||F.isDim()&&(He=pt.multiplyOpacity(tn,.5)),Ne){case 16777216:case 33554432:F.isBold()&&ye<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ye+=8),this._applyMinimumContrast(x,tn,y.ansi[ye],F,He,void 0)||Y.push(`xterm-fg-${ye}`);break;case 50331648:let $e=Bt.toColor(ye>>16&255,ye>>8&255,ye&255);this._applyMinimumContrast(x,tn,$e,F,He,nt)||this._addStyle(x,`color:#${b_(ye.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(x,tn,y.foreground,F,He,nt)||Le&&Y.push("xterm-fg-257")}Y.length&&(x.className=Y.join(" "),Y.length=0),!C&&!z&&!G&&Z?k++:x.textContent=E,ee!==this.defaultSpacing&&(x.style.letterSpacing=`${ee}px`),p.push(x),K=oe}return x&&k&&(x.textContent=E),p}_applyMinimumContrast(e,t,n,i,o,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||G2(i.getCode()))return!1;let l=this._getContrastCache(i),u;if(!o&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);u=pt.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,i=this._selectionEnd;return!n||!i?!1:this._columnSelectMode?n[0]<=i[0]?e>=n[0]&&t>=n[1]&&e<i[0]&&t<=i[1]:e<n[0]&&t>=n[1]&&e>=i[0]&&t<=i[1]:t>n[1]&&t<i[1]||n[1]===i[1]&&t===n[1]&&e>=n[0]&&e<i[0]||n[1]<i[1]&&t===i[1]&&e<i[0]||n[1]<i[1]&&t===n[1]&&e>=n[0]}};bd=Tt([me(1,jy),me(2,xn),me(3,Zr),me(4,cs),me(5,da),me(6,Ys)],bd);function b_(e,t,n){for(;e.length<n;)e=t+e;return e}var X2=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 i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.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,i,o,a],this._container.appendChild(n),this._container.appendChild(i),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,i){e===this._font&&t===this._fontSize&&n===this._weight&&i===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=i,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${i}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${i}`,this.clear())}get(e,t,n){let i=0;if(!t&&!n&&e.length===1&&(i=e.charCodeAt(0))<256){if(this._flat[i]!==-9999)return this._flat[i];let l=this._measure(e,0);return l>0&&(this._flat[i]=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}},Z2=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,i=!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=i,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 Q2(){return new Z2}var Rh="xterm-dom-renderer-owner-",er="xterm-rows",Il="xterm-fg-",S_="xterm-bg-",Uo="xterm-focus",Pl="xterm-selection",J2=1,Sd=class extends qe{constructor(e,t,n,i,o,a,l,u,d,h,g,p,v,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=i,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=J2++,this._rowElements=[],this._selectionRenderModel=Q2(),this.onRequestRedraw=this._register(new de).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(er),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(Pl),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Y2(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(bd,document),this._element.classList.add(Rh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(_t(()=>{this._element.classList.remove(Rh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new X2(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} .${er} 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} .${er} { 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} .${er} .xterm-dim { color: ${pt.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}`,i=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 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} .${er}.${Uo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${er}.${Uo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${er}.${Uo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Pl} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Pl} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Pl} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Il}${a} { color: ${l.css}; }${this._terminalSelector} .${Il}${a}.xterm-dim { color: ${pt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${S_}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Il}257 { color: ${pt.opaque(e.background).css}; }${this._terminalSelector} .${Il}257.xterm-dim { color: ${pt.multiplyOpacity(pt.opaque(e.background),.5).css}; }${this._terminalSelector} .${S_}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 i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}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(Uo),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Uo),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 i=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=i===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,i=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=`${i*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,i=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===i,l,u,o,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Rh}${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,i,o,a){n<0&&(e=0),i<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),i=Math.max(Math.min(i,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<=i;++y){let b=y+u.ydisp,x=this._rowElements[y],k=u.lines.get(b);if(!x||!k)break;x.replaceChildren(...this._rowFactory.createRow(k,b,b===d,p,v,h,g,this.dimensions.css.cell.width,this._widthCache,a?y===n?e:0:-1,a?(y===i?t:o)-1:-1))}}};Sd=Tt([me(7,of),me(8,pc),me(9,xn),me(10,wn),me(11,cs),me(12,Zr),me(13,Ys)],Sd);var wd=class extends qe{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new de),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new tA(this._optionsService))}catch{this._measureStrategy=this._register(new eA(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())}};wd=Tt([me(2,xn)],wd);var lb=class extends qe{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)}},eA=class extends lb{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}},tA=class extends lb{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}},nA=class extends qe{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 rA(this._window)),this._onDprChange=this._register(new de),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new de),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this._register(an.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Be(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Be(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},rA=class extends qe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new qs),this._onDprChange=this._register(new de),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(_t(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Be(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},iA=class extends qe{constructor(){super(),this.linkProviders=[],this._register(_t(()=>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 pf(e,t,n){let i=n.getBoundingClientRect(),o=e.getComputedStyle(n),a=parseInt(o.getPropertyValue("padding-left")),l=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-i.left-a,t.clientY-i.top-l]}function sA(e,t,n,i,o,a,l,u,d){if(!a)return;let h=pf(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),i+(d?1:0)),h[1]=Math.min(Math.max(h[1],1),o),h}var xd=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,i,o){return sA(window,e,t,n,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let n=pf(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])}}};xd=Tt([me(0,Qr),me(1,pc)],xd);var oA=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=[]}},cb={};gR(cb,{getSafariVersion:()=>lA,isChromeOS:()=>fb,isFirefox:()=>ub,isIpad:()=>cA,isIphone:()=>uA,isLegacyEdge:()=>aA,isLinux:()=>mf,isMac:()=>nc,isNode:()=>mc,isSafari:()=>hb,isWindows:()=>db});var mc=typeof process<"u"&&"title"in process,fa=mc?"node":navigator.userAgent,pa=mc?"node":navigator.platform,ub=fa.includes("Firefox"),aA=fa.includes("Edge"),hb=/^((?!chrome|android).)*safari/i.test(fa);function lA(){if(!hb)return 0;let e=fa.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var nc=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(pa),cA=pa==="iPad",uA=pa==="iPhone",db=["Windows","Win16","Win32","WinCE"].includes(pa),mf=pa.indexOf("Linux")>=0,fb=/\bCrOS\b/.test(fa),pb=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,i=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){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=o}this.clear()}},hA=class extends pb{_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())}}},dA=class extends pb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},rc=!mc&&"requestIdleCallback"in window?dA:hA,fA=class{constructor(){this._queue=new rc}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},kd=class extends qe{constructor(e,t,n,i,o,a,l,u,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=i,this._coreService=o,this._coreBrowserService=u,this._renderer=this._register(new qs),this._pausedResizeTask=new fA,this._observerDisposable=this._register(new qs),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 de),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new de),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new de),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new de),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new oA((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new pA(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(_t(()=>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(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=_t(()=>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 i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.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 i;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(i=this._renderer.value)==null||i.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};kd=Tt([me(2,xn),me(3,pc),me(4,cs),me(5,da),me(6,wn),me(7,Zr),me(8,Ys)],kd);var pA=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 mA(e,t,n,i){let o=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return vA(o,a,e,t,n,i)+gc(a,t,n,i)+yA(o,a,e,t,n,i);let l;if(a===t)return l=o>e?"D":"C",sa(Math.abs(o-e),ia(l,i));l=a>t?"D":"C";let u=Math.abs(a-t),d=_A(a>t?e:o,n)+(u-1)*n.cols+1+gA(a>t?o:e);return sa(d,ia(l,i))}function gA(e,t){return e-1}function _A(e,t){return t.cols-e}function vA(e,t,n,i,o,a){return gc(t,i,o,a).length===0?"":sa(gb(e,t,e,t-os(t,o),!1,o).length,ia("D",a))}function gc(e,t,n,i){let o=e-os(e,n),a=t-os(t,n),l=Math.abs(o-a)-bA(e,t,n);return sa(l,ia(mb(e,t),i))}function yA(e,t,n,i,o,a){let l;gc(t,i,o,a).length>0?l=i-os(i,o):l=t;let u=i,d=SA(e,t,n,i,o,a);return sa(gb(e,l,n,u,d==="C",o).length,ia(d,a))}function bA(e,t,n){var l;let i=0,o=e-os(e,n),a=t-os(t,n);for(let u=0;u<Math.abs(o-a);u++){let d=mb(e,t)==="A"?-1:1;(l=n.buffer.lines.get(o+d*u))!=null&&l.isWrapped&&i++}return i}function os(e,t){let n=0,i=t.buffer.lines.get(e),o=i==null?void 0:i.isWrapped;for(;o&&e>=0&&e<t.rows;)n++,i=t.buffer.lines.get(--e),o=i==null?void 0:i.isWrapped;return n}function SA(e,t,n,i,o,a){let l;return gc(n,i,o,a).length>0?l=i-os(i,o):l=t,e<n&&l<=i||e>=n&&l<i?"C":"D"}function mb(e,t){return e>t?"A":"B"}function gb(e,t,n,i,o,a){let l=e,u=t,d="";for(;(l!==n||u!==i)&&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 ia(e,t){let n=t?"O":"[";return J.ESC+n+e}function sa(e,t){e=Math.floor(e);let n="";for(let i=0;i<e;i++)n+=t;return n}var wA=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 w_(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 Ah=50,xA=15,kA=50,EA=500,CA=" ",NA=new RegExp(CA,"g"),Ed=class extends qe{constructor(e,t,n,i,o,a,l,u,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=i,this._coreService=o,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ir,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new de),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new de),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new de),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new de),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 wA(this._bufferService),this._activeSelectionMode=0,this._register(_t(()=>{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,i=[];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);i.push(u)}}else{let o=e[1]===t[1]?t[0]:void 0;i.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?i[i.length-1]+=u:i.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?i[i.length-1]+=l:i.push(l)}}return i.map(o=>o.replace(NA," ")).join(db?`\r
|
|
99
|
+
`,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=""))(J||(J={}));var $l;(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=""))($l||($l={}));var ab;(e=>e.ST=`${J.ESC}\\`)(ab||(ab={}));var yd=class{constructor(e,t,n,i,o,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=i,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(`${J.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,i=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=i+"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=i+"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)}}};yd=Tt([me(2,wn),me(3,xn),me(4,cs),me(5,Qr)],yd);var Zt=0,Qt=0,Jt=0,Nt=0,y_={css:"#00000000",rgba:0},Bt;(e=>{function t(o,a,l,u){return u!==void 0?`#${Xi(o)}${Xi(a)}${Xi(l)}${Xi(u)}`:`#${Xi(o)}${Xi(a)}${Xi(l)}`}e.toCss=t;function n(o,a,l,u=255){return(o<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function i(o,a,l,u){return{css:e.toCss(o,a,l,u),rgba:e.toRgba(o,a,l,u)}}e.toColor=i})(Bt||(Bt={}));var pt;(e=>{function t(d,h){if(Nt=(h.rgba&255)/255,Nt===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,b=d.rgba>>16&255,x=d.rgba>>8&255;Zt=y+Math.round((g-y)*Nt),Qt=b+Math.round((p-b)*Nt),Jt=x+Math.round((v-x)*Nt);let k=Bt.toCss(Zt,Qt,Jt),C=Bt.toRgba(Zt,Qt,Jt);return{css:k,rgba:C}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function i(d,h,g){let p=jl.ensureContrastRatio(d.rgba,h.rgba,g);if(p)return Bt.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=i;function o(d){let h=(d.rgba|255)>>>0;return[Zt,Qt,Jt]=jl.toChannels(h),{css:Bt.toCss(Zt,Qt,Jt),rgba:h}}e.opaque=o;function a(d,h){return Nt=Math.round(h*255),[Zt,Qt,Jt]=jl.toChannels(d.rgba),{css:Bt.toCss(Zt,Qt,Jt,Nt),rgba:Bt.toRgba(Zt,Qt,Jt,Nt)}}e.opacity=a;function l(d,h){return Nt=d.rgba&255,a(d,Nt*h/255)}e.multiplyOpacity=l;function u(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=u})(pt||(pt={}));var kt;(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 i(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return Zt=parseInt(o.slice(1,2).repeat(2),16),Qt=parseInt(o.slice(2,3).repeat(2),16),Jt=parseInt(o.slice(3,4).repeat(2),16),Bt.toColor(Zt,Qt,Jt);case 5:return Zt=parseInt(o.slice(1,2).repeat(2),16),Qt=parseInt(o.slice(2,3).repeat(2),16),Jt=parseInt(o.slice(3,4).repeat(2),16),Nt=parseInt(o.slice(4,5).repeat(2),16),Bt.toColor(Zt,Qt,Jt,Nt);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 Zt=parseInt(a[1]),Qt=parseInt(a[2]),Jt=parseInt(a[3]),Nt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Bt.toColor(Zt,Qt,Jt,Nt);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),[Zt,Qt,Jt,Nt]=t.getImageData(0,0,1,1).data,Nt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Bt.toRgba(Zt,Qt,Jt,Nt),css:o}}e.toColor=i})(kt||(kt={}));var yn;(e=>{function t(i){return n(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function n(i,o,a){let l=i/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})(yn||(yn={}));var jl;(e=>{function t(l,u){if(Nt=(u&255)/255,Nt===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 Zt=p+Math.round((d-p)*Nt),Qt=v+Math.round((h-v)*Nt),Jt=y+Math.round((g-y)*Nt),Bt.toRgba(Zt,Qt,Jt)}e.blend=t;function n(l,u,d){let h=yn.relativeLuminance(l>>8),g=yn.relativeLuminance(u>>8);if(Gr(h,g)<d){if(g<h){let y=i(l,u,d),b=Gr(h,yn.relativeLuminance(y>>8));if(b<d){let x=o(l,u,d),k=Gr(h,yn.relativeLuminance(x>>8));return b>k?y:x}return y}let p=o(l,u,d),v=Gr(h,yn.relativeLuminance(p>>8));if(v<d){let y=i(l,u,d),b=Gr(h,yn.relativeLuminance(y>>8));return v>b?p:y}return p}}e.ensureContrastRatio=n;function i(l,u,d){let h=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,b=u>>8&255,x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));for(;x<d&&(v>0||y>0||b>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),b-=Math.max(0,Math.ceil(b*.1)),x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));return(v<<24|y<<16|b<<8|255)>>>0}e.reduceLuminance=i;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,b=u>>8&255,x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));for(;x<d&&(v<255||y<255||b<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),x=Gr(yn.relativeLuminance2(v,y,b),yn.relativeLuminance2(h,g,p));return(v<<24|y<<16|b<<8|255)>>>0}e.increaseLuminance=o;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(jl||(jl={}));function Xi(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Gr(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var K2=class extends ha{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()]}},tc=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ir}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=[],i=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(i,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||Ei.length}if(this._bufferService.cols-o>1){let h=this._getJoinedRanges(i,l,a,t,o);for(let g=0;g<h.length;g++)n.push(h[g])}return n}_getJoinedRanges(e,t,n,i,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++)tc._mergeRanges(l,d[h])}catch(d){console.error(d)}return this._stringRangesToCellRanges(l,i,o),l}_stringRangesToCellRanges(e,t,n){let i=0,o=!1,a=0,l=e[i];if(l){for(let u=n;u<this._bufferService.cols;u++){let d=t.getWidth(u),h=t.getString(u).length||Ei.length;if(d!==0){if(!o&&l[0]<=a&&(l[0]=u,o=!0),l[1]<=a){if(l[1]=u,l=e[++i],!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 i=0;i<e.length;i++){let o=e[i];if(n){if(t[1]<=o[0])return e[i-1][1]=t[1],e;if(t[1]<=o[1])return e[i-1][1]=Math.max(t[1],o[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=o[0])return e.splice(i,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}};tc=Tt([me(0,wn)],tc);function q2(e){return 57508<=e&&e<=57558}function V2(e){return 9472<=e&&e<=9631}function G2(e){return q2(e)||V2(e)}function Y2(){return{css:{canvas:Ll(),cell:Ll()},device:{canvas:Ll(),cell:Ll(),char:{width:0,height:0,left:0,top:0}}}}function Ll(){return{width:0,height:0}}var bd=class{constructor(e,t,n,i,o,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=i,this._coreService=o,this._decorationService=a,this._themeService=l,this._workCell=new ir,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,i,o,a,l,u,d,h,g){let p=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<a+1&&(b=a+1);let x,k=0,C="",O=0,L=0,A=0,H=0,D=!1,se=0,W=!1,ee=0,R=0,Y=[],$=h!==-1&&g!==-1;for(let K=0;K<b;K++){e.loadCell(K,this._workCell);let q=this._workCell.getWidth();if(q===0)continue;let z=!1,Z=K>=R,oe=K,F=this._workCell;if(v.length>0&&K===v[0][0]&&Z){let $e=v.shift(),Ln=this._isCellInSelection($e[0],t);for(O=$e[0]+1;O<$e[1];O++)Z&&(Z=Ln===this._isCellInSelection(O,t));Z&&(Z=!n||a<$e[0]||a>=$e[1]),Z?(z=!0,F=new K2(this._workCell,e.translateToString(!0,$e[0],$e[1]),$e[1]-$e[0]),oe=$e[1]-1,q=F.getWidth()):R=$e[1]}let te=this._isCellInSelection(K,t),E=n&&K===a,I=$&&K>=h&&K<=g,G=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,$e=>{G=!0});let N=F.getChars()||Ei;if(N===" "&&(F.isUnderline()||F.isOverline())&&(N=" "),ee=q*u-d.get(N,F.isBold(),F.isItalic()),!x)x=this._document.createElement("span");else if(k&&(te&&W||!te&&!W&&F.bg===L)&&(te&&W&&y.selectionForeground||F.fg===A)&&F.extended.ext===H&&I===D&&ee===se&&!E&&!z&&!G&&Z){F.isInvisible()?C+=Ei:C+=N,k++;continue}else k&&(x.textContent=C),x=this._document.createElement("span"),k=0,C="";if(L=F.bg,A=F.fg,H=F.extended.ext,D=I,se=ee,W=te,z&&a>=K&&a<=oe&&(a=K),!this._coreService.isCursorHidden&&E&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&Y.push("xterm-cursor-blink"),Y.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline");break}}if(F.isBold()&&Y.push("xterm-bold"),F.isItalic()&&Y.push("xterm-italic"),F.isDim()&&Y.push("xterm-dim"),F.isInvisible()?C=Ei:C=F.getChars()||Ei,F.isUnderline()&&(Y.push(`xterm-underline-${F.extended.underlineStyle}`),C===" "&&(C=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${ha.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let $e=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&$e<8&&($e+=8),x.style.textDecorationColor=y.ansi[$e].css}F.isOverline()&&(Y.push("xterm-overline"),C===" "&&(C=" ")),F.isStrikethrough()&&Y.push("xterm-strikethrough"),I&&(x.style.textDecoration="underline");let ye=F.getFgColor(),Ne=F.getFgColorMode(),_e=F.getBgColor(),Ue=F.getBgColorMode(),Le=!!F.isInverse();if(Le){let $e=ye;ye=_e,_e=$e;let Ln=Ne;Ne=Ue,Ue=Ln}let He,nt,Ft=!1;this._decorationService.forEachDecorationAtCell(K,t,void 0,$e=>{$e.options.layer!=="top"&&Ft||($e.backgroundColorRGB&&(Ue=50331648,_e=$e.backgroundColorRGB.rgba>>8&16777215,He=$e.backgroundColorRGB),$e.foregroundColorRGB&&(Ne=50331648,ye=$e.foregroundColorRGB.rgba>>8&16777215,nt=$e.foregroundColorRGB),Ft=$e.options.layer==="top")}),!Ft&&te&&(He=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,_e=He.rgba>>8&16777215,Ue=50331648,Ft=!0,y.selectionForeground&&(Ne=50331648,ye=y.selectionForeground.rgba>>8&16777215,nt=y.selectionForeground)),Ft&&Y.push("xterm-decoration-top");let tn;switch(Ue){case 16777216:case 33554432:tn=y.ansi[_e],Y.push(`xterm-bg-${_e}`);break;case 50331648:tn=Bt.toColor(_e>>16,_e>>8&255,_e&255),this._addStyle(x,`background-color:#${b_((_e>>>0).toString(16),"0",6)}`);break;case 0:default:Le?(tn=y.foreground,Y.push("xterm-bg-257")):tn=y.background}switch(He||F.isDim()&&(He=pt.multiplyOpacity(tn,.5)),Ne){case 16777216:case 33554432:F.isBold()&&ye<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ye+=8),this._applyMinimumContrast(x,tn,y.ansi[ye],F,He,void 0)||Y.push(`xterm-fg-${ye}`);break;case 50331648:let $e=Bt.toColor(ye>>16&255,ye>>8&255,ye&255);this._applyMinimumContrast(x,tn,$e,F,He,nt)||this._addStyle(x,`color:#${b_(ye.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(x,tn,y.foreground,F,He,nt)||Le&&Y.push("xterm-fg-257")}Y.length&&(x.className=Y.join(" "),Y.length=0),!E&&!z&&!G&&Z?k++:x.textContent=C,ee!==this.defaultSpacing&&(x.style.letterSpacing=`${ee}px`),p.push(x),K=oe}return x&&k&&(x.textContent=C),p}_applyMinimumContrast(e,t,n,i,o,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||G2(i.getCode()))return!1;let l=this._getContrastCache(i),u;if(!o&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);u=pt.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,i=this._selectionEnd;return!n||!i?!1:this._columnSelectMode?n[0]<=i[0]?e>=n[0]&&t>=n[1]&&e<i[0]&&t<=i[1]:e<n[0]&&t>=n[1]&&e>=i[0]&&t<=i[1]:t>n[1]&&t<i[1]||n[1]===i[1]&&t===n[1]&&e>=n[0]&&e<i[0]||n[1]<i[1]&&t===i[1]&&e<i[0]||n[1]<i[1]&&t===n[1]&&e>=n[0]}};bd=Tt([me(1,jy),me(2,xn),me(3,Zr),me(4,cs),me(5,da),me(6,Ys)],bd);function b_(e,t,n){for(;e.length<n;)e=t+e;return e}var X2=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 i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.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,i,o,a],this._container.appendChild(n),this._container.appendChild(i),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,i){e===this._font&&t===this._fontSize&&n===this._weight&&i===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=i,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${i}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${i}`,this.clear())}get(e,t,n){let i=0;if(!t&&!n&&e.length===1&&(i=e.charCodeAt(0))<256){if(this._flat[i]!==-9999)return this._flat[i];let l=this._measure(e,0);return l>0&&(this._flat[i]=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}},Z2=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,i=!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=i,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 Q2(){return new Z2}var Rh="xterm-dom-renderer-owner-",er="xterm-rows",Il="xterm-fg-",S_="xterm-bg-",Uo="xterm-focus",Pl="xterm-selection",J2=1,Sd=class extends qe{constructor(e,t,n,i,o,a,l,u,d,h,g,p,v,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=i,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=J2++,this._rowElements=[],this._selectionRenderModel=Q2(),this.onRequestRedraw=this._register(new de).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(er),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(Pl),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Y2(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(bd,document),this._element.classList.add(Rh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(_t(()=>{this._element.classList.remove(Rh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new X2(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} .${er} 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} .${er} { 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} .${er} .xterm-dim { color: ${pt.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}`,i=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 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} .${er}.${Uo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${er}.${Uo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${er}.${Uo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${er} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Pl} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Pl} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Pl} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Il}${a} { color: ${l.css}; }${this._terminalSelector} .${Il}${a}.xterm-dim { color: ${pt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${S_}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Il}257 { color: ${pt.opaque(e.background).css}; }${this._terminalSelector} .${Il}257.xterm-dim { color: ${pt.multiplyOpacity(pt.opaque(e.background),.5).css}; }${this._terminalSelector} .${S_}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 i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}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(Uo),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Uo),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 i=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=i===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,i=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=`${i*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,i=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===i,l,u,o,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Rh}${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,i,o,a){n<0&&(e=0),i<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),i=Math.max(Math.min(i,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<=i;++y){let b=y+u.ydisp,x=this._rowElements[y],k=u.lines.get(b);if(!x||!k)break;x.replaceChildren(...this._rowFactory.createRow(k,b,b===d,p,v,h,g,this.dimensions.css.cell.width,this._widthCache,a?y===n?e:0:-1,a?(y===i?t:o)-1:-1))}}};Sd=Tt([me(7,of),me(8,pc),me(9,xn),me(10,wn),me(11,cs),me(12,Zr),me(13,Ys)],Sd);var wd=class extends qe{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new de),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new tA(this._optionsService))}catch{this._measureStrategy=this._register(new eA(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())}};wd=Tt([me(2,xn)],wd);var lb=class extends qe{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)}},eA=class extends lb{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}},tA=class extends lb{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}},nA=class extends qe{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 rA(this._window)),this._onDprChange=this._register(new de),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new de),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this._register(an.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Be(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Be(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},rA=class extends qe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new qs),this._onDprChange=this._register(new de),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(_t(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Be(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},iA=class extends qe{constructor(){super(),this.linkProviders=[],this._register(_t(()=>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 pf(e,t,n){let i=n.getBoundingClientRect(),o=e.getComputedStyle(n),a=parseInt(o.getPropertyValue("padding-left")),l=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-i.left-a,t.clientY-i.top-l]}function sA(e,t,n,i,o,a,l,u,d){if(!a)return;let h=pf(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),i+(d?1:0)),h[1]=Math.min(Math.max(h[1],1),o),h}var xd=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,i,o){return sA(window,e,t,n,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let n=pf(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])}}};xd=Tt([me(0,Qr),me(1,pc)],xd);var oA=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=[]}},cb={};gR(cb,{getSafariVersion:()=>lA,isChromeOS:()=>fb,isFirefox:()=>ub,isIpad:()=>cA,isIphone:()=>uA,isLegacyEdge:()=>aA,isLinux:()=>mf,isMac:()=>nc,isNode:()=>mc,isSafari:()=>hb,isWindows:()=>db});var mc=typeof process<"u"&&"title"in process,fa=mc?"node":navigator.userAgent,pa=mc?"node":navigator.platform,ub=fa.includes("Firefox"),aA=fa.includes("Edge"),hb=/^((?!chrome|android).)*safari/i.test(fa);function lA(){if(!hb)return 0;let e=fa.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var nc=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(pa),cA=pa==="iPad",uA=pa==="iPhone",db=["Windows","Win16","Win32","WinCE"].includes(pa),mf=pa.indexOf("Linux")>=0,fb=/\bCrOS\b/.test(fa),pb=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,i=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){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=o}this.clear()}},hA=class extends pb{_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())}}},dA=class extends pb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},rc=!mc&&"requestIdleCallback"in window?dA:hA,fA=class{constructor(){this._queue=new rc}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},kd=class extends qe{constructor(e,t,n,i,o,a,l,u,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=i,this._coreService=o,this._coreBrowserService=u,this._renderer=this._register(new qs),this._pausedResizeTask=new fA,this._observerDisposable=this._register(new qs),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 de),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new de),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new de),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new de),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new oA((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new pA(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(_t(()=>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(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=_t(()=>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 i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.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 i;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(i=this._renderer.value)==null||i.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};kd=Tt([me(2,xn),me(3,pc),me(4,cs),me(5,da),me(6,wn),me(7,Zr),me(8,Ys)],kd);var pA=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 mA(e,t,n,i){let o=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return vA(o,a,e,t,n,i)+gc(a,t,n,i)+yA(o,a,e,t,n,i);let l;if(a===t)return l=o>e?"D":"C",sa(Math.abs(o-e),ia(l,i));l=a>t?"D":"C";let u=Math.abs(a-t),d=_A(a>t?e:o,n)+(u-1)*n.cols+1+gA(a>t?o:e);return sa(d,ia(l,i))}function gA(e,t){return e-1}function _A(e,t){return t.cols-e}function vA(e,t,n,i,o,a){return gc(t,i,o,a).length===0?"":sa(gb(e,t,e,t-os(t,o),!1,o).length,ia("D",a))}function gc(e,t,n,i){let o=e-os(e,n),a=t-os(t,n),l=Math.abs(o-a)-bA(e,t,n);return sa(l,ia(mb(e,t),i))}function yA(e,t,n,i,o,a){let l;gc(t,i,o,a).length>0?l=i-os(i,o):l=t;let u=i,d=SA(e,t,n,i,o,a);return sa(gb(e,l,n,u,d==="C",o).length,ia(d,a))}function bA(e,t,n){var l;let i=0,o=e-os(e,n),a=t-os(t,n);for(let u=0;u<Math.abs(o-a);u++){let d=mb(e,t)==="A"?-1:1;(l=n.buffer.lines.get(o+d*u))!=null&&l.isWrapped&&i++}return i}function os(e,t){let n=0,i=t.buffer.lines.get(e),o=i==null?void 0:i.isWrapped;for(;o&&e>=0&&e<t.rows;)n++,i=t.buffer.lines.get(--e),o=i==null?void 0:i.isWrapped;return n}function SA(e,t,n,i,o,a){let l;return gc(n,i,o,a).length>0?l=i-os(i,o):l=t,e<n&&l<=i||e>=n&&l<i?"C":"D"}function mb(e,t){return e>t?"A":"B"}function gb(e,t,n,i,o,a){let l=e,u=t,d="";for(;(l!==n||u!==i)&&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 ia(e,t){let n=t?"O":"[";return J.ESC+n+e}function sa(e,t){e=Math.floor(e);let n="";for(let i=0;i<e;i++)n+=t;return n}var wA=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 w_(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 Ah=50,xA=15,kA=50,EA=500,CA=" ",NA=new RegExp(CA,"g"),Ed=class extends qe{constructor(e,t,n,i,o,a,l,u,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=i,this._coreService=o,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ir,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new de),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new de),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new de),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new de),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 wA(this._bufferService),this._activeSelectionMode=0,this._register(_t(()=>{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,i=[];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);i.push(u)}}else{let o=e[1]===t[1]?t[0]:void 0;i.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?i[i.length-1]+=u:i.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?i[i.length-1]+=l:i.push(l)}}return i.map(o=>o.replace(NA," ")).join(db?`\r
|
|
100
100
|
`:`
|
|
101
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),mf&&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,i=this._model.finalSelectionEnd;return!n||!i||!t?!1:this._areCoordsInSelection(t,n,i)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!n||!i?!1:this._areCoordsInSelection([e,t],n,i)}_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=w_(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,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=pf(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,-Ah),Ah),t/=Ah,t/Math.abs(t)+Math.round(t*(xA-1)))}shouldForceSelection(e){return nc?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(),kA)}_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&&!(nc&&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 i=n.lines.get(this._model.selectionEnd[1]);i&&i.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<EA&&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 i=mA(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!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 i=0;t>=i;i++){let o=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:o>1&&t!==i&&(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,i=!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 k=e[0],E=e[0];a.getWidth(k)===0&&(g++,k--),a.getWidth(E)===2&&(p++,E++);let O=a.getString(E).length;for(O>1&&(y+=O-1,d+=O-1);k>0&&u>0&&!this._isCharWordSeparator(a.loadCell(k-1,this._workCell));){a.loadCell(k-1,this._workCell);let L=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,k--):L>1&&(v+=L-1,u-=L-1),u--,k--}for(;E<a.length&&d+1<l.length&&!this._isCharWordSeparator(a.loadCell(E+1,this._workCell));){a.loadCell(E+1,this._workCell);let L=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,E++):L>1&&(y+=L-1,d+=L-1),d++,E++}}d++;let b=u+h-g+v,x=Math.min(this._bufferService.cols,d-u+g+p-v-y);if(!(!t&&l.slice(u,d).trim()==="")){if(n&&b===0&&a.getCodePoint(0)!==32){let k=o.lines.get(e[1]-1);if(k&&a.isWrapped&&k.getCodePoint(this._bufferService.cols-1)!==32){let E=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(E){let O=this._bufferService.cols-E.start;b-=O,x+=O}}}if(i&&b+x===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let k=o.lines.get(e[1]+1);if(k!=null&&k.isWrapped&&k.getCodePoint(0)!==32){let E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(x+=E.length)}}return{start:b,length:x}}}_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=w_(n,this._bufferService.cols)}};Ed=Tt([me(3,wn),me(4,cs),me(5,af),me(6,xn),me(7,Qr),me(8,Zr)],Ed);var x_=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 x_,this._css=new x_}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()}},jt=Object.freeze((()=>{let e=[kt.toColor("#2e3436"),kt.toColor("#cc0000"),kt.toColor("#4e9a06"),kt.toColor("#c4a000"),kt.toColor("#3465a4"),kt.toColor("#75507b"),kt.toColor("#06989a"),kt.toColor("#d3d7cf"),kt.toColor("#555753"),kt.toColor("#ef2929"),kt.toColor("#8ae234"),kt.toColor("#fce94f"),kt.toColor("#729fcf"),kt.toColor("#ad7fa8"),kt.toColor("#34e2e2"),kt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let i=t[n/36%6|0],o=t[n/6%6|0],a=t[n%6];e.push({css:Bt.toCss(i,o,a),rgba:Bt.toRgba(i,o,a)})}for(let n=0;n<24;n++){let i=8+n*10;e.push({css:Bt.toCss(i,i,i),rgba:Bt.toRgba(i,i,i)})}return e})()),Qi=kt.toColor("#ffffff"),Go=kt.toColor("#000000"),E_=kt.toColor("#ffffff"),C_=Go,Ho={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},TA=Qi,Cd=class extends qe{constructor(e){super(),this._optionsService=e,this._contrastCache=new k_,this._halfContrastCache=new k_,this._onChangeColors=this._register(new de),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Qi,background:Go,cursor:E_,cursorAccent:C_,selectionForeground:void 0,selectionBackgroundTransparent:Ho,selectionBackgroundOpaque:pt.blend(Go,Ho),selectionInactiveBackgroundTransparent:Ho,selectionInactiveBackgroundOpaque:pt.blend(Go,Ho),scrollbarSliderBackground:pt.opacity(Qi,.2),scrollbarSliderHoverBackground:pt.opacity(Qi,.4),scrollbarSliderActiveBackground:pt.opacity(Qi,.5),overviewRulerBorder:Qi,ansi:jt.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=st(e.foreground,Qi),t.background=st(e.background,Go),t.cursor=pt.blend(t.background,st(e.cursor,E_)),t.cursorAccent=pt.blend(t.background,st(e.cursorAccent,C_)),t.selectionBackgroundTransparent=st(e.selectionBackground,Ho),t.selectionBackgroundOpaque=pt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=st(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=pt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?st(e.selectionForeground,y_):void 0,t.selectionForeground===y_&&(t.selectionForeground=void 0),pt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=pt.opacity(t.selectionBackgroundTransparent,.3)),pt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=pt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=st(e.scrollbarSliderBackground,pt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=st(e.scrollbarSliderHoverBackground,pt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=st(e.scrollbarSliderActiveBackground,pt.opacity(t.foreground,.5)),t.overviewRulerBorder=st(e.overviewRulerBorder,TA),t.ansi=jt.slice(),t.ansi[0]=st(e.black,jt[0]),t.ansi[1]=st(e.red,jt[1]),t.ansi[2]=st(e.green,jt[2]),t.ansi[3]=st(e.yellow,jt[3]),t.ansi[4]=st(e.blue,jt[4]),t.ansi[5]=st(e.magenta,jt[5]),t.ansi[6]=st(e.cyan,jt[6]),t.ansi[7]=st(e.white,jt[7]),t.ansi[8]=st(e.brightBlack,jt[8]),t.ansi[9]=st(e.brightRed,jt[9]),t.ansi[10]=st(e.brightGreen,jt[10]),t.ansi[11]=st(e.brightYellow,jt[11]),t.ansi[12]=st(e.brightBlue,jt[12]),t.ansi[13]=st(e.brightMagenta,jt[13]),t.ansi[14]=st(e.brightCyan,jt[14]),t.ansi[15]=st(e.brightWhite,jt[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<n;i++)t.ansi[i+16]=st(e.extendedAnsi[i],jt[i+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()}}};Cd=Tt([me(0,xn)],Cd);function st(e,t){if(e!==void 0)try{return kt.toColor(e)}catch{}return t}var RA=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)}},AA=class{constructor(){this._services=new RA,this._services.set(of,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=xR(e).sort((a,l)=>a.index-l.index),i=[];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}.`);i.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,...i)}},MA={trace:0,debug:1,info:2,warn:3,error:4,off:5},OA="xterm.js: ",Nd=class extends qe{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=MA[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?"":OA)+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)}};Nd=Tt([me(0,xn)],Nd);var N_=class extends qe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new de),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new de),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new de),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 i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+n.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<n.length;i++)this._array[this._getCyclicIndex(e+i)]=n[i];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let i=this._length+n.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}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 i=e+t+n-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<t;i++)this.set(e+i+n,this.get(e+i))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ke=3,Pt=Object.freeze(new ha),Bl=0,Mh=2,Yo=class _b{constructor(t,n,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ke);let o=n||ir.fromCharData([0,Py,1,0]);for(let a=0;a<t;++a)this.setCell(a,o);this.length=t}get(t){let n=this._data[t*Ke+0],i=n&2097151;return[this._data[t*Ke+1],n&2097152?this._combined[t]:i?ki(i):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,n){this._data[t*Ke+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ke+0]=t|2097152|n[2]<<22):this._data[t*Ke+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ke+0]>>22}hasWidth(t){return this._data[t*Ke+0]&12582912}getFg(t){return this._data[t*Ke+1]}getBg(t){return this._data[t*Ke+2]}hasContent(t){return this._data[t*Ke+0]&4194303}getCodePoint(t){let n=this._data[t*Ke+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ke+0]&2097152}getString(t){let n=this._data[t*Ke+0];return n&2097152?this._combined[t]:n&2097151?ki(n&2097151):""}isProtected(t){return this._data[t*Ke+2]&536870912}loadCell(t,n){return Bl=t*Ke,n.content=this._data[Bl+0],n.fg=this._data[Bl+1],n.bg=this._data[Bl+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*Ke+0]=n.content,this._data[t*Ke+1]=n.fg,this._data[t*Ke+2]=n.bg}setCellFromCodepoint(t,n,i,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*Ke+0]=n|i<<22,this._data[t*Ke+1]=o.fg,this._data[t*Ke+2]=o.bg}addCodepointToCell(t,n,i){let o=this._data[t*Ke+0];o&2097152?this._combined[t]+=ki(n):o&2097151?(this._combined[t]=ki(o&2097151)+ki(n),o&=-2097152,o|=2097152):o=n|1<<22,i&&(o&=-12582913,o|=i<<22),this._data[t*Ke+0]=o}insertCells(t,n,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length-t){let o=new ir;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,i)}else for(let o=t;o<this.length;++o)this.setCell(o,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(t,n,i){if(t%=this.length,n<this.length-t){let o=new ir;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,i)}else for(let o=t;o<this.length;++o)this.setCell(o,i);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,i)}replaceCells(t,n,i,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,i);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,i),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,i);t<n&&t<this.length;)this.setCell(t++,i)}resize(t,n){if(t===this.length)return this._data.length*4*Mh<this._data.buffer.byteLength;let i=t*Ke;if(t>this.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let o=new Uint32Array(i);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,i);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,i*4*Mh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Mh<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 i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,t);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,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 _b(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*Ke+0]&4194303)return t+(this._data[t*Ke+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ke+0]&4194303||this._data[t*Ke+2]&50331648)return t+(this._data[t*Ke+0]>>22);return 0}copyCellsFrom(t,n,i,o,a){let l=t._data;if(a)for(let d=o-1;d>=0;d--){for(let h=0;h<Ke;h++)this._data[(i+d)*Ke+h]=l[(n+d)*Ke+h];l[(n+d)*Ke+2]&268435456&&(this._extendedAttrs[i+d]=t._extendedAttrs[n+d])}else for(let d=0;d<o;d++){for(let h=0;h<Ke;h++)this._data[(i+d)*Ke+h]=l[(n+d)*Ke+h];l[(n+d)*Ke+2]&268435456&&(this._extendedAttrs[i+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+i]=t._combined[h])}}translateToString(t,n,i,o){n=n??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),o&&(o.length=0);let a="";for(;n<i;){let l=this._data[n*Ke+0],u=l&2097151,d=l&2097152?this._combined[n]:u?ki(u):Ei;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 DA(e,t,n,i,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&&i>=u&&i<d){u+=g.length-1;continue}let p=0,v=oa(g,p,t),y=1,b=0;for(;y<g.length;){let k=oa(g,y,t),E=k-b,O=n-v,L=Math.min(E,O);g[p].copyCellsFrom(g[y],b,v,L,!1),v+=L,v===n&&(p++,v=0),b+=L,b===k&&(y++,b=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 x=0;for(let k=g.length-1;k>0&&(k>p||g[k].getTrimmedLength()===0);k--)x++;x>0&&(l.push(u+g.length-x),l.push(x)),u+=g.length-1}return l}function LA(e,t){let n=[],i=0,o=t[i],a=0;for(let l=0;l<e.length;l++)if(o===l){let u=t[++i];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,o=t[++i]}else n.push(l);return{layout:n,countRemoved:a}}function IA(e,t){let n=[];for(let i=0;i<t.length;i++)n.push(e.get(t[i]));for(let i=0;i<n.length;i++)e.set(i,n[i]);e.length=t.length}function PA(e,t,n){let i=[],o=e.map((d,h)=>oa(e,h,t)).reduce((d,h)=>d+h),a=0,l=0,u=0;for(;u<o;){if(o-u<n){i.push(o-u);break}a+=n;let d=oa(e,l,t);a>d&&(a-=d,l++);let h=e[l].getWidth(a-1)===2;h&&a--;let g=h?n-1:n;i.push(g),u+=g}return i}function oa(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,o=e[t+1].getWidth(0)===2;return i&&o?n-1:n}var vb=class yb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=yb._nextId++,this._onDispose=this.register(new de),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ss(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};vb._nextId=1;var BA=vb,Kt={},Ji=Kt.B;Kt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Kt.A={"#":"£"};Kt.B=void 0;Kt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Kt.C=Kt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Kt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Kt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Kt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Kt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Kt.E=Kt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Kt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Kt.H=Kt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Kt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var T_=4294967295,R_=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=Pt.clone(),this.savedCharset=Ji,this.markers=[],this._nullCell=ir.fromCharData([0,Py,1,0]),this._whitespaceCell=ir.fromCharData([0,Ei,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new rc,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new N_(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 Jl),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 Jl),this._whitespaceCell}getBlankLine(e,t){return new Yo(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>T_?T_:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Pt);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 N_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Pt),i=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++)i+=+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 Yo(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 Yo(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++)i+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),i>.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,i=DA(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Pt),n);if(i.length>0){let o=LA(this.lines,i);IA(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let i=this.getNullCell(Pt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Yo(e,i))):(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,i=this.getNullCell(Pt),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 L=this.ybase+this.y;if(L>=l&&L<l+d.length)continue}let h=d[d.length-1].getTrimmedLength(),g=PA(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 L=0;L<p;L++){let A=this.getBlankLine(Pt,!0);y.push(A)}y.length>0&&(o.push({start:l+d.length+a,newLines:y}),a+=y.length),d.push(...y);let b=g.length-1,x=g[b];x===0&&(b--,x=g[b]);let k=d.length-p-1,E=h;for(;k>=0;){let L=Math.min(E,x);if(d[b]===void 0)break;if(d[b].copyCellsFrom(d[k],E-L,x-L,L,!0),x-=L,x===0&&(b--,x=g[b]),E-=L,E===0){k--;let A=Math.max(k,0);E=oa(d,A,this._cols)}}for(let L=0;L<d.length;L++)g[L]<e&&d[L].setCell(g[L],i);let O=p-v;for(;O-- >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 x=0;x<this.lines.length;x++)u.push(this.lines.get(x));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 x=Math.min(this.lines.maxLength-1,d+a-1);x>=0;x--)if(p&&p.start>h+v){for(let k=p.newLines.length-1;k>=0;k--)this.lines.set(x--,p.newLines[k]);x++,l.push({index:h+1,amount:p.newLines.length}),v+=p.newLines.length,p=o[++g]}else this.lines.set(x,u[h--]);let y=0;for(let x=l.length-1;x>=0;x--)l[x].index+=y,this.lines.onInsertEmitter.fire(l[x]),y+=l[x].amount;let b=Math.max(0,d+a-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,t,n=0,i){let o=this.lines.get(e);return o?o.translateToString(t,n,i):""}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 BA(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)}},FA=class extends qe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new de),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new R_(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new R_(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},bb=2,Sb=1,Td=class extends qe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new de),this.onResize=this._onResize.event,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,bb),this.rows=Math.max(e.rawOptions.rows||0,Sb),this.buffers=this._register(new FA(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,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=n.getBlankLine(e,t),this._cachedBlankLine=i),i.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(i):n.lines.push(i.clone()):n.lines.splice(a+1,0,i.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,i.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 i=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),i!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Td=Tt([me(0,xn)],Td);var zs={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:nc,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},zA=["normal","bold","100","200","300","400","500","600","700","800","900"],UA=class extends qe{constructor(e){super(),this._onOptionChange=this._register(new de),this.onOptionChange=this._onOptionChange.event;let t={...zs};for(let n in e)if(n in t)try{let i=e[n];t[n]=this._sanitizeAndValidateOption(n,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(_t(()=>{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 zs))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,i)=>{if(!(n in zs))throw new Error(`No option with key "${n}"`);i=this._sanitizeAndValidateOption(n,i),this.rawOptions[n]!==i&&(this.rawOptions[n]=i,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let i={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=zs[e]),!HA(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=zs[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=zA.includes(t)?t:zs[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 HA(e){return e==="block"||e==="underline"||e==="bar"}function Xo(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let i in e)n[i]=t<=1?e[i]:e[i]&&Xo(e[i],t-1);return n}var A_=Object.freeze({insertMode:!1}),M_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Rd=class extends qe{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 de),this.onData=this._onData.event,this._onUserInput=this._register(new de),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new de),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new de),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Xo(A_),this.decPrivateModes=Xo(M_)}reset(){this.modes=Xo(A_),this.decPrivateModes=Xo(M_)}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(i=>i.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))}};Rd=Tt([me(0,wn),me(1,Hy),me(2,xn)],Rd);var O_={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 Oh(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 Dh=String.fromCharCode,D_={DEFAULT:e=>{let t=[Oh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Dh(t[0])}${Dh(t[1])}${Dh(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Oh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Oh(e,!0)};${e.x};${e.y}${t}`}},Ad=class extends qe{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 de),this.onProtocolChange=this._onProtocolChange.event;for(let i of Object.keys(O_))this.addProtocol(i,O_[i]);for(let i of Object.keys(D_))this.addEncoding(i,D_[i]);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 i=t/n,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=i+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)}};Ad=Tt([me(0,wn),me(1,cs),me(2,xn)],Ad);var Lh=[[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]],$A=[[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]],Wt;function jA(e,t){let n=0,i=t.length-1,o;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=n;)if(o=n+i>>1,e>t[o][1])n=o+1;else if(e<t[o][0])i=o-1;else return!0;return!1}var WA=class{constructor(){if(this.version="6",!Wt){Wt=new Uint8Array(65536),Wt.fill(1),Wt[0]=0,Wt.fill(0,1,32),Wt.fill(0,127,160),Wt.fill(2,4352,4448),Wt[9001]=2,Wt[9002]=2,Wt.fill(2,11904,42192),Wt[12351]=1,Wt.fill(2,44032,55204),Wt.fill(2,63744,64256),Wt.fill(2,65040,65050),Wt.fill(2,65072,65136),Wt.fill(2,65280,65377),Wt.fill(2,65504,65511);for(let e=0;e<Lh.length;++e)Wt.fill(0,Lh[e][0],Lh[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Wt[e]:jA(e,$A)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),i=n===0&&t!==0;if(i){let o=es.extractWidth(t);o===0?i=!1:o>n&&(n=o)}return es.createPropertyValue(0,n,i)}},es=class Wl{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new de,this.onChange=this._onChange.event;let t=new WA;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,i=!1){return(t&16777215)<<3|(n&3)<<1|(i?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,i=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,i),d=Wl.extractWidth(u);Wl.extractShouldJoin(u)&&(d-=Wl.extractWidth(i)),n+=d,i=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},KA=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 L_(e){var i;let t=(i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:i.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 $o=2147483647,qA=256,wb=class Md{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>qA)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 Md;if(!t.length)return n;for(let i=Array.isArray(t[0])?1:0;i<t.length;++i){let o=t[i];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 Md(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 i=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,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>$o?$o: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>$o?$o: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,i=this._subParamsIdx[t]&255;return i-n>0?this._subParams.subarray(n,i):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let i=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-i>0&&(t[n]=this._subParams.slice(i,o))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,o=i[n-1];i[n-1]=~o?Math.min(o*10+t,$o):t}},jo=[],VA=class{constructor(){this._state=0,this._active=jo,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 i=n.indexOf(t);i!==-1&&n.splice(i,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=jo}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=jo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||jo,!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",fc(e,t,n));else for(let i=this._active.length-1;i>=0;i--)this._active[i].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 i=e[t++];if(i===59){this._state=2,this._start();break}if(i<48||57<i){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+i-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,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,n=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;i>=0&&(n=this._active[i].end(e),n!==!0);i--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,n;i--}for(;i>=0;i--)if(n=this._active[i].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,n}this._active=jo,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+=fc(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}},Wo=[],GA=class{constructor(){this._handlers=Object.create(null),this._active=Wo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Wo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,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=Wo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Wo,!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",fc(e,t,n));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,n=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;i>=0&&(n=this._active[i].unhook(e),n!==!0);i--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,n;i--}for(;i>=0;i--)if(n=this._active[i].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,n}this._active=Wo,this._ident=0}},Zo=new wb;Zo.addParam(0);var I_=class{constructor(e){this._handler=e,this._data="",this._params=Zo,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Zo,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=fc(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=Zo,this._data="",this._hitLimit=!1,n));return this._params=Zo,this._data="",this._hitLimit=!1,t}},YA=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,i){this.table[t<<8|e]=n<<4|i}addMany(e,t,n,i){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=n<<4|i}},nr=160,XA=(function(){let e=new YA(4095),t=Array.apply(null,Array(256)).map((u,d)=>d),n=(u,d)=>t.slice(u,d),i=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(i,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(i,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(i,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(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(nr,0,2,0),e.add(nr,8,5,8),e.add(nr,6,0,6),e.add(nr,11,0,11),e.add(nr,13,13,13),e})(),ZA=class extends qe{constructor(e=XA){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 wb,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,i)=>{},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(_t(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new VA),this._dcsParser=this._register(new GA),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 i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=i,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 i=this._escHandlers[n];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.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 i=this._csiHandlers[n];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.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,i,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=i,this._parseStack.chunkPos=o}parse(e,t,n){let i=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(i=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(i!==24&&i!==26,n),l)return l;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],l=this._oscParser.end(i!==24&&i!==26,n),l)return l;i===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(i=e[u],o=this._transitions.table[this.currentState<<8|(i<160?i:nr)],o>>4){case 2:for(let v=u+1;;++v){if(v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|i],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|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++u<t&&(i=e[u])>47&&i<60);u--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let g=this._escHandlers[this._collect<<8|i],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|i),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|i,this._params);break;case 13:for(let v=u+1;;++v)if(v>=t||(i=e[v])===24||i===26||i===27||i>127&&i<nr){this._dcsParser.put(e,u,v),u=v-1;break}break;case 14:if(l=this._dcsParser.unhook(i!==24&&i!==26),l)return this._preserveStack(6,[],0,o,u),l;i===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||(i=e[v])<32||i>127&&i<nr){this._oscParser.put(e,u,v),u=v-1;break}break;case 6:if(l=this._oscParser.end(i!==24&&i!==26),l)return this._preserveStack(5,[],0,o,u),l;i===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},QA=/^([\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})$/,JA=/^[\da-f]+$/;function P_(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=QA.exec(t);if(n){let i=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/i*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/i*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/i*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),JA.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,i=[0,0,0];for(let o=0;o<3;++o){let a=parseInt(t.slice(n*o,n*o+n),16);i[o]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return i}}function Ih(e,t){let n=e.toString(16),i=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function eM(e,t=16){let[n,i,o]=e;return`rgb:${Ih(n,t)}/${Ih(i,t)}/${Ih(o,t)}`}var tM={"(":0,")":1,"*":2,"+":3,"-":1,".":2},xi=131072,B_=10;function F_(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 z_=5e3,U_=0,nM=class extends qe{constructor(e,t,n,i,o,a,l,u,d=new ZA){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=i,this._optionsService=o,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new SR,this._utf8Decoder=new wR,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Pt.clone(),this._eraseAttrDataInternal=Pt.clone(),this._onRequestBell=this._register(new de),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new de),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new de),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new de),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new de),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new de),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new de),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new de),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new de),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new de),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new de),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new de),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 Od(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(J.BEL,()=>this.bell()),this._parser.setExecuteHandler(J.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(J.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(J.BS,()=>this.backspace()),this._parser.setExecuteHandler(J.HT,()=>this.tab()),this._parser.setExecuteHandler(J.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(J.SI,()=>this.shiftIn()),this._parser.setExecuteHandler($l.IND,()=>this.index()),this._parser.setExecuteHandler($l.NEL,()=>this.nextLine()),this._parser.setExecuteHandler($l.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 Kt)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 I_((h,g)=>this.requestStatusString(h,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),z_))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${z_} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,i=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;i=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>xi&&(a=this._parseStack.position+xi)}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<xi&&(this._parseBuffer=new Uint32Array(Math.min(e.length,xi))),l||this._dirtyRowTracker.clearRange(),e.length>xi)for(let h=a;h<e.length;h+=xi){let g=h+xi<e.length?h+xi: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(i,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(i,o,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==i||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 i,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(i=e[y],i<127&&a){let E=a[String.fromCharCode(i)];E&&(i=E.charCodeAt(0))}let b=this._unicodeService.charProperties(i,v);o=es.extractWidth(b);let x=es.extractShouldJoin(b),k=x?es.extractWidth(v):0;if(v=b,l&&this._onA11yChar.fire(ki(i)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-k>u){if(d){let E=p,O=this._activeBuffer.x-k;for(this._activeBuffer.x=k,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),k>0&&p instanceof Yo&&p.copyCellsFrom(E,O,0,k,!1);O<u;)E.setCellFromCodepoint(O++,0,1,g)}else if(this._activeBuffer.x=u-1,o===2)continue}if(x&&this._activeBuffer.x){let E=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-E,i,o);for(let O=o-k;--O>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(h&&(p.insertCells(this._activeBuffer.x,o-k,this._activeBuffer.getNullCell(g)),p.getWidth(u-1)===2&&p.setCellFromCodepoint(u-1,0,1,g)),p.setCellFromCodepoint(this._activeBuffer.x++,i,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=>F_(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new I_(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,i=!1,o=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),o),i&&(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 i;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--&&!((i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&i.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,i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-i+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,i;for(i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-i;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}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(Pt));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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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,i=es.extractWidth(t),o=this._activeBuffer.x-i,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(J.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(J.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(J.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(J.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(J.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,Ji),this._charsetService.setgCharset(1,Ji),this._charsetService.setgCharset(2,Ji),this._charsetService.setgCharset(3,Ji);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){(x=>(x[x.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",x[x.SET=1]="SET",x[x.RESET=2]="RESET",x[x.PERMANENTLY_SET=3]="PERMANENTLY_SET",x[x.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let i=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=(x,k)=>(l.triggerDataEvent(`${J.ESC}[${t?"":"?"}${x};${k}$y`),!0),y=x=>x?1:2,b=e.params[0];return t?b===2?v(b,4):b===4?v(b,y(l.modes.insertMode)):b===12?v(b,3):b===20?v(b,y(p.convertEol)):v(b,0):b===1?v(b,y(i.applicationCursorKeys)):b===3?v(b,p.windowOptions.setWinLines?d===80?2:d===132?1:0:0):b===6?v(b,y(i.origin)):b===7?v(b,y(i.wraparound)):b===8?v(b,3):b===9?v(b,y(o==="X10")):b===12?v(b,y(p.cursorBlink)):b===25?v(b,y(!l.isCursorHidden)):b===45?v(b,y(i.reverseWraparound)):b===66?v(b,y(i.applicationKeypad)):b===67?v(b,4):b===1e3?v(b,y(o==="VT200")):b===1002?v(b,y(o==="DRAG")):b===1003?v(b,y(o==="ANY")):b===1004?v(b,y(i.sendFocus)):b===1005?v(b,4):b===1006?v(b,y(a==="SGR")):b===1015?v(b,4):b===1016?v(b,y(a==="SGR_PIXELS")):b===1048?v(b,1):b===47||b===1047||b===1049?v(b,y(h===g)):b===2004?v(b,y(i.bracketedPasteMode)):b===2026?v(b,y(i.synchronizedOutput)):v(b,0)}_updateAttrColor(e,t,n,i,o){return t===2?(e|=50331648,e&=-16777216,e|=ha.fromColorRGB([n,i,o])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let i=[0,0,-1,0,0,0],o=0,a=0;do{if(i[a+o]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do i[1]===5&&(o=1),i[a+u+1+o]=l[u];while(++u<l.length&&u+a+1+o<i.length);break}if(i[1]===5&&a+o>=2||i[1]===2&&a+o>=5)break;i[1]&&(o=1)}while(++a+t<e.length&&a+o<i.length);for(let l=2;l<i.length;++l)i[l]===-1&&(i[l]=0);switch(i[0]){case 38:n.fg=this._updateAttrColor(n.fg,i[1],i[3],i[4],i[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,i[1],i[3],i[4],i[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,i[1],i[3],i[4],i[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=Pt.fg,e.bg=Pt.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,i=this._curAttrData;for(let o=0;o<t;o++)n=e.params[o],n>=30&&n<=37?(i.fg&=-50331904,i.fg|=16777216|n-30):n>=40&&n<=47?(i.bg&=-50331904,i.bg|=16777216|n-40):n>=90&&n<=97?(i.fg&=-50331904,i.fg|=16777216|n-90|8):n>=100&&n<=107?(i.bg&=-50331904,i.bg|=16777216|n-100|8):n===0?this._processSGR0(i):n===1?i.fg|=134217728:n===3?i.bg|=67108864:n===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,i)):n===5?i.fg|=536870912:n===7?i.fg|=67108864:n===8?i.fg|=1073741824:n===9?i.fg|=2147483648:n===2?i.bg|=134217728:n===21?this._processUnderline(2,i):n===22?(i.fg&=-134217729,i.bg&=-134217729):n===23?i.bg&=-67108865:n===24?(i.fg&=-268435457,this._processUnderline(0,i)):n===25?i.fg&=-536870913:n===27?i.fg&=-67108865:n===28?i.fg&=-1073741825:n===29?i.fg&=2147483647:n===39?(i.fg&=-67108864,i.fg|=Pt.fg&16777215):n===49?(i.bg&=-67108864,i.bg|=Pt.bg&16777215):n===38||n===48||n===58?o+=this._extractColor(e,o,i):n===53?i.bg|=1073741824:n===55?i.bg&=-1073741825:n===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):n===100?(i.fg&=-67108864,i.fg|=Pt.fg&16777215,i.bg&=-67108864,i.bg|=Pt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${J.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${J.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(`${J.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=Pt.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(!F_(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(`${J.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>B_&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>B_&&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 i=n.shift(),o=n.shift();if(/^\d+$/.exec(i)){let a=parseInt(i);if(H_(a))if(o==="?")t.push({type:0,index:a});else{let l=P_(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(),i=e.slice(t+1);return i?this._createHyperlink(n,i):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),i,o=n.findIndex(a=>a.startsWith("id="));return o!==-1&&(i=n[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,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 i=0;i<n.length&&!(t>=this._specialColors.length);++i,++t)if(n[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=P_(n[i]);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 i=0;i<n.length;++i)if(/^\d+$/.exec(n[i])){let o=parseInt(n[i]);H_(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,Ji),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(tM[e[0]],Kt[e[1]]||Ji),!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=Pt.clone(),this._eraseAttrDataInternal=Pt.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 ir;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,i=this._activeBuffer.lines.get(n);i&&(i.fill(e),i.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${J.ESC}${l}${J.ESC}\\`),!0),i=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${i.scrollTop+1};${i.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)}},Od=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&&(U_=e,e=t,t=U_),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Od=Tt([me(0,wn)],Od);function H_(e){return 0<=e&&e<256}var rM=5e7,$_=12,iM=50,sM=class extends qe{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 de),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 i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>rM)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 i=this._writeBuffer[this._bufferOffset],o=this._action(i,t);if(o){let l=u=>performance.now()-n>=$_?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-=i.length,performance.now()-n>=$_)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>iM&&(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()}},Dd=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,i=this._getEntryIdKey(n),o=this._entriesWithId.get(i);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(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);n.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(n,i))}}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)))}};Dd=Tt([me(0,wn)],Dd);var j_=!1,oM=class extends qe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new qs),this._onBinary=this._register(new de),this.onBinary=this._onBinary.event,this._onData=this._register(new de),this.onData=this._onData.event,this._onLineFeed=this._register(new de),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new de),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new de),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new de),this._instantiationService=new AA,this.optionsService=this._register(new UA(e)),this._instantiationService.setService(xn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Td)),this._instantiationService.setService(wn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Nd)),this._instantiationService.setService(Hy,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Rd)),this._instantiationService.setService(cs,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Ad)),this._instantiationService.setService(Uy,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(es)),this._instantiationService.setService(CR,this.unicodeService),this._charsetService=this._instantiationService.createInstance(KA),this._instantiationService.setService(ER,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Dd),this._instantiationService.setService($y,this._oscLinkService),this._inputHandler=this._register(new nM(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(an.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(an.forward(this._bufferService.onResize,this._onResize)),this._register(an.forward(this.coreService.onData,this._onData)),this._register(an.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 sM((t,n)=>this._inputHandler.parse(t,n))),this._register(an.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new de),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&&!j_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j_=!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,bb),t=Math.max(t,Sb),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(L_.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(L_(this._bufferService),!1))),this._windowsWrappingHeuristics.value=_t(()=>{for(let t of e)t.dispose()})}}},aM={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 lM(e,t,n,i){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=J.ESC+"OA":o.key=J.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=J.ESC+"OD":o.key=J.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=J.ESC+"OC":o.key=J.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=J.ESC+"OB":o.key=J.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":J.DEL,e.altKey&&(o.key=J.ESC+o.key);break;case 9:if(e.shiftKey){o.key=J.ESC+"[Z";break}o.key=J.HT,o.cancel=!0;break;case 13:o.key=e.altKey?J.ESC+J.CR:J.CR,o.cancel=!0;break;case 27:o.key=J.ESC,e.altKey&&(o.key=J.ESC+J.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"D":t?o.key=J.ESC+"OD":o.key=J.ESC+"[D";break;case 39:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"C":t?o.key=J.ESC+"OC":o.key=J.ESC+"[C";break;case 38:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"A":t?o.key=J.ESC+"OA":o.key=J.ESC+"[A";break;case 40:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"B":t?o.key=J.ESC+"OB":o.key=J.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=J.ESC+"[2~");break;case 46:a?o.key=J.ESC+"[3;"+(a+1)+"~":o.key=J.ESC+"[3~";break;case 36:a?o.key=J.ESC+"[1;"+(a+1)+"H":t?o.key=J.ESC+"OH":o.key=J.ESC+"[H";break;case 35:a?o.key=J.ESC+"[1;"+(a+1)+"F":t?o.key=J.ESC+"OF":o.key=J.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=J.ESC+"[5;"+(a+1)+"~":o.key=J.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=J.ESC+"[6;"+(a+1)+"~":o.key=J.ESC+"[6~";break;case 112:a?o.key=J.ESC+"[1;"+(a+1)+"P":o.key=J.ESC+"OP";break;case 113:a?o.key=J.ESC+"[1;"+(a+1)+"Q":o.key=J.ESC+"OQ";break;case 114:a?o.key=J.ESC+"[1;"+(a+1)+"R":o.key=J.ESC+"OR";break;case 115:a?o.key=J.ESC+"[1;"+(a+1)+"S":o.key=J.ESC+"OS";break;case 116:a?o.key=J.ESC+"[15;"+(a+1)+"~":o.key=J.ESC+"[15~";break;case 117:a?o.key=J.ESC+"[17;"+(a+1)+"~":o.key=J.ESC+"[17~";break;case 118:a?o.key=J.ESC+"[18;"+(a+1)+"~":o.key=J.ESC+"[18~";break;case 119:a?o.key=J.ESC+"[19;"+(a+1)+"~":o.key=J.ESC+"[19~";break;case 120:a?o.key=J.ESC+"[20;"+(a+1)+"~":o.key=J.ESC+"[20~";break;case 121:a?o.key=J.ESC+"[21;"+(a+1)+"~":o.key=J.ESC+"[21~";break;case 122:a?o.key=J.ESC+"[23;"+(a+1)+"~":o.key=J.ESC+"[23~";break;case 123:a?o.key=J.ESC+"[24;"+(a+1)+"~":o.key=J.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=J.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=J.DEL:e.keyCode===219?o.key=J.ESC:e.keyCode===220?o.key=J.FS:e.keyCode===221&&(o.key=J.GS);else if((!n||i)&&e.altKey&&!e.metaKey){let u=(l=aM[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)o.key=J.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=J.ESC+h}else if(e.keyCode===32)o.key=J.ESC+(e.ctrlKey?J.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let d=e.code.slice(3,4);e.shiftKey||(d=d.toLowerCase()),o.key=J.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=J.US),e.key==="@"&&(o.key=J.NUL));break}return o}var Ot=0,cM=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new rc,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new rc,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,i=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<i.length;o++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(i[o]=e[t],t++):i[o]=this._array[n++];this._array=i,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||(Ot=this._search(t),Ot===-1)||this._getKey(this._array[Ot])!==t)return!1;do if(this._array[Ot]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ot),!0;while(++Ot<this._array.length&&this._getKey(this._array[Ot])===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),i=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:n[i++]=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&&(Ot=this._search(e),!(Ot<0||Ot>=this._array.length)&&this._getKey(this._array[Ot])===e))do yield this._array[Ot];while(++Ot<this._array.length&&this._getKey(this._array[Ot])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ot=this._search(e),!(Ot<0||Ot>=this._array.length)&&this._getKey(this._array[Ot])===e))do t(this._array[Ot]);while(++Ot<this._array.length&&this._getKey(this._array[Ot])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let i=t+n>>1,o=this._getKey(this._array[i]);if(o>e)n=i-1;else if(o<e)t=i+1;else{for(;i>0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},Ph=0,W_=0,uM=class extends qe{constructor(){super(),this._decorations=new cM(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new de),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new de),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(_t(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new hM(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.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 i=0,o=0;for(let a of this._decorations.getKeyIterator(t))i=a.options.x??0,o=i+(a.options.width??1),e>=i&&e<o&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,i){this._decorations.forEachByKey(t,o=>{Ph=o.options.x??0,W_=Ph+(o.options.width??1),e>=Ph&&e<W_&&(!n||(o.options.layer??"bottom")===n)&&i(o)})}},hM=class extends Ci{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new de),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new de),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=kt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=kt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},dM=1e3,fM=class{constructor(e,t=dM){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 i=performance.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=i-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)}},K_=20,ic=class extends qe{constructor(e,t,n,i){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=i,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 fM(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(`
|
|
101
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),mf&&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,i=this._model.finalSelectionEnd;return!n||!i||!t?!1:this._areCoordsInSelection(t,n,i)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!n||!i?!1:this._areCoordsInSelection([e,t],n,i)}_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=w_(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,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=pf(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,-Ah),Ah),t/=Ah,t/Math.abs(t)+Math.round(t*(xA-1)))}shouldForceSelection(e){return nc?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(),kA)}_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&&!(nc&&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 i=n.lines.get(this._model.selectionEnd[1]);i&&i.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<EA&&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 i=mA(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!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 i=0;t>=i;i++){let o=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:o>1&&t!==i&&(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,i=!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 k=e[0],C=e[0];a.getWidth(k)===0&&(g++,k--),a.getWidth(C)===2&&(p++,C++);let O=a.getString(C).length;for(O>1&&(y+=O-1,d+=O-1);k>0&&u>0&&!this._isCharWordSeparator(a.loadCell(k-1,this._workCell));){a.loadCell(k-1,this._workCell);let L=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,k--):L>1&&(v+=L-1,u-=L-1),u--,k--}for(;C<a.length&&d+1<l.length&&!this._isCharWordSeparator(a.loadCell(C+1,this._workCell));){a.loadCell(C+1,this._workCell);let L=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,C++):L>1&&(y+=L-1,d+=L-1),d++,C++}}d++;let b=u+h-g+v,x=Math.min(this._bufferService.cols,d-u+g+p-v-y);if(!(!t&&l.slice(u,d).trim()==="")){if(n&&b===0&&a.getCodePoint(0)!==32){let k=o.lines.get(e[1]-1);if(k&&a.isWrapped&&k.getCodePoint(this._bufferService.cols-1)!==32){let C=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(C){let O=this._bufferService.cols-C.start;b-=O,x+=O}}}if(i&&b+x===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let k=o.lines.get(e[1]+1);if(k!=null&&k.isWrapped&&k.getCodePoint(0)!==32){let C=this._getWordAt([0,e[1]+1],!1,!1,!0);C&&(x+=C.length)}}return{start:b,length:x}}}_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=w_(n,this._bufferService.cols)}};Ed=Tt([me(3,wn),me(4,cs),me(5,af),me(6,xn),me(7,Qr),me(8,Zr)],Ed);var x_=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 x_,this._css=new x_}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()}},jt=Object.freeze((()=>{let e=[kt.toColor("#2e3436"),kt.toColor("#cc0000"),kt.toColor("#4e9a06"),kt.toColor("#c4a000"),kt.toColor("#3465a4"),kt.toColor("#75507b"),kt.toColor("#06989a"),kt.toColor("#d3d7cf"),kt.toColor("#555753"),kt.toColor("#ef2929"),kt.toColor("#8ae234"),kt.toColor("#fce94f"),kt.toColor("#729fcf"),kt.toColor("#ad7fa8"),kt.toColor("#34e2e2"),kt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let i=t[n/36%6|0],o=t[n/6%6|0],a=t[n%6];e.push({css:Bt.toCss(i,o,a),rgba:Bt.toRgba(i,o,a)})}for(let n=0;n<24;n++){let i=8+n*10;e.push({css:Bt.toCss(i,i,i),rgba:Bt.toRgba(i,i,i)})}return e})()),Qi=kt.toColor("#ffffff"),Go=kt.toColor("#000000"),E_=kt.toColor("#ffffff"),C_=Go,Ho={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},TA=Qi,Cd=class extends qe{constructor(e){super(),this._optionsService=e,this._contrastCache=new k_,this._halfContrastCache=new k_,this._onChangeColors=this._register(new de),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Qi,background:Go,cursor:E_,cursorAccent:C_,selectionForeground:void 0,selectionBackgroundTransparent:Ho,selectionBackgroundOpaque:pt.blend(Go,Ho),selectionInactiveBackgroundTransparent:Ho,selectionInactiveBackgroundOpaque:pt.blend(Go,Ho),scrollbarSliderBackground:pt.opacity(Qi,.2),scrollbarSliderHoverBackground:pt.opacity(Qi,.4),scrollbarSliderActiveBackground:pt.opacity(Qi,.5),overviewRulerBorder:Qi,ansi:jt.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=st(e.foreground,Qi),t.background=st(e.background,Go),t.cursor=pt.blend(t.background,st(e.cursor,E_)),t.cursorAccent=pt.blend(t.background,st(e.cursorAccent,C_)),t.selectionBackgroundTransparent=st(e.selectionBackground,Ho),t.selectionBackgroundOpaque=pt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=st(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=pt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?st(e.selectionForeground,y_):void 0,t.selectionForeground===y_&&(t.selectionForeground=void 0),pt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=pt.opacity(t.selectionBackgroundTransparent,.3)),pt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=pt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=st(e.scrollbarSliderBackground,pt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=st(e.scrollbarSliderHoverBackground,pt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=st(e.scrollbarSliderActiveBackground,pt.opacity(t.foreground,.5)),t.overviewRulerBorder=st(e.overviewRulerBorder,TA),t.ansi=jt.slice(),t.ansi[0]=st(e.black,jt[0]),t.ansi[1]=st(e.red,jt[1]),t.ansi[2]=st(e.green,jt[2]),t.ansi[3]=st(e.yellow,jt[3]),t.ansi[4]=st(e.blue,jt[4]),t.ansi[5]=st(e.magenta,jt[5]),t.ansi[6]=st(e.cyan,jt[6]),t.ansi[7]=st(e.white,jt[7]),t.ansi[8]=st(e.brightBlack,jt[8]),t.ansi[9]=st(e.brightRed,jt[9]),t.ansi[10]=st(e.brightGreen,jt[10]),t.ansi[11]=st(e.brightYellow,jt[11]),t.ansi[12]=st(e.brightBlue,jt[12]),t.ansi[13]=st(e.brightMagenta,jt[13]),t.ansi[14]=st(e.brightCyan,jt[14]),t.ansi[15]=st(e.brightWhite,jt[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<n;i++)t.ansi[i+16]=st(e.extendedAnsi[i],jt[i+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()}}};Cd=Tt([me(0,xn)],Cd);function st(e,t){if(e!==void 0)try{return kt.toColor(e)}catch{}return t}var RA=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)}},AA=class{constructor(){this._services=new RA,this._services.set(of,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=xR(e).sort((a,l)=>a.index-l.index),i=[];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}.`);i.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,...i)}},MA={trace:0,debug:1,info:2,warn:3,error:4,off:5},OA="xterm.js: ",Nd=class extends qe{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=MA[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?"":OA)+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)}};Nd=Tt([me(0,xn)],Nd);var N_=class extends qe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new de),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new de),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new de),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 i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+n.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<n.length;i++)this._array[this._getCyclicIndex(e+i)]=n[i];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let i=this._length+n.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}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 i=e+t+n-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<t;i++)this.set(e+i+n,this.get(e+i))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ke=3,Pt=Object.freeze(new ha),Bl=0,Mh=2,Yo=class _b{constructor(t,n,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ke);let o=n||ir.fromCharData([0,Py,1,0]);for(let a=0;a<t;++a)this.setCell(a,o);this.length=t}get(t){let n=this._data[t*Ke+0],i=n&2097151;return[this._data[t*Ke+1],n&2097152?this._combined[t]:i?ki(i):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,n){this._data[t*Ke+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ke+0]=t|2097152|n[2]<<22):this._data[t*Ke+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ke+0]>>22}hasWidth(t){return this._data[t*Ke+0]&12582912}getFg(t){return this._data[t*Ke+1]}getBg(t){return this._data[t*Ke+2]}hasContent(t){return this._data[t*Ke+0]&4194303}getCodePoint(t){let n=this._data[t*Ke+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ke+0]&2097152}getString(t){let n=this._data[t*Ke+0];return n&2097152?this._combined[t]:n&2097151?ki(n&2097151):""}isProtected(t){return this._data[t*Ke+2]&536870912}loadCell(t,n){return Bl=t*Ke,n.content=this._data[Bl+0],n.fg=this._data[Bl+1],n.bg=this._data[Bl+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*Ke+0]=n.content,this._data[t*Ke+1]=n.fg,this._data[t*Ke+2]=n.bg}setCellFromCodepoint(t,n,i,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*Ke+0]=n|i<<22,this._data[t*Ke+1]=o.fg,this._data[t*Ke+2]=o.bg}addCodepointToCell(t,n,i){let o=this._data[t*Ke+0];o&2097152?this._combined[t]+=ki(n):o&2097151?(this._combined[t]=ki(o&2097151)+ki(n),o&=-2097152,o|=2097152):o=n|1<<22,i&&(o&=-12582913,o|=i<<22),this._data[t*Ke+0]=o}insertCells(t,n,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length-t){let o=new ir;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,i)}else for(let o=t;o<this.length;++o)this.setCell(o,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(t,n,i){if(t%=this.length,n<this.length-t){let o=new ir;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,i)}else for(let o=t;o<this.length;++o)this.setCell(o,i);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,i)}replaceCells(t,n,i,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,i);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,i),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,i);t<n&&t<this.length;)this.setCell(t++,i)}resize(t,n){if(t===this.length)return this._data.length*4*Mh<this._data.buffer.byteLength;let i=t*Ke;if(t>this.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let o=new Uint32Array(i);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,i);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,i*4*Mh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Mh<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 i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,t);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,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 _b(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*Ke+0]&4194303)return t+(this._data[t*Ke+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ke+0]&4194303||this._data[t*Ke+2]&50331648)return t+(this._data[t*Ke+0]>>22);return 0}copyCellsFrom(t,n,i,o,a){let l=t._data;if(a)for(let d=o-1;d>=0;d--){for(let h=0;h<Ke;h++)this._data[(i+d)*Ke+h]=l[(n+d)*Ke+h];l[(n+d)*Ke+2]&268435456&&(this._extendedAttrs[i+d]=t._extendedAttrs[n+d])}else for(let d=0;d<o;d++){for(let h=0;h<Ke;h++)this._data[(i+d)*Ke+h]=l[(n+d)*Ke+h];l[(n+d)*Ke+2]&268435456&&(this._extendedAttrs[i+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+i]=t._combined[h])}}translateToString(t,n,i,o){n=n??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),o&&(o.length=0);let a="";for(;n<i;){let l=this._data[n*Ke+0],u=l&2097151,d=l&2097152?this._combined[n]:u?ki(u):Ei;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 DA(e,t,n,i,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&&i>=u&&i<d){u+=g.length-1;continue}let p=0,v=oa(g,p,t),y=1,b=0;for(;y<g.length;){let k=oa(g,y,t),C=k-b,O=n-v,L=Math.min(C,O);g[p].copyCellsFrom(g[y],b,v,L,!1),v+=L,v===n&&(p++,v=0),b+=L,b===k&&(y++,b=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 x=0;for(let k=g.length-1;k>0&&(k>p||g[k].getTrimmedLength()===0);k--)x++;x>0&&(l.push(u+g.length-x),l.push(x)),u+=g.length-1}return l}function LA(e,t){let n=[],i=0,o=t[i],a=0;for(let l=0;l<e.length;l++)if(o===l){let u=t[++i];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,o=t[++i]}else n.push(l);return{layout:n,countRemoved:a}}function IA(e,t){let n=[];for(let i=0;i<t.length;i++)n.push(e.get(t[i]));for(let i=0;i<n.length;i++)e.set(i,n[i]);e.length=t.length}function PA(e,t,n){let i=[],o=e.map((d,h)=>oa(e,h,t)).reduce((d,h)=>d+h),a=0,l=0,u=0;for(;u<o;){if(o-u<n){i.push(o-u);break}a+=n;let d=oa(e,l,t);a>d&&(a-=d,l++);let h=e[l].getWidth(a-1)===2;h&&a--;let g=h?n-1:n;i.push(g),u+=g}return i}function oa(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,o=e[t+1].getWidth(0)===2;return i&&o?n-1:n}var vb=class yb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=yb._nextId++,this._onDispose=this.register(new de),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ss(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};vb._nextId=1;var BA=vb,Kt={},Ji=Kt.B;Kt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Kt.A={"#":"£"};Kt.B=void 0;Kt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Kt.C=Kt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Kt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Kt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Kt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Kt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Kt.E=Kt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Kt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Kt.H=Kt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Kt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var T_=4294967295,R_=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=Pt.clone(),this.savedCharset=Ji,this.markers=[],this._nullCell=ir.fromCharData([0,Py,1,0]),this._whitespaceCell=ir.fromCharData([0,Ei,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new rc,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new N_(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 Jl),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 Jl),this._whitespaceCell}getBlankLine(e,t){return new Yo(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>T_?T_:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Pt);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 N_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Pt),i=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++)i+=+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 Yo(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 Yo(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++)i+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),i>.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,i=DA(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Pt),n);if(i.length>0){let o=LA(this.lines,i);IA(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let i=this.getNullCell(Pt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Yo(e,i))):(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,i=this.getNullCell(Pt),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 L=this.ybase+this.y;if(L>=l&&L<l+d.length)continue}let h=d[d.length-1].getTrimmedLength(),g=PA(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 L=0;L<p;L++){let A=this.getBlankLine(Pt,!0);y.push(A)}y.length>0&&(o.push({start:l+d.length+a,newLines:y}),a+=y.length),d.push(...y);let b=g.length-1,x=g[b];x===0&&(b--,x=g[b]);let k=d.length-p-1,C=h;for(;k>=0;){let L=Math.min(C,x);if(d[b]===void 0)break;if(d[b].copyCellsFrom(d[k],C-L,x-L,L,!0),x-=L,x===0&&(b--,x=g[b]),C-=L,C===0){k--;let A=Math.max(k,0);C=oa(d,A,this._cols)}}for(let L=0;L<d.length;L++)g[L]<e&&d[L].setCell(g[L],i);let O=p-v;for(;O-- >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 x=0;x<this.lines.length;x++)u.push(this.lines.get(x));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 x=Math.min(this.lines.maxLength-1,d+a-1);x>=0;x--)if(p&&p.start>h+v){for(let k=p.newLines.length-1;k>=0;k--)this.lines.set(x--,p.newLines[k]);x++,l.push({index:h+1,amount:p.newLines.length}),v+=p.newLines.length,p=o[++g]}else this.lines.set(x,u[h--]);let y=0;for(let x=l.length-1;x>=0;x--)l[x].index+=y,this.lines.onInsertEmitter.fire(l[x]),y+=l[x].amount;let b=Math.max(0,d+a-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,t,n=0,i){let o=this.lines.get(e);return o?o.translateToString(t,n,i):""}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 BA(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)}},FA=class extends qe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new de),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new R_(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new R_(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},bb=2,Sb=1,Td=class extends qe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new de),this.onResize=this._onResize.event,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,bb),this.rows=Math.max(e.rawOptions.rows||0,Sb),this.buffers=this._register(new FA(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,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=n.getBlankLine(e,t),this._cachedBlankLine=i),i.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(i):n.lines.push(i.clone()):n.lines.splice(a+1,0,i.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,i.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 i=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),i!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Td=Tt([me(0,xn)],Td);var zs={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:nc,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},zA=["normal","bold","100","200","300","400","500","600","700","800","900"],UA=class extends qe{constructor(e){super(),this._onOptionChange=this._register(new de),this.onOptionChange=this._onOptionChange.event;let t={...zs};for(let n in e)if(n in t)try{let i=e[n];t[n]=this._sanitizeAndValidateOption(n,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(_t(()=>{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 zs))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,i)=>{if(!(n in zs))throw new Error(`No option with key "${n}"`);i=this._sanitizeAndValidateOption(n,i),this.rawOptions[n]!==i&&(this.rawOptions[n]=i,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let i={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=zs[e]),!HA(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=zs[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=zA.includes(t)?t:zs[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 HA(e){return e==="block"||e==="underline"||e==="bar"}function Xo(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let i in e)n[i]=t<=1?e[i]:e[i]&&Xo(e[i],t-1);return n}var A_=Object.freeze({insertMode:!1}),M_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Rd=class extends qe{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 de),this.onData=this._onData.event,this._onUserInput=this._register(new de),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new de),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new de),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Xo(A_),this.decPrivateModes=Xo(M_)}reset(){this.modes=Xo(A_),this.decPrivateModes=Xo(M_)}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(i=>i.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))}};Rd=Tt([me(0,wn),me(1,Hy),me(2,xn)],Rd);var O_={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 Oh(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 Dh=String.fromCharCode,D_={DEFAULT:e=>{let t=[Oh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Dh(t[0])}${Dh(t[1])}${Dh(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Oh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Oh(e,!0)};${e.x};${e.y}${t}`}},Ad=class extends qe{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 de),this.onProtocolChange=this._onProtocolChange.event;for(let i of Object.keys(O_))this.addProtocol(i,O_[i]);for(let i of Object.keys(D_))this.addEncoding(i,D_[i]);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 i=t/n,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=i+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)}};Ad=Tt([me(0,wn),me(1,cs),me(2,xn)],Ad);var Lh=[[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]],$A=[[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]],Wt;function jA(e,t){let n=0,i=t.length-1,o;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=n;)if(o=n+i>>1,e>t[o][1])n=o+1;else if(e<t[o][0])i=o-1;else return!0;return!1}var WA=class{constructor(){if(this.version="6",!Wt){Wt=new Uint8Array(65536),Wt.fill(1),Wt[0]=0,Wt.fill(0,1,32),Wt.fill(0,127,160),Wt.fill(2,4352,4448),Wt[9001]=2,Wt[9002]=2,Wt.fill(2,11904,42192),Wt[12351]=1,Wt.fill(2,44032,55204),Wt.fill(2,63744,64256),Wt.fill(2,65040,65050),Wt.fill(2,65072,65136),Wt.fill(2,65280,65377),Wt.fill(2,65504,65511);for(let e=0;e<Lh.length;++e)Wt.fill(0,Lh[e][0],Lh[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Wt[e]:jA(e,$A)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),i=n===0&&t!==0;if(i){let o=es.extractWidth(t);o===0?i=!1:o>n&&(n=o)}return es.createPropertyValue(0,n,i)}},es=class Wl{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new de,this.onChange=this._onChange.event;let t=new WA;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,i=!1){return(t&16777215)<<3|(n&3)<<1|(i?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,i=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,i),d=Wl.extractWidth(u);Wl.extractShouldJoin(u)&&(d-=Wl.extractWidth(i)),n+=d,i=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},KA=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 L_(e){var i;let t=(i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:i.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 $o=2147483647,qA=256,wb=class Md{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>qA)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 Md;if(!t.length)return n;for(let i=Array.isArray(t[0])?1:0;i<t.length;++i){let o=t[i];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 Md(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 i=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,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>$o?$o: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>$o?$o: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,i=this._subParamsIdx[t]&255;return i-n>0?this._subParams.subarray(n,i):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let i=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-i>0&&(t[n]=this._subParams.slice(i,o))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,o=i[n-1];i[n-1]=~o?Math.min(o*10+t,$o):t}},jo=[],VA=class{constructor(){this._state=0,this._active=jo,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 i=n.indexOf(t);i!==-1&&n.splice(i,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=jo}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=jo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||jo,!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",fc(e,t,n));else for(let i=this._active.length-1;i>=0;i--)this._active[i].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 i=e[t++];if(i===59){this._state=2,this._start();break}if(i<48||57<i){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+i-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,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,n=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;i>=0&&(n=this._active[i].end(e),n!==!0);i--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,n;i--}for(;i>=0;i--)if(n=this._active[i].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,n}this._active=jo,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+=fc(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}},Wo=[],GA=class{constructor(){this._handlers=Object.create(null),this._active=Wo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Wo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,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=Wo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Wo,!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",fc(e,t,n));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,n=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;i>=0&&(n=this._active[i].unhook(e),n!==!0);i--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,n;i--}for(;i>=0;i--)if(n=this._active[i].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,n}this._active=Wo,this._ident=0}},Zo=new wb;Zo.addParam(0);var I_=class{constructor(e){this._handler=e,this._data="",this._params=Zo,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Zo,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=fc(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=Zo,this._data="",this._hitLimit=!1,n));return this._params=Zo,this._data="",this._hitLimit=!1,t}},YA=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,i){this.table[t<<8|e]=n<<4|i}addMany(e,t,n,i){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=n<<4|i}},nr=160,XA=(function(){let e=new YA(4095),t=Array.apply(null,Array(256)).map((u,d)=>d),n=(u,d)=>t.slice(u,d),i=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(i,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(i,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(i,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(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(nr,0,2,0),e.add(nr,8,5,8),e.add(nr,6,0,6),e.add(nr,11,0,11),e.add(nr,13,13,13),e})(),ZA=class extends qe{constructor(e=XA){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 wb,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,i)=>{},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(_t(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new VA),this._dcsParser=this._register(new GA),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 i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=i,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 i=this._escHandlers[n];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.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 i=this._csiHandlers[n];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.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,i,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=i,this._parseStack.chunkPos=o}parse(e,t,n){let i=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(i=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(i!==24&&i!==26,n),l)return l;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],l=this._oscParser.end(i!==24&&i!==26,n),l)return l;i===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(i=e[u],o=this._transitions.table[this.currentState<<8|(i<160?i:nr)],o>>4){case 2:for(let v=u+1;;++v){if(v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(i=e[v])<32||i>126&&i<nr){this._printHandler(e,u,v),u=v-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|i],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|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++u<t&&(i=e[u])>47&&i<60);u--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let g=this._escHandlers[this._collect<<8|i],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|i),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|i,this._params);break;case 13:for(let v=u+1;;++v)if(v>=t||(i=e[v])===24||i===26||i===27||i>127&&i<nr){this._dcsParser.put(e,u,v),u=v-1;break}break;case 14:if(l=this._dcsParser.unhook(i!==24&&i!==26),l)return this._preserveStack(6,[],0,o,u),l;i===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||(i=e[v])<32||i>127&&i<nr){this._oscParser.put(e,u,v),u=v-1;break}break;case 6:if(l=this._oscParser.end(i!==24&&i!==26),l)return this._preserveStack(5,[],0,o,u),l;i===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},QA=/^([\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})$/,JA=/^[\da-f]+$/;function P_(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=QA.exec(t);if(n){let i=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/i*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/i*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/i*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),JA.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,i=[0,0,0];for(let o=0;o<3;++o){let a=parseInt(t.slice(n*o,n*o+n),16);i[o]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return i}}function Ih(e,t){let n=e.toString(16),i=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function eM(e,t=16){let[n,i,o]=e;return`rgb:${Ih(n,t)}/${Ih(i,t)}/${Ih(o,t)}`}var tM={"(":0,")":1,"*":2,"+":3,"-":1,".":2},xi=131072,B_=10;function F_(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 z_=5e3,U_=0,nM=class extends qe{constructor(e,t,n,i,o,a,l,u,d=new ZA){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=i,this._optionsService=o,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new SR,this._utf8Decoder=new wR,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Pt.clone(),this._eraseAttrDataInternal=Pt.clone(),this._onRequestBell=this._register(new de),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new de),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new de),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new de),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new de),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new de),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new de),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new de),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new de),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new de),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new de),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new de),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new de),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 Od(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(J.BEL,()=>this.bell()),this._parser.setExecuteHandler(J.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(J.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(J.BS,()=>this.backspace()),this._parser.setExecuteHandler(J.HT,()=>this.tab()),this._parser.setExecuteHandler(J.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(J.SI,()=>this.shiftIn()),this._parser.setExecuteHandler($l.IND,()=>this.index()),this._parser.setExecuteHandler($l.NEL,()=>this.nextLine()),this._parser.setExecuteHandler($l.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 Kt)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 I_((h,g)=>this.requestStatusString(h,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),z_))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${z_} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,i=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;i=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>xi&&(a=this._parseStack.position+xi)}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<xi&&(this._parseBuffer=new Uint32Array(Math.min(e.length,xi))),l||this._dirtyRowTracker.clearRange(),e.length>xi)for(let h=a;h<e.length;h+=xi){let g=h+xi<e.length?h+xi: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(i,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(i,o,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==i||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 i,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(i=e[y],i<127&&a){let C=a[String.fromCharCode(i)];C&&(i=C.charCodeAt(0))}let b=this._unicodeService.charProperties(i,v);o=es.extractWidth(b);let x=es.extractShouldJoin(b),k=x?es.extractWidth(v):0;if(v=b,l&&this._onA11yChar.fire(ki(i)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-k>u){if(d){let C=p,O=this._activeBuffer.x-k;for(this._activeBuffer.x=k,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),k>0&&p instanceof Yo&&p.copyCellsFrom(C,O,0,k,!1);O<u;)C.setCellFromCodepoint(O++,0,1,g)}else if(this._activeBuffer.x=u-1,o===2)continue}if(x&&this._activeBuffer.x){let C=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-C,i,o);for(let O=o-k;--O>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(h&&(p.insertCells(this._activeBuffer.x,o-k,this._activeBuffer.getNullCell(g)),p.getWidth(u-1)===2&&p.setCellFromCodepoint(u-1,0,1,g)),p.setCellFromCodepoint(this._activeBuffer.x++,i,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=>F_(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new I_(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,i=!1,o=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),o),i&&(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 i;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--&&!((i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&i.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,i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-i+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,i;for(i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-i;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}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(Pt));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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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,i=es.extractWidth(t),o=this._activeBuffer.x-i,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(J.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(J.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(J.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(J.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(J.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,Ji),this._charsetService.setgCharset(1,Ji),this._charsetService.setgCharset(2,Ji),this._charsetService.setgCharset(3,Ji);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){(x=>(x[x.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",x[x.SET=1]="SET",x[x.RESET=2]="RESET",x[x.PERMANENTLY_SET=3]="PERMANENTLY_SET",x[x.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let i=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=(x,k)=>(l.triggerDataEvent(`${J.ESC}[${t?"":"?"}${x};${k}$y`),!0),y=x=>x?1:2,b=e.params[0];return t?b===2?v(b,4):b===4?v(b,y(l.modes.insertMode)):b===12?v(b,3):b===20?v(b,y(p.convertEol)):v(b,0):b===1?v(b,y(i.applicationCursorKeys)):b===3?v(b,p.windowOptions.setWinLines?d===80?2:d===132?1:0:0):b===6?v(b,y(i.origin)):b===7?v(b,y(i.wraparound)):b===8?v(b,3):b===9?v(b,y(o==="X10")):b===12?v(b,y(p.cursorBlink)):b===25?v(b,y(!l.isCursorHidden)):b===45?v(b,y(i.reverseWraparound)):b===66?v(b,y(i.applicationKeypad)):b===67?v(b,4):b===1e3?v(b,y(o==="VT200")):b===1002?v(b,y(o==="DRAG")):b===1003?v(b,y(o==="ANY")):b===1004?v(b,y(i.sendFocus)):b===1005?v(b,4):b===1006?v(b,y(a==="SGR")):b===1015?v(b,4):b===1016?v(b,y(a==="SGR_PIXELS")):b===1048?v(b,1):b===47||b===1047||b===1049?v(b,y(h===g)):b===2004?v(b,y(i.bracketedPasteMode)):b===2026?v(b,y(i.synchronizedOutput)):v(b,0)}_updateAttrColor(e,t,n,i,o){return t===2?(e|=50331648,e&=-16777216,e|=ha.fromColorRGB([n,i,o])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let i=[0,0,-1,0,0,0],o=0,a=0;do{if(i[a+o]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do i[1]===5&&(o=1),i[a+u+1+o]=l[u];while(++u<l.length&&u+a+1+o<i.length);break}if(i[1]===5&&a+o>=2||i[1]===2&&a+o>=5)break;i[1]&&(o=1)}while(++a+t<e.length&&a+o<i.length);for(let l=2;l<i.length;++l)i[l]===-1&&(i[l]=0);switch(i[0]){case 38:n.fg=this._updateAttrColor(n.fg,i[1],i[3],i[4],i[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,i[1],i[3],i[4],i[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,i[1],i[3],i[4],i[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=Pt.fg,e.bg=Pt.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,i=this._curAttrData;for(let o=0;o<t;o++)n=e.params[o],n>=30&&n<=37?(i.fg&=-50331904,i.fg|=16777216|n-30):n>=40&&n<=47?(i.bg&=-50331904,i.bg|=16777216|n-40):n>=90&&n<=97?(i.fg&=-50331904,i.fg|=16777216|n-90|8):n>=100&&n<=107?(i.bg&=-50331904,i.bg|=16777216|n-100|8):n===0?this._processSGR0(i):n===1?i.fg|=134217728:n===3?i.bg|=67108864:n===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,i)):n===5?i.fg|=536870912:n===7?i.fg|=67108864:n===8?i.fg|=1073741824:n===9?i.fg|=2147483648:n===2?i.bg|=134217728:n===21?this._processUnderline(2,i):n===22?(i.fg&=-134217729,i.bg&=-134217729):n===23?i.bg&=-67108865:n===24?(i.fg&=-268435457,this._processUnderline(0,i)):n===25?i.fg&=-536870913:n===27?i.fg&=-67108865:n===28?i.fg&=-1073741825:n===29?i.fg&=2147483647:n===39?(i.fg&=-67108864,i.fg|=Pt.fg&16777215):n===49?(i.bg&=-67108864,i.bg|=Pt.bg&16777215):n===38||n===48||n===58?o+=this._extractColor(e,o,i):n===53?i.bg|=1073741824:n===55?i.bg&=-1073741825:n===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):n===100?(i.fg&=-67108864,i.fg|=Pt.fg&16777215,i.bg&=-67108864,i.bg|=Pt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${J.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${J.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(`${J.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=Pt.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(!F_(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(`${J.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>B_&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>B_&&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 i=n.shift(),o=n.shift();if(/^\d+$/.exec(i)){let a=parseInt(i);if(H_(a))if(o==="?")t.push({type:0,index:a});else{let l=P_(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(),i=e.slice(t+1);return i?this._createHyperlink(n,i):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),i,o=n.findIndex(a=>a.startsWith("id="));return o!==-1&&(i=n[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,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 i=0;i<n.length&&!(t>=this._specialColors.length);++i,++t)if(n[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=P_(n[i]);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 i=0;i<n.length;++i)if(/^\d+$/.exec(n[i])){let o=parseInt(n[i]);H_(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,Ji),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(tM[e[0]],Kt[e[1]]||Ji),!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=Pt.clone(),this._eraseAttrDataInternal=Pt.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 ir;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,i=this._activeBuffer.lines.get(n);i&&(i.fill(e),i.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${J.ESC}${l}${J.ESC}\\`),!0),i=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${i.scrollTop+1};${i.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)}},Od=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&&(U_=e,e=t,t=U_),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Od=Tt([me(0,wn)],Od);function H_(e){return 0<=e&&e<256}var rM=5e7,$_=12,iM=50,sM=class extends qe{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 de),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 i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>rM)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 i=this._writeBuffer[this._bufferOffset],o=this._action(i,t);if(o){let l=u=>performance.now()-n>=$_?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-=i.length,performance.now()-n>=$_)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>iM&&(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()}},Dd=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,i=this._getEntryIdKey(n),o=this._entriesWithId.get(i);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(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);n.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(n,i))}}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)))}};Dd=Tt([me(0,wn)],Dd);var j_=!1,oM=class extends qe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new qs),this._onBinary=this._register(new de),this.onBinary=this._onBinary.event,this._onData=this._register(new de),this.onData=this._onData.event,this._onLineFeed=this._register(new de),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new de),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new de),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new de),this._instantiationService=new AA,this.optionsService=this._register(new UA(e)),this._instantiationService.setService(xn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Td)),this._instantiationService.setService(wn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Nd)),this._instantiationService.setService(Hy,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Rd)),this._instantiationService.setService(cs,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Ad)),this._instantiationService.setService(Uy,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(es)),this._instantiationService.setService(CR,this.unicodeService),this._charsetService=this._instantiationService.createInstance(KA),this._instantiationService.setService(ER,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Dd),this._instantiationService.setService($y,this._oscLinkService),this._inputHandler=this._register(new nM(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(an.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(an.forward(this._bufferService.onResize,this._onResize)),this._register(an.forward(this.coreService.onData,this._onData)),this._register(an.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 sM((t,n)=>this._inputHandler.parse(t,n))),this._register(an.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new de),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&&!j_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j_=!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,bb),t=Math.max(t,Sb),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(L_.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(L_(this._bufferService),!1))),this._windowsWrappingHeuristics.value=_t(()=>{for(let t of e)t.dispose()})}}},aM={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 lM(e,t,n,i){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=J.ESC+"OA":o.key=J.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=J.ESC+"OD":o.key=J.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=J.ESC+"OC":o.key=J.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=J.ESC+"OB":o.key=J.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":J.DEL,e.altKey&&(o.key=J.ESC+o.key);break;case 9:if(e.shiftKey){o.key=J.ESC+"[Z";break}o.key=J.HT,o.cancel=!0;break;case 13:o.key=e.altKey?J.ESC+J.CR:J.CR,o.cancel=!0;break;case 27:o.key=J.ESC,e.altKey&&(o.key=J.ESC+J.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"D":t?o.key=J.ESC+"OD":o.key=J.ESC+"[D";break;case 39:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"C":t?o.key=J.ESC+"OC":o.key=J.ESC+"[C";break;case 38:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"A":t?o.key=J.ESC+"OA":o.key=J.ESC+"[A";break;case 40:if(e.metaKey)break;a?o.key=J.ESC+"[1;"+(a+1)+"B":t?o.key=J.ESC+"OB":o.key=J.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=J.ESC+"[2~");break;case 46:a?o.key=J.ESC+"[3;"+(a+1)+"~":o.key=J.ESC+"[3~";break;case 36:a?o.key=J.ESC+"[1;"+(a+1)+"H":t?o.key=J.ESC+"OH":o.key=J.ESC+"[H";break;case 35:a?o.key=J.ESC+"[1;"+(a+1)+"F":t?o.key=J.ESC+"OF":o.key=J.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=J.ESC+"[5;"+(a+1)+"~":o.key=J.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=J.ESC+"[6;"+(a+1)+"~":o.key=J.ESC+"[6~";break;case 112:a?o.key=J.ESC+"[1;"+(a+1)+"P":o.key=J.ESC+"OP";break;case 113:a?o.key=J.ESC+"[1;"+(a+1)+"Q":o.key=J.ESC+"OQ";break;case 114:a?o.key=J.ESC+"[1;"+(a+1)+"R":o.key=J.ESC+"OR";break;case 115:a?o.key=J.ESC+"[1;"+(a+1)+"S":o.key=J.ESC+"OS";break;case 116:a?o.key=J.ESC+"[15;"+(a+1)+"~":o.key=J.ESC+"[15~";break;case 117:a?o.key=J.ESC+"[17;"+(a+1)+"~":o.key=J.ESC+"[17~";break;case 118:a?o.key=J.ESC+"[18;"+(a+1)+"~":o.key=J.ESC+"[18~";break;case 119:a?o.key=J.ESC+"[19;"+(a+1)+"~":o.key=J.ESC+"[19~";break;case 120:a?o.key=J.ESC+"[20;"+(a+1)+"~":o.key=J.ESC+"[20~";break;case 121:a?o.key=J.ESC+"[21;"+(a+1)+"~":o.key=J.ESC+"[21~";break;case 122:a?o.key=J.ESC+"[23;"+(a+1)+"~":o.key=J.ESC+"[23~";break;case 123:a?o.key=J.ESC+"[24;"+(a+1)+"~":o.key=J.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=J.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=J.DEL:e.keyCode===219?o.key=J.ESC:e.keyCode===220?o.key=J.FS:e.keyCode===221&&(o.key=J.GS);else if((!n||i)&&e.altKey&&!e.metaKey){let u=(l=aM[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)o.key=J.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=J.ESC+h}else if(e.keyCode===32)o.key=J.ESC+(e.ctrlKey?J.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let d=e.code.slice(3,4);e.shiftKey||(d=d.toLowerCase()),o.key=J.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=J.US),e.key==="@"&&(o.key=J.NUL));break}return o}var Ot=0,cM=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new rc,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new rc,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,i=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<i.length;o++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(i[o]=e[t],t++):i[o]=this._array[n++];this._array=i,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||(Ot=this._search(t),Ot===-1)||this._getKey(this._array[Ot])!==t)return!1;do if(this._array[Ot]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ot),!0;while(++Ot<this._array.length&&this._getKey(this._array[Ot])===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),i=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:n[i++]=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&&(Ot=this._search(e),!(Ot<0||Ot>=this._array.length)&&this._getKey(this._array[Ot])===e))do yield this._array[Ot];while(++Ot<this._array.length&&this._getKey(this._array[Ot])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ot=this._search(e),!(Ot<0||Ot>=this._array.length)&&this._getKey(this._array[Ot])===e))do t(this._array[Ot]);while(++Ot<this._array.length&&this._getKey(this._array[Ot])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let i=t+n>>1,o=this._getKey(this._array[i]);if(o>e)n=i-1;else if(o<e)t=i+1;else{for(;i>0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},Ph=0,W_=0,uM=class extends qe{constructor(){super(),this._decorations=new cM(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new de),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new de),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(_t(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new hM(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.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 i=0,o=0;for(let a of this._decorations.getKeyIterator(t))i=a.options.x??0,o=i+(a.options.width??1),e>=i&&e<o&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,i){this._decorations.forEachByKey(t,o=>{Ph=o.options.x??0,W_=Ph+(o.options.width??1),e>=Ph&&e<W_&&(!n||(o.options.layer??"bottom")===n)&&i(o)})}},hM=class extends Ci{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new de),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new de),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=kt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=kt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},dM=1e3,fM=class{constructor(e,t=dM){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 i=performance.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=i-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)}},K_=20,ic=class extends qe{constructor(e,t,n,i){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=i,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 fM(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(`
|
|
102
102
|
`))),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(Be(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(_t(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<K_+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
103
103
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===K_+1&&(this._liveRegion.textContent+=Jh.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,i=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",i),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,i=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!==i)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 i=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:i,offset:((u=i.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 i=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${i/t})`}};ic=Tt([me(1,of),me(2,Zr),me(3,Qr)],ic);var Ld=class extends qe{constructor(e,t,n,i,o){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=i,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new de),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new de),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(_t(()=>{var a;ss(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(Be(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Be(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Be(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Be(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(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 i=0;i<n.length;i++){let o=n[i];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 i,o;(!this._activeProviderReplies||!t)&&((i=this._activeProviderReplies)==null||i.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 i=0;i<t.size;i++){let o=t.get(i);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 i=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&&i){let l=i.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&&pM(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,ss(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,i;return(i=(n=this._currentLink)==null?void 0:n.state)==null?void 0:i.decorations.pointerCursor},set:n=>{var i;(i=this._currentLink)!=null&&i.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,i;return(i=(n=this._currentLink)==null?void 0:n.state)==null?void 0:i.decorations.underline},set:n=>{var i,o,a;(i=this._currentLink)!=null&&i.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 i=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>=i&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(i,o),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,n){var i;(i=this._currentLink)!=null&&i.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,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-i-1,n.end.x,n.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,n){var i;(i=this._currentLink)!=null&&i.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,i=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return n<=o&&o<=i}_positionFromMouseEvent(e,t,n){let i=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,i,o){return{x1:e,y1:t,x2:n,y2:i,cols:this._bufferService.cols,fg:o}}};Ld=Tt([me(1,af),me(2,Qr),me(3,wn),me(4,Wy)],Ld);function pM(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 mM=class extends oM{constructor(e={}){super(e),this._linkifier=this._register(new qs),this.browser=cb,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new qs),this._onCursorMove=this._register(new de),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new de),this.onKey=this._onKey.event,this._onRender=this._register(new de),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new de),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new de),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new de),this.onBell=this._onBell.event,this._onFocus=this._register(new de),this._onBlur=this._register(new de),this._onA11yCharEmitter=this._register(new de),this._onA11yTabEmitter=this._register(new de),this._onWillOpen=this._register(new de),this._setup(),this._decorationService=this._instantiationService.createInstance(uM),this._instantiationService.setService(da,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(iA),this._instantiationService.setService(Wy,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(td)),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(an.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(an.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(an.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(an.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(_t(()=>{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,i="";switch(t.index){case 256:n="foreground",i="10";break;case 257:n="background",i="11";break;case 258:n="cursor",i="12";break;default:n="ansi",i="4;"+t.index}switch(t.type){case 0:let o=pt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${J.ESC}]${i};${eM(o)}${ab.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=Bt.toColor(...t.color));else{let a=n;this._themeService.modifyColors(l=>l[a]=Bt.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(ic,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.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(J.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),i=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=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Be(this.element,"copy",t=>{this.hasSelection()&&yR(t,this._selectionService)}));let e=t=>bR(t,this.textarea,this.coreService,this.optionsService);this._register(Be(this.textarea,"paste",e)),this._register(Be(this.element,"paste",e)),ub?this._register(Be(this.element,"mousedown",t=>{t.button===2&&t_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Be(this.element,"contextmenu",t=>{t_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),mf&&this._register(Be(this.element,"auxclick",t=>{t.button===1&&Iy(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Be(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Be(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Be(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Be(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Be(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Be(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Be(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var 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(Be(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",Qh.get()),fb||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(nA,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Zr,this._coreBrowserService),this._register(Be(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Be(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(wd,this._document,this._helperContainer),this._instantiationService.setService(pc,this._charSizeService),this._themeService=this._instantiationService.createInstance(Cd),this._instantiationService.setService(Ys,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(tc),this._instantiationService.setService(jy,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(kd,this.rows,this.screenElement)),this._instantiationService.setService(Qr,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(yd,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(xd),this._instantiationService.setService(af,this._mouseService);let i=this._linkifier.value=this._register(this._instantiationService.createInstance(Ld,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(_d,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(Ed,this.element,this.screenElement,i)),this._instantiationService.setService(TR,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(an.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var a;this._selectionService.refresh(),(a=this._viewport)==null||a.queueSync()})),this._register(this._instantiationService.createInstance(vd,this.screenElement)),this._register(Be(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(ic,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ec,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ec,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Sd,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 b=a.deltaY;if(b===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=b<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 i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:a=>(n(a),a.buttons||(this._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.removeEventListener("mousemove",i.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?i.mousemove||(t.addEventListener("mousemove",o.mousemove),i.mousemove=o.mousemove):(t.removeEventListener("mousemove",i.mousemove),i.mousemove=null),a&16?i.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),i.wheel=o.wheel):(t.removeEventListener("wheel",i.wheel),i.wheel=null),a&2?i.mouseup||(i.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),a&4?i.mousedrag||(i.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Be(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return n(a),i.mouseup&&this._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.addEventListener("mousemove",i.mousedrag),this.cancel(a)})),this._register(Be(t,"wheel",a=>{var l,u,d,h,g;if(!i.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=J.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){Ly(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=lM(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let i=this.rows-1;return this.scrollLines(n.type===2?-i:i),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===J.ETX||n.key===J.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)&&(gM(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(Pt));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(J.ESC+"[I"):this.coreService.triggerDataEvent(J.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(`${J.ESC}[4;${n};${t}t`);break;case 1:let i=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.ESC}[6;${o};${i}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function gM(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var _M=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)}},vM=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 ir)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},q_=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 vM(t)}getNullCell(){return new ir}},yM=class extends qe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new de),this.onBufferChange=this._onBufferChange.event,this._normal=new q_(this._core.buffers.normal,"normal"),this._alternate=new q_(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)}},bM=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,i)=>t(n,i.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)}},SM=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}},wM=["cols","rows"],Nr=0,xM=class extends qe{constructor(e){super(),this._core=this._register(new mM(e)),this._addonManager=this._register(new _M),this._publicOptions={...this._core.options};let t=i=>this._core.options[i],n=(i,o)=>{this._checkReadonlyOptions(i),this._core.options[i]=o};for(let i in this._core.options){let o={get:t.bind(this,i),set:n.bind(this,i)};Object.defineProperty(this._publicOptions,i,o)}}_checkReadonlyOptions(e){if(wM.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 bM(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new SM(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 yM(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
|
|
104
104
|
`,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 Qh.get()},set promptLabel(e){Qh.set(e)},get tooMuchOutput(){return Jh.get()},set tooMuchOutput(e){Jh.set(e)}}}_verifyIntegers(...e){for(Nr of e)if(Nr===1/0||isNaN(Nr)||Nr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Nr of e)if(Nr&&(Nr===1/0||isNaN(Nr)||Nr%1!==0||Nr<0))throw new Error("This API only accepts positive integers")}};/**
|
|
@@ -112,5 +112,5 @@ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){t
|
|
|
112
112
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
113
113
|
* http://bellard.org/jslinux/
|
|
114
114
|
* Copyright (c) 2011 Fabrice Bellard
|
|
115
|
-
*/var kM=2,EM=1,CM=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),i=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=i-u,g=o-d-t;return{cols:Math.max(kM,Math.floor(g/e.css.cell.width)),rows:Math.max(EM,Math.floor(h/e.css.cell.height))}}};const NM={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 TM({terminalId:e,command:t,cwd:n,active:i,send:o,register:a}){const l=ie.useRef(null),u=ie.useRef(null);return ie.useEffect(()=>{const d=l.current;if(!d)return;const h=new xM({theme:NM,fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace',fontSize:13,cursorBlink:!0,scrollback:8e3}),g=new CM;h.loadAddon(g),h.open(d),u.current={term:h,fit:g},i&&h.focus();const p=a(e,{write:k=>h.write(k),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})}),b=h.onData(k=>{o({type:"terminal_input",terminalId:e,data:k})});let x=null;return typeof ResizeObserver<"u"&&(x=new ResizeObserver(()=>{d.offsetWidth>0&&d.offsetHeight>0&&v()}),x.observe(d)),()=>{cancelAnimationFrame(y),b.dispose(),x==null||x.disconnect(),p(),o({type:"terminal_kill",terminalId:e}),h.dispose(),u.current=null}},[e,t,o,a]),ie.useEffect(()=>{if(!i)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)},[i]),S.jsx("div",{ref:l,className:`term-xterm ${i?"":"hidden"}`})}const V_={name:"",command:"",cwd:"${pwd}"};function RM({chat:e,send:t,terminal:n}){const[i,o]=ie.useState(null),[a,l]=ie.useState(!1),[u,d]=ie.useState(null),[h,g]=ie.useState(V_),[p,v]=ie.useState(null),y=ie.useRef(null);ie.useEffect(()=>{e.terminals.length===0?o(null):e.terminals.some(W=>W.id===i)||o(e.terminals[e.terminals.length-1].id)},[e.terminals,i]),ie.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]);const b=W=>{if(!e.ready)return;const ee=crypto.randomUUID();n.create({...W,id:ee,running:!0,exitCode:null}),o(ee)},x=()=>{var W;return b({title:`终端 ${e.terminals.length+1}`,cwd:((W=e.state)==null?void 0:W.cwd)??""})},k=W=>{var Y;const ee=W.name||W.command,R=e.terminals.find($=>$.title===ee);if(R){n.restart(R.id),o(R.id),t({type:"run_command",terminalId:R.id,command:W,cols:80,rows:24});return}b({title:ee,cwd:((Y=e.state)==null?void 0:Y.cwd)??"",command:W})},
|
|
116
|
-
> ${W.command.command}`:""}`,onClick:()=>o(W.id),children:[S.jsx("span",{className:`term-tab-dot ${W.running?"run":"exit"}`}),S.jsxs("span",{className:"term-tab-title",children:[W.title,!W.running&&S.jsxs("span",{className:"term-tab-exit",children:["(已退出",W.exitCode!==null?` ${W.exitCode}`:"",")"]})]})]}),S.jsx("button",{type:"button",className:"term-tab-close",title:"关闭终端",onClick:()=>E(W.id),children:S.jsx(Pd,{})})]},W.id))]})]})]})}function AM({send:e,piConfigured:t,providers:n,onClose:i}){const[o,a]=ie.useState(!1),[l,u]=ie.useState(!1),[d,h]=ie.useState(""),[g,p]=ie.useState(""),[v,y]=ie.useState(!1);ie.useEffect(()=>{e({type:"list_providers"})},[e]),ie.useEffect(()=>{t&&i()},[t,i]),ie.useEffect(()=>{var O;!d&&n.length>0&&h(((O=n.find(L=>!L.configured))==null?void 0:O.id)??n[0].id)},[n,d]);const b=()=>{o||(a(!0),e({type:"install_pi_agent"}),setTimeout(()=>{a(!1),u(!0)},3e3))},x=()=>{!g.trim()||v||(y(!0),e({type:"set_provider_api_key",provider:d.trim(),apiKey:g.trim()}),setTimeout(()=>y(!1),3e3))},k=()=>{e({type:"get_state"}),e({type:"list_providers"})},E=n.find(O=>O.id===d);return S.jsx("div",{className:"modal-backdrop",children:S.jsxs("div",{className:"modal setup-modal",children:[S.jsx("button",{type:"button",className:"modal-close","aria-label":"关闭",onClick:i,children:S.jsx(Pd,{})}),S.jsxs("div",{className:"modal-head",children:[S.jsx(zd,{className:"modal-head-icon"}),S.jsx("h2",{children:"未检测到 pi agent 配置"})]}),S.jsxs("p",{className:"modal-desc",children:["pi-web-ui 需要 pi 的配置目录(",S.jsx("code",{children:"~/.pi/agent"}),")和至少一个 API 密钥才能运行智能体。pi 内置了 openai、anthropic、deepseek 等服务商 ——选一个填密钥即可,全程无需打开终端。"]}),l?S.jsxs("div",{className:"setup-key-form",children:[S.jsx("div",{className:"setup-done",children:"✅ pi agent CLI 已安装。选择服务商并填入 API 密钥即可开始对话:"}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"服务商"}),S.jsxs("select",{value:d,onChange:O=>h(O.target.value),children:[n.length===0&&S.jsx("option",{value:"",children:"加载中…"}),n.map(O=>S.jsxs("option",{value:O.id,children:[O.name,"(",O.id,")",O.configured?" · 已配置":""]},O.id))]}),(E==null?void 0:E.configured)&&S.jsx("div",{className:"field-hint",children:"该服务商已配置密钥,可直接使用或更换新密钥。"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"API 密钥"}),S.jsx("input",{type:"password",value:g,onChange:O=>p(O.target.value),placeholder:"sk-…"})]}),S.jsxs("div",{className:"setup-actions",children:[S.jsx("button",{type:"button",className:"btn primary",disabled:!g.trim()||v||!d,onClick:x,children:v?"保存中…":"保存并开始使用"}),S.jsxs("button",{type:"button",className:"btn",onClick:k,children:[S.jsx(Fd,{})," 重新检测"]})]})]}):S.jsxs("div",{className:"setup-actions",children:[S.jsx("button",{type:"button",className:"btn primary",disabled:o,onClick:b,children:o?"正在安装 pi agent CLI…":"自动安装 pi agent"}),S.jsx("button",{type:"button",className:"btn",onClick:i,children:"跳过"})]})]})})}const MM=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],gf=()=>({id:"",name:"",reasoning:!1,input:"text",contextWindow:"",maxTokens:""}),OM=()=>({providerId:"",name:"",api:"openai-completions",baseUrl:"",apiKey:"",authHeader:!0,models:[gf()]});function DM(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:[gf()]).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 LM({send:e,providers:t,providerStatus:n,onClose:i}){const[o,a]=ie.useState(null),[l,u]=ie.useState({}),[d,h]=ie.useState(null);ie.useEffect(()=>{e({type:"list_models_config"}),e({type:"list_providers"})},[e]);const g=b=>{const x=(l[b.id]??"").trim();!x||d||(h(b.id),e({type:"set_provider_api_key",provider:b.id,apiKey:x}),setTimeout(()=>{h(null),u(k=>({...k,[b.id]:""})),e({type:"list_providers"})},1500))},p=()=>{if(!o)return;const b=o.providerId.trim(),x=o.models.filter(E=>E.id.trim()).map(E=>({id:E.id.trim(),name:E.name.trim()||void 0,reasoning:E.reasoning||void 0,input:E.input==="text-image"?["text","image"]:void 0,contextWindow:E.contextWindow?Number(E.contextWindow):void 0,maxTokens:E.maxTokens?Number(E.maxTokens):void 0})),k={providerId:b,name:o.name.trim()||void 0,api:o.api.trim()||void 0,baseUrl:o.baseUrl.trim()||void 0,apiKey:o.apiKey.trim()||void 0,authHeader:o.authHeader||void 0,models:x};e({type:"save_model_config",providerId:b,config:k}),i()},v=b=>{window.confirm(`删除服务商 ${b.providerId} 及其 ${b.models.length} 个模型?`)&&e({type:"delete_model_config",providerId:b.providerId})},y=(b,x)=>{o&&a({...o,models:o.models.map((k,E)=>E===b?{...k,...x}:k)})};return S.jsx("div",{className:"modal-backdrop",children:S.jsxs("div",{className:"modal model-modal",children:[S.jsx("button",{type:"button",className:"modal-close","aria-label":"关闭",onClick:i,children:S.jsx(Pd,{})}),S.jsx("div",{className:"modal-head",children:S.jsx("h2",{children:o?"编辑服务商":"管理模型"})}),o?S.jsxs("div",{className:"provider-form",children:[S.jsxs("div",{className:"form-grid",children:[S.jsxs("label",{className:"field",children:[S.jsxs("span",{className:"field-label",children:["服务商 ID ",S.jsx("em",{children:"(必填,如 ollama / my-proxy)"})]}),S.jsx("input",{type:"text",value:o.providerId,disabled:t.some(b=>b.providerId===o.providerId),onChange:b=>a({...o,providerId:b.target.value}),placeholder:"my-proxy"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"显示名"}),S.jsx("input",{type:"text",value:o.name,onChange:b=>a({...o,name:b.target.value}),placeholder:"我的代理"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"API 类型"}),S.jsx("select",{value:o.api,onChange:b=>a({...o,api:b.target.value}),children:MM.map(b=>S.jsx("option",{value:b,children:b},b))})]}),S.jsxs("label",{className:"field",children:[S.jsxs("span",{className:"field-label",children:["baseUrl ",S.jsx("em",{children:"(OpenAI 兼容端点)"})]}),S.jsx("input",{type:"text",value:o.baseUrl,onChange:b=>a({...o,baseUrl:b.target.value}),placeholder:"http://localhost:11434/v1"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"API 密钥"}),S.jsx("input",{type:"password",value:o.apiKey,onChange:b=>a({...o,apiKey:b.target.value}),placeholder:"sk-…(可留空,用 auth.json 的密钥)"})]}),S.jsxs("label",{className:"field check",children:[S.jsx("input",{type:"checkbox",checked:o.authHeader,onChange:b=>a({...o,authHeader:b.target.checked})}),S.jsx("span",{children:"自动添加 Authorization 请求头"})]})]}),S.jsx("div",{className:"form-section-title",children:"模型"}),o.models.map((b,x)=>S.jsxs("div",{className:"model-row",children:[S.jsx("input",{type:"text",value:b.id,onChange:k=>y(x,{id:k.target.value}),placeholder:"模型 ID(必填)"}),S.jsx("input",{type:"text",value:b.name,onChange:k=>y(x,{name:k.target.value}),placeholder:"显示名"}),S.jsxs("select",{value:b.input,onChange:k=>y(x,{input:k.target.value}),children:[S.jsx("option",{value:"text",children:"文本"}),S.jsx("option",{value:"text-image",children:"文本+图片"})]}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:b.reasoning,onChange:k=>y(x,{reasoning:k.target.checked})}),S.jsx("span",{children:"推理"})]}),S.jsx("input",{type:"number",value:b.contextWindow,onChange:k=>y(x,{contextWindow:k.target.value}),placeholder:"上下文",title:"contextWindow"}),S.jsx("input",{type:"number",value:b.maxTokens,onChange:k=>y(x,{maxTokens:k.target.value}),placeholder:"最大输出",title:"maxTokens"}),S.jsx("button",{type:"button",className:"iconbtn danger",title:"移除模型",onClick:()=>a({...o,models:o.models.filter((k,E)=>E!==x)}),children:S.jsx(Fh,{})})]},x)),S.jsxs("button",{type:"button",className:"btn",onClick:()=>a({...o,models:[...o.models,gf()]}),children:[S.jsx(Ws,{})," 添加模型"]}),S.jsxs("div",{className:"modal-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>a(null),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",disabled:!o.providerId.trim()||!o.models.some(b=>b.id.trim()),onClick:p,children:"保存"})]})]}):S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"form-section-title",children:["内置服务商 ",S.jsx("em",{className:"section-hint",children:"只需填入 API 密钥"})]}),S.jsxs("div",{className:"provider-list",children:[n.length===0&&S.jsx("div",{className:"dd-loading",children:"加载中…"}),n.map(b=>S.jsxs("div",{className:"provider-row",children:[S.jsxs("div",{className:"provider-info",children:[S.jsx("span",{className:"provider-name",children:b.name}),S.jsxs("span",{className:"provider-sub",children:[b.id,b.configured&&S.jsx("span",{className:"auth-badge",children:"✓ 已配置"}),b.source&&!b.configured&&S.jsx("span",{className:"auth-badge dim",children:b.source})]})]}),S.jsx("div",{className:"provider-actions",children:b.configured?S.jsx("span",{className:"auth-badge",children:"密钥已就绪"}):S.jsxs(S.Fragment,{children:[S.jsx("input",{type:"password",className:"key-input",placeholder:"粘贴 API 密钥…",value:l[b.id]??"",onChange:x=>u(k=>({...k,[b.id]:x.target.value}))}),S.jsxs("button",{type:"button",className:"btn primary sm",disabled:!(l[b.id]??"").trim()||d===b.id,onClick:()=>g(b),children:[S.jsx(Sw,{})," ",d===b.id?"保存中":"保存密钥"]})]})})]},b.id))]}),S.jsx("div",{className:"form-section-title",children:"自定义服务商"}),S.jsxs("p",{className:"modal-desc",children:["用于 Ollama / vLLM / 兼容 OpenAI 的代理等,写入 pi 的"," ",S.jsx("code",{children:"models.json"}),",保存后热重载、立即生效。"]}),t.length===0&&S.jsx("div",{className:"dd-loading",children:"还没有自定义服务商"}),S.jsx("div",{className:"provider-list",children:t.map(b=>S.jsxs("div",{className:"provider-row",children:[S.jsxs("div",{className:"provider-info",children:[S.jsx("span",{className:"provider-name",children:b.providerId}),S.jsxs("span",{className:"provider-sub",children:[b.api??"—",b.baseUrl?` · ${b.baseUrl}`:"",b.models.length>0&&` · ${b.models.length} 个模型`]})]}),S.jsxs("div",{className:"provider-actions",children:[S.jsx("button",{type:"button",className:"iconbtn",title:"编辑",onClick:()=>a(DM(b)),children:S.jsx(iv,{})}),S.jsx("button",{type:"button",className:"iconbtn danger",title:"删除",onClick:()=>v(b),children:S.jsx(Fh,{})})]})]},b.providerId))}),S.jsx("div",{className:"modal-actions",children:S.jsxs("button",{type:"button",className:"btn primary",onClick:()=>a(OM()),children:[S.jsx(Ws,{})," 新增服务商"]})})]})]})})}const G_=2e5,IM=2e5;function PM(){const e=new Map,t=new Map;return{write(n,i){const o=e.get(n);if(o){o.write(i);return}const a=t.get(n)??"",l=a.length+i.length>IM?i:a+i;t.set(n,l)},register(n,i){e.set(n,i);const o=t.get(n);if(o){try{i.write(o)}catch{}t.delete(n)}return()=>{e.get(n)===i&&e.delete(n),t.delete(n)}},clear(){e.clear(),t.clear()}}}function BM(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 i=!1;for(const o of e.keys())n.has(o)&&(e.delete(o),i=!0);return i?new Map(e):e}function FM(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,liveOutputs:BM(e.liveOutputs,t.state)};case"tool_delta":{const n=e.liveOutputs.get(t.toolCallId),i=((n==null?void 0:n.text)??"")+t.delta,o=i.length>G_?i.slice(0,G_):i,a=new Map(e.liveOutputs);return a.set(t.toolCallId,{toolName:t.toolName,text:o}),{...e,liveOutputs:a}}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"files":return{...e,files:t.files};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"path_completions":return{...e,pathCompletions:t.completions};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"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 Y_="pi-web-client-id";function zM(){let e=localStorage.getItem(Y_);return e||(e=crypto.randomUUID(),localStorage.setItem(Y_,e)),e}function UM(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws`}function HM(){const[e,t]=ie.useReducer(FM,{status:"connecting",ready:!1,state:null,liveOutputs:new Map,notices:[],sessions:[],files:null,models:[],modelsLoading:!1,modelsConfig:[],providers:[],pathCompletions:[],widgets:[],statuses:[],dialog:null,commands:[],commandsPath:"",terminals:[]}),n=ie.useRef(null),i=ie.useRef(PM()),o=ie.useRef(0),a=ie.useRef(null),l=ie.useRef(!0),u=ie.useRef(0),d=ie.useRef(0),h=ie.useCallback((O,L)=>{const A=++d.current;t({type:"notice",notice:{id:A,level:O,text:L}}),setTimeout(()=>t({type:"dismiss_notice",id:A}),O==="error"?12e3:7e3)},[]),g=ie.useCallback(O=>{const L=n.current;return L&&L.readyState===WebSocket.OPEN?(L.send(JSON.stringify(O)),!0):!1},[]),p=ie.useCallback(()=>{if(!l.current)return;t({type:"status",status:"connecting"});const O=new WebSocket(UM());n.current=O,O.onopen=()=>{n.current===O&&(t({type:"status",status:"open"}),o.current=0,u.current=Date.now(),O.send(JSON.stringify({type:"hello",clientId:zM()})))},O.onmessage=L=>{if(n.current!==O)return;u.current=Date.now();let A;try{A=JSON.parse(L.data)}catch{return}switch(A.type){case"ready":t({type:"ready",serverVersion:A.serverVersion}),O.send(JSON.stringify({type:"get_state"})),O.send(JSON.stringify({type:"list_sessions"})),O.send(JSON.stringify({type:"list_files"})),O.send(JSON.stringify({type:"list_models"})),O.send(JSON.stringify({type:"list_commands"}));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"notice":{const H=++d.current;t({type:"notice",notice:{id:H,level:A.level,text:A.text}}),setTimeout(()=>t({type:"dismiss_notice",id:H}),A.level==="error"?12e3:7e3);break}case"sessions":t({type:"sessions",sessions:A.sessions});break;case"files":t({type:"files",files:A});break;case"models":t({type:"models",models:A.models,loading:!1});break;case"path_completions":t({type:"path_completions",completions:A.completions});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":i.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}},O.onclose=()=>{if(n.current===O&&(n.current=null),i.current.clear(),!l.current)return;t({type:"status",status:"closed"});const L=Math.min(1e3*2**o.current,1e4);o.current+=1,a.current=setTimeout(()=>{a.current=null,p()},L)},O.onerror=()=>{O.close()}},[]);ie.useEffect(()=>{l.current=!0,p();const O=setInterval(()=>{if(!l.current)return;const L=n.current;L&&L.readyState===WebSocket.OPEN&&Date.now()-u.current>3e4&&L.close()},5e3);return()=>{var L;l.current=!1,clearInterval(O),a.current&&(clearTimeout(a.current),a.current=null),(L=n.current)==null||L.close(),n.current=null}},[p]);const v=ie.useCallback(O=>t({type:"dismiss_notice",id:O}),[]),y=ie.useCallback(O=>t({type:"terminal_add",meta:O}),[]),b=ie.useCallback(O=>t({type:"terminal_remove",id:O}),[]),x=ie.useCallback(O=>t({type:"terminal_restart",terminalId:O}),[]),k=ie.useCallback((O,L)=>i.current.register(O,L),[]),E=ie.useRef({chat:e,send:g,pushNotice:h,dismissNotice:v,terminal:{create:y,close:b,register:k,restart:x}});return E.current={chat:e,send:g,pushNotice:h,dismissNotice:v,terminal:{create:y,close:b,register:k,restart:x}},E.current}const xb="pi-web-sounds",Bh={enabled:!0,question:!0,done:!0,start:!1,error:!0,volume:60};function kb(){try{const e=localStorage.getItem(xb);if(!e)return{...Bh};const t=JSON.parse(e);return{...Bh,...t}}catch{return{...Bh}}}function $M(e){try{localStorage.setItem(xb,JSON.stringify(e))}catch{}}let Ko=null;function jM(){try{if(!Ko){const e=window.AudioContext??window.webkitAudioContext;if(!e)return null;Ko=new e}return Ko.state==="suspended"&&Ko.resume(),Ko}catch{return null}}const WM=[{type:"sine",freq:587.33,start:0,dur:.13,peak:.5},{type:"sine",freq:880,start:.11,dur:.24,peak:.5}],KM=[{type:"sine",freq:880,start:0,dur:.15,peak:.35},{type:"sine",freq:587.33,start:.15,dur:.32,peak:.35}],qM=[{type:"triangle",freq:660,start:0,dur:.08,peak:.22}],VM=[{type:"square",freq:220,start:0,dur:.16,peak:.18},{type:"square",freq:174.61,start:.18,dur:.26,peak:.18}],GM={question:WM,done:KM,start:qM,error:VM};function YM(e,t,n){const i=e.createOscillator(),o=e.createGain();i.type=t.type,i.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),i.connect(o),o.connect(e.destination),i.start(a),i.stop(a+t.dur+.05)}function qo(e,t=kb()){if(!t.enabled||!t[e])return;const n=jM();if(!n)return;const i=Math.max(0,Math.min(1,t.volume/100));for(const o of GM[e])YM(n,o,i)}function XM(){var L;const{chat:e,send:t,dismissNotice:n,terminal:i}=HM(),[o,a]=ie.useState([]),[l,u]=ie.useState("chat"),[d,h]=ie.useState(!1),[g,p]=ie.useState(!1),[v,y]=ie.useState(kb),b=ie.useRef(null),x=ie.useRef(null),k=ie.useRef(0);ie.useEffect(()=>{$M(v)},[v]),ie.useEffect(()=>{var D;const A=((D=e.state)==null?void 0:D.isStreaming)??!1,H=b.current;b.current=A,H!==null&&(!H&&A?qo("start",v):H&&!A&&qo("done",v))},[(L=e.state)==null?void 0:L.isStreaming,v]),ie.useEffect(()=>{var H;const A=((H=e.dialog)==null?void 0:H.id)??null;A!==null&&A!==x.current&&qo("question",v),x.current=A},[e.dialog,v]),ie.useEffect(()=>{const A=[...e.notices].reverse().find(H=>H.level==="error");A&&A.id!==k.current&&(k.current=A.id,qo("error",v))},[e.notices,v]);const E=(A,H,D,se=!1)=>{a(W=>W.some(ee=>ee.path===A)?W:[...W,{path:A,name:H,mode:D,isDir:se}])},O=A=>a(H=>H.filter(D=>D.path!==A));return S.jsxs("div",{className:"app",children:[S.jsx(Rw,{chat:e,send:t,view:l,onViewChange:u,onManageModels:()=>p(!0),sound:v,onSoundChange:y,onSoundPreview:A=>qo(A,v)}),S.jsx("div",{className:"notices",children:e.notices.map(A=>S.jsx("button",{type:"button",className:`notice notice-${A.level}`,onClick:()=>n(A.id),children:A.text},A.id))}),S.jsxs("div",{className:"layout",children:[S.jsxs("div",{className:`view-pane ${l==="chat"?"":"hidden"}`,children:[S.jsx(Mw,{chat:e,send:t}),S.jsxs("main",{className:"main",children:[e.state?S.jsx(uR,{state:e.state,liveOutputs:e.liveOutputs}):S.jsx("div",{className:"boot-wait",children:e.ready?"正在加载会话…":"正在连接 pi-web-ui 服务器…"}),S.jsx(hR,{chat:e,send:t,attachments:o,onRemoveAttachment:O,onSent:()=>a([])})]}),S.jsx(Ow,{chat:e,send:t,onAttach:E})]}),S.jsx("div",{className:`view-pane ${l==="terminal"?"":"hidden"}`,children:S.jsx(RM,{chat:e,send:t,terminal:i})})]}),S.jsx(dR,{chat:e}),e.dialog&&S.jsx(pR,{dialog:e.dialog,send:t}),e.ready&&e.state&&e.state.piConfigured===!1&&!d&&!g&&S.jsx(AM,{send:t,piConfigured:e.state.piConfigured,providers:e.providers,onClose:()=>h(!0)}),g&&S.jsx(LM,{send:t,providers:e.modelsConfig,providerStatus:e.providers,onClose:()=>p(!1)})]})}uw.createRoot(document.getElementById("root")).render(S.jsx(ie.StrictMode,{children:S.jsx(XM,{})}));
|
|
115
|
+
*/var kM=2,EM=1,CM=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),i=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=i-u,g=o-d-t;return{cols:Math.max(kM,Math.floor(g/e.css.cell.width)),rows:Math.max(EM,Math.floor(h/e.css.cell.height))}}};const NM={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 TM({terminalId:e,command:t,cwd:n,active:i,send:o,register:a}){const l=ie.useRef(null),u=ie.useRef(null);return ie.useEffect(()=>{const d=l.current;if(!d)return;const h=new xM({theme:NM,fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace',fontSize:13,cursorBlink:!0,scrollback:8e3}),g=new CM;h.loadAddon(g),h.open(d),u.current={term:h,fit:g},i&&h.focus();const p=a(e,{write:k=>h.write(k),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})}),b=h.onData(k=>{o({type:"terminal_input",terminalId:e,data:k})});let x=null;return typeof ResizeObserver<"u"&&(x=new ResizeObserver(()=>{d.offsetWidth>0&&d.offsetHeight>0&&v()}),x.observe(d)),()=>{cancelAnimationFrame(y),b.dispose(),x==null||x.disconnect(),p(),o({type:"terminal_kill",terminalId:e}),h.dispose(),u.current=null}},[e,t,o,a]),ie.useEffect(()=>{if(!i)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)},[i]),S.jsx("div",{ref:l,className:`term-xterm ${i?"":"hidden"}`})}const V_={name:"",command:"",cwd:"${pwd}"};function RM({chat:e,send:t,terminal:n}){const[i,o]=ie.useState(null),[a,l]=ie.useState(!1),[u,d]=ie.useState(null),[h,g]=ie.useState(V_),[p,v]=ie.useState(null),y=ie.useRef(null);ie.useEffect(()=>{e.terminals.length===0?o(null):e.terminals.some(W=>W.id===i)||o(e.terminals[e.terminals.length-1].id)},[e.terminals,i]),ie.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]);const b=W=>{if(!e.ready)return;const ee=crypto.randomUUID();n.create({...W,id:ee,running:!0,exitCode:null}),o(ee)},x=()=>{var W;return b({title:`终端 ${e.terminals.length+1}`,cwd:((W=e.state)==null?void 0:W.cwd)??""})},k=W=>{var Y;const ee=W.name||W.command,R=e.terminals.find($=>$.title===ee);if(R){n.restart(R.id),o(R.id),t({type:"run_command",terminalId:R.id,command:W,cols:80,rows:24});return}b({title:ee,cwd:((Y=e.state)==null?void 0:Y.cwd)??"",command:W})},C=W=>{if(n.close(W),i===W){const ee=e.terminals.filter(R=>R.id!==W);o(ee.length>0?ee[ee.length-1].id:null)}},O=()=>{l(!0),d(null),g(V_)},L=W=>{const ee=e.commands[W];ee&&(l(!1),d(W),g({name:ee.name,command:ee.command,cwd:ee.cwd??""}))},A=()=>{l(!1),d(null)},H=()=>{const W=h.name.trim(),ee=h.command.trim();if(!W||!ee)return;const R=h.cwd.trim(),Y={name:W,command:ee,cwd:R||void 0},$=a?[...e.commands,Y]:u!==null?e.commands.map((K,q)=>q===u?Y:K):e.commands;t({type:"save_commands",commands:$}),A()},D=W=>{if(p===W){const ee=e.commands.filter((R,Y)=>Y!==W);t({type:"save_commands",commands:ee}),v(null),y.current&&clearTimeout(y.current)}else v(W),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(null),2500)},se=a||u!==null;return S.jsxs("div",{className:"terminal-view",children:[S.jsxs("aside",{className:"term-side term-commands",children:[S.jsxs("div",{className:"panel-header",children:[S.jsx("span",{className:"panel-title",children:"命令"}),S.jsxs("div",{className:"panel-header-actions",children:[S.jsx("button",{type:"button",className:"panel-refresh",title:"重新读取 .pi/commands.json",onClick:()=>t({type:"list_commands"}),children:S.jsx(Fd,{})}),S.jsx("button",{type:"button",className:"panel-new",title:"新建命令",onClick:O,children:S.jsx(Ws,{})})]})]}),S.jsx("div",{className:"panel-body",children:se?S.jsxs("div",{className:"cmd-form",children:[S.jsx("label",{htmlFor:"cmd-name",children:"名称"}),S.jsx("input",{id:"cmd-name",className:"cmd-input",value:h.name,placeholder:"例如:启动开发服务器",autoFocus:!0,onChange:W=>g({...h,name:W.target.value})}),S.jsx("label",{htmlFor:"cmd-command",children:"命令"}),S.jsx("input",{id:"cmd-command",className:"cmd-input",value:h.command,placeholder:"例如:npm run dev",onChange:W=>g({...h,command:W.target.value}),onKeyDown:W=>{W.key==="Enter"&&!W.nativeEvent.isComposing&&H()}}),S.jsxs("label",{htmlFor:"cmd-cwd",children:["目录"," ",S.jsxs("span",{className:"cmd-hint",children:["($","{pwd}"," = 当前工作目录)"]})]}),S.jsx("input",{id:"cmd-cwd",className:"cmd-input",value:h.cwd,placeholder:"${pwd}",onChange:W=>g({...h,cwd:W.target.value}),onKeyDown:W=>{W.key==="Enter"&&!W.nativeEvent.isComposing&&H()}}),S.jsxs("div",{className:"cmd-form-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:A,children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",disabled:!h.name.trim()||!h.command.trim(),onClick:H,children:"保存"})]})]}):S.jsxs(S.Fragment,{children:[e.commands.length===0&&S.jsx("div",{className:"panel-empty",children:"还没有命令,点 + 添加一个"}),e.commands.map((W,ee)=>S.jsxs("div",{className:"cmd-item",children:[S.jsx("button",{type:"button",className:"cmd-run",title:"点击运行",onClick:()=>k(W),children:S.jsx(bw,{})}),S.jsxs("button",{type:"button",className:"cmd-main",title:"点击运行",onClick:()=>k(W),children:[S.jsx("span",{className:"cmd-name",children:W.name}),S.jsx("span",{className:"cmd-command",children:W.command}),W.cwd&&S.jsx("span",{className:"cmd-cwd",children:W.cwd})]}),S.jsx("button",{type:"button",className:"cmd-act",title:"编辑",onClick:()=>L(ee),children:S.jsx(iv,{})}),S.jsx("button",{type:"button",className:`cmd-act del ${p===ee?"confirm":""}`,title:"删除",onClick:()=>D(ee),children:p===ee?"确认?":S.jsx(Fh,{})})]},ee))]})}),S.jsxs("div",{className:"panel-footer",children:[S.jsxs("div",{className:"cmd-file",title:e.commandsPath,children:[S.jsx(ww,{className:"cmd-file-icon"}),S.jsx("span",{className:"cmd-file-path",children:e.commandsPath||".pi/commands.json"})]}),S.jsxs("div",{className:"cmd-file-hint",children:["$","{pwd}"," 指代当前工作目录"]})]})]}),S.jsx("div",{className:"term-main",children:e.terminals.length===0?S.jsxs("div",{className:"term-empty",children:[S.jsx(Bd,{className:"term-empty-icon"}),S.jsx("div",{className:"term-empty-title",children:"内置终端"}),S.jsx("div",{className:"term-empty-sub",children:"点击左侧命令运行,或点右侧 + 新建终端"})]}):e.terminals.map(W=>S.jsx(TM,{terminalId:W.id,command:W.command,cwd:W.cwd,active:W.id===i,send:t,register:n.register},W.id))}),S.jsxs("aside",{className:"term-side term-tabs",children:[S.jsxs("div",{className:"panel-header",children:[S.jsx("span",{className:"panel-title",children:"终端"}),S.jsx("button",{type:"button",className:"panel-new",title:"新建终端",onClick:x,children:S.jsx(Ws,{})})]}),S.jsxs("div",{className:"panel-body",children:[e.terminals.length===0&&S.jsx("div",{className:"panel-empty",children:"暂无终端"}),e.terminals.map(W=>S.jsxs("div",{className:`term-tab ${W.id===i?"active":""}`,children:[S.jsxs("button",{type:"button",className:"term-tab-main",title:`${W.cwd}${W.command?`
|
|
116
|
+
> ${W.command.command}`:""}`,onClick:()=>o(W.id),children:[S.jsx("span",{className:`term-tab-dot ${W.running?"run":"exit"}`}),S.jsxs("span",{className:"term-tab-title",children:[W.title,!W.running&&S.jsxs("span",{className:"term-tab-exit",children:["(已退出",W.exitCode!==null?` ${W.exitCode}`:"",")"]})]})]}),S.jsx("button",{type:"button",className:"term-tab-close",title:"关闭终端",onClick:()=>C(W.id),children:S.jsx(Pd,{})})]},W.id))]})]})]})}function AM({send:e,piConfigured:t,providers:n,installResult:i,onClose:o}){const[a,l]=ie.useState(!1),[u,d]=ie.useState(""),[h,g]=ie.useState(""),[p,v]=ie.useState(!1);ie.useEffect(()=>{e({type:"list_providers"})},[e]),ie.useEffect(()=>{t&&o()},[t,o]),ie.useEffect(()=>{i&&l(!1)},[i]),ie.useEffect(()=>{var O;!u&&n.length>0&&d(((O=n.find(L=>!L.configured))==null?void 0:O.id)??n[0].id)},[n,u]);const y=()=>{a||(l(!0),e({type:"install_pi_agent"}))},b=()=>{!h.trim()||p||(v(!0),e({type:"set_provider_api_key",provider:u.trim(),apiKey:h.trim()}),setTimeout(()=>v(!1),3e3))},x=()=>{e({type:"get_state"}),e({type:"list_providers"})},k=n.find(O=>O.id===u),C=i!==null&&!i.ok;return S.jsx("div",{className:"modal-backdrop",children:S.jsxs("div",{className:"modal setup-modal",children:[S.jsx("button",{type:"button",className:"modal-close","aria-label":"关闭",onClick:o,children:S.jsx(Pd,{})}),S.jsxs("div",{className:"modal-head",children:[S.jsx(zd,{className:"modal-head-icon"}),S.jsx("h2",{children:"未检测到 pi agent 配置"})]}),S.jsxs("p",{className:"modal-desc",children:["pi-web-ui 需要 pi 的配置目录(",S.jsx("code",{children:"~/.pi/agent"}),")和至少一个 API 密钥才能运行智能体。pi 内置了 openai、anthropic、deepseek 等服务商 ——选一个填密钥即可,全程无需打开终端。"]}),C?S.jsxs("div",{className:"setup-failed",children:[S.jsx("div",{className:"setup-done",children:"✖ pi agent 安装失败:"}),S.jsx("pre",{className:"setup-detail",children:i.detail}),S.jsxs("div",{className:"setup-actions",children:[S.jsx("button",{type:"button",className:"btn primary",disabled:a,onClick:y,children:"重试安装"}),S.jsx("button",{type:"button",className:"btn",onClick:o,children:"跳过"})]})]}):i!=null&&i.ok?S.jsxs("div",{className:"setup-key-form",children:[S.jsx("div",{className:"setup-done",children:"✅ pi agent CLI 已安装。选择服务商并填入 API 密钥即可开始对话:"}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"服务商"}),S.jsxs("select",{value:u,onChange:O=>d(O.target.value),children:[n.length===0&&S.jsx("option",{value:"",children:"加载中…"}),n.map(O=>S.jsxs("option",{value:O.id,children:[O.name,"(",O.id,")",O.configured?" · 已配置":""]},O.id))]}),(k==null?void 0:k.configured)&&S.jsx("div",{className:"field-hint",children:"该服务商已配置密钥,可直接使用或更换新密钥。"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"API 密钥"}),S.jsx("input",{type:"password",value:h,onChange:O=>g(O.target.value),placeholder:"sk-…"})]}),S.jsxs("div",{className:"setup-actions",children:[S.jsx("button",{type:"button",className:"btn primary",disabled:!h.trim()||p||!u,onClick:b,children:p?"保存中…":"保存并开始使用"}),S.jsxs("button",{type:"button",className:"btn",onClick:x,children:[S.jsx(Fd,{})," 重新检测"]})]})]}):S.jsxs("div",{className:"setup-actions",children:[S.jsx("button",{type:"button",className:"btn primary",disabled:a,onClick:y,children:a?"正在安装 pi agent CLI…":"自动安装 pi agent"}),S.jsx("button",{type:"button",className:"btn",onClick:o,children:"跳过"})]})]})})}const MM=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],gf=()=>({id:"",name:"",reasoning:!1,input:"text",contextWindow:"",maxTokens:""}),OM=()=>({providerId:"",name:"",api:"openai-completions",baseUrl:"",apiKey:"",authHeader:!0,models:[gf()]});function DM(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:[gf()]).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 LM({send:e,providers:t,providerStatus:n,onClose:i}){const[o,a]=ie.useState(null),[l,u]=ie.useState({}),[d,h]=ie.useState(null);ie.useEffect(()=>{e({type:"list_models_config"}),e({type:"list_providers"})},[e]);const g=b=>{const x=(l[b.id]??"").trim();!x||d||(h(b.id),e({type:"set_provider_api_key",provider:b.id,apiKey:x}),setTimeout(()=>{h(null),u(k=>({...k,[b.id]:""})),e({type:"list_providers"})},1500))},p=()=>{if(!o)return;const b=o.providerId.trim(),x=o.models.filter(C=>C.id.trim()).map(C=>({id:C.id.trim(),name:C.name.trim()||void 0,reasoning:C.reasoning||void 0,input:C.input==="text-image"?["text","image"]:void 0,contextWindow:C.contextWindow?Number(C.contextWindow):void 0,maxTokens:C.maxTokens?Number(C.maxTokens):void 0})),k={providerId:b,name:o.name.trim()||void 0,api:o.api.trim()||void 0,baseUrl:o.baseUrl.trim()||void 0,apiKey:o.apiKey.trim()||void 0,authHeader:o.authHeader||void 0,models:x};e({type:"save_model_config",providerId:b,config:k}),i()},v=b=>{window.confirm(`删除服务商 ${b.providerId} 及其 ${b.models.length} 个模型?`)&&e({type:"delete_model_config",providerId:b.providerId})},y=(b,x)=>{o&&a({...o,models:o.models.map((k,C)=>C===b?{...k,...x}:k)})};return S.jsx("div",{className:"modal-backdrop",children:S.jsxs("div",{className:"modal model-modal",children:[S.jsx("button",{type:"button",className:"modal-close","aria-label":"关闭",onClick:i,children:S.jsx(Pd,{})}),S.jsx("div",{className:"modal-head",children:S.jsx("h2",{children:o?"编辑服务商":"管理模型"})}),o?S.jsxs("div",{className:"provider-form",children:[S.jsxs("div",{className:"form-grid",children:[S.jsxs("label",{className:"field",children:[S.jsxs("span",{className:"field-label",children:["服务商 ID ",S.jsx("em",{children:"(必填,如 ollama / my-proxy)"})]}),S.jsx("input",{type:"text",value:o.providerId,disabled:t.some(b=>b.providerId===o.providerId),onChange:b=>a({...o,providerId:b.target.value}),placeholder:"my-proxy"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"显示名"}),S.jsx("input",{type:"text",value:o.name,onChange:b=>a({...o,name:b.target.value}),placeholder:"我的代理"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"API 类型"}),S.jsx("select",{value:o.api,onChange:b=>a({...o,api:b.target.value}),children:MM.map(b=>S.jsx("option",{value:b,children:b},b))})]}),S.jsxs("label",{className:"field",children:[S.jsxs("span",{className:"field-label",children:["baseUrl ",S.jsx("em",{children:"(OpenAI 兼容端点)"})]}),S.jsx("input",{type:"text",value:o.baseUrl,onChange:b=>a({...o,baseUrl:b.target.value}),placeholder:"http://localhost:11434/v1"})]}),S.jsxs("label",{className:"field",children:[S.jsx("span",{className:"field-label",children:"API 密钥"}),S.jsx("input",{type:"password",value:o.apiKey,onChange:b=>a({...o,apiKey:b.target.value}),placeholder:"sk-…(可留空,用 auth.json 的密钥)"})]}),S.jsxs("label",{className:"field check",children:[S.jsx("input",{type:"checkbox",checked:o.authHeader,onChange:b=>a({...o,authHeader:b.target.checked})}),S.jsx("span",{children:"自动添加 Authorization 请求头"})]})]}),S.jsx("div",{className:"form-section-title",children:"模型"}),o.models.map((b,x)=>S.jsxs("div",{className:"model-row",children:[S.jsx("input",{type:"text",value:b.id,onChange:k=>y(x,{id:k.target.value}),placeholder:"模型 ID(必填)"}),S.jsx("input",{type:"text",value:b.name,onChange:k=>y(x,{name:k.target.value}),placeholder:"显示名"}),S.jsxs("select",{value:b.input,onChange:k=>y(x,{input:k.target.value}),children:[S.jsx("option",{value:"text",children:"文本"}),S.jsx("option",{value:"text-image",children:"文本+图片"})]}),S.jsxs("label",{className:"check",children:[S.jsx("input",{type:"checkbox",checked:b.reasoning,onChange:k=>y(x,{reasoning:k.target.checked})}),S.jsx("span",{children:"推理"})]}),S.jsx("input",{type:"number",value:b.contextWindow,onChange:k=>y(x,{contextWindow:k.target.value}),placeholder:"上下文",title:"contextWindow"}),S.jsx("input",{type:"number",value:b.maxTokens,onChange:k=>y(x,{maxTokens:k.target.value}),placeholder:"最大输出",title:"maxTokens"}),S.jsx("button",{type:"button",className:"iconbtn danger",title:"移除模型",onClick:()=>a({...o,models:o.models.filter((k,C)=>C!==x)}),children:S.jsx(Fh,{})})]},x)),S.jsxs("button",{type:"button",className:"btn",onClick:()=>a({...o,models:[...o.models,gf()]}),children:[S.jsx(Ws,{})," 添加模型"]}),S.jsxs("div",{className:"modal-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>a(null),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",disabled:!o.providerId.trim()||!o.models.some(b=>b.id.trim()),onClick:p,children:"保存"})]})]}):S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"form-section-title",children:["内置服务商 ",S.jsx("em",{className:"section-hint",children:"只需填入 API 密钥"})]}),S.jsxs("div",{className:"provider-list",children:[n.length===0&&S.jsx("div",{className:"dd-loading",children:"加载中…"}),n.map(b=>S.jsxs("div",{className:"provider-row",children:[S.jsxs("div",{className:"provider-info",children:[S.jsx("span",{className:"provider-name",children:b.name}),S.jsxs("span",{className:"provider-sub",children:[b.id,b.configured&&S.jsx("span",{className:"auth-badge",children:"✓ 已配置"}),b.source&&!b.configured&&S.jsx("span",{className:"auth-badge dim",children:b.source})]})]}),S.jsx("div",{className:"provider-actions",children:b.configured?S.jsx("span",{className:"auth-badge",children:"密钥已就绪"}):S.jsxs(S.Fragment,{children:[S.jsx("input",{type:"password",className:"key-input",placeholder:"粘贴 API 密钥…",value:l[b.id]??"",onChange:x=>u(k=>({...k,[b.id]:x.target.value}))}),S.jsxs("button",{type:"button",className:"btn primary sm",disabled:!(l[b.id]??"").trim()||d===b.id,onClick:()=>g(b),children:[S.jsx(Sw,{})," ",d===b.id?"保存中":"保存密钥"]})]})})]},b.id))]}),S.jsx("div",{className:"form-section-title",children:"自定义服务商"}),S.jsxs("p",{className:"modal-desc",children:["用于 Ollama / vLLM / 兼容 OpenAI 的代理等,写入 pi 的"," ",S.jsx("code",{children:"models.json"}),",保存后热重载、立即生效。"]}),t.length===0&&S.jsx("div",{className:"dd-loading",children:"还没有自定义服务商"}),S.jsx("div",{className:"provider-list",children:t.map(b=>S.jsxs("div",{className:"provider-row",children:[S.jsxs("div",{className:"provider-info",children:[S.jsx("span",{className:"provider-name",children:b.providerId}),S.jsxs("span",{className:"provider-sub",children:[b.api??"—",b.baseUrl?` · ${b.baseUrl}`:"",b.models.length>0&&` · ${b.models.length} 个模型`]})]}),S.jsxs("div",{className:"provider-actions",children:[S.jsx("button",{type:"button",className:"iconbtn",title:"编辑",onClick:()=>a(DM(b)),children:S.jsx(iv,{})}),S.jsx("button",{type:"button",className:"iconbtn danger",title:"删除",onClick:()=>v(b),children:S.jsx(Fh,{})})]})]},b.providerId))}),S.jsx("div",{className:"modal-actions",children:S.jsxs("button",{type:"button",className:"btn primary",onClick:()=>a(OM()),children:[S.jsx(Ws,{})," 新增服务商"]})})]})]})})}const G_=2e5,IM=2e5;function PM(){const e=new Map,t=new Map;return{write(n,i){const o=e.get(n);if(o){o.write(i);return}const a=t.get(n)??"",l=a.length+i.length>IM?i:a+i;t.set(n,l)},register(n,i){e.set(n,i);const o=t.get(n);if(o){try{i.write(o)}catch{}t.delete(n)}return()=>{e.get(n)===i&&e.delete(n),t.delete(n)}},clear(){e.clear(),t.clear()}}}function BM(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 i=!1;for(const o of e.keys())n.has(o)&&(e.delete(o),i=!0);return i?new Map(e):e}function FM(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,liveOutputs:BM(e.liveOutputs,t.state)};case"tool_delta":{const n=e.liveOutputs.get(t.toolCallId),i=((n==null?void 0:n.text)??"")+t.delta,o=i.length>G_?i.slice(0,G_):i,a=new Map(e.liveOutputs);return a.set(t.toolCallId,{toolName:t.toolName,text:o}),{...e,liveOutputs:a}}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"files":return{...e,files:t.files};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"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"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 Y_="pi-web-client-id";function zM(){let e=localStorage.getItem(Y_);return e||(e=crypto.randomUUID(),localStorage.setItem(Y_,e)),e}function UM(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws`}function HM(){const[e,t]=ie.useReducer(FM,{status:"connecting",ready:!1,state:null,liveOutputs:new Map,notices:[],sessions:[],files:null,models:[],modelsLoading:!1,modelsConfig:[],providers:[],installResult:null,pathCompletions:[],widgets:[],statuses:[],dialog:null,commands:[],commandsPath:"",terminals:[]}),n=ie.useRef(null),i=ie.useRef(PM()),o=ie.useRef(0),a=ie.useRef(null),l=ie.useRef(!0),u=ie.useRef(0),d=ie.useRef(0),h=ie.useCallback((O,L)=>{const A=++d.current;t({type:"notice",notice:{id:A,level:O,text:L}}),setTimeout(()=>t({type:"dismiss_notice",id:A}),O==="error"?12e3:7e3)},[]),g=ie.useCallback(O=>{const L=n.current;return L&&L.readyState===WebSocket.OPEN?(L.send(JSON.stringify(O)),!0):!1},[]),p=ie.useCallback(()=>{if(!l.current)return;t({type:"status",status:"connecting"});const O=new WebSocket(UM());n.current=O,O.onopen=()=>{n.current===O&&(t({type:"status",status:"open"}),o.current=0,u.current=Date.now(),O.send(JSON.stringify({type:"hello",clientId:zM()})))},O.onmessage=L=>{if(n.current!==O)return;u.current=Date.now();let A;try{A=JSON.parse(L.data)}catch{return}switch(A.type){case"ready":t({type:"ready",serverVersion:A.serverVersion}),O.send(JSON.stringify({type:"get_state"})),O.send(JSON.stringify({type:"list_sessions"})),O.send(JSON.stringify({type:"list_files"})),O.send(JSON.stringify({type:"list_models"})),O.send(JSON.stringify({type:"list_commands"}));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"notice":{const H=++d.current;t({type:"notice",notice:{id:H,level:A.level,text:A.text}}),setTimeout(()=>t({type:"dismiss_notice",id:H}),A.level==="error"?12e3:7e3);break}case"sessions":t({type:"sessions",sessions:A.sessions});break;case"files":t({type:"files",files: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"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":i.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}},O.onclose=()=>{if(n.current===O&&(n.current=null),i.current.clear(),!l.current)return;t({type:"status",status:"closed"});const L=Math.min(1e3*2**o.current,1e4);o.current+=1,a.current=setTimeout(()=>{a.current=null,p()},L)},O.onerror=()=>{O.close()}},[]);ie.useEffect(()=>{l.current=!0,p();const O=setInterval(()=>{if(!l.current)return;const L=n.current;L&&L.readyState===WebSocket.OPEN&&Date.now()-u.current>3e4&&L.close()},5e3);return()=>{var L;l.current=!1,clearInterval(O),a.current&&(clearTimeout(a.current),a.current=null),(L=n.current)==null||L.close(),n.current=null}},[p]);const v=ie.useCallback(O=>t({type:"dismiss_notice",id:O}),[]),y=ie.useCallback(O=>t({type:"terminal_add",meta:O}),[]),b=ie.useCallback(O=>t({type:"terminal_remove",id:O}),[]),x=ie.useCallback(O=>t({type:"terminal_restart",terminalId:O}),[]),k=ie.useCallback((O,L)=>i.current.register(O,L),[]),C=ie.useRef({chat:e,send:g,pushNotice:h,dismissNotice:v,terminal:{create:y,close:b,register:k,restart:x}});return C.current={chat:e,send:g,pushNotice:h,dismissNotice:v,terminal:{create:y,close:b,register:k,restart:x}},C.current}const xb="pi-web-sounds",Bh={enabled:!0,question:!0,done:!0,start:!1,error:!0,volume:60};function kb(){try{const e=localStorage.getItem(xb);if(!e)return{...Bh};const t=JSON.parse(e);return{...Bh,...t}}catch{return{...Bh}}}function $M(e){try{localStorage.setItem(xb,JSON.stringify(e))}catch{}}let Ko=null;function jM(){try{if(!Ko){const e=window.AudioContext??window.webkitAudioContext;if(!e)return null;Ko=new e}return Ko.state==="suspended"&&Ko.resume(),Ko}catch{return null}}const WM=[{type:"sine",freq:587.33,start:0,dur:.13,peak:.5},{type:"sine",freq:880,start:.11,dur:.24,peak:.5}],KM=[{type:"sine",freq:880,start:0,dur:.15,peak:.35},{type:"sine",freq:587.33,start:.15,dur:.32,peak:.35}],qM=[{type:"triangle",freq:660,start:0,dur:.08,peak:.22}],VM=[{type:"square",freq:220,start:0,dur:.16,peak:.18},{type:"square",freq:174.61,start:.18,dur:.26,peak:.18}],GM={question:WM,done:KM,start:qM,error:VM};function YM(e,t,n){const i=e.createOscillator(),o=e.createGain();i.type=t.type,i.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),i.connect(o),o.connect(e.destination),i.start(a),i.stop(a+t.dur+.05)}function qo(e,t=kb()){if(!t.enabled||!t[e])return;const n=jM();if(!n)return;const i=Math.max(0,Math.min(1,t.volume/100));for(const o of GM[e])YM(n,o,i)}function XM(){var L;const{chat:e,send:t,dismissNotice:n,terminal:i}=HM(),[o,a]=ie.useState([]),[l,u]=ie.useState("chat"),[d,h]=ie.useState(!1),[g,p]=ie.useState(!1),[v,y]=ie.useState(kb),b=ie.useRef(null),x=ie.useRef(null),k=ie.useRef(0);ie.useEffect(()=>{$M(v)},[v]),ie.useEffect(()=>{var D;const A=((D=e.state)==null?void 0:D.isStreaming)??!1,H=b.current;b.current=A,H!==null&&(!H&&A?qo("start",v):H&&!A&&qo("done",v))},[(L=e.state)==null?void 0:L.isStreaming,v]),ie.useEffect(()=>{var H;const A=((H=e.dialog)==null?void 0:H.id)??null;A!==null&&A!==x.current&&qo("question",v),x.current=A},[e.dialog,v]),ie.useEffect(()=>{const A=[...e.notices].reverse().find(H=>H.level==="error");A&&A.id!==k.current&&(k.current=A.id,qo("error",v))},[e.notices,v]);const C=(A,H,D,se=!1)=>{a(W=>W.some(ee=>ee.path===A)?W:[...W,{path:A,name:H,mode:D,isDir:se}])},O=A=>a(H=>H.filter(D=>D.path!==A));return S.jsxs("div",{className:"app",children:[S.jsx(Rw,{chat:e,send:t,view:l,onViewChange:u,onManageModels:()=>p(!0),sound:v,onSoundChange:y,onSoundPreview:A=>qo(A,v)}),S.jsx("div",{className:"notices",children:e.notices.map(A=>S.jsx("button",{type:"button",className:`notice notice-${A.level}`,onClick:()=>n(A.id),children:A.text},A.id))}),S.jsxs("div",{className:"layout",children:[S.jsxs("div",{className:`view-pane ${l==="chat"?"":"hidden"}`,children:[S.jsx(Mw,{chat:e,send:t}),S.jsxs("main",{className:"main",children:[e.state?S.jsx(uR,{state:e.state,liveOutputs:e.liveOutputs}):S.jsx("div",{className:"boot-wait",children:e.ready?"正在加载会话…":"正在连接 pi-web-ui 服务器…"}),S.jsx(hR,{chat:e,send:t,attachments:o,onRemoveAttachment:O,onSent:()=>a([])})]}),S.jsx(Ow,{chat:e,send:t,onAttach:C})]}),S.jsx("div",{className:`view-pane ${l==="terminal"?"":"hidden"}`,children:S.jsx(RM,{chat:e,send:t,terminal:i})})]}),S.jsx(dR,{chat:e}),e.dialog&&S.jsx(pR,{dialog:e.dialog,send:t}),e.ready&&e.state&&e.state.piConfigured===!1&&!d&&!g&&S.jsx(AM,{send:t,piConfigured:e.state.piConfigured,providers:e.providers,installResult:e.installResult,onClose:()=>h(!0)}),g&&S.jsx(LM,{send:t,providers:e.modelsConfig,providerStatus:e.providers,onClose:()=>p(!1)})]})}uw.createRoot(document.getElementById("root")).render(S.jsx(ie.StrictMode,{children:S.jsx(XM,{})}));
|