plotlink-ows 1.0.16 → 1.0.19

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.
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var $g;function gx(){if($g)return we;$g=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),b=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=b&&T[b]||T["@@iterator"],typeof T=="function"?T:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function M(T,X,C){this.props=T,this.context=X,this.refs=N,this.updater=C||x}M.prototype.isReactComponent={},M.prototype.setState=function(T,X){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,X,"setState")},M.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function G(){}G.prototype=M.prototype;function U(T,X,C){this.props=T,this.context=X,this.refs=N,this.updater=C||x}var Q=U.prototype=new G;Q.constructor=U,E(Q,M.prototype),Q.isPureReactComponent=!0;var K=Array.isArray;function O(){}var ee={H:null,A:null,T:null,S:null},oe=Object.prototype.hasOwnProperty;function de(T,X,C){var se=C.ref;return{$$typeof:e,type:T,key:X,ref:se!==void 0?se:null,props:C}}function q(T,X){return de(T.type,X,T.props)}function B(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function D(T){var X={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(C){return X[C]})}var j=/\/+/g;function P(T,X){return typeof T=="object"&&T!==null&&T.key!=null?D(""+T.key):X.toString(36)}function L(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(O,O):(T.status="pending",T.then(function(X){T.status==="pending"&&(T.status="fulfilled",T.value=X)},function(X){T.status==="pending"&&(T.status="rejected",T.reason=X)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function A(T,X,C,se,pe){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var be=!1;if(T===null)be=!0;else switch(he){case"bigint":case"string":case"number":be=!0;break;case"object":switch(T.$$typeof){case e:case t:be=!0;break;case g:return be=T._init,A(be(T._payload),X,C,se,pe)}}if(be)return pe=pe(T),be=se===""?"."+P(T,0):se,K(pe)?(C="",be!=null&&(C=be.replace(j,"$&/")+"/"),A(pe,X,C,"",function(jt){return jt})):pe!=null&&(B(pe)&&(pe=q(pe,C+(pe.key==null||T&&T.key===pe.key?"":(""+pe.key).replace(j,"$&/")+"/")+be)),X.push(pe)),1;be=0;var Te=se===""?".":se+":";if(K(T))for(var Re=0;Re<T.length;Re++)se=T[Re],he=Te+P(se,Re),be+=A(se,X,C,he,pe);else if(Re=y(T),typeof Re=="function")for(T=Re.call(T),Re=0;!(se=T.next()).done;)se=se.value,he=Te+P(se,Re++),be+=A(se,X,C,he,pe);else if(he==="object"){if(typeof T.then=="function")return A(L(T),X,C,se,pe);throw X=String(T),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return be}function I(T,X,C){if(T==null)return T;var se=[],pe=0;return A(T,se,"","",function(he){return X.call(C,he,pe++)}),se}function Y(T){if(T._status===-1){var X=T._result;X=X(),X.then(function(C){(T._status===0||T._status===-1)&&(T._status=1,T._result=C)},function(C){(T._status===0||T._status===-1)&&(T._status=2,T._result=C)}),T._status===-1&&(T._status=0,T._result=X)}if(T._status===1)return T._result.default;throw T._result}var le=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},k={map:I,forEach:function(T,X,C){I(T,function(){X.apply(this,arguments)},C)},count:function(T){var X=0;return I(T,function(){X++}),X},toArray:function(T){return I(T,function(X){return X})||[]},only:function(T){if(!B(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return we.Activity=_,we.Children=k,we.Component=M,we.Fragment=n,we.Profiler=a,we.PureComponent=U,we.StrictMode=s,we.Suspense=p,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ee,we.__COMPILER_RUNTIME={__proto__:null,c:function(T){return ee.H.useMemoCache(T)}},we.cache=function(T){return function(){return T.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(T,X,C){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var se=E({},T.props),pe=T.key;if(X!=null)for(he in X.key!==void 0&&(pe=""+X.key),X)!oe.call(X,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&X.ref===void 0||(se[he]=X[he]);var he=arguments.length-2;if(he===1)se.children=C;else if(1<he){for(var be=Array(he),Te=0;Te<he;Te++)be[Te]=arguments[Te+2];se.children=be}return de(T.type,pe,se)},we.createContext=function(T){return T={$$typeof:c,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:o,_context:T},T},we.createElement=function(T,X,C){var se,pe={},he=null;if(X!=null)for(se in X.key!==void 0&&(he=""+X.key),X)oe.call(X,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(pe[se]=X[se]);var be=arguments.length-2;if(be===1)pe.children=C;else if(1<be){for(var Te=Array(be),Re=0;Re<be;Re++)Te[Re]=arguments[Re+2];pe.children=Te}if(T&&T.defaultProps)for(se in be=T.defaultProps,be)pe[se]===void 0&&(pe[se]=be[se]);return de(T,he,pe)},we.createRef=function(){return{current:null}},we.forwardRef=function(T){return{$$typeof:f,render:T}},we.isValidElement=B,we.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:Y}},we.memo=function(T,X){return{$$typeof:h,type:T,compare:X===void 0?null:X}},we.startTransition=function(T){var X=ee.T,C={};ee.T=C;try{var se=T(),pe=ee.S;pe!==null&&pe(C,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(O,le)}catch(he){le(he)}finally{X!==null&&C.types!==null&&(X.types=C.types),ee.T=X}},we.unstable_useCacheRefresh=function(){return ee.H.useCacheRefresh()},we.use=function(T){return ee.H.use(T)},we.useActionState=function(T,X,C){return ee.H.useActionState(T,X,C)},we.useCallback=function(T,X){return ee.H.useCallback(T,X)},we.useContext=function(T){return ee.H.useContext(T)},we.useDebugValue=function(){},we.useDeferredValue=function(T,X){return ee.H.useDeferredValue(T,X)},we.useEffect=function(T,X){return ee.H.useEffect(T,X)},we.useEffectEvent=function(T){return ee.H.useEffectEvent(T)},we.useId=function(){return ee.H.useId()},we.useImperativeHandle=function(T,X,C){return ee.H.useImperativeHandle(T,X,C)},we.useInsertionEffect=function(T,X){return ee.H.useInsertionEffect(T,X)},we.useLayoutEffect=function(T,X){return ee.H.useLayoutEffect(T,X)},we.useMemo=function(T,X){return ee.H.useMemo(T,X)},we.useOptimistic=function(T,X){return ee.H.useOptimistic(T,X)},we.useReducer=function(T,X,C){return ee.H.useReducer(T,X,C)},we.useRef=function(T){return ee.H.useRef(T)},we.useState=function(T){return ee.H.useState(T)},we.useSyncExternalStore=function(T,X,C){return ee.H.useSyncExternalStore(T,X,C)},we.useTransition=function(){return ee.H.useTransition()},we.version="19.2.3",we}var Gg;function Sd(){return Gg||(Gg=1,qh.exports=gx()),qh.exports}var ne=Sd();const vx=gu(ne);var Wh={exports:{}},Wl={},Yh={exports:{}},Vh={};/**
17
+ */var $g;function gx(){if($g)return we;$g=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),b=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=b&&T[b]||T["@@iterator"],typeof T=="function"?T:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function M(T,X,C){this.props=T,this.context=X,this.refs=N,this.updater=C||x}M.prototype.isReactComponent={},M.prototype.setState=function(T,X){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,X,"setState")},M.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function G(){}G.prototype=M.prototype;function U(T,X,C){this.props=T,this.context=X,this.refs=N,this.updater=C||x}var Q=U.prototype=new G;Q.constructor=U,E(Q,M.prototype),Q.isPureReactComponent=!0;var K=Array.isArray;function O(){}var ee={H:null,A:null,T:null,S:null},oe=Object.prototype.hasOwnProperty;function de(T,X,C){var se=C.ref;return{$$typeof:e,type:T,key:X,ref:se!==void 0?se:null,props:C}}function F(T,X){return de(T.type,X,T.props)}function B(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function D(T){var X={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(C){return X[C]})}var j=/\/+/g;function P(T,X){return typeof T=="object"&&T!==null&&T.key!=null?D(""+T.key):X.toString(36)}function L(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(O,O):(T.status="pending",T.then(function(X){T.status==="pending"&&(T.status="fulfilled",T.value=X)},function(X){T.status==="pending"&&(T.status="rejected",T.reason=X)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function A(T,X,C,se,pe){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var be=!1;if(T===null)be=!0;else switch(he){case"bigint":case"string":case"number":be=!0;break;case"object":switch(T.$$typeof){case e:case t:be=!0;break;case g:return be=T._init,A(be(T._payload),X,C,se,pe)}}if(be)return pe=pe(T),be=se===""?"."+P(T,0):se,K(pe)?(C="",be!=null&&(C=be.replace(j,"$&/")+"/"),A(pe,X,C,"",function(jt){return jt})):pe!=null&&(B(pe)&&(pe=F(pe,C+(pe.key==null||T&&T.key===pe.key?"":(""+pe.key).replace(j,"$&/")+"/")+be)),X.push(pe)),1;be=0;var Te=se===""?".":se+":";if(K(T))for(var Re=0;Re<T.length;Re++)se=T[Re],he=Te+P(se,Re),be+=A(se,X,C,he,pe);else if(Re=y(T),typeof Re=="function")for(T=Re.call(T),Re=0;!(se=T.next()).done;)se=se.value,he=Te+P(se,Re++),be+=A(se,X,C,he,pe);else if(he==="object"){if(typeof T.then=="function")return A(L(T),X,C,se,pe);throw X=String(T),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return be}function I(T,X,C){if(T==null)return T;var se=[],pe=0;return A(T,se,"","",function(he){return X.call(C,he,pe++)}),se}function Y(T){if(T._status===-1){var X=T._result;X=X(),X.then(function(C){(T._status===0||T._status===-1)&&(T._status=1,T._result=C)},function(C){(T._status===0||T._status===-1)&&(T._status=2,T._result=C)}),T._status===-1&&(T._status=0,T._result=X)}if(T._status===1)return T._result.default;throw T._result}var le=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},k={map:I,forEach:function(T,X,C){I(T,function(){X.apply(this,arguments)},C)},count:function(T){var X=0;return I(T,function(){X++}),X},toArray:function(T){return I(T,function(X){return X})||[]},only:function(T){if(!B(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return we.Activity=_,we.Children=k,we.Component=M,we.Fragment=n,we.Profiler=a,we.PureComponent=U,we.StrictMode=s,we.Suspense=p,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ee,we.__COMPILER_RUNTIME={__proto__:null,c:function(T){return ee.H.useMemoCache(T)}},we.cache=function(T){return function(){return T.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(T,X,C){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var se=E({},T.props),pe=T.key;if(X!=null)for(he in X.key!==void 0&&(pe=""+X.key),X)!oe.call(X,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&X.ref===void 0||(se[he]=X[he]);var he=arguments.length-2;if(he===1)se.children=C;else if(1<he){for(var be=Array(he),Te=0;Te<he;Te++)be[Te]=arguments[Te+2];se.children=be}return de(T.type,pe,se)},we.createContext=function(T){return T={$$typeof:c,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:o,_context:T},T},we.createElement=function(T,X,C){var se,pe={},he=null;if(X!=null)for(se in X.key!==void 0&&(he=""+X.key),X)oe.call(X,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(pe[se]=X[se]);var be=arguments.length-2;if(be===1)pe.children=C;else if(1<be){for(var Te=Array(be),Re=0;Re<be;Re++)Te[Re]=arguments[Re+2];pe.children=Te}if(T&&T.defaultProps)for(se in be=T.defaultProps,be)pe[se]===void 0&&(pe[se]=be[se]);return de(T,he,pe)},we.createRef=function(){return{current:null}},we.forwardRef=function(T){return{$$typeof:f,render:T}},we.isValidElement=B,we.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:Y}},we.memo=function(T,X){return{$$typeof:h,type:T,compare:X===void 0?null:X}},we.startTransition=function(T){var X=ee.T,C={};ee.T=C;try{var se=T(),pe=ee.S;pe!==null&&pe(C,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(O,le)}catch(he){le(he)}finally{X!==null&&C.types!==null&&(X.types=C.types),ee.T=X}},we.unstable_useCacheRefresh=function(){return ee.H.useCacheRefresh()},we.use=function(T){return ee.H.use(T)},we.useActionState=function(T,X,C){return ee.H.useActionState(T,X,C)},we.useCallback=function(T,X){return ee.H.useCallback(T,X)},we.useContext=function(T){return ee.H.useContext(T)},we.useDebugValue=function(){},we.useDeferredValue=function(T,X){return ee.H.useDeferredValue(T,X)},we.useEffect=function(T,X){return ee.H.useEffect(T,X)},we.useEffectEvent=function(T){return ee.H.useEffectEvent(T)},we.useId=function(){return ee.H.useId()},we.useImperativeHandle=function(T,X,C){return ee.H.useImperativeHandle(T,X,C)},we.useInsertionEffect=function(T,X){return ee.H.useInsertionEffect(T,X)},we.useLayoutEffect=function(T,X){return ee.H.useLayoutEffect(T,X)},we.useMemo=function(T,X){return ee.H.useMemo(T,X)},we.useOptimistic=function(T,X){return ee.H.useOptimistic(T,X)},we.useReducer=function(T,X,C){return ee.H.useReducer(T,X,C)},we.useRef=function(T){return ee.H.useRef(T)},we.useState=function(T){return ee.H.useState(T)},we.useSyncExternalStore=function(T,X,C){return ee.H.useSyncExternalStore(T,X,C)},we.useTransition=function(){return ee.H.useTransition()},we.version="19.2.3",we}var Gg;function Sd(){return Gg||(Gg=1,qh.exports=gx()),qh.exports}var ne=Sd();const vx=gu(ne);var Wh={exports:{}},Wl={},Yh={exports:{}},Vh={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -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 Zg;function yx(){return Zg||(Zg=1,(function(e){function t(A,I){var Y=A.length;A.push(I);e:for(;0<Y;){var le=Y-1>>>1,k=A[le];if(0<a(k,I))A[le]=I,A[Y]=k,Y=le;else break e}}function n(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var I=A[0],Y=A.pop();if(Y!==I){A[0]=Y;e:for(var le=0,k=A.length,T=k>>>1;le<T;){var X=2*(le+1)-1,C=A[X],se=X+1,pe=A[se];if(0>a(C,Y))se<k&&0>a(pe,C)?(A[le]=pe,A[se]=Y,le=se):(A[le]=C,A[X]=Y,le=X);else if(se<k&&0>a(pe,Y))A[le]=pe,A[se]=Y,le=se;else break e}}return I}function a(A,I){var Y=A.sortIndex-I.sortIndex;return Y!==0?Y:A.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var p=[],h=[],g=1,_=null,b=3,y=!1,x=!1,E=!1,N=!1,M=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function Q(A){for(var I=n(h);I!==null;){if(I.callback===null)s(h);else if(I.startTime<=A)s(h),I.sortIndex=I.expirationTime,t(p,I);else break;I=n(h)}}function K(A){if(E=!1,Q(A),!x)if(n(p)!==null)x=!0,O||(O=!0,D());else{var I=n(h);I!==null&&L(K,I.startTime-A)}}var O=!1,ee=-1,oe=5,de=-1;function q(){return N?!0:!(e.unstable_now()-de<oe)}function B(){if(N=!1,O){var A=e.unstable_now();de=A;var I=!0;try{e:{x=!1,E&&(E=!1,G(ee),ee=-1),y=!0;var Y=b;try{t:{for(Q(A),_=n(p);_!==null&&!(_.expirationTime>A&&q());){var le=_.callback;if(typeof le=="function"){_.callback=null,b=_.priorityLevel;var k=le(_.expirationTime<=A);if(A=e.unstable_now(),typeof k=="function"){_.callback=k,Q(A),I=!0;break t}_===n(p)&&s(p),Q(A)}else s(p);_=n(p)}if(_!==null)I=!0;else{var T=n(h);T!==null&&L(K,T.startTime-A),I=!1}}break e}finally{_=null,b=Y,y=!1}I=void 0}}finally{I?D():O=!1}}}var D;if(typeof U=="function")D=function(){U(B)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,P=j.port2;j.port1.onmessage=B,D=function(){P.postMessage(null)}}else D=function(){M(B,0)};function L(A,I){ee=M(function(){A(e.unstable_now())},I)}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(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oe=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(A){switch(b){case 1:case 2:case 3:var I=3;break;default:I=b}var Y=b;b=I;try{return A()}finally{b=Y}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(A,I){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var Y=b;b=A;try{return I()}finally{b=Y}},e.unstable_scheduleCallback=function(A,I,Y){var le=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?le+Y:le):Y=le,A){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=Y+k,A={id:g++,callback:I,priorityLevel:A,startTime:Y,expirationTime:k,sortIndex:-1},Y>le?(A.sortIndex=Y,t(h,A),n(p)===null&&A===n(h)&&(E?(G(ee),ee=-1):E=!0,L(K,Y-le))):(A.sortIndex=k,t(p,A),x||y||(x=!0,O||(O=!0,D()))),A},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(A){var I=b;return function(){var Y=b;b=I;try{return A.apply(this,arguments)}finally{b=Y}}}})(Vh)),Vh}var Qg;function bx(){return Qg||(Qg=1,Yh.exports=yx()),Yh.exports}var Kh={exports:{}},Vt={};/**
25
+ */var Zg;function yx(){return Zg||(Zg=1,(function(e){function t(A,I){var Y=A.length;A.push(I);e:for(;0<Y;){var le=Y-1>>>1,k=A[le];if(0<a(k,I))A[le]=I,A[Y]=k,Y=le;else break e}}function n(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var I=A[0],Y=A.pop();if(Y!==I){A[0]=Y;e:for(var le=0,k=A.length,T=k>>>1;le<T;){var X=2*(le+1)-1,C=A[X],se=X+1,pe=A[se];if(0>a(C,Y))se<k&&0>a(pe,C)?(A[le]=pe,A[se]=Y,le=se):(A[le]=C,A[X]=Y,le=X);else if(se<k&&0>a(pe,Y))A[le]=pe,A[se]=Y,le=se;else break e}}return I}function a(A,I){var Y=A.sortIndex-I.sortIndex;return Y!==0?Y:A.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var p=[],h=[],g=1,_=null,b=3,y=!1,x=!1,E=!1,N=!1,M=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function Q(A){for(var I=n(h);I!==null;){if(I.callback===null)s(h);else if(I.startTime<=A)s(h),I.sortIndex=I.expirationTime,t(p,I);else break;I=n(h)}}function K(A){if(E=!1,Q(A),!x)if(n(p)!==null)x=!0,O||(O=!0,D());else{var I=n(h);I!==null&&L(K,I.startTime-A)}}var O=!1,ee=-1,oe=5,de=-1;function F(){return N?!0:!(e.unstable_now()-de<oe)}function B(){if(N=!1,O){var A=e.unstable_now();de=A;var I=!0;try{e:{x=!1,E&&(E=!1,G(ee),ee=-1),y=!0;var Y=b;try{t:{for(Q(A),_=n(p);_!==null&&!(_.expirationTime>A&&F());){var le=_.callback;if(typeof le=="function"){_.callback=null,b=_.priorityLevel;var k=le(_.expirationTime<=A);if(A=e.unstable_now(),typeof k=="function"){_.callback=k,Q(A),I=!0;break t}_===n(p)&&s(p),Q(A)}else s(p);_=n(p)}if(_!==null)I=!0;else{var T=n(h);T!==null&&L(K,T.startTime-A),I=!1}}break e}finally{_=null,b=Y,y=!1}I=void 0}}finally{I?D():O=!1}}}var D;if(typeof U=="function")D=function(){U(B)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,P=j.port2;j.port1.onmessage=B,D=function(){P.postMessage(null)}}else D=function(){M(B,0)};function L(A,I){ee=M(function(){A(e.unstable_now())},I)}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(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oe=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(A){switch(b){case 1:case 2:case 3:var I=3;break;default:I=b}var Y=b;b=I;try{return A()}finally{b=Y}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(A,I){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var Y=b;b=A;try{return I()}finally{b=Y}},e.unstable_scheduleCallback=function(A,I,Y){var le=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?le+Y:le):Y=le,A){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=Y+k,A={id:g++,callback:I,priorityLevel:A,startTime:Y,expirationTime:k,sortIndex:-1},Y>le?(A.sortIndex=Y,t(h,A),n(p)===null&&A===n(h)&&(E?(G(ee),ee=-1):E=!0,L(K,Y-le))):(A.sortIndex=k,t(p,A),x||y||(x=!0,O||(O=!0,D()))),A},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(A){var I=b;return function(){var Y=b;b=I;try{return A.apply(this,arguments)}finally{b=Y}}}})(Vh)),Vh}var Qg;function bx(){return Qg||(Qg=1,Yh.exports=yx()),Yh.exports}var Kh={exports:{}},Vt={};/**
26
26
  * @license React
27
27
  * react-dom.production.js
28
28
  *
@@ -38,15 +38,15 @@
38
38
  *
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
- */var tv;function wx(){if(tv)return Wl;tv=1;var e=bx(),t=Sd(),n=xx();function s(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var r=i,l=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(l=r.return),i=r.return;while(i)}return r.tag===3?l:null}function c(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function f(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function p(i){if(o(i)!==i)throw Error(s(188))}function h(i){var r=i.alternate;if(!r){if(r=o(i),r===null)throw Error(s(188));return r!==i?null:i}for(var l=i,u=r;;){var d=l.return;if(d===null)break;var m=d.alternate;if(m===null){if(u=d.return,u!==null){l=u;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===l)return p(d),i;if(m===u)return p(d),r;m=m.sibling}throw Error(s(188))}if(l.return!==u.return)l=d,u=m;else{for(var v=!1,w=d.child;w;){if(w===l){v=!0,l=d,u=m;break}if(w===u){v=!0,u=d,l=m;break}w=w.sibling}if(!v){for(w=m.child;w;){if(w===l){v=!0,l=m,u=d;break}if(w===u){v=!0,u=m,l=d;break}w=w.sibling}if(!v)throw Error(s(189))}}if(l.alternate!==u)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?i:r}function g(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=g(i),r!==null)return r;i=i.sibling}return null}var _=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),U=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=B&&i[B]||i["@@iterator"],typeof i=="function"?i:null)}var j=Symbol.for("react.client.reference");function P(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===j?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case E:return"Fragment";case M:return"Profiler";case N:return"StrictMode";case K:return"Suspense";case O:return"SuspenseList";case de:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case U:return i.displayName||"Context";case G:return(i._context.displayName||"Context")+".Consumer";case Q:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ee:return r=i.displayName||null,r!==null?r:P(i.type)||"Memo";case oe:r=i._payload,i=i._init;try{return P(i(r))}catch{}}return null}var L=Array.isArray,A=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},le=[],k=-1;function T(i){return{current:i}}function X(i){0>k||(i.current=le[k],le[k]=null,k--)}function C(i,r){k++,le[k]=i.current,i.current=r}var se=T(null),pe=T(null),he=T(null),be=T(null);function Te(i,r){switch(C(he,r),C(pe,i),C(se,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?_g(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=_g(r),i=gg(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}X(se),C(se,i)}function Re(){X(se),X(pe),X(he)}function jt(i){i.memoizedState!==null&&C(be,i);var r=se.current,l=gg(r,i.type);r!==l&&(C(pe,i),C(se,l))}function Zt(i){pe.current===i&&(X(se),X(pe)),be.current===i&&(X(be),Ul._currentValue=Y)}var ai,He;function yi(i){if(ai===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);ai=r&&r[1]||"",He=-1<l.stack.indexOf(`
41
+ */var tv;function wx(){if(tv)return Wl;tv=1;var e=bx(),t=Sd(),n=xx();function s(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var r=i,l=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(l=r.return),i=r.return;while(i)}return r.tag===3?l:null}function c(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function f(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function p(i){if(o(i)!==i)throw Error(s(188))}function h(i){var r=i.alternate;if(!r){if(r=o(i),r===null)throw Error(s(188));return r!==i?null:i}for(var l=i,u=r;;){var d=l.return;if(d===null)break;var m=d.alternate;if(m===null){if(u=d.return,u!==null){l=u;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===l)return p(d),i;if(m===u)return p(d),r;m=m.sibling}throw Error(s(188))}if(l.return!==u.return)l=d,u=m;else{for(var v=!1,w=d.child;w;){if(w===l){v=!0,l=d,u=m;break}if(w===u){v=!0,u=d,l=m;break}w=w.sibling}if(!v){for(w=m.child;w;){if(w===l){v=!0,l=m,u=d;break}if(w===u){v=!0,u=m,l=d;break}w=w.sibling}if(!v)throw Error(s(189))}}if(l.alternate!==u)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?i:r}function g(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=g(i),r!==null)return r;i=i.sibling}return null}var _=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),U=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=B&&i[B]||i["@@iterator"],typeof i=="function"?i:null)}var j=Symbol.for("react.client.reference");function P(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===j?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case E:return"Fragment";case M:return"Profiler";case N:return"StrictMode";case K:return"Suspense";case O:return"SuspenseList";case de:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case U:return i.displayName||"Context";case G:return(i._context.displayName||"Context")+".Consumer";case Q:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ee:return r=i.displayName||null,r!==null?r:P(i.type)||"Memo";case oe:r=i._payload,i=i._init;try{return P(i(r))}catch{}}return null}var L=Array.isArray,A=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},le=[],k=-1;function T(i){return{current:i}}function X(i){0>k||(i.current=le[k],le[k]=null,k--)}function C(i,r){k++,le[k]=i.current,i.current=r}var se=T(null),pe=T(null),he=T(null),be=T(null);function Te(i,r){switch(C(he,r),C(pe,i),C(se,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?_g(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=_g(r),i=gg(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}X(se),C(se,i)}function Re(){X(se),X(pe),X(he)}function jt(i){i.memoizedState!==null&&C(be,i);var r=se.current,l=gg(r,i.type);r!==l&&(C(pe,i),C(se,l))}function Zt(i){pe.current===i&&(X(se),X(pe)),be.current===i&&(X(be),Ul._currentValue=Y)}var ai,He;function yi(i){if(ai===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);ai=r&&r[1]||"",He=-1<l.stack.indexOf(`
42
42
  at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
43
  `+ai+i+He}var Gr=!1;function Zr(i,r){if(!i||Gr)return"";Gr=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch($){var V=$}Reflect.construct(i,[],ie)}else{try{ie.call()}catch($){V=$}i.call(ie.prototype)}}else{try{throw Error()}catch($){V=$}(ie=i())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch($){if($&&V&&typeof $.stack=="string")return[$.stack,V.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=u.DetermineComponentFrameRoot(),v=m[0],w=m[1];if(v&&w){var R=v.split(`
44
44
  `),W=w.split(`
45
45
  `);for(d=u=0;u<R.length&&!R[u].includes("DetermineComponentFrameRoot");)u++;for(;d<W.length&&!W[d].includes("DetermineComponentFrameRoot");)d++;if(u===R.length||d===W.length)for(u=R.length-1,d=W.length-1;1<=u&&0<=d&&R[u]!==W[d];)d--;for(;1<=u&&0<=d;u--,d--)if(R[u]!==W[d]){if(u!==1||d!==1)do if(u--,d--,0>d||R[u]!==W[d]){var Z=`
46
46
  `+R[u].replace(" at new "," at ");return i.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",i.displayName)),Z}while(1<=u&&0<=d);break}}}finally{Gr=!1,Error.prepareStackTrace=l}return(l=i?i.displayName||i.name:"")?yi(l):""}function Ca(i,r){switch(i.tag){case 26:case 27:case 5:return yi(i.type);case 16:return yi("Lazy");case 13:return i.child!==r&&r!==null?yi("Suspense Fallback"):yi("Suspense");case 19:return yi("SuspenseList");case 0:case 15:return Zr(i.type,!1);case 11:return Zr(i.type.render,!1);case 1:return Zr(i.type,!0);case 31:return yi("Activity");default:return""}}function ka(i){try{var r="",l=null;do r+=Ca(i,l),l=i,i=i.return;while(i);return r}catch(u){return`
47
47
  Error generating stack: `+u.message+`
48
- `+u.stack}}var Qr=Object.prototype.hasOwnProperty,Jr=e.unstable_scheduleCallback,Zs=e.unstable_cancelCallback,Tu=e.unstable_shouldYield,Au=e.unstable_requestPaint,Qt=e.unstable_now,Du=e.unstable_getCurrentPriorityLevel,J=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,Me=e.unstable_LowPriority,qe=e.unstable_IdlePriority,bi=e.log,fn=e.unstable_setDisableYieldValue,Jt=null,xt=null;function oi(i){if(typeof bi=="function"&&fn(i),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(Jt,i)}catch{}}var Ge=Math.clz32?Math.clz32:t0,Hn=Math.log,Ki=Math.LN2;function t0(i){return i>>>=0,i===0?32:31-(Hn(i)/Ki|0)|0}var Ea=256,Ta=262144,Aa=4194304;function yr(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Da(i,r,l){var u=i.pendingLanes;if(u===0)return 0;var d=0,m=i.suspendedLanes,v=i.pingedLanes;i=i.warmLanes;var w=u&134217727;return w!==0?(u=w&~m,u!==0?d=yr(u):(v&=w,v!==0?d=yr(v):l||(l=w&~i,l!==0&&(d=yr(l))))):(w=u&~m,w!==0?d=yr(w):v!==0?d=yr(v):l||(l=u&~i,l!==0&&(d=yr(l)))),d===0?0:r!==0&&r!==d&&(r&m)===0&&(m=d&-d,l=r&-r,m>=l||m===32&&(l&4194048)!==0)?r:d}function Qs(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function i0(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zd(){var i=Aa;return Aa<<=1,(Aa&62914560)===0&&(Aa=4194304),i}function Ru(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function Js(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function n0(i,r,l,u,d,m){var v=i.pendingLanes;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=l,i.entangledLanes&=l,i.errorRecoveryDisabledLanes&=l,i.shellSuspendCounter=0;var w=i.entanglements,R=i.expirationTimes,W=i.hiddenUpdates;for(l=v&~l;0<l;){var Z=31-Ge(l),ie=1<<Z;w[Z]=0,R[Z]=-1;var V=W[Z];if(V!==null)for(W[Z]=null,Z=0;Z<V.length;Z++){var $=V[Z];$!==null&&($.lane&=-536870913)}l&=~ie}u!==0&&Qd(i,u,0),m!==0&&d===0&&i.tag!==0&&(i.suspendedLanes|=m&~(v&~r))}function Qd(i,r,l){i.pendingLanes|=r,i.suspendedLanes&=~r;var u=31-Ge(r);i.entangledLanes|=r,i.entanglements[u]=i.entanglements[u]|1073741824|l&261930}function Jd(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var u=31-Ge(l),d=1<<u;d&r|i[u]&r&&(i[u]|=r),l&=~d}}function ep(i,r){var l=r&-r;return l=(l&42)!==0?1:Mu(l),(l&(i.suspendedLanes|r))!==0?0:l}function Mu(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Bu(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function tp(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:Pg(i.type))}function ip(i,r){var l=I.p;try{return I.p=i,r()}finally{I.p=l}}var Un=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Un,ui="__reactProps$"+Un,es="__reactContainer$"+Un,Nu="__reactEvents$"+Un,r0="__reactListeners$"+Un,s0="__reactHandles$"+Un,np="__reactResources$"+Un,el="__reactMarker$"+Un;function Lu(i){delete i[Ht],delete i[ui],delete i[Nu],delete i[r0],delete i[s0]}function ts(i){var r=i[Ht];if(r)return r;for(var l=i.parentNode;l;){if(r=l[es]||l[Ht]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=Cg(i);i!==null;){if(l=i[Ht])return l;i=Cg(i)}return r}i=l,l=i.parentNode}return null}function is(i){if(i=i[Ht]||i[es]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function tl(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(s(33))}function ns(i){var r=i[np];return r||(r=i[np]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Tt(i){i[el]=!0}var rp=new Set,sp={};function br(i,r){rs(i,r),rs(i+"Capture",r)}function rs(i,r){for(sp[i]=r,i=0;i<r.length;i++)rp.add(r[i])}var l0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lp={},ap={};function a0(i){return Qr.call(ap,i)?!0:Qr.call(lp,i)?!1:l0.test(i)?ap[i]=!0:(lp[i]=!0,!1)}function Ra(i,r,l){if(a0(r))if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+l)}}function Ma(i,r,l){if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+l)}}function dn(i,r,l,u){if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttributeNS(r,l,""+u)}}function Bi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function op(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function o0(i,r,l){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var d=u.get,m=u.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return d.call(this)},set:function(v){l=""+v,m.call(this,v)}}),Object.defineProperty(i,r,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function zu(i){if(!i._valueTracker){var r=op(i)?"checked":"value";i._valueTracker=o0(i,r,""+i[r])}}function up(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),u="";return i&&(u=op(i)?i.checked?"true":"false":i.value),i=u,i!==l?(r.setValue(i),!0):!1}function Ba(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var u0=/[\n"\\]/g;function Ni(i){return i.replace(u0,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ou(i,r,l,u,d,m,v,w){i.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?i.type=v:i.removeAttribute("type"),r!=null?v==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Bi(r)):i.value!==""+Bi(r)&&(i.value=""+Bi(r)):v!=="submit"&&v!=="reset"||i.removeAttribute("value"),r!=null?ju(i,v,Bi(r)):l!=null?ju(i,v,Bi(l)):u!=null&&i.removeAttribute("value"),d==null&&m!=null&&(i.defaultChecked=!!m),d!=null&&(i.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+Bi(w):i.removeAttribute("name")}function cp(i,r,l,u,d,m,v,w){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(i.type=m),r!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){zu(i);return}l=l!=null?""+Bi(l):"",r=r!=null?""+Bi(r):l,w||r===i.value||(i.value=r),i.defaultValue=r}u=u??d,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=w?i.checked:!!u,i.defaultChecked=!!u,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.name=v),zu(i)}function ju(i,r,l){r==="number"&&Ba(i.ownerDocument)===i||i.defaultValue===""+l||(i.defaultValue=""+l)}function ss(i,r,l,u){if(i=i.options,r){r={};for(var d=0;d<l.length;d++)r["$"+l[d]]=!0;for(l=0;l<i.length;l++)d=r.hasOwnProperty("$"+i[l].value),i[l].selected!==d&&(i[l].selected=d),d&&u&&(i[l].defaultSelected=!0)}else{for(l=""+Bi(l),r=null,d=0;d<i.length;d++){if(i[d].value===l){i[d].selected=!0,u&&(i[d].defaultSelected=!0);return}r!==null||i[d].disabled||(r=i[d])}r!==null&&(r.selected=!0)}}function hp(i,r,l){if(r!=null&&(r=""+Bi(r),r!==i.value&&(i.value=r),l==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=l!=null?""+Bi(l):""}function fp(i,r,l,u){if(r==null){if(u!=null){if(l!=null)throw Error(s(92));if(L(u)){if(1<u.length)throw Error(s(93));u=u[0]}l=u}l==null&&(l=""),r=l}l=Bi(r),i.defaultValue=l,u=i.textContent,u===l&&u!==""&&u!==null&&(i.value=u),zu(i)}function ls(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var c0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dp(i,r,l){var u=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":u?i.setProperty(r,l):typeof l!="number"||l===0||c0.has(r)?r==="float"?i.cssFloat=l:i[r]=(""+l).trim():i[r]=l+"px"}function pp(i,r,l){if(r!=null&&typeof r!="object")throw Error(s(62));if(i=i.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var d in r)u=r[d],r.hasOwnProperty(d)&&l[d]!==u&&dp(i,d,u)}else for(var m in r)r.hasOwnProperty(m)&&dp(i,m,r[m])}function Hu(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var h0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),f0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Na(i){return f0.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function pn(){}var Uu=null;function Pu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var as=null,os=null;function mp(i){var r=is(i);if(r&&(i=r.stateNode)){var l=i[ui]||null;e:switch(i=r.stateNode,r.type){case"input":if(Ou(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ni(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var u=l[r];if(u!==i&&u.form===i.form){var d=u[ui]||null;if(!d)throw Error(s(90));Ou(u,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<l.length;r++)u=l[r],u.form===i.form&&up(u)}break e;case"textarea":hp(i,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&ss(i,!!l.multiple,r,!1)}}}var Iu=!1;function _p(i,r,l){if(Iu)return i(r,l);Iu=!0;try{var u=i(r);return u}finally{if(Iu=!1,(as!==null||os!==null)&&(So(),as&&(r=as,i=os,os=as=null,mp(r),i)))for(r=0;r<i.length;r++)mp(i[r])}}function il(i,r){var l=i.stateNode;if(l===null)return null;var u=l[ui]||null;if(u===null)return null;l=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(s(231,r,typeof l));return l}var mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fu=!1;if(mn)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{Fu=!1}var Pn=null,qu=null,La=null;function gp(){if(La)return La;var i,r=qu,l=r.length,u,d="value"in Pn?Pn.value:Pn.textContent,m=d.length;for(i=0;i<l&&r[i]===d[i];i++);var v=l-i;for(u=1;u<=v&&r[l-u]===d[m-u];u++);return La=d.slice(i,1<u?1-u:void 0)}function za(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Oa(){return!0}function vp(){return!1}function ci(i){function r(l,u,d,m,v){this._reactName=l,this._targetInst=d,this.type=u,this.nativeEvent=m,this.target=v,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(l=i[w],this[w]=l?l(m):m[w]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Oa:vp,this.isPropagationStopped=vp,this}return _(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Oa)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Oa)},persist:function(){},isPersistent:Oa}),r}var Sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ja=ci(Sr),rl=_({},Sr,{view:0,detail:0}),d0=ci(rl),Wu,Yu,sl,Ha=_({},rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ku,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==sl&&(sl&&i.type==="mousemove"?(Wu=i.screenX-sl.screenX,Yu=i.screenY-sl.screenY):Yu=Wu=0,sl=i),Wu)},movementY:function(i){return"movementY"in i?i.movementY:Yu}}),yp=ci(Ha),p0=_({},Ha,{dataTransfer:0}),m0=ci(p0),_0=_({},rl,{relatedTarget:0}),Vu=ci(_0),g0=_({},Sr,{animationName:0,elapsedTime:0,pseudoElement:0}),v0=ci(g0),y0=_({},Sr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),b0=ci(y0),S0=_({},Sr,{data:0}),bp=ci(S0),x0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w0={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"},C0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function k0(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=C0[i])?!!r[i]:!1}function Ku(){return k0}var E0=_({},rl,{key:function(i){if(i.key){var r=x0[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=za(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?w0[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ku,charCode:function(i){return i.type==="keypress"?za(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?za(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),T0=ci(E0),A0=_({},Ha,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sp=ci(A0),D0=_({},rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ku}),R0=ci(D0),M0=_({},Sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),B0=ci(M0),N0=_({},Ha,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),L0=ci(N0),z0=_({},Sr,{newState:0,oldState:0}),O0=ci(z0),j0=[9,13,27,32],Xu=mn&&"CompositionEvent"in window,ll=null;mn&&"documentMode"in document&&(ll=document.documentMode);var H0=mn&&"TextEvent"in window&&!ll,xp=mn&&(!Xu||ll&&8<ll&&11>=ll),wp=" ",Cp=!1;function kp(i,r){switch(i){case"keyup":return j0.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ep(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var us=!1;function U0(i,r){switch(i){case"compositionend":return Ep(r);case"keypress":return r.which!==32?null:(Cp=!0,wp);case"textInput":return i=r.data,i===wp&&Cp?null:i;default:return null}}function P0(i,r){if(us)return i==="compositionend"||!Xu&&kp(i,r)?(i=gp(),La=qu=Pn=null,us=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return xp&&r.locale!=="ko"?null:r.data;default:return null}}var I0={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 Tp(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!I0[i.type]:r==="textarea"}function Ap(i,r,l,u){as?os?os.push(u):os=[u]:as=u,r=Ao(r,"onChange"),0<r.length&&(l=new ja("onChange","change",null,l,u),i.push({event:l,listeners:r}))}var al=null,ol=null;function F0(i){cg(i,0)}function Ua(i){var r=tl(i);if(up(r))return i}function Dp(i,r){if(i==="change")return r}var Rp=!1;if(mn){var $u;if(mn){var Gu="oninput"in document;if(!Gu){var Mp=document.createElement("div");Mp.setAttribute("oninput","return;"),Gu=typeof Mp.oninput=="function"}$u=Gu}else $u=!1;Rp=$u&&(!document.documentMode||9<document.documentMode)}function Bp(){al&&(al.detachEvent("onpropertychange",Np),ol=al=null)}function Np(i){if(i.propertyName==="value"&&Ua(ol)){var r=[];Ap(r,ol,i,Pu(i)),_p(F0,r)}}function q0(i,r,l){i==="focusin"?(Bp(),al=r,ol=l,al.attachEvent("onpropertychange",Np)):i==="focusout"&&Bp()}function W0(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ua(ol)}function Y0(i,r){if(i==="click")return Ua(r)}function V0(i,r){if(i==="input"||i==="change")return Ua(r)}function K0(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var Si=typeof Object.is=="function"?Object.is:K0;function ul(i,r){if(Si(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),u=Object.keys(r);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var d=l[u];if(!Qr.call(r,d)||!Si(i[d],r[d]))return!1}return!0}function Lp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function zp(i,r){var l=Lp(i);i=0;for(var u;l;){if(l.nodeType===3){if(u=i+l.textContent.length,i<=r&&u>=r)return{node:l,offset:r-i};i=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Lp(l)}}function Op(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?Op(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function jp(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Ba(i.document);r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=Ba(i.document)}return r}function Zu(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var X0=mn&&"documentMode"in document&&11>=document.documentMode,cs=null,Qu=null,cl=null,Ju=!1;function Hp(i,r,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ju||cs==null||cs!==Ba(u)||(u=cs,"selectionStart"in u&&Zu(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),cl&&ul(cl,u)||(cl=u,u=Ao(Qu,"onSelect"),0<u.length&&(r=new ja("onSelect","select",null,r,l),i.push({event:r,listeners:u}),r.target=cs)))}function xr(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var hs={animationend:xr("Animation","AnimationEnd"),animationiteration:xr("Animation","AnimationIteration"),animationstart:xr("Animation","AnimationStart"),transitionrun:xr("Transition","TransitionRun"),transitionstart:xr("Transition","TransitionStart"),transitioncancel:xr("Transition","TransitionCancel"),transitionend:xr("Transition","TransitionEnd")},ec={},Up={};mn&&(Up=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function wr(i){if(ec[i])return ec[i];if(!hs[i])return i;var r=hs[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in Up)return ec[i]=r[l];return i}var Pp=wr("animationend"),Ip=wr("animationiteration"),Fp=wr("animationstart"),$0=wr("transitionrun"),G0=wr("transitionstart"),Z0=wr("transitioncancel"),qp=wr("transitionend"),Wp=new Map,tc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");tc.push("scrollEnd");function Xi(i,r){Wp.set(i,r),br(r,[i])}var Pa=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Li=[],fs=0,ic=0;function Ia(){for(var i=fs,r=ic=fs=0;r<i;){var l=Li[r];Li[r++]=null;var u=Li[r];Li[r++]=null;var d=Li[r];Li[r++]=null;var m=Li[r];if(Li[r++]=null,u!==null&&d!==null){var v=u.pending;v===null?d.next=d:(d.next=v.next,v.next=d),u.pending=d}m!==0&&Yp(l,d,m)}}function Fa(i,r,l,u){Li[fs++]=i,Li[fs++]=r,Li[fs++]=l,Li[fs++]=u,ic|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function nc(i,r,l,u){return Fa(i,r,l,u),qa(i)}function Cr(i,r){return Fa(i,null,null,r),qa(i)}function Yp(i,r,l){i.lanes|=l;var u=i.alternate;u!==null&&(u.lanes|=l);for(var d=!1,m=i.return;m!==null;)m.childLanes|=l,u=m.alternate,u!==null&&(u.childLanes|=l),m.tag===22&&(i=m.stateNode,i===null||i._visibility&1||(d=!0)),i=m,m=m.return;return i.tag===3?(m=i.stateNode,d&&r!==null&&(d=31-Ge(l),i=m.hiddenUpdates,u=i[d],u===null?i[d]=[r]:u.push(r),r.lane=l|536870912),m):null}function qa(i){if(50<Bl)throw Bl=0,fh=null,Error(s(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var ds={};function Q0(i,r,l,u){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xi(i,r,l,u){return new Q0(i,r,l,u)}function rc(i){return i=i.prototype,!(!i||!i.isReactComponent)}function _n(i,r){var l=i.alternate;return l===null?(l=xi(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&65011712,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l.refCleanup=i.refCleanup,l}function Vp(i,r){i.flags&=65011714;var l=i.alternate;return l===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,r=l.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Wa(i,r,l,u,d,m){var v=0;if(u=i,typeof i=="function")rc(i)&&(v=1);else if(typeof i=="string")v=nx(i,l,se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case de:return i=xi(31,l,r,d),i.elementType=de,i.lanes=m,i;case E:return kr(l.children,d,m,r);case N:v=8,d|=24;break;case M:return i=xi(12,l,r,d|2),i.elementType=M,i.lanes=m,i;case K:return i=xi(13,l,r,d),i.elementType=K,i.lanes=m,i;case O:return i=xi(19,l,r,d),i.elementType=O,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case U:v=10;break e;case G:v=9;break e;case Q:v=11;break e;case ee:v=14;break e;case oe:v=16,u=null;break e}v=29,l=Error(s(130,i===null?"null":typeof i,"")),u=null}return r=xi(v,l,r,d),r.elementType=i,r.type=u,r.lanes=m,r}function kr(i,r,l,u){return i=xi(7,i,u,r),i.lanes=l,i}function sc(i,r,l){return i=xi(6,i,null,r),i.lanes=l,i}function Kp(i){var r=xi(18,null,null,0);return r.stateNode=i,r}function lc(i,r,l){return r=xi(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var Xp=new WeakMap;function zi(i,r){if(typeof i=="object"&&i!==null){var l=Xp.get(i);return l!==void 0?l:(r={value:i,source:r,stack:ka(r)},Xp.set(i,r),r)}return{value:i,source:r,stack:ka(r)}}var ps=[],ms=0,Ya=null,hl=0,Oi=[],ji=0,In=null,Ji=1,en="";function gn(i,r){ps[ms++]=hl,ps[ms++]=Ya,Ya=i,hl=r}function $p(i,r,l){Oi[ji++]=Ji,Oi[ji++]=en,Oi[ji++]=In,In=i;var u=Ji;i=en;var d=32-Ge(u)-1;u&=~(1<<d),l+=1;var m=32-Ge(r)+d;if(30<m){var v=d-d%5;m=(u&(1<<v)-1).toString(32),u>>=v,d-=v,Ji=1<<32-Ge(r)+d|l<<d|u,en=m+i}else Ji=1<<m|l<<d|u,en=i}function ac(i){i.return!==null&&(gn(i,1),$p(i,1,0))}function oc(i){for(;i===Ya;)Ya=ps[--ms],ps[ms]=null,hl=ps[--ms],ps[ms]=null;for(;i===In;)In=Oi[--ji],Oi[ji]=null,en=Oi[--ji],Oi[ji]=null,Ji=Oi[--ji],Oi[ji]=null}function Gp(i,r){Oi[ji++]=Ji,Oi[ji++]=en,Oi[ji++]=In,Ji=r.id,en=r.overflow,In=i}var Ut=null,et=null,je=!1,Fn=null,Hi=!1,uc=Error(s(519));function qn(i){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fl(zi(r,i)),uc}function Zp(i){var r=i.stateNode,l=i.type,u=i.memoizedProps;switch(r[Ht]=i,r[ui]=u,l){case"dialog":Ne("cancel",r),Ne("close",r);break;case"iframe":case"object":case"embed":Ne("load",r);break;case"video":case"audio":for(l=0;l<Ll.length;l++)Ne(Ll[l],r);break;case"source":Ne("error",r);break;case"img":case"image":case"link":Ne("error",r),Ne("load",r);break;case"details":Ne("toggle",r);break;case"input":Ne("invalid",r),cp(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ne("invalid",r);break;case"textarea":Ne("invalid",r),fp(r,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||u.suppressHydrationWarning===!0||pg(r.textContent,l)?(u.popover!=null&&(Ne("beforetoggle",r),Ne("toggle",r)),u.onScroll!=null&&Ne("scroll",r),u.onScrollEnd!=null&&Ne("scrollend",r),u.onClick!=null&&(r.onclick=pn),r=!0):r=!1,r||qn(i,!0)}function Qp(i){for(Ut=i.return;Ut;)switch(Ut.tag){case 5:case 31:case 13:Hi=!1;return;case 27:case 3:Hi=!0;return;default:Ut=Ut.return}}function _s(i){if(i!==Ut)return!1;if(!je)return Qp(i),je=!0,!1;var r=i.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=i.type,l=!(l!=="form"&&l!=="button")||Th(i.type,i.memoizedProps)),l=!l),l&&et&&qn(i),Qp(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));et=wg(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));et=wg(i)}else r===27?(r=et,nr(i.type)?(i=Bh,Bh=null,et=i):et=r):et=Ut?Pi(i.stateNode.nextSibling):null;return!0}function Er(){et=Ut=null,je=!1}function cc(){var i=Fn;return i!==null&&(pi===null?pi=i:pi.push.apply(pi,i),Fn=null),i}function fl(i){Fn===null?Fn=[i]:Fn.push(i)}var hc=T(null),Tr=null,vn=null;function Wn(i,r,l){C(hc,r._currentValue),r._currentValue=l}function yn(i){i._currentValue=hc.current,X(hc)}function fc(i,r,l){for(;i!==null;){var u=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),i===l)break;i=i.return}}function dc(i,r,l,u){var d=i.child;for(d!==null&&(d.return=i);d!==null;){var m=d.dependencies;if(m!==null){var v=d.child;m=m.firstContext;e:for(;m!==null;){var w=m;m=d;for(var R=0;R<r.length;R++)if(w.context===r[R]){m.lanes|=l,w=m.alternate,w!==null&&(w.lanes|=l),fc(m.return,l,i),u||(v=null);break e}m=w.next}}else if(d.tag===18){if(v=d.return,v===null)throw Error(s(341));v.lanes|=l,m=v.alternate,m!==null&&(m.lanes|=l),fc(v,l,i),v=null}else v=d.child;if(v!==null)v.return=d;else for(v=d;v!==null;){if(v===i){v=null;break}if(d=v.sibling,d!==null){d.return=v.return,v=d;break}v=v.return}d=v}}function gs(i,r,l,u){i=null;for(var d=r,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var v=d.alternate;if(v===null)throw Error(s(387));if(v=v.memoizedProps,v!==null){var w=d.type;Si(d.pendingProps.value,v.value)||(i!==null?i.push(w):i=[w])}}else if(d===be.current){if(v=d.alternate,v===null)throw Error(s(387));v.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(i!==null?i.push(Ul):i=[Ul])}d=d.return}i!==null&&dc(r,i,l,u),r.flags|=262144}function Va(i){for(i=i.firstContext;i!==null;){if(!Si(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ar(i){Tr=i,vn=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Pt(i){return Jp(Tr,i)}function Ka(i,r){return Tr===null&&Ar(i),Jp(i,r)}function Jp(i,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},vn===null){if(i===null)throw Error(s(308));vn=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else vn=vn.next=r;return l}var J0=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(l,u){i.push(u)}};this.abort=function(){r.aborted=!0,i.forEach(function(l){return l()})}},e1=e.unstable_scheduleCallback,t1=e.unstable_NormalPriority,mt={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pc(){return{controller:new J0,data:new Map,refCount:0}}function dl(i){i.refCount--,i.refCount===0&&e1(t1,function(){i.controller.abort()})}var pl=null,mc=0,vs=0,ys=null;function i1(i,r){if(pl===null){var l=pl=[];mc=0,vs=vh(),ys={status:"pending",value:void 0,then:function(u){l.push(u)}}}return mc++,r.then(em,em),r}function em(){if(--mc===0&&pl!==null){ys!==null&&(ys.status="fulfilled");var i=pl;pl=null,vs=0,ys=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function n1(i,r){var l=[],u={status:"pending",value:null,reason:null,then:function(d){l.push(d)}};return i.then(function(){u.status="fulfilled",u.value=r;for(var d=0;d<l.length;d++)(0,l[d])(r)},function(d){for(u.status="rejected",u.reason=d,d=0;d<l.length;d++)(0,l[d])(void 0)}),u}var tm=A.S;A.S=function(i,r){H_=Qt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&i1(i,r),tm!==null&&tm(i,r)};var Dr=T(null);function _c(){var i=Dr.current;return i!==null?i:Ze.pooledCache}function Xa(i,r){r===null?C(Dr,Dr.current):C(Dr,r.pool)}function im(){var i=_c();return i===null?null:{parent:mt._currentValue,pool:i}}var bs=Error(s(460)),gc=Error(s(474)),$a=Error(s(542)),Ga={then:function(){}};function nm(i){return i=i.status,i==="fulfilled"||i==="rejected"}function rm(i,r,l){switch(l=i[l],l===void 0?i.push(r):l!==r&&(r.then(pn,pn),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,lm(i),i;default:if(typeof r.status=="string")r.then(pn,pn);else{if(i=Ze,i!==null&&100<i.shellSuspendCounter)throw Error(s(482));i=r,i.status="pending",i.then(function(u){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=u}},function(u){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,lm(i),i}throw Mr=r,bs}}function Rr(i){try{var r=i._init;return r(i._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Mr=l,bs):l}}var Mr=null;function sm(){if(Mr===null)throw Error(s(459));var i=Mr;return Mr=null,i}function lm(i){if(i===bs||i===$a)throw Error(s(483))}var Ss=null,ml=0;function Za(i){var r=ml;return ml+=1,Ss===null&&(Ss=[]),rm(Ss,i,r)}function _l(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Qa(i,r){throw r.$$typeof===b?Error(s(525)):(i=Object.prototype.toString.call(r),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function am(i){function r(H,z){if(i){var F=H.deletions;F===null?(H.deletions=[z],H.flags|=16):F.push(z)}}function l(H,z){if(!i)return null;for(;z!==null;)r(H,z),z=z.sibling;return null}function u(H){for(var z=new Map;H!==null;)H.key!==null?z.set(H.key,H):z.set(H.index,H),H=H.sibling;return z}function d(H,z){return H=_n(H,z),H.index=0,H.sibling=null,H}function m(H,z,F){return H.index=F,i?(F=H.alternate,F!==null?(F=F.index,F<z?(H.flags|=67108866,z):F):(H.flags|=67108866,z)):(H.flags|=1048576,z)}function v(H){return i&&H.alternate===null&&(H.flags|=67108866),H}function w(H,z,F,te){return z===null||z.tag!==6?(z=sc(F,H.mode,te),z.return=H,z):(z=d(z,F),z.return=H,z)}function R(H,z,F,te){var ge=F.type;return ge===E?Z(H,z,F.props.children,te,F.key):z!==null&&(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===oe&&Rr(ge)===z.type)?(z=d(z,F.props),_l(z,F),z.return=H,z):(z=Wa(F.type,F.key,F.props,null,H.mode,te),_l(z,F),z.return=H,z)}function W(H,z,F,te){return z===null||z.tag!==4||z.stateNode.containerInfo!==F.containerInfo||z.stateNode.implementation!==F.implementation?(z=lc(F,H.mode,te),z.return=H,z):(z=d(z,F.children||[]),z.return=H,z)}function Z(H,z,F,te,ge){return z===null||z.tag!==7?(z=kr(F,H.mode,te,ge),z.return=H,z):(z=d(z,F),z.return=H,z)}function ie(H,z,F){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=sc(""+z,H.mode,F),z.return=H,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case y:return F=Wa(z.type,z.key,z.props,null,H.mode,F),_l(F,z),F.return=H,F;case x:return z=lc(z,H.mode,F),z.return=H,z;case oe:return z=Rr(z),ie(H,z,F)}if(L(z)||D(z))return z=kr(z,H.mode,F,null),z.return=H,z;if(typeof z.then=="function")return ie(H,Za(z),F);if(z.$$typeof===U)return ie(H,Ka(H,z),F);Qa(H,z)}return null}function V(H,z,F,te){var ge=z!==null?z.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return ge!==null?null:w(H,z,""+F,te);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case y:return F.key===ge?R(H,z,F,te):null;case x:return F.key===ge?W(H,z,F,te):null;case oe:return F=Rr(F),V(H,z,F,te)}if(L(F)||D(F))return ge!==null?null:Z(H,z,F,te,null);if(typeof F.then=="function")return V(H,z,Za(F),te);if(F.$$typeof===U)return V(H,z,Ka(H,F),te);Qa(H,F)}return null}function $(H,z,F,te,ge){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return H=H.get(F)||null,w(z,H,""+te,ge);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return H=H.get(te.key===null?F:te.key)||null,R(z,H,te,ge);case x:return H=H.get(te.key===null?F:te.key)||null,W(z,H,te,ge);case oe:return te=Rr(te),$(H,z,F,te,ge)}if(L(te)||D(te))return H=H.get(F)||null,Z(z,H,te,ge,null);if(typeof te.then=="function")return $(H,z,F,Za(te),ge);if(te.$$typeof===U)return $(H,z,F,Ka(z,te),ge);Qa(z,te)}return null}function me(H,z,F,te){for(var ge=null,Pe=null,_e=z,ke=z=0,Oe=null;_e!==null&&ke<F.length;ke++){_e.index>ke?(Oe=_e,_e=null):Oe=_e.sibling;var Ie=V(H,_e,F[ke],te);if(Ie===null){_e===null&&(_e=Oe);break}i&&_e&&Ie.alternate===null&&r(H,_e),z=m(Ie,z,ke),Pe===null?ge=Ie:Pe.sibling=Ie,Pe=Ie,_e=Oe}if(ke===F.length)return l(H,_e),je&&gn(H,ke),ge;if(_e===null){for(;ke<F.length;ke++)_e=ie(H,F[ke],te),_e!==null&&(z=m(_e,z,ke),Pe===null?ge=_e:Pe.sibling=_e,Pe=_e);return je&&gn(H,ke),ge}for(_e=u(_e);ke<F.length;ke++)Oe=$(_e,H,ke,F[ke],te),Oe!==null&&(i&&Oe.alternate!==null&&_e.delete(Oe.key===null?ke:Oe.key),z=m(Oe,z,ke),Pe===null?ge=Oe:Pe.sibling=Oe,Pe=Oe);return i&&_e.forEach(function(or){return r(H,or)}),je&&gn(H,ke),ge}function ye(H,z,F,te){if(F==null)throw Error(s(151));for(var ge=null,Pe=null,_e=z,ke=z=0,Oe=null,Ie=F.next();_e!==null&&!Ie.done;ke++,Ie=F.next()){_e.index>ke?(Oe=_e,_e=null):Oe=_e.sibling;var or=V(H,_e,Ie.value,te);if(or===null){_e===null&&(_e=Oe);break}i&&_e&&or.alternate===null&&r(H,_e),z=m(or,z,ke),Pe===null?ge=or:Pe.sibling=or,Pe=or,_e=Oe}if(Ie.done)return l(H,_e),je&&gn(H,ke),ge;if(_e===null){for(;!Ie.done;ke++,Ie=F.next())Ie=ie(H,Ie.value,te),Ie!==null&&(z=m(Ie,z,ke),Pe===null?ge=Ie:Pe.sibling=Ie,Pe=Ie);return je&&gn(H,ke),ge}for(_e=u(_e);!Ie.done;ke++,Ie=F.next())Ie=$(_e,H,ke,Ie.value,te),Ie!==null&&(i&&Ie.alternate!==null&&_e.delete(Ie.key===null?ke:Ie.key),z=m(Ie,z,ke),Pe===null?ge=Ie:Pe.sibling=Ie,Pe=Ie);return i&&_e.forEach(function(px){return r(H,px)}),je&&gn(H,ke),ge}function Xe(H,z,F,te){if(typeof F=="object"&&F!==null&&F.type===E&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case y:e:{for(var ge=F.key;z!==null;){if(z.key===ge){if(ge=F.type,ge===E){if(z.tag===7){l(H,z.sibling),te=d(z,F.props.children),te.return=H,H=te;break e}}else if(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===oe&&Rr(ge)===z.type){l(H,z.sibling),te=d(z,F.props),_l(te,F),te.return=H,H=te;break e}l(H,z);break}else r(H,z);z=z.sibling}F.type===E?(te=kr(F.props.children,H.mode,te,F.key),te.return=H,H=te):(te=Wa(F.type,F.key,F.props,null,H.mode,te),_l(te,F),te.return=H,H=te)}return v(H);case x:e:{for(ge=F.key;z!==null;){if(z.key===ge)if(z.tag===4&&z.stateNode.containerInfo===F.containerInfo&&z.stateNode.implementation===F.implementation){l(H,z.sibling),te=d(z,F.children||[]),te.return=H,H=te;break e}else{l(H,z);break}else r(H,z);z=z.sibling}te=lc(F,H.mode,te),te.return=H,H=te}return v(H);case oe:return F=Rr(F),Xe(H,z,F,te)}if(L(F))return me(H,z,F,te);if(D(F)){if(ge=D(F),typeof ge!="function")throw Error(s(150));return F=ge.call(F),ye(H,z,F,te)}if(typeof F.then=="function")return Xe(H,z,Za(F),te);if(F.$$typeof===U)return Xe(H,z,Ka(H,F),te);Qa(H,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,z!==null&&z.tag===6?(l(H,z.sibling),te=d(z,F),te.return=H,H=te):(l(H,z),te=sc(F,H.mode,te),te.return=H,H=te),v(H)):l(H,z)}return function(H,z,F,te){try{ml=0;var ge=Xe(H,z,F,te);return Ss=null,ge}catch(_e){if(_e===bs||_e===$a)throw _e;var Pe=xi(29,_e,null,H.mode);return Pe.lanes=te,Pe.return=H,Pe}finally{}}}var Br=am(!0),om=am(!1),Yn=!1;function vc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yc(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Vn(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Kn(i,r,l){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(Fe&2)!==0){var d=u.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),u.pending=r,r=qa(i),Yp(i,null,l),r}return Fa(i,u,r,l),qa(i)}function gl(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,Jd(i,l)}}function bc(i,r){var l=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var d=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?d=m=v:m=m.next=v,l=l.next}while(l!==null);m===null?d=m=r:m=m.next=r}else d=m=r;l={baseState:u.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:u.shared,callbacks:u.callbacks},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}var Sc=!1;function vl(){if(Sc){var i=ys;if(i!==null)throw i}}function yl(i,r,l,u){Sc=!1;var d=i.updateQueue;Yn=!1;var m=d.firstBaseUpdate,v=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var R=w,W=R.next;R.next=null,v===null?m=W:v.next=W,v=R;var Z=i.alternate;Z!==null&&(Z=Z.updateQueue,w=Z.lastBaseUpdate,w!==v&&(w===null?Z.firstBaseUpdate=W:w.next=W,Z.lastBaseUpdate=R))}if(m!==null){var ie=d.baseState;v=0,Z=W=R=null,w=m;do{var V=w.lane&-536870913,$=V!==w.lane;if($?(ze&V)===V:(u&V)===V){V!==0&&V===vs&&(Sc=!0),Z!==null&&(Z=Z.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var me=i,ye=w;V=r;var Xe=l;switch(ye.tag){case 1:if(me=ye.payload,typeof me=="function"){ie=me.call(Xe,ie,V);break e}ie=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ye.payload,V=typeof me=="function"?me.call(Xe,ie,V):me,V==null)break e;ie=_({},ie,V);break e;case 2:Yn=!0}}V=w.callback,V!==null&&(i.flags|=64,$&&(i.flags|=8192),$=d.callbacks,$===null?d.callbacks=[V]:$.push(V))}else $={lane:V,tag:w.tag,payload:w.payload,callback:w.callback,next:null},Z===null?(W=Z=$,R=ie):Z=Z.next=$,v|=V;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;$=w,w=$.next,$.next=null,d.lastBaseUpdate=$,d.shared.pending=null}}while(!0);Z===null&&(R=ie),d.baseState=R,d.firstBaseUpdate=W,d.lastBaseUpdate=Z,m===null&&(d.shared.lanes=0),Qn|=v,i.lanes=v,i.memoizedState=ie}}function um(i,r){if(typeof i!="function")throw Error(s(191,i));i.call(r)}function cm(i,r){var l=i.callbacks;if(l!==null)for(i.callbacks=null,i=0;i<l.length;i++)um(l[i],r)}var xs=T(null),Ja=T(0);function hm(i,r){i=An,C(Ja,i),C(xs,r),An=i|r.baseLanes}function xc(){C(Ja,An),C(xs,xs.current)}function wc(){An=Ja.current,X(xs),X(Ja)}var wi=T(null),Ui=null;function Xn(i){var r=i.alternate;C(ft,ft.current&1),C(wi,i),Ui===null&&(r===null||xs.current!==null||r.memoizedState!==null)&&(Ui=i)}function Cc(i){C(ft,ft.current),C(wi,i),Ui===null&&(Ui=i)}function fm(i){i.tag===22?(C(ft,ft.current),C(wi,i),Ui===null&&(Ui=i)):$n()}function $n(){C(ft,ft.current),C(wi,wi.current)}function Ci(i){X(wi),Ui===i&&(Ui=null),X(ft)}var ft=T(0);function eo(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Rh(l)||Mh(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var bn=0,Ce=null,Ve=null,_t=null,to=!1,ws=!1,Nr=!1,io=0,bl=0,Cs=null,r1=0;function at(){throw Error(s(321))}function kc(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!Si(i[l],r[l]))return!1;return!0}function Ec(i,r,l,u,d,m){return bn=m,Ce=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,A.H=i===null||i.memoizedState===null?$m:Ic,Nr=!1,m=l(u,d),Nr=!1,ws&&(m=pm(r,l,u,d)),dm(i),m}function dm(i){A.H=wl;var r=Ve!==null&&Ve.next!==null;if(bn=0,_t=Ve=Ce=null,to=!1,bl=0,Cs=null,r)throw Error(s(300));i===null||gt||(i=i.dependencies,i!==null&&Va(i)&&(gt=!0))}function pm(i,r,l,u){Ce=i;var d=0;do{if(ws&&(Cs=null),bl=0,ws=!1,25<=d)throw Error(s(301));if(d+=1,_t=Ve=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}A.H=Gm,m=r(l,u)}while(ws);return m}function s1(){var i=A.H,r=i.useState()[0];return r=typeof r.then=="function"?Sl(r):r,i=i.useState()[0],(Ve!==null?Ve.memoizedState:null)!==i&&(Ce.flags|=1024),r}function Tc(){var i=io!==0;return io=0,i}function Ac(i,r,l){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~l}function Dc(i){if(to){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}to=!1}bn=0,_t=Ve=Ce=null,ws=!1,bl=io=0,Cs=null}function ei(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Ce.memoizedState=_t=i:_t=_t.next=i,_t}function dt(){if(Ve===null){var i=Ce.alternate;i=i!==null?i.memoizedState:null}else i=Ve.next;var r=_t===null?Ce.memoizedState:_t.next;if(r!==null)_t=r,Ve=i;else{if(i===null)throw Ce.alternate===null?Error(s(467)):Error(s(310));Ve=i,i={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},_t===null?Ce.memoizedState=_t=i:_t=_t.next=i}return _t}function no(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sl(i){var r=bl;return bl+=1,Cs===null&&(Cs=[]),i=rm(Cs,i,r),r=Ce,(_t===null?r.memoizedState:_t.next)===null&&(r=r.alternate,A.H=r===null||r.memoizedState===null?$m:Ic),i}function ro(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Sl(i);if(i.$$typeof===U)return Pt(i)}throw Error(s(438,String(i)))}function Rc(i){var r=null,l=Ce.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var u=Ce.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(d){return d.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=no(),Ce.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(i),u=0;u<i;u++)l[u]=q;return r.index++,l}function Sn(i,r){return typeof r=="function"?r(i):r}function so(i){var r=dt();return Mc(r,Ve,i)}function Mc(i,r,l){var u=i.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=l;var d=i.baseQueue,m=u.pending;if(m!==null){if(d!==null){var v=d.next;d.next=m.next,m.next=v}r.baseQueue=d=m,u.pending=null}if(m=i.baseState,d===null)i.memoizedState=m;else{r=d.next;var w=v=null,R=null,W=r,Z=!1;do{var ie=W.lane&-536870913;if(ie!==W.lane?(ze&ie)===ie:(bn&ie)===ie){var V=W.revertLane;if(V===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ie===vs&&(Z=!0);else if((bn&V)===V){W=W.next,V===vs&&(Z=!0);continue}else ie={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(w=R=ie,v=m):R=R.next=ie,Ce.lanes|=V,Qn|=V;ie=W.action,Nr&&l(m,ie),m=W.hasEagerState?W.eagerState:l(m,ie)}else V={lane:ie,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(w=R=V,v=m):R=R.next=V,Ce.lanes|=ie,Qn|=ie;W=W.next}while(W!==null&&W!==r);if(R===null?v=m:R.next=w,!Si(m,i.memoizedState)&&(gt=!0,Z&&(l=ys,l!==null)))throw l;i.memoizedState=m,i.baseState=v,i.baseQueue=R,u.lastRenderedState=m}return d===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Bc(i){var r=dt(),l=r.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var u=l.dispatch,d=l.pending,m=r.memoizedState;if(d!==null){l.pending=null;var v=d=d.next;do m=i(m,v.action),v=v.next;while(v!==d);Si(m,r.memoizedState)||(gt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),l.lastRenderedState=m}return[m,u]}function mm(i,r,l){var u=Ce,d=dt(),m=je;if(m){if(l===void 0)throw Error(s(407));l=l()}else l=r();var v=!Si((Ve||d).memoizedState,l);if(v&&(d.memoizedState=l,gt=!0),d=d.queue,zc(vm.bind(null,u,d,i),[i]),d.getSnapshot!==r||v||_t!==null&&_t.memoizedState.tag&1){if(u.flags|=2048,ks(9,{destroy:void 0},gm.bind(null,u,d,l,r),null),Ze===null)throw Error(s(349));m||(bn&127)!==0||_m(u,r,l)}return l}function _m(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=Ce.updateQueue,r===null?(r=no(),Ce.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function gm(i,r,l,u){r.value=l,r.getSnapshot=u,ym(r)&&bm(i)}function vm(i,r,l){return l(function(){ym(r)&&bm(i)})}function ym(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!Si(i,l)}catch{return!0}}function bm(i){var r=Cr(i,2);r!==null&&mi(r,i,2)}function Nc(i){var r=ei();if(typeof i=="function"){var l=i;if(i=l(),Nr){oi(!0);try{l()}finally{oi(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:i},r}function Sm(i,r,l,u){return i.baseState=l,Mc(i,Ve,typeof u=="function"?u:Sn)}function l1(i,r,l,u,d){if(oo(i))throw Error(s(485));if(i=r.action,i!==null){var m={payload:d,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){m.listeners.push(v)}};A.T!==null?l(!0):m.isTransition=!1,u(m),l=r.pending,l===null?(m.next=r.pending=m,xm(r,m)):(m.next=l.next,r.pending=l.next=m)}}function xm(i,r){var l=r.action,u=r.payload,d=i.state;if(r.isTransition){var m=A.T,v={};A.T=v;try{var w=l(d,u),R=A.S;R!==null&&R(v,w),wm(i,r,w)}catch(W){Lc(i,r,W)}finally{m!==null&&v.types!==null&&(m.types=v.types),A.T=m}}else try{m=l(d,u),wm(i,r,m)}catch(W){Lc(i,r,W)}}function wm(i,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Cm(i,r,u)},function(u){return Lc(i,r,u)}):Cm(i,r,l)}function Cm(i,r,l){r.status="fulfilled",r.value=l,km(r),i.state=l,r=i.pending,r!==null&&(l=r.next,l===r?i.pending=null:(l=l.next,r.next=l,xm(i,l)))}function Lc(i,r,l){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=l,km(r),r=r.next;while(r!==u)}i.action=null}function km(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function Em(i,r){return r}function Tm(i,r){if(je){var l=Ze.formState;if(l!==null){e:{var u=Ce;if(je){if(et){t:{for(var d=et,m=Hi;d.nodeType!==8;){if(!m){d=null;break t}if(d=Pi(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){et=Pi(d.nextSibling),u=d.data==="F!";break e}}qn(u)}u=!1}u&&(r=l[0])}}return l=ei(),l.memoizedState=l.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Em,lastRenderedState:r},l.queue=u,l=Vm.bind(null,Ce,u),u.dispatch=l,u=Nc(!1),m=Pc.bind(null,Ce,!1,u.queue),u=ei(),d={state:r,dispatch:null,action:i,pending:null},u.queue=d,l=l1.bind(null,Ce,d,m,l),d.dispatch=l,u.memoizedState=i,[r,l,!1]}function Am(i){var r=dt();return Dm(r,Ve,i)}function Dm(i,r,l){if(r=Mc(i,r,Em)[0],i=so(Sn)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=Sl(r)}catch(v){throw v===bs?$a:v}else u=r;r=dt();var d=r.queue,m=d.dispatch;return l!==r.memoizedState&&(Ce.flags|=2048,ks(9,{destroy:void 0},a1.bind(null,d,l),null)),[u,m,i]}function a1(i,r){i.action=r}function Rm(i){var r=dt(),l=Ve;if(l!==null)return Dm(r,l,i);dt(),r=r.memoizedState,l=dt();var u=l.queue.dispatch;return l.memoizedState=i,[r,u,!1]}function ks(i,r,l,u){return i={tag:i,create:l,deps:u,inst:r,next:null},r=Ce.updateQueue,r===null&&(r=no(),Ce.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=i.next=i:(u=l.next,l.next=i,i.next=u,r.lastEffect=i),i}function Mm(){return dt().memoizedState}function lo(i,r,l,u){var d=ei();Ce.flags|=i,d.memoizedState=ks(1|r,{destroy:void 0},l,u===void 0?null:u)}function ao(i,r,l,u){var d=dt();u=u===void 0?null:u;var m=d.memoizedState.inst;Ve!==null&&u!==null&&kc(u,Ve.memoizedState.deps)?d.memoizedState=ks(r,m,l,u):(Ce.flags|=i,d.memoizedState=ks(1|r,m,l,u))}function Bm(i,r){lo(8390656,8,i,r)}function zc(i,r){ao(2048,8,i,r)}function o1(i){Ce.flags|=4;var r=Ce.updateQueue;if(r===null)r=no(),Ce.updateQueue=r,r.events=[i];else{var l=r.events;l===null?r.events=[i]:l.push(i)}}function Nm(i){var r=dt().memoizedState;return o1({ref:r,nextImpl:i}),function(){if((Fe&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Lm(i,r){return ao(4,2,i,r)}function zm(i,r){return ao(4,4,i,r)}function Om(i,r){if(typeof r=="function"){i=i();var l=r(i);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function jm(i,r,l){l=l!=null?l.concat([i]):null,ao(4,4,Om.bind(null,r,i),l)}function Oc(){}function Hm(i,r){var l=dt();r=r===void 0?null:r;var u=l.memoizedState;return r!==null&&kc(r,u[1])?u[0]:(l.memoizedState=[i,r],i)}function Um(i,r){var l=dt();r=r===void 0?null:r;var u=l.memoizedState;if(r!==null&&kc(r,u[1]))return u[0];if(u=i(),Nr){oi(!0);try{i()}finally{oi(!1)}}return l.memoizedState=[u,r],u}function jc(i,r,l){return l===void 0||(bn&1073741824)!==0&&(ze&261930)===0?i.memoizedState=r:(i.memoizedState=l,i=P_(),Ce.lanes|=i,Qn|=i,l)}function Pm(i,r,l,u){return Si(l,r)?l:xs.current!==null?(i=jc(i,l,u),Si(i,r)||(gt=!0),i):(bn&42)===0||(bn&1073741824)!==0&&(ze&261930)===0?(gt=!0,i.memoizedState=l):(i=P_(),Ce.lanes|=i,Qn|=i,r)}function Im(i,r,l,u,d){var m=I.p;I.p=m!==0&&8>m?m:8;var v=A.T,w={};A.T=w,Pc(i,!1,r,l);try{var R=d(),W=A.S;if(W!==null&&W(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Z=n1(R,u);xl(i,r,Z,Ti(i))}else xl(i,r,u,Ti(i))}catch(ie){xl(i,r,{then:function(){},status:"rejected",reason:ie},Ti())}finally{I.p=m,v!==null&&w.types!==null&&(v.types=w.types),A.T=v}}function u1(){}function Hc(i,r,l,u){if(i.tag!==5)throw Error(s(476));var d=Fm(i).queue;Im(i,d,r,Y,l===null?u1:function(){return qm(i),l(u)})}function Fm(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:Y},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:l},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function qm(i){var r=Fm(i);r.next===null&&(r=i.alternate.memoizedState),xl(i,r.next.queue,{},Ti())}function Uc(){return Pt(Ul)}function Wm(){return dt().memoizedState}function Ym(){return dt().memoizedState}function c1(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var l=Ti();i=Vn(l);var u=Kn(r,i,l);u!==null&&(mi(u,r,l),gl(u,r,l)),r={cache:pc()},i.payload=r;return}r=r.return}}function h1(i,r,l){var u=Ti();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},oo(i)?Km(r,l):(l=nc(i,r,l,u),l!==null&&(mi(l,i,u),Xm(l,r,u)))}function Vm(i,r,l){var u=Ti();xl(i,r,l,u)}function xl(i,r,l,u){var d={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(oo(i))Km(r,d);else{var m=i.alternate;if(i.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var v=r.lastRenderedState,w=m(v,l);if(d.hasEagerState=!0,d.eagerState=w,Si(w,v))return Fa(i,r,d,0),Ze===null&&Ia(),!1}catch{}finally{}if(l=nc(i,r,d,u),l!==null)return mi(l,i,u),Xm(l,r,u),!0}return!1}function Pc(i,r,l,u){if(u={lane:2,revertLane:vh(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},oo(i)){if(r)throw Error(s(479))}else r=nc(i,l,u,2),r!==null&&mi(r,i,2)}function oo(i){var r=i.alternate;return i===Ce||r!==null&&r===Ce}function Km(i,r){ws=to=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function Xm(i,r,l){if((l&4194048)!==0){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,Jd(i,l)}}var wl={readContext:Pt,use:ro,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};wl.useEffectEvent=at;var $m={readContext:Pt,use:ro,useCallback:function(i,r){return ei().memoizedState=[i,r===void 0?null:r],i},useContext:Pt,useEffect:Bm,useImperativeHandle:function(i,r,l){l=l!=null?l.concat([i]):null,lo(4194308,4,Om.bind(null,r,i),l)},useLayoutEffect:function(i,r){return lo(4194308,4,i,r)},useInsertionEffect:function(i,r){lo(4,2,i,r)},useMemo:function(i,r){var l=ei();r=r===void 0?null:r;var u=i();if(Nr){oi(!0);try{i()}finally{oi(!1)}}return l.memoizedState=[u,r],u},useReducer:function(i,r,l){var u=ei();if(l!==void 0){var d=l(r);if(Nr){oi(!0);try{l(r)}finally{oi(!1)}}}else d=r;return u.memoizedState=u.baseState=d,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:d},u.queue=i,i=i.dispatch=h1.bind(null,Ce,i),[u.memoizedState,i]},useRef:function(i){var r=ei();return i={current:i},r.memoizedState=i},useState:function(i){i=Nc(i);var r=i.queue,l=Vm.bind(null,Ce,r);return r.dispatch=l,[i.memoizedState,l]},useDebugValue:Oc,useDeferredValue:function(i,r){var l=ei();return jc(l,i,r)},useTransition:function(){var i=Nc(!1);return i=Im.bind(null,Ce,i.queue,!0,!1),ei().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,l){var u=Ce,d=ei();if(je){if(l===void 0)throw Error(s(407));l=l()}else{if(l=r(),Ze===null)throw Error(s(349));(ze&127)!==0||_m(u,r,l)}d.memoizedState=l;var m={value:l,getSnapshot:r};return d.queue=m,Bm(vm.bind(null,u,m,i),[i]),u.flags|=2048,ks(9,{destroy:void 0},gm.bind(null,u,m,l,r),null),l},useId:function(){var i=ei(),r=Ze.identifierPrefix;if(je){var l=en,u=Ji;l=(u&~(1<<32-Ge(u)-1)).toString(32)+l,r="_"+r+"R_"+l,l=io++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=r1++,r="_"+r+"r_"+l.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Uc,useFormState:Tm,useActionState:Tm,useOptimistic:function(i){var r=ei();r.memoizedState=r.baseState=i;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=Pc.bind(null,Ce,!0,l),l.dispatch=r,[i,r]},useMemoCache:Rc,useCacheRefresh:function(){return ei().memoizedState=c1.bind(null,Ce)},useEffectEvent:function(i){var r=ei(),l={impl:i};return r.memoizedState=l,function(){if((Fe&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Ic={readContext:Pt,use:ro,useCallback:Hm,useContext:Pt,useEffect:zc,useImperativeHandle:jm,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Um,useReducer:so,useRef:Mm,useState:function(){return so(Sn)},useDebugValue:Oc,useDeferredValue:function(i,r){var l=dt();return Pm(l,Ve.memoizedState,i,r)},useTransition:function(){var i=so(Sn)[0],r=dt().memoizedState;return[typeof i=="boolean"?i:Sl(i),r]},useSyncExternalStore:mm,useId:Wm,useHostTransitionStatus:Uc,useFormState:Am,useActionState:Am,useOptimistic:function(i,r){var l=dt();return Sm(l,Ve,i,r)},useMemoCache:Rc,useCacheRefresh:Ym};Ic.useEffectEvent=Nm;var Gm={readContext:Pt,use:ro,useCallback:Hm,useContext:Pt,useEffect:zc,useImperativeHandle:jm,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Um,useReducer:Bc,useRef:Mm,useState:function(){return Bc(Sn)},useDebugValue:Oc,useDeferredValue:function(i,r){var l=dt();return Ve===null?jc(l,i,r):Pm(l,Ve.memoizedState,i,r)},useTransition:function(){var i=Bc(Sn)[0],r=dt().memoizedState;return[typeof i=="boolean"?i:Sl(i),r]},useSyncExternalStore:mm,useId:Wm,useHostTransitionStatus:Uc,useFormState:Rm,useActionState:Rm,useOptimistic:function(i,r){var l=dt();return Ve!==null?Sm(l,Ve,i,r):(l.baseState=i,[i,l.queue.dispatch])},useMemoCache:Rc,useCacheRefresh:Ym};Gm.useEffectEvent=Nm;function Fc(i,r,l,u){r=i.memoizedState,l=l(u,r),l=l==null?r:_({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var qc={enqueueSetState:function(i,r,l){i=i._reactInternals;var u=Ti(),d=Vn(u);d.payload=r,l!=null&&(d.callback=l),r=Kn(i,d,u),r!==null&&(mi(r,i,u),gl(r,i,u))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var u=Ti(),d=Vn(u);d.tag=1,d.payload=r,l!=null&&(d.callback=l),r=Kn(i,d,u),r!==null&&(mi(r,i,u),gl(r,i,u))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=Ti(),u=Vn(l);u.tag=2,r!=null&&(u.callback=r),r=Kn(i,u,l),r!==null&&(mi(r,i,l),gl(r,i,l))}};function Zm(i,r,l,u,d,m,v){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,m,v):r.prototype&&r.prototype.isPureReactComponent?!ul(l,u)||!ul(d,m):!0}function Qm(i,r,l,u){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,u),r.state!==i&&qc.enqueueReplaceState(r,r.state,null)}function Lr(i,r){var l=r;if("ref"in r){l={};for(var u in r)u!=="ref"&&(l[u]=r[u])}if(i=i.defaultProps){l===r&&(l=_({},l));for(var d in i)l[d]===void 0&&(l[d]=i[d])}return l}function Jm(i){Pa(i)}function e_(i){console.error(i)}function t_(i){Pa(i)}function uo(i,r){try{var l=i.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function i_(i,r,l){try{var u=i.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Wc(i,r,l){return l=Vn(l),l.tag=3,l.payload={element:null},l.callback=function(){uo(i,r)},l}function n_(i){return i=Vn(i),i.tag=3,i}function r_(i,r,l,u){var d=l.type.getDerivedStateFromError;if(typeof d=="function"){var m=u.value;i.payload=function(){return d(m)},i.callback=function(){i_(r,l,u)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(i.callback=function(){i_(r,l,u),typeof d!="function"&&(Jn===null?Jn=new Set([this]):Jn.add(this));var w=u.stack;this.componentDidCatch(u.value,{componentStack:w!==null?w:""})})}function f1(i,r,l,u,d){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=l.alternate,r!==null&&gs(r,l,d,!0),l=wi.current,l!==null){switch(l.tag){case 31:case 13:return Ui===null?xo():l.alternate===null&&ot===0&&(ot=3),l.flags&=-257,l.flags|=65536,l.lanes=d,u===Ga?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([u]):r.add(u),mh(i,u,d)),!1;case 22:return l.flags|=65536,u===Ga?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([u]):l.add(u)),mh(i,u,d)),!1}throw Error(s(435,l.tag))}return mh(i,u,d),xo(),!1}if(je)return r=wi.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=d,u!==uc&&(i=Error(s(422),{cause:u}),fl(zi(i,l)))):(u!==uc&&(r=Error(s(423),{cause:u}),fl(zi(r,l))),i=i.current.alternate,i.flags|=65536,d&=-d,i.lanes|=d,u=zi(u,l),d=Wc(i.stateNode,u,d),bc(i,d),ot!==4&&(ot=2)),!1;var m=Error(s(520),{cause:u});if(m=zi(m,l),Ml===null?Ml=[m]:Ml.push(m),ot!==4&&(ot=2),r===null)return!0;u=zi(u,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,i=d&-d,l.lanes|=i,i=Wc(l.stateNode,u,i),bc(l,i),!1;case 1:if(r=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Jn===null||!Jn.has(m))))return l.flags|=65536,d&=-d,l.lanes|=d,d=n_(d),r_(d,i,l,u),bc(l,d),!1}l=l.return}while(l!==null);return!1}var Yc=Error(s(461)),gt=!1;function It(i,r,l,u){r.child=i===null?om(r,null,l,u):Br(r,i.child,l,u)}function s_(i,r,l,u,d){l=l.render;var m=r.ref;if("ref"in u){var v={};for(var w in u)w!=="ref"&&(v[w]=u[w])}else v=u;return Ar(r),u=Ec(i,r,l,v,m,d),w=Tc(),i!==null&&!gt?(Ac(i,r,d),xn(i,r,d)):(je&&w&&ac(r),r.flags|=1,It(i,r,u,d),r.child)}function l_(i,r,l,u,d){if(i===null){var m=l.type;return typeof m=="function"&&!rc(m)&&m.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=m,a_(i,r,m,u,d)):(i=Wa(l.type,null,u,r,r.mode,d),i.ref=r.ref,i.return=r,r.child=i)}if(m=i.child,!Jc(i,d)){var v=m.memoizedProps;if(l=l.compare,l=l!==null?l:ul,l(v,u)&&i.ref===r.ref)return xn(i,r,d)}return r.flags|=1,i=_n(m,u),i.ref=r.ref,i.return=r,r.child=i}function a_(i,r,l,u,d){if(i!==null){var m=i.memoizedProps;if(ul(m,u)&&i.ref===r.ref)if(gt=!1,r.pendingProps=u=m,Jc(i,d))(i.flags&131072)!==0&&(gt=!0);else return r.lanes=i.lanes,xn(i,r,d)}return Vc(i,r,l,u,d)}function o_(i,r,l,u){var d=u.children,m=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,i!==null){for(u=r.child=i.child,d=0;u!==null;)d=d|u.lanes|u.childLanes,u=u.sibling;u=d&~m}else u=0,r.child=null;return u_(i,r,m,l,u)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Xa(r,m!==null?m.cachePool:null),m!==null?hm(r,m):xc(),fm(r);else return u=r.lanes=536870912,u_(i,r,m!==null?m.baseLanes|l:l,l,u)}else m!==null?(Xa(r,m.cachePool),hm(r,m),$n(),r.memoizedState=null):(i!==null&&Xa(r,null),xc(),$n());return It(i,r,d,l),r.child}function Cl(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function u_(i,r,l,u,d){var m=_c();return m=m===null?null:{parent:mt._currentValue,pool:m},r.memoizedState={baseLanes:l,cachePool:m},i!==null&&Xa(r,null),xc(),fm(r),i!==null&&gs(i,r,u,!0),r.childLanes=d,null}function co(i,r){return r=fo({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function c_(i,r,l){return Br(r,i.child,null,l),i=co(r,r.pendingProps),i.flags|=2,Ci(r),r.memoizedState=null,i}function d1(i,r,l){var u=r.pendingProps,d=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(je){if(u.mode==="hidden")return i=co(r,u),r.lanes=536870912,Cl(null,i);if(Cc(r),(i=et)?(i=xg(i,Hi),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:In!==null?{id:Ji,overflow:en}:null,retryLane:536870912,hydrationErrors:null},l=Kp(i),l.return=r,r.child=l,Ut=r,et=null)):i=null,i===null)throw qn(r);return r.lanes=536870912,null}return co(r,u)}var m=i.memoizedState;if(m!==null){var v=m.dehydrated;if(Cc(r),d)if(r.flags&256)r.flags&=-257,r=c_(i,r,l);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(s(558));else if(gt||gs(i,r,l,!1),d=(l&i.childLanes)!==0,gt||d){if(u=Ze,u!==null&&(v=ep(u,l),v!==0&&v!==m.retryLane))throw m.retryLane=v,Cr(i,v),mi(u,i,v),Yc;xo(),r=c_(i,r,l)}else i=m.treeContext,et=Pi(v.nextSibling),Ut=r,je=!0,Fn=null,Hi=!1,i!==null&&Gp(r,i),r=co(r,u),r.flags|=4096;return r}return i=_n(i.child,{mode:u.mode,children:u.children}),i.ref=r.ref,r.child=i,i.return=r,i}function ho(i,r){var l=r.ref;if(l===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(i===null||i.ref!==l)&&(r.flags|=4194816)}}function Vc(i,r,l,u,d){return Ar(r),l=Ec(i,r,l,u,void 0,d),u=Tc(),i!==null&&!gt?(Ac(i,r,d),xn(i,r,d)):(je&&u&&ac(r),r.flags|=1,It(i,r,l,d),r.child)}function h_(i,r,l,u,d,m){return Ar(r),r.updateQueue=null,l=pm(r,u,l,d),dm(i),u=Tc(),i!==null&&!gt?(Ac(i,r,m),xn(i,r,m)):(je&&u&&ac(r),r.flags|=1,It(i,r,l,m),r.child)}function f_(i,r,l,u,d){if(Ar(r),r.stateNode===null){var m=ds,v=l.contextType;typeof v=="object"&&v!==null&&(m=Pt(v)),m=new l(u,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=qc,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=u,m.state=r.memoizedState,m.refs={},vc(r),v=l.contextType,m.context=typeof v=="object"&&v!==null?Pt(v):ds,m.state=r.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Fc(r,l,v,u),m.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(v=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),v!==m.state&&qc.enqueueReplaceState(m,m.state,null),yl(r,u,m,d),vl(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(i===null){m=r.stateNode;var w=r.memoizedProps,R=Lr(l,w);m.props=R;var W=m.context,Z=l.contextType;v=ds,typeof Z=="object"&&Z!==null&&(v=Pt(Z));var ie=l.getDerivedStateFromProps;Z=typeof ie=="function"||typeof m.getSnapshotBeforeUpdate=="function",w=r.pendingProps!==w,Z||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w||W!==v)&&Qm(r,m,u,v),Yn=!1;var V=r.memoizedState;m.state=V,yl(r,u,m,d),vl(),W=r.memoizedState,w||V!==W||Yn?(typeof ie=="function"&&(Fc(r,l,ie,u),W=r.memoizedState),(R=Yn||Zm(r,l,R,u,V,W,v))?(Z||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=W),m.props=u,m.state=W,m.context=v,u=R):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{m=r.stateNode,yc(i,r),v=r.memoizedProps,Z=Lr(l,v),m.props=Z,ie=r.pendingProps,V=m.context,W=l.contextType,R=ds,typeof W=="object"&&W!==null&&(R=Pt(W)),w=l.getDerivedStateFromProps,(W=typeof w=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==ie||V!==R)&&Qm(r,m,u,R),Yn=!1,V=r.memoizedState,m.state=V,yl(r,u,m,d),vl();var $=r.memoizedState;v!==ie||V!==$||Yn||i!==null&&i.dependencies!==null&&Va(i.dependencies)?(typeof w=="function"&&(Fc(r,l,w,u),$=r.memoizedState),(Z=Yn||Zm(r,l,Z,u,V,$,R)||i!==null&&i.dependencies!==null&&Va(i.dependencies))?(W||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(u,$,R),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(u,$,R)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=$),m.props=u,m.state=$,m.context=R,u=Z):(typeof m.componentDidUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=1024),u=!1)}return m=u,ho(i,r),u=(r.flags&128)!==0,m||u?(m=r.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,i!==null&&u?(r.child=Br(r,i.child,null,d),r.child=Br(r,null,l,d)):It(i,r,l,d),r.memoizedState=m.state,i=r.child):i=xn(i,r,d),i}function d_(i,r,l,u){return Er(),r.flags|=256,It(i,r,l,u),r.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(i){return{baseLanes:i,cachePool:im()}}function $c(i,r,l){return i=i!==null?i.childLanes&~l:0,r&&(i|=Ei),i}function p_(i,r,l){var u=r.pendingProps,d=!1,m=(r.flags&128)!==0,v;if((v=m)||(v=i!==null&&i.memoizedState===null?!1:(ft.current&2)!==0),v&&(d=!0,r.flags&=-129),v=(r.flags&32)!==0,r.flags&=-33,i===null){if(je){if(d?Xn(r):$n(),(i=et)?(i=xg(i,Hi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:In!==null?{id:Ji,overflow:en}:null,retryLane:536870912,hydrationErrors:null},l=Kp(i),l.return=r,r.child=l,Ut=r,et=null)):i=null,i===null)throw qn(r);return Mh(i)?r.lanes=32:r.lanes=536870912,null}var w=u.children;return u=u.fallback,d?($n(),d=r.mode,w=fo({mode:"hidden",children:w},d),u=kr(u,d,l,null),w.return=r,u.return=r,w.sibling=u,r.child=w,u=r.child,u.memoizedState=Xc(l),u.childLanes=$c(i,v,l),r.memoizedState=Kc,Cl(null,u)):(Xn(r),Gc(r,w))}var R=i.memoizedState;if(R!==null&&(w=R.dehydrated,w!==null)){if(m)r.flags&256?(Xn(r),r.flags&=-257,r=Zc(i,r,l)):r.memoizedState!==null?($n(),r.child=i.child,r.flags|=128,r=null):($n(),w=u.fallback,d=r.mode,u=fo({mode:"visible",children:u.children},d),w=kr(w,d,l,null),w.flags|=2,u.return=r,w.return=r,u.sibling=w,r.child=u,Br(r,i.child,null,l),u=r.child,u.memoizedState=Xc(l),u.childLanes=$c(i,v,l),r.memoizedState=Kc,r=Cl(null,u));else if(Xn(r),Mh(w)){if(v=w.nextSibling&&w.nextSibling.dataset,v)var W=v.dgst;v=W,u=Error(s(419)),u.stack="",u.digest=v,fl({value:u,source:null,stack:null}),r=Zc(i,r,l)}else if(gt||gs(i,r,l,!1),v=(l&i.childLanes)!==0,gt||v){if(v=Ze,v!==null&&(u=ep(v,l),u!==0&&u!==R.retryLane))throw R.retryLane=u,Cr(i,u),mi(v,i,u),Yc;Rh(w)||xo(),r=Zc(i,r,l)}else Rh(w)?(r.flags|=192,r.child=i.child,r=null):(i=R.treeContext,et=Pi(w.nextSibling),Ut=r,je=!0,Fn=null,Hi=!1,i!==null&&Gp(r,i),r=Gc(r,u.children),r.flags|=4096);return r}return d?($n(),w=u.fallback,d=r.mode,R=i.child,W=R.sibling,u=_n(R,{mode:"hidden",children:u.children}),u.subtreeFlags=R.subtreeFlags&65011712,W!==null?w=_n(W,w):(w=kr(w,d,l,null),w.flags|=2),w.return=r,u.return=r,u.sibling=w,r.child=u,Cl(null,u),u=r.child,w=i.child.memoizedState,w===null?w=Xc(l):(d=w.cachePool,d!==null?(R=mt._currentValue,d=d.parent!==R?{parent:R,pool:R}:d):d=im(),w={baseLanes:w.baseLanes|l,cachePool:d}),u.memoizedState=w,u.childLanes=$c(i,v,l),r.memoizedState=Kc,Cl(i.child,u)):(Xn(r),l=i.child,i=l.sibling,l=_n(l,{mode:"visible",children:u.children}),l.return=r,l.sibling=null,i!==null&&(v=r.deletions,v===null?(r.deletions=[i],r.flags|=16):v.push(i)),r.child=l,r.memoizedState=null,l)}function Gc(i,r){return r=fo({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function fo(i,r){return i=xi(22,i,null,r),i.lanes=0,i}function Zc(i,r,l){return Br(r,i.child,null,l),i=Gc(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function m_(i,r,l){i.lanes|=r;var u=i.alternate;u!==null&&(u.lanes|=r),fc(i.return,r,l)}function Qc(i,r,l,u,d,m){var v=i.memoizedState;v===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:d,treeForkCount:m}:(v.isBackwards=r,v.rendering=null,v.renderingStartTime=0,v.last=u,v.tail=l,v.tailMode=d,v.treeForkCount=m)}function __(i,r,l){var u=r.pendingProps,d=u.revealOrder,m=u.tail;u=u.children;var v=ft.current,w=(v&2)!==0;if(w?(v=v&1|2,r.flags|=128):v&=1,C(ft,v),It(i,r,u,l),u=je?hl:0,!w&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&m_(i,l,r);else if(i.tag===19)m_(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(d){case"forwards":for(l=r.child,d=null;l!==null;)i=l.alternate,i!==null&&eo(i)===null&&(d=l),l=l.sibling;l=d,l===null?(d=r.child,r.child=null):(d=l.sibling,l.sibling=null),Qc(r,!1,d,l,m,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,d=r.child,r.child=null;d!==null;){if(i=d.alternate,i!==null&&eo(i)===null){r.child=d;break}i=d.sibling,d.sibling=l,l=d,d=i}Qc(r,!0,l,null,m,u);break;case"together":Qc(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function xn(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Qn|=r.lanes,(l&r.childLanes)===0)if(i!==null){if(gs(i,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(s(153));if(r.child!==null){for(i=r.child,l=_n(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=_n(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function Jc(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Va(i)))}function p1(i,r,l){switch(r.tag){case 3:Te(r,r.stateNode.containerInfo),Wn(r,mt,i.memoizedState.cache),Er();break;case 27:case 5:jt(r);break;case 4:Te(r,r.stateNode.containerInfo);break;case 10:Wn(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Cc(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Xn(r),r.flags|=128,null):(l&r.child.childLanes)!==0?p_(i,r,l):(Xn(r),i=xn(i,r,l),i!==null?i.sibling:null);Xn(r);break;case 19:var d=(i.flags&128)!==0;if(u=(l&r.childLanes)!==0,u||(gs(i,r,l,!1),u=(l&r.childLanes)!==0),d){if(u)return __(i,r,l);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),C(ft,ft.current),u)break;return null;case 22:return r.lanes=0,o_(i,r,l,r.pendingProps);case 24:Wn(r,mt,i.memoizedState.cache)}return xn(i,r,l)}function g_(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps)gt=!0;else{if(!Jc(i,l)&&(r.flags&128)===0)return gt=!1,p1(i,r,l);gt=(i.flags&131072)!==0}else gt=!1,je&&(r.flags&1048576)!==0&&$p(r,hl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(i=Rr(r.elementType),r.type=i,typeof i=="function")rc(i)?(u=Lr(i,u),r.tag=1,r=f_(null,r,i,u,l)):(r.tag=0,r=Vc(null,r,i,u,l));else{if(i!=null){var d=i.$$typeof;if(d===Q){r.tag=11,r=s_(null,r,i,u,l);break e}else if(d===ee){r.tag=14,r=l_(null,r,i,u,l);break e}}throw r=P(i)||i,Error(s(306,r,""))}}return r;case 0:return Vc(i,r,r.type,r.pendingProps,l);case 1:return u=r.type,d=Lr(u,r.pendingProps),f_(i,r,u,d,l);case 3:e:{if(Te(r,r.stateNode.containerInfo),i===null)throw Error(s(387));u=r.pendingProps;var m=r.memoizedState;d=m.element,yc(i,r),yl(r,u,null,l);var v=r.memoizedState;if(u=v.cache,Wn(r,mt,u),u!==m.cache&&dc(r,[mt],l,!0),vl(),u=v.element,m.isDehydrated)if(m={element:u,isDehydrated:!1,cache:v.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=d_(i,r,u,l);break e}else if(u!==d){d=zi(Error(s(424)),r),fl(d),r=d_(i,r,u,l);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(et=Pi(i.firstChild),Ut=r,je=!0,Fn=null,Hi=!0,l=om(r,null,u,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Er(),u===d){r=xn(i,r,l);break e}It(i,r,u,l)}r=r.child}return r;case 26:return ho(i,r),i===null?(l=Ag(r.type,null,r.pendingProps,null))?r.memoizedState=l:je||(l=r.type,i=r.pendingProps,u=Do(he.current).createElement(l),u[Ht]=r,u[ui]=i,Ft(u,l,i),Tt(u),r.stateNode=u):r.memoizedState=Ag(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return jt(r),i===null&&je&&(u=r.stateNode=kg(r.type,r.pendingProps,he.current),Ut=r,Hi=!0,d=et,nr(r.type)?(Bh=d,et=Pi(u.firstChild)):et=d),It(i,r,r.pendingProps.children,l),ho(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&je&&((d=u=et)&&(u=W1(u,r.type,r.pendingProps,Hi),u!==null?(r.stateNode=u,Ut=r,et=Pi(u.firstChild),Hi=!1,d=!0):d=!1),d||qn(r)),jt(r),d=r.type,m=r.pendingProps,v=i!==null?i.memoizedProps:null,u=m.children,Th(d,m)?u=null:v!==null&&Th(d,v)&&(r.flags|=32),r.memoizedState!==null&&(d=Ec(i,r,s1,null,null,l),Ul._currentValue=d),ho(i,r),It(i,r,u,l),r.child;case 6:return i===null&&je&&((i=l=et)&&(l=Y1(l,r.pendingProps,Hi),l!==null?(r.stateNode=l,Ut=r,et=null,i=!0):i=!1),i||qn(r)),null;case 13:return p_(i,r,l);case 4:return Te(r,r.stateNode.containerInfo),u=r.pendingProps,i===null?r.child=Br(r,null,u,l):It(i,r,u,l),r.child;case 11:return s_(i,r,r.type,r.pendingProps,l);case 7:return It(i,r,r.pendingProps,l),r.child;case 8:return It(i,r,r.pendingProps.children,l),r.child;case 12:return It(i,r,r.pendingProps.children,l),r.child;case 10:return u=r.pendingProps,Wn(r,r.type,u.value),It(i,r,u.children,l),r.child;case 9:return d=r.type._context,u=r.pendingProps.children,Ar(r),d=Pt(d),u=u(d),r.flags|=1,It(i,r,u,l),r.child;case 14:return l_(i,r,r.type,r.pendingProps,l);case 15:return a_(i,r,r.type,r.pendingProps,l);case 19:return __(i,r,l);case 31:return d1(i,r,l);case 22:return o_(i,r,l,r.pendingProps);case 24:return Ar(r),u=Pt(mt),i===null?(d=_c(),d===null&&(d=Ze,m=pc(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=l),d=m),r.memoizedState={parent:u,cache:d},vc(r),Wn(r,mt,d)):((i.lanes&l)!==0&&(yc(i,r),yl(r,null,null,l),vl()),d=i.memoizedState,m=r.memoizedState,d.parent!==u?(d={parent:u,cache:u},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),Wn(r,mt,u)):(u=m.cache,Wn(r,mt,u),u!==d.cache&&dc(r,[mt],l,!0))),It(i,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function wn(i){i.flags|=4}function eh(i,r,l,u,d){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(d&335544128)===d)if(i.stateNode.complete)i.flags|=8192;else if(W_())i.flags|=8192;else throw Mr=Ga,gc}else i.flags&=-16777217}function v_(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Ng(r))if(W_())i.flags|=8192;else throw Mr=Ga,gc}function po(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Zd():536870912,i.lanes|=r,Ds|=r)}function kl(i,r){if(!je)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function tt(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,u=0;if(r)for(var d=i.child;d!==null;)l|=d.lanes|d.childLanes,u|=d.subtreeFlags&65011712,u|=d.flags&65011712,d.return=i,d=d.sibling;else for(d=i.child;d!==null;)l|=d.lanes|d.childLanes,u|=d.subtreeFlags,u|=d.flags,d.return=i,d=d.sibling;return i.subtreeFlags|=u,i.childLanes=l,r}function m1(i,r,l){var u=r.pendingProps;switch(oc(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(r),null;case 1:return tt(r),null;case 3:return l=r.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),yn(mt),Re(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(i===null||i.child===null)&&(_s(r)?wn(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,cc())),tt(r),null;case 26:var d=r.type,m=r.memoizedState;return i===null?(wn(r),m!==null?(tt(r),v_(r,m)):(tt(r),eh(r,d,null,u,l))):m?m!==i.memoizedState?(wn(r),tt(r),v_(r,m)):(tt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==u&&wn(r),tt(r),eh(r,d,i,u,l)),null;case 27:if(Zt(r),l=he.current,d=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&wn(r);else{if(!u){if(r.stateNode===null)throw Error(s(166));return tt(r),null}i=se.current,_s(r)?Zp(r):(i=kg(d,u,l),r.stateNode=i,wn(r))}return tt(r),null;case 5:if(Zt(r),d=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&wn(r);else{if(!u){if(r.stateNode===null)throw Error(s(166));return tt(r),null}if(m=se.current,_s(r))Zp(r);else{var v=Do(he.current);switch(m){case 1:m=v.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=v.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=v.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof u.is=="string"?v.createElement("select",{is:u.is}):v.createElement("select"),u.multiple?m.multiple=!0:u.size&&(m.size=u.size);break;default:m=typeof u.is=="string"?v.createElement(d,{is:u.is}):v.createElement(d)}}m[Ht]=r,m[ui]=u;e:for(v=r.child;v!==null;){if(v.tag===5||v.tag===6)m.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===r)break e;for(;v.sibling===null;){if(v.return===null||v.return===r)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}r.stateNode=m;e:switch(Ft(m,d,u),d){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&wn(r)}}return tt(r),eh(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,l),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==u&&wn(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(s(166));if(i=he.current,_s(r)){if(i=r.stateNode,l=r.memoizedProps,u=null,d=Ut,d!==null)switch(d.tag){case 27:case 5:u=d.memoizedProps}i[Ht]=r,i=!!(i.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||pg(i.nodeValue,l)),i||qn(r,!0)}else i=Do(i).createTextNode(u),i[Ht]=r,r.stateNode=i}return tt(r),null;case 31:if(l=r.memoizedState,i===null||i.memoizedState!==null){if(u=_s(r),l!==null){if(i===null){if(!u)throw Error(s(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(557));i[Ht]=r}else Er(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),i=!1}else l=cc(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=l),i=!0;if(!i)return r.flags&256?(Ci(r),r):(Ci(r),null);if((r.flags&128)!==0)throw Error(s(558))}return tt(r),null;case 13:if(u=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(d=_s(r),u!==null&&u.dehydrated!==null){if(i===null){if(!d)throw Error(s(318));if(d=r.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[Ht]=r}else Er(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),d=!1}else d=cc(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(Ci(r),r):(Ci(r),null)}return Ci(r),(r.flags&128)!==0?(r.lanes=l,r):(l=u!==null,i=i!==null&&i.memoizedState!==null,l&&(u=r.child,d=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(d=u.alternate.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==d&&(u.flags|=2048)),l!==i&&l&&(r.child.flags|=8192),po(r,r.updateQueue),tt(r),null);case 4:return Re(),i===null&&xh(r.stateNode.containerInfo),tt(r),null;case 10:return yn(r.type),tt(r),null;case 19:if(X(ft),u=r.memoizedState,u===null)return tt(r),null;if(d=(r.flags&128)!==0,m=u.rendering,m===null)if(d)kl(u,!1);else{if(ot!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(m=eo(i),m!==null){for(r.flags|=128,kl(u,!1),i=m.updateQueue,r.updateQueue=i,po(r,i),r.subtreeFlags=0,i=l,l=r.child;l!==null;)Vp(l,i),l=l.sibling;return C(ft,ft.current&1|2),je&&gn(r,u.treeForkCount),r.child}i=i.sibling}u.tail!==null&&Qt()>yo&&(r.flags|=128,d=!0,kl(u,!1),r.lanes=4194304)}else{if(!d)if(i=eo(m),i!==null){if(r.flags|=128,d=!0,i=i.updateQueue,r.updateQueue=i,po(r,i),kl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!m.alternate&&!je)return tt(r),null}else 2*Qt()-u.renderingStartTime>yo&&l!==536870912&&(r.flags|=128,d=!0,kl(u,!1),r.lanes=4194304);u.isBackwards?(m.sibling=r.child,r.child=m):(i=u.last,i!==null?i.sibling=m:r.child=m,u.last=m)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=Qt(),i.sibling=null,l=ft.current,C(ft,d?l&1|2:l&1),je&&gn(r,u.treeForkCount),i):(tt(r),null);case 22:case 23:return Ci(r),wc(),u=r.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(l&536870912)!==0&&(r.flags&128)===0&&(tt(r),r.subtreeFlags&6&&(r.flags|=8192)):tt(r),l=r.updateQueue,l!==null&&po(r,l.retryQueue),l=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==l&&(r.flags|=2048),i!==null&&X(Dr),null;case 24:return l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),yn(mt),tt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function _1(i,r){switch(oc(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return yn(mt),Re(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return Zt(r),null;case 31:if(r.memoizedState!==null){if(Ci(r),r.alternate===null)throw Error(s(340));Er()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Ci(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Er()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return X(ft),null;case 4:return Re(),null;case 10:return yn(r.type),null;case 22:case 23:return Ci(r),wc(),i!==null&&X(Dr),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return yn(mt),null;case 25:return null;default:return null}}function y_(i,r){switch(oc(r),r.tag){case 3:yn(mt),Re();break;case 26:case 27:case 5:Zt(r);break;case 4:Re();break;case 31:r.memoizedState!==null&&Ci(r);break;case 13:Ci(r);break;case 19:X(ft);break;case 10:yn(r.type);break;case 22:case 23:Ci(r),wc(),i!==null&&X(Dr);break;case 24:yn(mt)}}function El(i,r){try{var l=r.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var d=u.next;l=d;do{if((l.tag&i)===i){u=void 0;var m=l.create,v=l.inst;u=m(),v.destroy=u}l=l.next}while(l!==d)}}catch(w){Ye(r,r.return,w)}}function Gn(i,r,l){try{var u=r.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var m=d.next;u=m;do{if((u.tag&i)===i){var v=u.inst,w=v.destroy;if(w!==void 0){v.destroy=void 0,d=r;var R=l,W=w;try{W()}catch(Z){Ye(d,R,Z)}}}u=u.next}while(u!==m)}}catch(Z){Ye(r,r.return,Z)}}function b_(i){var r=i.updateQueue;if(r!==null){var l=i.stateNode;try{cm(r,l)}catch(u){Ye(i,i.return,u)}}}function S_(i,r,l){l.props=Lr(i.type,i.memoizedProps),l.state=i.memoizedState;try{l.componentWillUnmount()}catch(u){Ye(i,r,u)}}function Tl(i,r){try{var l=i.ref;if(l!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof l=="function"?i.refCleanup=l(u):l.current=u}}catch(d){Ye(i,r,d)}}function tn(i,r){var l=i.ref,u=i.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(d){Ye(i,r,d)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(d){Ye(i,r,d)}else l.current=null}function x_(i){var r=i.type,l=i.memoizedProps,u=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(d){Ye(i,i.return,d)}}function th(i,r,l){try{var u=i.stateNode;H1(u,i.type,l,r),u[ui]=r}catch(d){Ye(i,i.return,d)}}function w_(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&nr(i.type)||i.tag===4}function ih(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||w_(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&nr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function nh(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(i,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(i),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=pn));else if(u!==4&&(u===27&&nr(i.type)&&(l=i.stateNode,r=null),i=i.child,i!==null))for(nh(i,r,l),i=i.sibling;i!==null;)nh(i,r,l),i=i.sibling}function mo(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(u!==4&&(u===27&&nr(i.type)&&(l=i.stateNode),i=i.child,i!==null))for(mo(i,r,l),i=i.sibling;i!==null;)mo(i,r,l),i=i.sibling}function C_(i){var r=i.stateNode,l=i.memoizedProps;try{for(var u=i.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);Ft(r,u,l),r[Ht]=i,r[ui]=l}catch(m){Ye(i,i.return,m)}}var Cn=!1,vt=!1,rh=!1,k_=typeof WeakSet=="function"?WeakSet:Set,At=null;function g1(i,r){if(i=i.containerInfo,kh=Oo,i=jp(i),Zu(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var d=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var v=0,w=-1,R=-1,W=0,Z=0,ie=i,V=null;t:for(;;){for(var $;ie!==l||d!==0&&ie.nodeType!==3||(w=v+d),ie!==m||u!==0&&ie.nodeType!==3||(R=v+u),ie.nodeType===3&&(v+=ie.nodeValue.length),($=ie.firstChild)!==null;)V=ie,ie=$;for(;;){if(ie===i)break t;if(V===l&&++W===d&&(w=v),V===m&&++Z===u&&(R=v),($=ie.nextSibling)!==null)break;ie=V,V=ie.parentNode}ie=$}l=w===-1||R===-1?null:{start:w,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(Eh={focusedElem:i,selectionRange:l},Oo=!1,At=r;At!==null;)if(r=At,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,At=i;else for(;At!==null;){switch(r=At,m=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(l=0;l<i.length;l++)d=i[l],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&m!==null){i=void 0,l=r,d=m.memoizedProps,m=m.memoizedState,u=l.stateNode;try{var me=Lr(l.type,d);i=u.getSnapshotBeforeUpdate(me,m),u.__reactInternalSnapshotBeforeUpdate=i}catch(ye){Ye(l,l.return,ye)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,l=i.nodeType,l===9)Dh(i);else if(l===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Dh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(s(163))}if(i=r.sibling,i!==null){i.return=r.return,At=i;break}At=r.return}}function E_(i,r,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:En(i,l),u&4&&El(5,l);break;case 1:if(En(i,l),u&4)if(i=l.stateNode,r===null)try{i.componentDidMount()}catch(v){Ye(l,l.return,v)}else{var d=Lr(l.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(d,r,i.__reactInternalSnapshotBeforeUpdate)}catch(v){Ye(l,l.return,v)}}u&64&&b_(l),u&512&&Tl(l,l.return);break;case 3:if(En(i,l),u&64&&(i=l.updateQueue,i!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{cm(i,r)}catch(v){Ye(l,l.return,v)}}break;case 27:r===null&&u&4&&C_(l);case 26:case 5:En(i,l),r===null&&u&4&&x_(l),u&512&&Tl(l,l.return);break;case 12:En(i,l);break;case 31:En(i,l),u&4&&D_(i,l);break;case 13:En(i,l),u&4&&R_(i,l),u&64&&(i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(l=E1.bind(null,l),V1(i,l))));break;case 22:if(u=l.memoizedState!==null||Cn,!u){r=r!==null&&r.memoizedState!==null||vt,d=Cn;var m=vt;Cn=u,(vt=r)&&!m?Tn(i,l,(l.subtreeFlags&8772)!==0):En(i,l),Cn=d,vt=m}break;case 30:break;default:En(i,l)}}function T_(i){var r=i.alternate;r!==null&&(i.alternate=null,T_(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Lu(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var nt=null,hi=!1;function kn(i,r,l){for(l=l.child;l!==null;)A_(i,r,l),l=l.sibling}function A_(i,r,l){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(Jt,l)}catch{}switch(l.tag){case 26:vt||tn(l,r),kn(i,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:vt||tn(l,r);var u=nt,d=hi;nr(l.type)&&(nt=l.stateNode,hi=!1),kn(i,r,l),Ol(l.stateNode),nt=u,hi=d;break;case 5:vt||tn(l,r);case 6:if(u=nt,d=hi,nt=null,kn(i,r,l),nt=u,hi=d,nt!==null)if(hi)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(l.stateNode)}catch(m){Ye(l,r,m)}else try{nt.removeChild(l.stateNode)}catch(m){Ye(l,r,m)}break;case 18:nt!==null&&(hi?(i=nt,bg(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,l.stateNode),js(i)):bg(nt,l.stateNode));break;case 4:u=nt,d=hi,nt=l.stateNode.containerInfo,hi=!0,kn(i,r,l),nt=u,hi=d;break;case 0:case 11:case 14:case 15:Gn(2,l,r),vt||Gn(4,l,r),kn(i,r,l);break;case 1:vt||(tn(l,r),u=l.stateNode,typeof u.componentWillUnmount=="function"&&S_(l,r,u)),kn(i,r,l);break;case 21:kn(i,r,l);break;case 22:vt=(u=vt)||l.memoizedState!==null,kn(i,r,l),vt=u;break;default:kn(i,r,l)}}function D_(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{js(i)}catch(l){Ye(r,r.return,l)}}}function R_(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{js(i)}catch(l){Ye(r,r.return,l)}}function v1(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new k_),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new k_),r;default:throw Error(s(435,i.tag))}}function _o(i,r){var l=v1(i);r.forEach(function(u){if(!l.has(u)){l.add(u);var d=T1.bind(null,i,u);u.then(d,d)}})}function fi(i,r){var l=r.deletions;if(l!==null)for(var u=0;u<l.length;u++){var d=l[u],m=i,v=r,w=v;e:for(;w!==null;){switch(w.tag){case 27:if(nr(w.type)){nt=w.stateNode,hi=!1;break e}break;case 5:nt=w.stateNode,hi=!1;break e;case 3:case 4:nt=w.stateNode.containerInfo,hi=!0;break e}w=w.return}if(nt===null)throw Error(s(160));A_(m,v,d),nt=null,hi=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)M_(r,i),r=r.sibling}var $i=null;function M_(i,r){var l=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:fi(r,i),di(i),u&4&&(Gn(3,i,i.return),El(3,i),Gn(5,i,i.return));break;case 1:fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),u&64&&Cn&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(l=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var d=$i;if(fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),u&4){var m=l!==null?l.memoizedState:null;if(u=i.memoizedState,l===null)if(u===null)if(i.stateNode===null){e:{u=i.type,l=i.memoizedProps,d=d.ownerDocument||d;t:switch(u){case"title":m=d.getElementsByTagName("title")[0],(!m||m[el]||m[Ht]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(u),d.head.insertBefore(m,d.querySelector("head > title"))),Ft(m,u,l),m[Ht]=i,Tt(m),u=m;break e;case"link":var v=Mg("link","href",d).get(u+(l.href||""));if(v){for(var w=0;w<v.length;w++)if(m=v[w],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(w,1);break t}}m=d.createElement(u),Ft(m,u,l),d.head.appendChild(m);break;case"meta":if(v=Mg("meta","content",d).get(u+(l.content||""))){for(w=0;w<v.length;w++)if(m=v[w],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(w,1);break t}}m=d.createElement(u),Ft(m,u,l),d.head.appendChild(m);break;default:throw Error(s(468,u))}m[Ht]=i,Tt(m),u=m}i.stateNode=u}else Bg(d,i.type,i.stateNode);else i.stateNode=Rg(d,u,i.memoizedProps);else m!==u?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,u===null?Bg(d,i.type,i.stateNode):Rg(d,u,i.memoizedProps)):u===null&&i.stateNode!==null&&th(i,i.memoizedProps,l.memoizedProps)}break;case 27:fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),l!==null&&u&4&&th(i,i.memoizedProps,l.memoizedProps);break;case 5:if(fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),i.flags&32){d=i.stateNode;try{ls(d,"")}catch(me){Ye(i,i.return,me)}}u&4&&i.stateNode!=null&&(d=i.memoizedProps,th(i,d,l!==null?l.memoizedProps:d)),u&1024&&(rh=!0);break;case 6:if(fi(r,i),di(i),u&4){if(i.stateNode===null)throw Error(s(162));u=i.memoizedProps,l=i.stateNode;try{l.nodeValue=u}catch(me){Ye(i,i.return,me)}}break;case 3:if(Bo=null,d=$i,$i=Ro(r.containerInfo),fi(r,i),$i=d,di(i),u&4&&l!==null&&l.memoizedState.isDehydrated)try{js(r.containerInfo)}catch(me){Ye(i,i.return,me)}rh&&(rh=!1,B_(i));break;case 4:u=$i,$i=Ro(i.stateNode.containerInfo),fi(r,i),di(i),$i=u;break;case 12:fi(r,i),di(i);break;case 31:fi(r,i),di(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,_o(i,u)));break;case 13:fi(r,i),di(i),i.child.flags&8192&&i.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(vo=Qt()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,_o(i,u)));break;case 22:d=i.memoizedState!==null;var R=l!==null&&l.memoizedState!==null,W=Cn,Z=vt;if(Cn=W||d,vt=Z||R,fi(r,i),vt=Z,Cn=W,di(i),u&8192)e:for(r=i.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(l===null||R||Cn||vt||zr(i)),l=null,r=i;;){if(r.tag===5||r.tag===26){if(l===null){R=l=r;try{if(m=R.stateNode,d)v=m.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{w=R.stateNode;var ie=R.memoizedProps.style,V=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;w.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(me){Ye(R,R.return,me)}}}else if(r.tag===6){if(l===null){R=r;try{R.stateNode.nodeValue=d?"":R.memoizedProps}catch(me){Ye(R,R.return,me)}}}else if(r.tag===18){if(l===null){R=r;try{var $=R.stateNode;d?Sg($,!0):Sg(R.stateNode,!1)}catch(me){Ye(R,R.return,me)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=i.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,_o(i,l))));break;case 19:fi(r,i),di(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,_o(i,u)));break;case 30:break;case 21:break;default:fi(r,i),di(i)}}function di(i){var r=i.flags;if(r&2){try{for(var l,u=i.return;u!==null;){if(w_(u)){l=u;break}u=u.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var d=l.stateNode,m=ih(i);mo(i,m,d);break;case 5:var v=l.stateNode;l.flags&32&&(ls(v,""),l.flags&=-33);var w=ih(i);mo(i,w,v);break;case 3:case 4:var R=l.stateNode.containerInfo,W=ih(i);nh(i,W,R);break;default:throw Error(s(161))}}catch(Z){Ye(i,i.return,Z)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function B_(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;B_(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function En(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)E_(i,r.alternate,r),r=r.sibling}function zr(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Gn(4,r,r.return),zr(r);break;case 1:tn(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&S_(r,r.return,l),zr(r);break;case 27:Ol(r.stateNode);case 26:case 5:tn(r,r.return),zr(r);break;case 22:r.memoizedState===null&&zr(r);break;case 30:zr(r);break;default:zr(r)}i=i.sibling}}function Tn(i,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,d=i,m=r,v=m.flags;switch(m.tag){case 0:case 11:case 15:Tn(d,m,l),El(4,m);break;case 1:if(Tn(d,m,l),u=m,d=u.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(W){Ye(u,u.return,W)}if(u=m,d=u.updateQueue,d!==null){var w=u.stateNode;try{var R=d.shared.hiddenCallbacks;if(R!==null)for(d.shared.hiddenCallbacks=null,d=0;d<R.length;d++)um(R[d],w)}catch(W){Ye(u,u.return,W)}}l&&v&64&&b_(m),Tl(m,m.return);break;case 27:C_(m);case 26:case 5:Tn(d,m,l),l&&u===null&&v&4&&x_(m),Tl(m,m.return);break;case 12:Tn(d,m,l);break;case 31:Tn(d,m,l),l&&v&4&&D_(d,m);break;case 13:Tn(d,m,l),l&&v&4&&R_(d,m);break;case 22:m.memoizedState===null&&Tn(d,m,l),Tl(m,m.return);break;case 30:break;default:Tn(d,m,l)}r=r.sibling}}function sh(i,r){var l=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==l&&(i!=null&&i.refCount++,l!=null&&dl(l))}function lh(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&dl(i))}function Gi(i,r,l,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)N_(i,r,l,u),r=r.sibling}function N_(i,r,l,u){var d=r.flags;switch(r.tag){case 0:case 11:case 15:Gi(i,r,l,u),d&2048&&El(9,r);break;case 1:Gi(i,r,l,u);break;case 3:Gi(i,r,l,u),d&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&dl(i)));break;case 12:if(d&2048){Gi(i,r,l,u),i=r.stateNode;try{var m=r.memoizedProps,v=m.id,w=m.onPostCommit;typeof w=="function"&&w(v,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(R){Ye(r,r.return,R)}}else Gi(i,r,l,u);break;case 31:Gi(i,r,l,u);break;case 13:Gi(i,r,l,u);break;case 23:break;case 22:m=r.stateNode,v=r.alternate,r.memoizedState!==null?m._visibility&2?Gi(i,r,l,u):Al(i,r):m._visibility&2?Gi(i,r,l,u):(m._visibility|=2,Es(i,r,l,u,(r.subtreeFlags&10256)!==0||!1)),d&2048&&sh(v,r);break;case 24:Gi(i,r,l,u),d&2048&&lh(r.alternate,r);break;default:Gi(i,r,l,u)}}function Es(i,r,l,u,d){for(d=d&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=i,v=r,w=l,R=u,W=v.flags;switch(v.tag){case 0:case 11:case 15:Es(m,v,w,R,d),El(8,v);break;case 23:break;case 22:var Z=v.stateNode;v.memoizedState!==null?Z._visibility&2?Es(m,v,w,R,d):Al(m,v):(Z._visibility|=2,Es(m,v,w,R,d)),d&&W&2048&&sh(v.alternate,v);break;case 24:Es(m,v,w,R,d),d&&W&2048&&lh(v.alternate,v);break;default:Es(m,v,w,R,d)}r=r.sibling}}function Al(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=i,u=r,d=u.flags;switch(u.tag){case 22:Al(l,u),d&2048&&sh(u.alternate,u);break;case 24:Al(l,u),d&2048&&lh(u.alternate,u);break;default:Al(l,u)}r=r.sibling}}var Dl=8192;function Ts(i,r,l){if(i.subtreeFlags&Dl)for(i=i.child;i!==null;)L_(i,r,l),i=i.sibling}function L_(i,r,l){switch(i.tag){case 26:Ts(i,r,l),i.flags&Dl&&i.memoizedState!==null&&rx(l,$i,i.memoizedState,i.memoizedProps);break;case 5:Ts(i,r,l);break;case 3:case 4:var u=$i;$i=Ro(i.stateNode.containerInfo),Ts(i,r,l),$i=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=Dl,Dl=16777216,Ts(i,r,l),Dl=u):Ts(i,r,l));break;default:Ts(i,r,l)}}function z_(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function Rl(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];At=u,j_(u,i)}z_(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)O_(i),i=i.sibling}function O_(i){switch(i.tag){case 0:case 11:case 15:Rl(i),i.flags&2048&&Gn(9,i,i.return);break;case 3:Rl(i);break;case 12:Rl(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,go(i)):Rl(i);break;default:Rl(i)}}function go(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];At=u,j_(u,i)}z_(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Gn(8,r,r.return),go(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,go(r));break;default:go(r)}i=i.sibling}}function j_(i,r){for(;At!==null;){var l=At;switch(l.tag){case 0:case 11:case 15:Gn(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:dl(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,At=u;else e:for(l=i;At!==null;){u=At;var d=u.sibling,m=u.return;if(T_(u),u===l){At=null;break e}if(d!==null){d.return=m,At=d;break e}At=m}}}var y1={getCacheForType:function(i){var r=Pt(mt),l=r.data.get(i);return l===void 0&&(l=i(),r.data.set(i,l)),l},cacheSignal:function(){return Pt(mt).controller.signal}},b1=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Ze=null,Be=null,ze=0,We=0,ki=null,Zn=!1,As=!1,ah=!1,An=0,ot=0,Qn=0,Or=0,oh=0,Ei=0,Ds=0,Ml=null,pi=null,uh=!1,vo=0,H_=0,yo=1/0,bo=null,Jn=null,wt=0,er=null,Rs=null,Dn=0,ch=0,hh=null,U_=null,Bl=0,fh=null;function Ti(){return(Fe&2)!==0&&ze!==0?ze&-ze:A.T!==null?vh():tp()}function P_(){if(Ei===0)if((ze&536870912)===0||je){var i=Ta;Ta<<=1,(Ta&3932160)===0&&(Ta=262144),Ei=i}else Ei=536870912;return i=wi.current,i!==null&&(i.flags|=32),Ei}function mi(i,r,l){(i===Ze&&(We===2||We===9)||i.cancelPendingCommit!==null)&&(Ms(i,0),tr(i,ze,Ei,!1)),Js(i,l),((Fe&2)===0||i!==Ze)&&(i===Ze&&((Fe&2)===0&&(Or|=l),ot===4&&tr(i,ze,Ei,!1)),nn(i))}function I_(i,r,l){if((Fe&6)!==0)throw Error(s(327));var u=!l&&(r&127)===0&&(r&i.expiredLanes)===0||Qs(i,r),d=u?w1(i,r):ph(i,r,!0),m=u;do{if(d===0){As&&!u&&tr(i,r,0,!1);break}else{if(l=i.current.alternate,m&&!S1(l)){d=ph(i,r,!1),m=!1;continue}if(d===2){if(m=r,i.errorRecoveryDisabledLanes&m)var v=0;else v=i.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){r=v;e:{var w=i;d=Ml;var R=w.current.memoizedState.isDehydrated;if(R&&(Ms(w,v).flags|=256),v=ph(w,v,!1),v!==2){if(ah&&!R){w.errorRecoveryDisabledLanes|=m,Or|=m,d=4;break e}m=pi,pi=d,m!==null&&(pi===null?pi=m:pi.push.apply(pi,m))}d=v}if(m=!1,d!==2)continue}}if(d===1){Ms(i,0),tr(i,r,0,!0);break}e:{switch(u=i,m=d,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:tr(u,r,Ei,!Zn);break e;case 2:pi=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(d=vo+300-Qt(),10<d)){if(tr(u,r,Ei,!Zn),Da(u,0,!0)!==0)break e;Dn=r,u.timeoutHandle=vg(F_.bind(null,u,l,pi,bo,uh,r,Ei,Or,Ds,Zn,m,"Throttled",-0,0),d);break e}F_(u,l,pi,bo,uh,r,Ei,Or,Ds,Zn,m,null,-0,0)}}break}while(!0);nn(i)}function F_(i,r,l,u,d,m,v,w,R,W,Z,ie,V,$){if(i.timeoutHandle=-1,ie=r.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pn},L_(r,m,ie);var me=(m&62914560)===m?vo-Qt():(m&4194048)===m?H_-Qt():0;if(me=sx(ie,me),me!==null){Dn=m,i.cancelPendingCommit=me(G_.bind(null,i,r,m,l,u,d,v,w,R,Z,ie,null,V,$)),tr(i,m,v,!W);return}}G_(i,r,m,l,u,d,v,w,R)}function S1(i){for(var r=i;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var d=l[u],m=d.getSnapshot;d=d.value;try{if(!Si(m(),d))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function tr(i,r,l,u){r&=~oh,r&=~Or,i.suspendedLanes|=r,i.pingedLanes&=~r,u&&(i.warmLanes|=r),u=i.expirationTimes;for(var d=r;0<d;){var m=31-Ge(d),v=1<<m;u[m]=-1,d&=~v}l!==0&&Qd(i,l,r)}function So(){return(Fe&6)===0?(Nl(0),!1):!0}function dh(){if(Be!==null){if(We===0)var i=Be.return;else i=Be,vn=Tr=null,Dc(i),Ss=null,ml=0,i=Be;for(;i!==null;)y_(i.alternate,i),i=i.return;Be=null}}function Ms(i,r){var l=i.timeoutHandle;l!==-1&&(i.timeoutHandle=-1,I1(l)),l=i.cancelPendingCommit,l!==null&&(i.cancelPendingCommit=null,l()),Dn=0,dh(),Ze=i,Be=l=_n(i.current,null),ze=r,We=0,ki=null,Zn=!1,As=Qs(i,r),ah=!1,Ds=Ei=oh=Or=Qn=ot=0,pi=Ml=null,uh=!1,(r&8)!==0&&(r|=r&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=r;0<u;){var d=31-Ge(u),m=1<<d;r|=i[d],u&=~m}return An=r,Ia(),l}function q_(i,r){Ce=null,A.H=wl,r===bs||r===$a?(r=sm(),We=3):r===gc?(r=sm(),We=4):We=r===Yc?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ki=r,Be===null&&(ot=1,uo(i,zi(r,i.current)))}function W_(){var i=wi.current;return i===null?!0:(ze&4194048)===ze?Ui===null:(ze&62914560)===ze||(ze&536870912)!==0?i===Ui:!1}function Y_(){var i=A.H;return A.H=wl,i===null?wl:i}function V_(){var i=A.A;return A.A=y1,i}function xo(){ot=4,Zn||(ze&4194048)!==ze&&wi.current!==null||(As=!0),(Qn&134217727)===0&&(Or&134217727)===0||Ze===null||tr(Ze,ze,Ei,!1)}function ph(i,r,l){var u=Fe;Fe|=2;var d=Y_(),m=V_();(Ze!==i||ze!==r)&&(bo=null,Ms(i,r)),r=!1;var v=ot;e:do try{if(We!==0&&Be!==null){var w=Be,R=ki;switch(We){case 8:dh(),v=6;break e;case 3:case 2:case 9:case 6:wi.current===null&&(r=!0);var W=We;if(We=0,ki=null,Bs(i,w,R,W),l&&As){v=0;break e}break;default:W=We,We=0,ki=null,Bs(i,w,R,W)}}x1(),v=ot;break}catch(Z){q_(i,Z)}while(!0);return r&&i.shellSuspendCounter++,vn=Tr=null,Fe=u,A.H=d,A.A=m,Be===null&&(Ze=null,ze=0,Ia()),v}function x1(){for(;Be!==null;)K_(Be)}function w1(i,r){var l=Fe;Fe|=2;var u=Y_(),d=V_();Ze!==i||ze!==r?(bo=null,yo=Qt()+500,Ms(i,r)):As=Qs(i,r);e:do try{if(We!==0&&Be!==null){r=Be;var m=ki;t:switch(We){case 1:We=0,ki=null,Bs(i,r,m,1);break;case 2:case 9:if(nm(m)){We=0,ki=null,X_(r);break}r=function(){We!==2&&We!==9||Ze!==i||(We=7),nn(i)},m.then(r,r);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:nm(m)?(We=0,ki=null,X_(r)):(We=0,ki=null,Bs(i,r,m,7));break;case 5:var v=null;switch(Be.tag){case 26:v=Be.memoizedState;case 5:case 27:var w=Be;if(v?Ng(v):w.stateNode.complete){We=0,ki=null;var R=w.sibling;if(R!==null)Be=R;else{var W=w.return;W!==null?(Be=W,wo(W)):Be=null}break t}}We=0,ki=null,Bs(i,r,m,5);break;case 6:We=0,ki=null,Bs(i,r,m,6);break;case 8:dh(),ot=6;break e;default:throw Error(s(462))}}C1();break}catch(Z){q_(i,Z)}while(!0);return vn=Tr=null,A.H=u,A.A=d,Fe=l,Be!==null?0:(Ze=null,ze=0,Ia(),ot)}function C1(){for(;Be!==null&&!Tu();)K_(Be)}function K_(i){var r=g_(i.alternate,i,An);i.memoizedProps=i.pendingProps,r===null?wo(i):Be=r}function X_(i){var r=i,l=r.alternate;switch(r.tag){case 15:case 0:r=h_(l,r,r.pendingProps,r.type,void 0,ze);break;case 11:r=h_(l,r,r.pendingProps,r.type.render,r.ref,ze);break;case 5:Dc(r);default:y_(l,r),r=Be=Vp(r,An),r=g_(l,r,An)}i.memoizedProps=i.pendingProps,r===null?wo(i):Be=r}function Bs(i,r,l,u){vn=Tr=null,Dc(r),Ss=null,ml=0;var d=r.return;try{if(f1(i,d,r,l,ze)){ot=1,uo(i,zi(l,i.current)),Be=null;return}}catch(m){if(d!==null)throw Be=d,m;ot=1,uo(i,zi(l,i.current)),Be=null;return}r.flags&32768?(je||u===1?i=!0:As||(ze&536870912)!==0?i=!1:(Zn=i=!0,(u===2||u===9||u===3||u===6)&&(u=wi.current,u!==null&&u.tag===13&&(u.flags|=16384))),$_(r,i)):wo(r)}function wo(i){var r=i;do{if((r.flags&32768)!==0){$_(r,Zn);return}i=r.return;var l=m1(r.alternate,r,An);if(l!==null){Be=l;return}if(r=r.sibling,r!==null){Be=r;return}Be=r=i}while(r!==null);ot===0&&(ot=5)}function $_(i,r){do{var l=_1(i.alternate,i);if(l!==null){l.flags&=32767,Be=l;return}if(l=i.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(i=i.sibling,i!==null)){Be=i;return}Be=i=l}while(i!==null);ot=6,Be=null}function G_(i,r,l,u,d,m,v,w,R){i.cancelPendingCommit=null;do Co();while(wt!==0);if((Fe&6)!==0)throw Error(s(327));if(r!==null){if(r===i.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=ic,n0(i,l,m,v,w,R),i===Ze&&(Be=Ze=null,ze=0),Rs=r,er=i,Dn=l,ch=m,hh=d,U_=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,A1(Se,function(){return tg(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=A.T,A.T=null,d=I.p,I.p=2,v=Fe,Fe|=4;try{g1(i,r,l)}finally{Fe=v,I.p=d,A.T=u}}wt=1,Z_(),Q_(),J_()}}function Z_(){if(wt===1){wt=0;var i=er,r=Rs,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=A.T,A.T=null;var u=I.p;I.p=2;var d=Fe;Fe|=4;try{M_(r,i);var m=Eh,v=jp(i.containerInfo),w=m.focusedElem,R=m.selectionRange;if(v!==w&&w&&w.ownerDocument&&Op(w.ownerDocument.documentElement,w)){if(R!==null&&Zu(w)){var W=R.start,Z=R.end;if(Z===void 0&&(Z=W),"selectionStart"in w)w.selectionStart=W,w.selectionEnd=Math.min(Z,w.value.length);else{var ie=w.ownerDocument||document,V=ie&&ie.defaultView||window;if(V.getSelection){var $=V.getSelection(),me=w.textContent.length,ye=Math.min(R.start,me),Xe=R.end===void 0?ye:Math.min(R.end,me);!$.extend&&ye>Xe&&(v=Xe,Xe=ye,ye=v);var H=zp(w,ye),z=zp(w,Xe);if(H&&z&&($.rangeCount!==1||$.anchorNode!==H.node||$.anchorOffset!==H.offset||$.focusNode!==z.node||$.focusOffset!==z.offset)){var F=ie.createRange();F.setStart(H.node,H.offset),$.removeAllRanges(),ye>Xe?($.addRange(F),$.extend(z.node,z.offset)):(F.setEnd(z.node,z.offset),$.addRange(F))}}}}for(ie=[],$=w;$=$.parentNode;)$.nodeType===1&&ie.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ie.length;w++){var te=ie[w];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Oo=!!kh,Eh=kh=null}finally{Fe=d,I.p=u,A.T=l}}i.current=r,wt=2}}function Q_(){if(wt===2){wt=0;var i=er,r=Rs,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=A.T,A.T=null;var u=I.p;I.p=2;var d=Fe;Fe|=4;try{E_(i,r.alternate,r)}finally{Fe=d,I.p=u,A.T=l}}wt=3}}function J_(){if(wt===4||wt===3){wt=0,Au();var i=er,r=Rs,l=Dn,u=U_;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?wt=5:(wt=0,Rs=er=null,eg(i,i.pendingLanes));var d=i.pendingLanes;if(d===0&&(Jn=null),Bu(l),r=r.stateNode,xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(Jt,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=A.T,d=I.p,I.p=2,A.T=null;try{for(var m=i.onRecoverableError,v=0;v<u.length;v++){var w=u[v];m(w.value,{componentStack:w.stack})}}finally{A.T=r,I.p=d}}(Dn&3)!==0&&Co(),nn(i),d=i.pendingLanes,(l&261930)!==0&&(d&42)!==0?i===fh?Bl++:(Bl=0,fh=i):Bl=0,Nl(0)}}function eg(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,dl(r)))}function Co(){return Z_(),Q_(),J_(),tg()}function tg(){if(wt!==5)return!1;var i=er,r=ch;ch=0;var l=Bu(Dn),u=A.T,d=I.p;try{I.p=32>l?32:l,A.T=null,l=hh,hh=null;var m=er,v=Dn;if(wt=0,Rs=er=null,Dn=0,(Fe&6)!==0)throw Error(s(331));var w=Fe;if(Fe|=4,O_(m.current),N_(m,m.current,v,l),Fe=w,Nl(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(Jt,m)}catch{}return!0}finally{I.p=d,A.T=u,eg(i,r)}}function ig(i,r,l){r=zi(l,r),r=Wc(i.stateNode,r,2),i=Kn(i,r,2),i!==null&&(Js(i,2),nn(i))}function Ye(i,r,l){if(i.tag===3)ig(i,i,l);else for(;r!==null;){if(r.tag===3){ig(r,i,l);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jn===null||!Jn.has(u))){i=zi(l,i),l=n_(2),u=Kn(r,l,2),u!==null&&(r_(l,u,r,i),Js(u,2),nn(u));break}}r=r.return}}function mh(i,r,l){var u=i.pingCache;if(u===null){u=i.pingCache=new b1;var d=new Set;u.set(r,d)}else d=u.get(r),d===void 0&&(d=new Set,u.set(r,d));d.has(l)||(ah=!0,d.add(l),i=k1.bind(null,i,r,l),r.then(i,i))}function k1(i,r,l){var u=i.pingCache;u!==null&&u.delete(r),i.pingedLanes|=i.suspendedLanes&l,i.warmLanes&=~l,Ze===i&&(ze&l)===l&&(ot===4||ot===3&&(ze&62914560)===ze&&300>Qt()-vo?(Fe&2)===0&&Ms(i,0):oh|=l,Ds===ze&&(Ds=0)),nn(i)}function ng(i,r){r===0&&(r=Zd()),i=Cr(i,r),i!==null&&(Js(i,r),nn(i))}function E1(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function T1(i,r){var l=0;switch(i.tag){case 31:case 13:var u=i.stateNode,d=i.memoizedState;d!==null&&(l=d.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(r),ng(i,l)}function A1(i,r){return Jr(i,r)}var ko=null,Ns=null,_h=!1,Eo=!1,gh=!1,ir=0;function nn(i){i!==Ns&&i.next===null&&(Ns===null?ko=Ns=i:Ns=Ns.next=i),Eo=!0,_h||(_h=!0,R1())}function Nl(i,r){if(!gh&&Eo){gh=!0;do for(var l=!1,u=ko;u!==null;){if(i!==0){var d=u.pendingLanes;if(d===0)var m=0;else{var v=u.suspendedLanes,w=u.pingedLanes;m=(1<<31-Ge(42|i)+1)-1,m&=d&~(v&~w),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,ag(u,m))}else m=ze,m=Da(u,u===Ze?m:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(m&3)===0||Qs(u,m)||(l=!0,ag(u,m));u=u.next}while(l);gh=!1}}function D1(){rg()}function rg(){Eo=_h=!1;var i=0;ir!==0&&P1()&&(i=ir);for(var r=Qt(),l=null,u=ko;u!==null;){var d=u.next,m=sg(u,r);m===0?(u.next=null,l===null?ko=d:l.next=d,d===null&&(Ns=l)):(l=u,(i!==0||(m&3)!==0)&&(Eo=!0)),u=d}wt!==0&&wt!==5||Nl(i),ir!==0&&(ir=0)}function sg(i,r){for(var l=i.suspendedLanes,u=i.pingedLanes,d=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var v=31-Ge(m),w=1<<v,R=d[v];R===-1?((w&l)===0||(w&u)!==0)&&(d[v]=i0(w,r)):R<=r&&(i.expiredLanes|=w),m&=~w}if(r=Ze,l=ze,l=Da(i,i===r?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,l===0||i===r&&(We===2||We===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&Zs(u),i.callbackNode=null,i.callbackPriority=0;if((l&3)===0||Qs(i,l)){if(r=l&-l,r===i.callbackPriority)return r;switch(u!==null&&Zs(u),Bu(l)){case 2:case 8:l=ce;break;case 32:l=Se;break;case 268435456:l=qe;break;default:l=Se}return u=lg.bind(null,i),l=Jr(l,u),i.callbackPriority=r,i.callbackNode=l,r}return u!==null&&u!==null&&Zs(u),i.callbackPriority=2,i.callbackNode=null,2}function lg(i,r){if(wt!==0&&wt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var l=i.callbackNode;if(Co()&&i.callbackNode!==l)return null;var u=ze;return u=Da(i,i===Ze?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(I_(i,u,r),sg(i,Qt()),i.callbackNode!=null&&i.callbackNode===l?lg.bind(null,i):null)}function ag(i,r){if(Co())return null;I_(i,r,!0)}function R1(){F1(function(){(Fe&6)!==0?Jr(J,D1):rg()})}function vh(){if(ir===0){var i=vs;i===0&&(i=Ea,Ea<<=1,(Ea&261888)===0&&(Ea=256)),ir=i}return ir}function og(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Na(""+i)}function ug(i,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,i.id&&l.setAttribute("form",i.id),r.parentNode.insertBefore(l,r),i=new FormData(i),l.parentNode.removeChild(l),i}function M1(i,r,l,u,d){if(r==="submit"&&l&&l.stateNode===d){var m=og((d[ui]||null).action),v=u.submitter;v&&(r=(r=v[ui]||null)?og(r.formAction):v.getAttribute("formAction"),r!==null&&(m=r,v=null));var w=new ja("action","action",null,u,d);i.push({event:w,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ir!==0){var R=v?ug(d,v):new FormData(d);Hc(l,{pending:!0,data:R,method:d.method,action:m},null,R)}}else typeof m=="function"&&(w.preventDefault(),R=v?ug(d,v):new FormData(d),Hc(l,{pending:!0,data:R,method:d.method,action:m},m,R))},currentTarget:d}]})}}for(var yh=0;yh<tc.length;yh++){var bh=tc[yh],B1=bh.toLowerCase(),N1=bh[0].toUpperCase()+bh.slice(1);Xi(B1,"on"+N1)}Xi(Pp,"onAnimationEnd"),Xi(Ip,"onAnimationIteration"),Xi(Fp,"onAnimationStart"),Xi("dblclick","onDoubleClick"),Xi("focusin","onFocus"),Xi("focusout","onBlur"),Xi($0,"onTransitionRun"),Xi(G0,"onTransitionStart"),Xi(Z0,"onTransitionCancel"),Xi(qp,"onTransitionEnd"),rs("onMouseEnter",["mouseout","mouseover"]),rs("onMouseLeave",["mouseout","mouseover"]),rs("onPointerEnter",["pointerout","pointerover"]),rs("onPointerLeave",["pointerout","pointerover"]),br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),br("onBeforeInput",["compositionend","keypress","textInput","paste"]),br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ll="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(" "),L1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ll));function cg(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var u=i[l],d=u.event;u=u.listeners;e:{var m=void 0;if(r)for(var v=u.length-1;0<=v;v--){var w=u[v],R=w.instance,W=w.currentTarget;if(w=w.listener,R!==m&&d.isPropagationStopped())break e;m=w,d.currentTarget=W;try{m(d)}catch(Z){Pa(Z)}d.currentTarget=null,m=R}else for(v=0;v<u.length;v++){if(w=u[v],R=w.instance,W=w.currentTarget,w=w.listener,R!==m&&d.isPropagationStopped())break e;m=w,d.currentTarget=W;try{m(d)}catch(Z){Pa(Z)}d.currentTarget=null,m=R}}}}function Ne(i,r){var l=r[Nu];l===void 0&&(l=r[Nu]=new Set);var u=i+"__bubble";l.has(u)||(hg(r,i,2,!1),l.add(u))}function Sh(i,r,l){var u=0;r&&(u|=4),hg(l,i,u,r)}var To="_reactListening"+Math.random().toString(36).slice(2);function xh(i){if(!i[To]){i[To]=!0,rp.forEach(function(l){l!=="selectionchange"&&(L1.has(l)||Sh(l,!1,i),Sh(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[To]||(r[To]=!0,Sh("selectionchange",!1,r))}}function hg(i,r,l,u){switch(Pg(r)){case 2:var d=ox;break;case 8:d=ux;break;default:d=jh}l=d.bind(null,r,l,i),d=void 0,!Fu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),u?d!==void 0?i.addEventListener(r,l,{capture:!0,passive:d}):i.addEventListener(r,l,!0):d!==void 0?i.addEventListener(r,l,{passive:d}):i.addEventListener(r,l,!1)}function wh(i,r,l,u,d){var m=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var v=u.tag;if(v===3||v===4){var w=u.stateNode.containerInfo;if(w===d)break;if(v===4)for(v=u.return;v!==null;){var R=v.tag;if((R===3||R===4)&&v.stateNode.containerInfo===d)return;v=v.return}for(;w!==null;){if(v=ts(w),v===null)return;if(R=v.tag,R===5||R===6||R===26||R===27){u=m=v;continue e}w=w.parentNode}}u=u.return}_p(function(){var W=m,Z=Pu(l),ie=[];e:{var V=Wp.get(i);if(V!==void 0){var $=ja,me=i;switch(i){case"keypress":if(za(l)===0)break e;case"keydown":case"keyup":$=T0;break;case"focusin":me="focus",$=Vu;break;case"focusout":me="blur",$=Vu;break;case"beforeblur":case"afterblur":$=Vu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=yp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=m0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=R0;break;case Pp:case Ip:case Fp:$=v0;break;case qp:$=B0;break;case"scroll":case"scrollend":$=d0;break;case"wheel":$=L0;break;case"copy":case"cut":case"paste":$=b0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=Sp;break;case"toggle":case"beforetoggle":$=O0}var ye=(r&4)!==0,Xe=!ye&&(i==="scroll"||i==="scrollend"),H=ye?V!==null?V+"Capture":null:V;ye=[];for(var z=W,F;z!==null;){var te=z;if(F=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||F===null||H===null||(te=il(z,H),te!=null&&ye.push(zl(z,te,F))),Xe)break;z=z.return}0<ye.length&&(V=new $(V,me,null,l,Z),ie.push({event:V,listeners:ye}))}}if((r&7)===0){e:{if(V=i==="mouseover"||i==="pointerover",$=i==="mouseout"||i==="pointerout",V&&l!==Uu&&(me=l.relatedTarget||l.fromElement)&&(ts(me)||me[es]))break e;if(($||V)&&(V=Z.window===Z?Z:(V=Z.ownerDocument)?V.defaultView||V.parentWindow:window,$?(me=l.relatedTarget||l.toElement,$=W,me=me?ts(me):null,me!==null&&(Xe=o(me),ye=me.tag,me!==Xe||ye!==5&&ye!==27&&ye!==6)&&(me=null)):($=null,me=W),$!==me)){if(ye=yp,te="onMouseLeave",H="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(ye=Sp,te="onPointerLeave",H="onPointerEnter",z="pointer"),Xe=$==null?V:tl($),F=me==null?V:tl(me),V=new ye(te,z+"leave",$,l,Z),V.target=Xe,V.relatedTarget=F,te=null,ts(Z)===W&&(ye=new ye(H,z+"enter",me,l,Z),ye.target=F,ye.relatedTarget=Xe,te=ye),Xe=te,$&&me)t:{for(ye=z1,H=$,z=me,F=0,te=H;te;te=ye(te))F++;te=0;for(var ge=z;ge;ge=ye(ge))te++;for(;0<F-te;)H=ye(H),F--;for(;0<te-F;)z=ye(z),te--;for(;F--;){if(H===z||z!==null&&H===z.alternate){ye=H;break t}H=ye(H),z=ye(z)}ye=null}else ye=null;$!==null&&fg(ie,V,$,ye,!1),me!==null&&Xe!==null&&fg(ie,Xe,me,ye,!0)}}e:{if(V=W?tl(W):window,$=V.nodeName&&V.nodeName.toLowerCase(),$==="select"||$==="input"&&V.type==="file")var Pe=Dp;else if(Tp(V))if(Rp)Pe=V0;else{Pe=W0;var _e=q0}else $=V.nodeName,!$||$.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?W&&Hu(W.elementType)&&(Pe=Dp):Pe=Y0;if(Pe&&(Pe=Pe(i,W))){Ap(ie,Pe,l,Z);break e}_e&&_e(i,V,W),i==="focusout"&&W&&V.type==="number"&&W.memoizedProps.value!=null&&ju(V,"number",V.value)}switch(_e=W?tl(W):window,i){case"focusin":(Tp(_e)||_e.contentEditable==="true")&&(cs=_e,Qu=W,cl=null);break;case"focusout":cl=Qu=cs=null;break;case"mousedown":Ju=!0;break;case"contextmenu":case"mouseup":case"dragend":Ju=!1,Hp(ie,l,Z);break;case"selectionchange":if(X0)break;case"keydown":case"keyup":Hp(ie,l,Z)}var ke;if(Xu)e:{switch(i){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else us?kp(i,l)&&(Oe="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Oe="onCompositionStart");Oe&&(xp&&l.locale!=="ko"&&(us||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&us&&(ke=gp()):(Pn=Z,qu="value"in Pn?Pn.value:Pn.textContent,us=!0)),_e=Ao(W,Oe),0<_e.length&&(Oe=new bp(Oe,i,null,l,Z),ie.push({event:Oe,listeners:_e}),ke?Oe.data=ke:(ke=Ep(l),ke!==null&&(Oe.data=ke)))),(ke=H0?U0(i,l):P0(i,l))&&(Oe=Ao(W,"onBeforeInput"),0<Oe.length&&(_e=new bp("onBeforeInput","beforeinput",null,l,Z),ie.push({event:_e,listeners:Oe}),_e.data=ke)),M1(ie,i,W,l,Z)}cg(ie,r)})}function zl(i,r,l){return{instance:i,listener:r,currentTarget:l}}function Ao(i,r){for(var l=r+"Capture",u=[];i!==null;){var d=i,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=il(i,l),d!=null&&u.unshift(zl(i,d,m)),d=il(i,r),d!=null&&u.push(zl(i,d,m))),i.tag===3)return u;i=i.return}return[]}function z1(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function fg(i,r,l,u,d){for(var m=r._reactName,v=[];l!==null&&l!==u;){var w=l,R=w.alternate,W=w.stateNode;if(w=w.tag,R!==null&&R===u)break;w!==5&&w!==26&&w!==27||W===null||(R=W,d?(W=il(l,m),W!=null&&v.unshift(zl(l,W,R))):d||(W=il(l,m),W!=null&&v.push(zl(l,W,R)))),l=l.return}v.length!==0&&i.push({event:r,listeners:v})}var O1=/\r\n?/g,j1=/\u0000|\uFFFD/g;function dg(i){return(typeof i=="string"?i:""+i).replace(O1,`
49
- `).replace(j1,"")}function pg(i,r){return r=dg(r),dg(i)===r}function Ke(i,r,l,u,d,m){switch(l){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||ls(i,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&ls(i,""+u);break;case"className":Ma(i,"class",u);break;case"tabIndex":Ma(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ma(i,l,u);break;case"style":pp(i,u,m);break;case"data":if(r!=="object"){Ma(i,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||l!=="href")){i.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=Na(""+u),i.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(l==="formAction"?(r!=="input"&&Ke(i,r,"name",d.name,d,null),Ke(i,r,"formEncType",d.formEncType,d,null),Ke(i,r,"formMethod",d.formMethod,d,null),Ke(i,r,"formTarget",d.formTarget,d,null)):(Ke(i,r,"encType",d.encType,d,null),Ke(i,r,"method",d.method,d,null),Ke(i,r,"target",d.target,d,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=Na(""+u),i.setAttribute(l,u);break;case"onClick":u!=null&&(i.onclick=pn);break;case"onScroll":u!=null&&Ne("scroll",i);break;case"onScrollEnd":u!=null&&Ne("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(l=u.__html,l!=null){if(d.children!=null)throw Error(s(60));i.innerHTML=l}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}l=Na(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""+u):i.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""):i.removeAttribute(l);break;case"capture":case"download":u===!0?i.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,u):i.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(l,u):i.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(l):i.setAttribute(l,u);break;case"popover":Ne("beforetoggle",i),Ne("toggle",i),Ra(i,"popover",u);break;case"xlinkActuate":dn(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":dn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":dn(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":dn(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":dn(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":dn(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":dn(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":dn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":dn(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Ra(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=h0.get(l)||l,Ra(i,l,u))}}function Ch(i,r,l,u,d,m){switch(l){case"style":pp(i,u,m);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(l=u.__html,l!=null){if(d.children!=null)throw Error(s(60));i.innerHTML=l}}break;case"children":typeof u=="string"?ls(i,u):(typeof u=="number"||typeof u=="bigint")&&ls(i,""+u);break;case"onScroll":u!=null&&Ne("scroll",i);break;case"onScrollEnd":u!=null&&Ne("scrollend",i);break;case"onClick":u!=null&&(i.onclick=pn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sp.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(d=l.endsWith("Capture"),r=l.slice(2,d?l.length-7:void 0),m=i[ui]||null,m=m!=null?m[l]:null,typeof m=="function"&&i.removeEventListener(r,m,d),typeof u=="function")){typeof m!="function"&&m!==null&&(l in i?i[l]=null:i.hasAttribute(l)&&i.removeAttribute(l)),i.addEventListener(r,u,d);break e}l in i?i[l]=u:u===!0?i.setAttribute(l,""):Ra(i,l,u)}}}function Ft(i,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",i),Ne("load",i);var u=!1,d=!1,m;for(m in l)if(l.hasOwnProperty(m)){var v=l[m];if(v!=null)switch(m){case"src":u=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ke(i,r,m,v,l,null)}}d&&Ke(i,r,"srcSet",l.srcSet,l,null),u&&Ke(i,r,"src",l.src,l,null);return;case"input":Ne("invalid",i);var w=m=v=d=null,R=null,W=null;for(u in l)if(l.hasOwnProperty(u)){var Z=l[u];if(Z!=null)switch(u){case"name":d=Z;break;case"type":v=Z;break;case"checked":R=Z;break;case"defaultChecked":W=Z;break;case"value":m=Z;break;case"defaultValue":w=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,r));break;default:Ke(i,r,u,Z,l,null)}}cp(i,m,w,R,W,v,d,!1);return;case"select":Ne("invalid",i),u=v=m=null;for(d in l)if(l.hasOwnProperty(d)&&(w=l[d],w!=null))switch(d){case"value":m=w;break;case"defaultValue":v=w;break;case"multiple":u=w;default:Ke(i,r,d,w,l,null)}r=m,l=v,i.multiple=!!u,r!=null?ss(i,!!u,r,!1):l!=null&&ss(i,!!u,l,!0);return;case"textarea":Ne("invalid",i),m=d=u=null;for(v in l)if(l.hasOwnProperty(v)&&(w=l[v],w!=null))switch(v){case"value":u=w;break;case"defaultValue":d=w;break;case"children":m=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:Ke(i,r,v,w,l,null)}fp(i,u,d,m);return;case"option":for(R in l)if(l.hasOwnProperty(R)&&(u=l[R],u!=null))switch(R){case"selected":i.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Ke(i,r,R,u,l,null)}return;case"dialog":Ne("beforetoggle",i),Ne("toggle",i),Ne("cancel",i),Ne("close",i);break;case"iframe":case"object":Ne("load",i);break;case"video":case"audio":for(u=0;u<Ll.length;u++)Ne(Ll[u],i);break;case"image":Ne("error",i),Ne("load",i);break;case"details":Ne("toggle",i);break;case"embed":case"source":case"link":Ne("error",i),Ne("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(u=l[W],u!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ke(i,r,W,u,l,null)}return;default:if(Hu(r)){for(Z in l)l.hasOwnProperty(Z)&&(u=l[Z],u!==void 0&&Ch(i,r,Z,u,l,void 0));return}}for(w in l)l.hasOwnProperty(w)&&(u=l[w],u!=null&&Ke(i,r,w,u,l,null))}function H1(i,r,l,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,v=null,w=null,R=null,W=null,Z=null;for($ in l){var ie=l[$];if(l.hasOwnProperty($)&&ie!=null)switch($){case"checked":break;case"value":break;case"defaultValue":R=ie;default:u.hasOwnProperty($)||Ke(i,r,$,null,u,ie)}}for(var V in u){var $=u[V];if(ie=l[V],u.hasOwnProperty(V)&&($!=null||ie!=null))switch(V){case"type":m=$;break;case"name":d=$;break;case"checked":W=$;break;case"defaultChecked":Z=$;break;case"value":v=$;break;case"defaultValue":w=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(s(137,r));break;default:$!==ie&&Ke(i,r,V,$,u,ie)}}Ou(i,v,w,R,W,Z,m,d);return;case"select":$=v=w=V=null;for(m in l)if(R=l[m],l.hasOwnProperty(m)&&R!=null)switch(m){case"value":break;case"multiple":$=R;default:u.hasOwnProperty(m)||Ke(i,r,m,null,u,R)}for(d in u)if(m=u[d],R=l[d],u.hasOwnProperty(d)&&(m!=null||R!=null))switch(d){case"value":V=m;break;case"defaultValue":w=m;break;case"multiple":v=m;default:m!==R&&Ke(i,r,d,m,u,R)}r=w,l=v,u=$,V!=null?ss(i,!!l,V,!1):!!u!=!!l&&(r!=null?ss(i,!!l,r,!0):ss(i,!!l,l?[]:"",!1));return;case"textarea":$=V=null;for(w in l)if(d=l[w],l.hasOwnProperty(w)&&d!=null&&!u.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ke(i,r,w,null,u,d)}for(v in u)if(d=u[v],m=l[v],u.hasOwnProperty(v)&&(d!=null||m!=null))switch(v){case"value":V=d;break;case"defaultValue":$=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==m&&Ke(i,r,v,d,u,m)}hp(i,V,$);return;case"option":for(var me in l)if(V=l[me],l.hasOwnProperty(me)&&V!=null&&!u.hasOwnProperty(me))switch(me){case"selected":i.selected=!1;break;default:Ke(i,r,me,null,u,V)}for(R in u)if(V=u[R],$=l[R],u.hasOwnProperty(R)&&V!==$&&(V!=null||$!=null))switch(R){case"selected":i.selected=V&&typeof V!="function"&&typeof V!="symbol";break;default:Ke(i,r,R,V,u,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in l)V=l[ye],l.hasOwnProperty(ye)&&V!=null&&!u.hasOwnProperty(ye)&&Ke(i,r,ye,null,u,V);for(W in u)if(V=u[W],$=l[W],u.hasOwnProperty(W)&&V!==$&&(V!=null||$!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(s(137,r));break;default:Ke(i,r,W,V,u,$)}return;default:if(Hu(r)){for(var Xe in l)V=l[Xe],l.hasOwnProperty(Xe)&&V!==void 0&&!u.hasOwnProperty(Xe)&&Ch(i,r,Xe,void 0,u,V);for(Z in u)V=u[Z],$=l[Z],!u.hasOwnProperty(Z)||V===$||V===void 0&&$===void 0||Ch(i,r,Z,V,u,$);return}}for(var H in l)V=l[H],l.hasOwnProperty(H)&&V!=null&&!u.hasOwnProperty(H)&&Ke(i,r,H,null,u,V);for(ie in u)V=u[ie],$=l[ie],!u.hasOwnProperty(ie)||V===$||V==null&&$==null||Ke(i,r,ie,V,u,$)}function mg(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function U1(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var d=l[u],m=d.transferSize,v=d.initiatorType,w=d.duration;if(m&&w&&mg(v)){for(v=0,w=d.responseEnd,u+=1;u<l.length;u++){var R=l[u],W=R.startTime;if(W>w)break;var Z=R.transferSize,ie=R.initiatorType;Z&&mg(ie)&&(R=R.responseEnd,v+=Z*(R<w?1:(w-W)/(R-W)))}if(--u,r+=8*(m+v)/(d.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var kh=null,Eh=null;function Do(i){return i.nodeType===9?i:i.ownerDocument}function _g(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gg(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function Th(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Ah=null;function P1(){var i=window.event;return i&&i.type==="popstate"?i===Ah?!1:(Ah=i,!0):(Ah=null,!1)}var vg=typeof setTimeout=="function"?setTimeout:void 0,I1=typeof clearTimeout=="function"?clearTimeout:void 0,yg=typeof Promise=="function"?Promise:void 0,F1=typeof queueMicrotask=="function"?queueMicrotask:typeof yg<"u"?function(i){return yg.resolve(null).then(i).catch(q1)}:vg;function q1(i){setTimeout(function(){throw i})}function nr(i){return i==="head"}function bg(i,r){var l=r,u=0;do{var d=l.nextSibling;if(i.removeChild(l),d&&d.nodeType===8)if(l=d.data,l==="/$"||l==="/&"){if(u===0){i.removeChild(d),js(r);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Ol(i.ownerDocument.documentElement);else if(l==="head"){l=i.ownerDocument.head,Ol(l);for(var m=l.firstChild;m;){var v=m.nextSibling,w=m.nodeName;m[el]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=v}}else l==="body"&&Ol(i.ownerDocument.body);l=d}while(l);js(r)}function Sg(i,r){var l=i;i=0;do{var u=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(i===0)break;i--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||i++;l=u}while(l)}function Dh(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Dh(l),Lu(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}i.removeChild(l)}}function W1(i,r,l,u){for(;i.nodeType===1;){var d=l;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[el])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(m=i.getAttribute("rel"),m==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(m!==d.rel||i.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||i.getAttribute("title")!==(d.title==null?null:d.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(m=i.getAttribute("src"),(m!==(d.src==null?null:d.src)||i.getAttribute("type")!==(d.type==null?null:d.type)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&i.getAttribute("name")===m)return i}else return i;if(i=Pi(i.nextSibling),i===null)break}return null}function Y1(i,r,l){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Pi(i.nextSibling),i===null))return null;return i}function xg(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Pi(i.nextSibling),i===null))return null;return i}function Rh(i){return i.data==="$?"||i.data==="$~"}function Mh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function V1(i,r){var l=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||l.readyState!=="loading")r();else{var u=function(){r(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function Pi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var Bh=null;function wg(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"||l==="/&"){if(r===0)return Pi(i.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}i=i.nextSibling}return null}function Cg(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return i;r--}else l!=="/$"&&l!=="/&"||r++}i=i.previousSibling}return null}function kg(i,r,l){switch(r=Do(l),i){case"html":if(i=r.documentElement,!i)throw Error(s(452));return i;case"head":if(i=r.head,!i)throw Error(s(453));return i;case"body":if(i=r.body,!i)throw Error(s(454));return i;default:throw Error(s(451))}}function Ol(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Lu(i)}var Ii=new Map,Eg=new Set;function Ro(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Rn=I.d;I.d={f:K1,r:X1,D:$1,C:G1,L:Z1,m:Q1,X:ex,S:J1,M:tx};function K1(){var i=Rn.f(),r=So();return i||r}function X1(i){var r=is(i);r!==null&&r.tag===5&&r.type==="form"?qm(r):Rn.r(i)}var Ls=typeof document>"u"?null:document;function Tg(i,r,l){var u=Ls;if(u&&typeof r=="string"&&r){var d=Ni(r);d='link[rel="'+i+'"][href="'+d+'"]',typeof l=="string"&&(d+='[crossorigin="'+l+'"]'),Eg.has(d)||(Eg.add(d),i={rel:i,crossOrigin:l,href:r},u.querySelector(d)===null&&(r=u.createElement("link"),Ft(r,"link",i),Tt(r),u.head.appendChild(r)))}}function $1(i){Rn.D(i),Tg("dns-prefetch",i,null)}function G1(i,r){Rn.C(i,r),Tg("preconnect",i,r)}function Z1(i,r,l){Rn.L(i,r,l);var u=Ls;if(u&&i&&r){var d='link[rel="preload"][as="'+Ni(r)+'"]';r==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+Ni(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+Ni(l.imageSizes)+'"]')):d+='[href="'+Ni(i)+'"]';var m=d;switch(r){case"style":m=zs(i);break;case"script":m=Os(i)}Ii.has(m)||(i=_({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:i,as:r},l),Ii.set(m,i),u.querySelector(d)!==null||r==="style"&&u.querySelector(jl(m))||r==="script"&&u.querySelector(Hl(m))||(r=u.createElement("link"),Ft(r,"link",i),Tt(r),u.head.appendChild(r)))}}function Q1(i,r){Rn.m(i,r);var l=Ls;if(l&&i){var u=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+Ni(u)+'"][href="'+Ni(i)+'"]',m=d;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Os(i)}if(!Ii.has(m)&&(i=_({rel:"modulepreload",href:i},r),Ii.set(m,i),l.querySelector(d)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Hl(m)))return}u=l.createElement("link"),Ft(u,"link",i),Tt(u),l.head.appendChild(u)}}}function J1(i,r,l){Rn.S(i,r,l);var u=Ls;if(u&&i){var d=ns(u).hoistableStyles,m=zs(i);r=r||"default";var v=d.get(m);if(!v){var w={loading:0,preload:null};if(v=u.querySelector(jl(m)))w.loading=5;else{i=_({rel:"stylesheet",href:i,"data-precedence":r},l),(l=Ii.get(m))&&Nh(i,l);var R=v=u.createElement("link");Tt(R),Ft(R,"link",i),R._p=new Promise(function(W,Z){R.onload=W,R.onerror=Z}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Mo(v,r,u)}v={type:"stylesheet",instance:v,count:1,state:w},d.set(m,v)}}}function ex(i,r){Rn.X(i,r);var l=Ls;if(l&&i){var u=ns(l).hoistableScripts,d=Os(i),m=u.get(d);m||(m=l.querySelector(Hl(d)),m||(i=_({src:i,async:!0},r),(r=Ii.get(d))&&Lh(i,r),m=l.createElement("script"),Tt(m),Ft(m,"link",i),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(d,m))}}function tx(i,r){Rn.M(i,r);var l=Ls;if(l&&i){var u=ns(l).hoistableScripts,d=Os(i),m=u.get(d);m||(m=l.querySelector(Hl(d)),m||(i=_({src:i,async:!0,type:"module"},r),(r=Ii.get(d))&&Lh(i,r),m=l.createElement("script"),Tt(m),Ft(m,"link",i),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(d,m))}}function Ag(i,r,l,u){var d=(d=he.current)?Ro(d):null;if(!d)throw Error(s(446));switch(i){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=zs(l.href),l=ns(d).hoistableStyles,u=l.get(r),u||(u={type:"style",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){i=zs(l.href);var m=ns(d).hoistableStyles,v=m.get(i);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(i,v),(m=d.querySelector(jl(i)))&&!m._p&&(v.instance=m,v.state.loading=5),Ii.has(i)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ii.set(i,l),m||ix(d,i,l,v.state))),r&&u===null)throw Error(s(528,""));return v}if(r&&u!==null)throw Error(s(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Os(l),l=ns(d).hoistableScripts,u=l.get(r),u||(u={type:"script",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,i))}}function zs(i){return'href="'+Ni(i)+'"'}function jl(i){return'link[rel="stylesheet"]['+i+"]"}function Dg(i){return _({},i,{"data-precedence":i.precedence,precedence:null})}function ix(i,r,l,u){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=i.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),Ft(r,"link",l),Tt(r),i.head.appendChild(r))}function Os(i){return'[src="'+Ni(i)+'"]'}function Hl(i){return"script[async]"+i}function Rg(i,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var u=i.querySelector('style[data-href~="'+Ni(l.href)+'"]');if(u)return r.instance=u,Tt(u),u;var d=_({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Tt(u),Ft(u,"style",d),Mo(u,l.precedence,i),r.instance=u;case"stylesheet":d=zs(l.href);var m=i.querySelector(jl(d));if(m)return r.state.loading|=4,r.instance=m,Tt(m),m;u=Dg(l),(d=Ii.get(d))&&Nh(u,d),m=(i.ownerDocument||i).createElement("link"),Tt(m);var v=m;return v._p=new Promise(function(w,R){v.onload=w,v.onerror=R}),Ft(m,"link",u),r.state.loading|=4,Mo(m,l.precedence,i),r.instance=m;case"script":return m=Os(l.src),(d=i.querySelector(Hl(m)))?(r.instance=d,Tt(d),d):(u=l,(d=Ii.get(m))&&(u=_({},l),Lh(u,d)),i=i.ownerDocument||i,d=i.createElement("script"),Tt(d),Ft(d,"link",u),i.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Mo(u,l.precedence,i));return r.instance}function Mo(i,r,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=u.length?u[u.length-1]:null,m=d,v=0;v<u.length;v++){var w=u[v];if(w.dataset.precedence===r)m=w;else if(m!==d)break}m?m.parentNode.insertBefore(i,m.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(i,r.firstChild))}function Nh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Lh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Bo=null;function Mg(i,r,l){if(Bo===null){var u=new Map,d=Bo=new Map;d.set(l,u)}else d=Bo,u=d.get(l),u||(u=new Map,d.set(l,u));if(u.has(i))return u;for(u.set(i,null),l=l.getElementsByTagName(i),d=0;d<l.length;d++){var m=l[d];if(!(m[el]||m[Ht]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var v=m.getAttribute(r)||"";v=i+v;var w=u.get(v);w?w.push(m):u.set(v,[m])}}return u}function Bg(i,r,l){i=i.ownerDocument||i,i.head.insertBefore(l,r==="title"?i.querySelector("head > title"):null)}function nx(i,r,l){if(l===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Ng(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function rx(i,r,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var d=zs(u.href),m=r.querySelector(jl(d));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=No.bind(i),r.then(i,i)),l.state.loading|=4,l.instance=m,Tt(m);return}m=r.ownerDocument||r,u=Dg(u),(d=Ii.get(d))&&Nh(u,d),m=m.createElement("link"),Tt(m);var v=m;v._p=new Promise(function(w,R){v.onload=w,v.onerror=R}),Ft(m,"link",u),l.instance=m}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(i.count++,l=No.bind(i),r.addEventListener("load",l),r.addEventListener("error",l))}}var zh=0;function sx(i,r){return i.stylesheets&&i.count===0&&zo(i,i.stylesheets),0<i.count||0<i.imgCount?function(l){var u=setTimeout(function(){if(i.stylesheets&&zo(i,i.stylesheets),i.unsuspend){var m=i.unsuspend;i.unsuspend=null,m()}},6e4+r);0<i.imgBytes&&zh===0&&(zh=62500*U1());var d=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&zo(i,i.stylesheets),i.unsuspend)){var m=i.unsuspend;i.unsuspend=null,m()}},(i.imgBytes>zh?50:800)+r);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(d)}}:null}function No(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zo(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Lo=null;function zo(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Lo=new Map,r.forEach(lx,i),Lo=null,No.call(i))}function lx(i,r){if(!(r.state.loading&4)){var l=Lo.get(i);if(l)var u=l.get(null);else{l=new Map,Lo.set(i,l);for(var d=i.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var v=d[m];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),u=v)}u&&l.set(null,u)}d=r.instance,v=d.getAttribute("data-precedence"),m=l.get(v)||u,m===u&&l.set(null,d),l.set(v,d),this.count++,u=No.bind(this),d.addEventListener("load",u),d.addEventListener("error",u),m?m.parentNode.insertBefore(d,m.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(d,i.firstChild)),r.state.loading|=4}}var Ul={$$typeof:U,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function ax(i,r,l,u,d,m,v,w,R){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ru(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ru(0),this.hiddenUpdates=Ru(null),this.identifierPrefix=u,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Lg(i,r,l,u,d,m,v,w,R,W,Z,ie){return i=new ax(i,r,l,v,R,W,Z,ie,w),r=1,m===!0&&(r|=24),m=xi(3,null,null,r),i.current=m,m.stateNode=i,r=pc(),r.refCount++,i.pooledCache=r,r.refCount++,m.memoizedState={element:u,isDehydrated:l,cache:r},vc(m),i}function zg(i){return i?(i=ds,i):ds}function Og(i,r,l,u,d,m){d=zg(d),u.context===null?u.context=d:u.pendingContext=d,u=Vn(r),u.payload={element:l},m=m===void 0?null:m,m!==null&&(u.callback=m),l=Kn(i,u,r),l!==null&&(mi(l,i,r),gl(l,i,r))}function jg(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function Oh(i,r){jg(i,r),(i=i.alternate)&&jg(i,r)}function Hg(i){if(i.tag===13||i.tag===31){var r=Cr(i,67108864);r!==null&&mi(r,i,67108864),Oh(i,67108864)}}function Ug(i){if(i.tag===13||i.tag===31){var r=Ti();r=Mu(r);var l=Cr(i,r);l!==null&&mi(l,i,r),Oh(i,r)}}var Oo=!0;function ox(i,r,l,u){var d=A.T;A.T=null;var m=I.p;try{I.p=2,jh(i,r,l,u)}finally{I.p=m,A.T=d}}function ux(i,r,l,u){var d=A.T;A.T=null;var m=I.p;try{I.p=8,jh(i,r,l,u)}finally{I.p=m,A.T=d}}function jh(i,r,l,u){if(Oo){var d=Hh(u);if(d===null)wh(i,r,u,jo,l),Ig(i,u);else if(hx(d,i,r,l,u))u.stopPropagation();else if(Ig(i,u),r&4&&-1<cx.indexOf(i)){for(;d!==null;){var m=is(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var v=yr(m.pendingLanes);if(v!==0){var w=m;for(w.pendingLanes|=2,w.entangledLanes|=2;v;){var R=1<<31-Ge(v);w.entanglements[1]|=R,v&=~R}nn(m),(Fe&6)===0&&(yo=Qt()+500,Nl(0))}}break;case 31:case 13:w=Cr(m,2),w!==null&&mi(w,m,2),So(),Oh(m,2)}if(m=Hh(u),m===null&&wh(i,r,u,jo,l),m===d)break;d=m}d!==null&&u.stopPropagation()}else wh(i,r,u,null,l)}}function Hh(i){return i=Pu(i),Uh(i)}var jo=null;function Uh(i){if(jo=null,i=ts(i),i!==null){var r=o(i);if(r===null)i=null;else{var l=r.tag;if(l===13){if(i=c(r),i!==null)return i;i=null}else if(l===31){if(i=f(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return jo=i,null}function Pg(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Du()){case J:return 2;case ce:return 8;case Se:case Me:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Ph=!1,rr=null,sr=null,lr=null,Pl=new Map,Il=new Map,ar=[],cx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ig(i,r){switch(i){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":sr=null;break;case"mouseover":case"mouseout":lr=null;break;case"pointerover":case"pointerout":Pl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(r.pointerId)}}function Fl(i,r,l,u,d,m){return i===null||i.nativeEvent!==m?(i={blockedOn:r,domEventName:l,eventSystemFlags:u,nativeEvent:m,targetContainers:[d]},r!==null&&(r=is(r),r!==null&&Hg(r)),i):(i.eventSystemFlags|=u,r=i.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),i)}function hx(i,r,l,u,d){switch(r){case"focusin":return rr=Fl(rr,i,r,l,u,d),!0;case"dragenter":return sr=Fl(sr,i,r,l,u,d),!0;case"mouseover":return lr=Fl(lr,i,r,l,u,d),!0;case"pointerover":var m=d.pointerId;return Pl.set(m,Fl(Pl.get(m)||null,i,r,l,u,d)),!0;case"gotpointercapture":return m=d.pointerId,Il.set(m,Fl(Il.get(m)||null,i,r,l,u,d)),!0}return!1}function Fg(i){var r=ts(i.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=c(l),r!==null){i.blockedOn=r,ip(i.priority,function(){Ug(l)});return}}else if(r===31){if(r=f(l),r!==null){i.blockedOn=r,ip(i.priority,function(){Ug(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ho(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=Hh(i.nativeEvent);if(l===null){l=i.nativeEvent;var u=new l.constructor(l.type,l);Uu=u,l.target.dispatchEvent(u),Uu=null}else return r=is(l),r!==null&&Hg(r),i.blockedOn=l,!1;r.shift()}return!0}function qg(i,r,l){Ho(i)&&l.delete(r)}function fx(){Ph=!1,rr!==null&&Ho(rr)&&(rr=null),sr!==null&&Ho(sr)&&(sr=null),lr!==null&&Ho(lr)&&(lr=null),Pl.forEach(qg),Il.forEach(qg)}function Uo(i,r){i.blockedOn===r&&(i.blockedOn=null,Ph||(Ph=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fx)))}var Po=null;function Wg(i){Po!==i&&(Po=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Po===i&&(Po=null);for(var r=0;r<i.length;r+=3){var l=i[r],u=i[r+1],d=i[r+2];if(typeof u!="function"){if(Uh(u||l)===null)continue;break}var m=is(l);m!==null&&(i.splice(r,3),r-=3,Hc(m,{pending:!0,data:d,method:l.method,action:u},u,d))}}))}function js(i){function r(R){return Uo(R,i)}rr!==null&&Uo(rr,i),sr!==null&&Uo(sr,i),lr!==null&&Uo(lr,i),Pl.forEach(r),Il.forEach(r);for(var l=0;l<ar.length;l++){var u=ar[l];u.blockedOn===i&&(u.blockedOn=null)}for(;0<ar.length&&(l=ar[0],l.blockedOn===null);)Fg(l),l.blockedOn===null&&ar.shift();if(l=(i.ownerDocument||i).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var d=l[u],m=l[u+1],v=d[ui]||null;if(typeof m=="function")v||Wg(l);else if(v){var w=null;if(m&&m.hasAttribute("formAction")){if(d=m,v=m[ui]||null)w=v.formAction;else if(Uh(d)!==null)continue}else w=v.action;typeof w=="function"?l[u+1]=w:(l.splice(u,3),u-=3),Wg(l)}}}function Yg(){function i(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(v){return d=v})},focusReset:"manual",scroll:"manual"})}function r(){d!==null&&(d(),d=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,d=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),d!==null&&(d(),d=null)}}}function Ih(i){this._internalRoot=i}Io.prototype.render=Ih.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(s(409));var l=r.current,u=Ti();Og(l,u,i,r,null,null)},Io.prototype.unmount=Ih.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Og(i.current,2,null,i,null,null),So(),r[es]=null}};function Io(i){this._internalRoot=i}Io.prototype.unstable_scheduleHydration=function(i){if(i){var r=tp();i={blockedOn:null,target:i,priority:r};for(var l=0;l<ar.length&&r!==0&&r<ar[l].priority;l++);ar.splice(l,0,i),l===0&&Fg(i)}};var Vg=t.version;if(Vg!=="19.2.3")throw Error(s(527,Vg,"19.2.3"));I.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=h(r),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var dx={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fo.isDisabled&&Fo.supportsFiber)try{Jt=Fo.inject(dx),xt=Fo}catch{}}return Wl.createRoot=function(i,r){if(!a(i))throw Error(s(299));var l=!1,u="",d=Jm,m=e_,v=t_;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(v=r.onRecoverableError)),r=Lg(i,1,!1,null,null,l,u,null,d,m,v,Yg),i[es]=r.current,xh(i),new Ih(r)},Wl.hydrateRoot=function(i,r,l){if(!a(i))throw Error(s(299));var u=!1,d="",m=Jm,v=e_,w=t_,R=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),r=Lg(i,1,!0,r,l??null,u,d,R,m,v,w,Yg),r.context=zg(null),l=r.current,u=Ti(),u=Mu(u),d=Vn(u),d.callback=null,Kn(l,d,u),l=u,r.current.lanes=l,Js(r,l),nn(r),i[es]=r.current,xh(i),new Io(r)},Wl.version="19.2.3",Wl}var iv;function Cx(){if(iv)return Wh.exports;iv=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(),Wh.exports=wx(),Wh.exports}var kx=Cx();const Ex=gu(kx);function Tx({onLogin:e}){const[t,n]=ne.useState(""),[s,a]=ne.useState(null),[o,c]=ne.useState(!1),f=async p=>{if(p.preventDefault(),!t.trim())return;c(!0),a(null);const h=await e(t);h&&a(h),c(!1)};return S.jsx("div",{className:"flex h-screen items-center justify-center p-4",children:S.jsxs("div",{className:"w-full max-w-sm",children:[S.jsxs("div",{className:"border-border rounded border p-6",children:[S.jsxs("div",{className:"mb-6 text-center",children:[S.jsx("h1",{className:"text-accent text-lg font-bold tracking-tight",children:"PlotLink OWS"}),S.jsx("p",{className:"text-muted mt-1 text-xs",children:"local writer agent"})]}),S.jsxs("form",{onSubmit:f,className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Passphrase"}),S.jsx("input",{type:"password",value:t,onChange:p=>n(p.target.value),placeholder:"enter your passphrase",autoFocus:!0,className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),s&&S.jsx("p",{className:"text-error text-xs",children:s}),S.jsx("button",{type:"submit",disabled:o||!t.trim(),className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:o?"authenticating...":"unlock"})]})]}),S.jsx("p",{className:"text-muted mt-4 text-center text-[10px]",children:"enter your passphrase to unlock"})]})})}function Ax({onSetup:e}){const[t,n]=ne.useState(""),[s,a]=ne.useState(""),[o,c]=ne.useState(null),[f,p]=ne.useState(!1),h=async g=>{if(g.preventDefault(),!t.trim()||t.length<4){c("Passphrase must be at least 4 characters");return}if(t!==s){c("Passphrases do not match");return}p(!0),c(null);const _=await e(t);_&&c(_),p(!1)};return S.jsx("div",{className:"flex h-screen items-center justify-center p-4",children:S.jsx("div",{className:"w-full max-w-sm",children:S.jsxs("div",{className:"border-border rounded border p-6",children:[S.jsxs("div",{className:"mb-6 text-center",children:[S.jsx("h1",{className:"text-accent text-lg font-bold tracking-tight",children:"PlotLink OWS"}),S.jsx("p",{className:"text-muted mt-1 text-xs",children:"first-time setup"})]}),S.jsx("p",{className:"text-muted mb-4 text-xs leading-relaxed",children:"Choose a passphrase to protect your local writer agent. This will be used to unlock the app and secure your OWS wallet."}),S.jsxs("form",{onSubmit:h,className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Passphrase"}),S.jsx("input",{type:"password",value:t,onChange:g=>n(g.target.value),placeholder:"choose a passphrase",autoFocus:!0,className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Confirm"}),S.jsx("input",{type:"password",value:s,onChange:g=>a(g.target.value),placeholder:"repeat passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),o&&S.jsx("p",{className:"text-error text-xs",children:o}),S.jsx("button",{type:"submit",disabled:f||!t.trim()||!s.trim(),className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:f?"setting up...":"create passphrase"})]})]})})})}const nv="http://localhost:7777";function Zy({token:e}){const[t,n]=ne.useState(null),[s,a]=ne.useState(!1),[o,c]=ne.useState(!1),[f,p]=ne.useState(null),h=(x,E)=>fetch(x,{...E,headers:{...E==null?void 0:E.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),g=()=>{h(`${nv}/api/wallet`).then(x=>x.json()).then(x=>n(x)).catch(()=>n({exists:!1,error:"Failed to load wallet"}))};ne.useEffect(()=>{g()},[]);const _=async()=>{a(!0),p(null);try{const x=await h(`${nv}/api/wallet/create`,{method:"POST"}),E=await x.json();if(!x.ok)throw new Error(E.error||"Creation failed");g()}catch(x){p(x instanceof Error?x.message:"Failed to create wallet")}a(!1)},b=()=>{t!=null&&t.address&&(navigator.clipboard.writeText(t.address),c(!0),setTimeout(()=>c(!1),2e3))},y=x=>`${x.slice(0,6)}...${x.slice(-4)}`;return S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"OWS Wallet"}),!t&&S.jsx("p",{className:"text-muted text-xs",children:"loading..."}),t&&!t.exists&&S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{className:"text-muted text-xs",children:"No wallet created yet. Create one to enable autonomous transactions."}),f&&S.jsx("p",{className:"text-error text-xs",children:f}),S.jsx("button",{onClick:_,disabled:s,className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 rounded border px-4 py-2 text-xs font-medium transition-colors",children:s?"creating...":"create wallet"})]}),t&&t.exists&&t.address&&S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-muted text-[10px] uppercase tracking-wider",children:"Address (Base)"}),S.jsx("span",{className:`rounded border px-1.5 py-0.5 text-[9px] ${t.ethBalance&&parseFloat(t.ethBalance)>0?"border-accent/30 text-accent":"border-accent-dim/30 text-accent-dim"}`,children:t.ethBalance&&parseFloat(t.ethBalance)>0?"active":"no balance"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("code",{className:"text-foreground bg-surface rounded px-2 py-1 text-xs font-mono",children:y(t.address)}),S.jsx("button",{onClick:b,className:"text-muted hover:text-accent text-xs transition-colors",children:o?"copied":"copy"})]}),S.jsxs("div",{className:"border-border space-y-1 border-t pt-3",children:[S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"ETH"}),S.jsxs("span",{className:"text-foreground font-medium",children:[t.ethBalance||"0.000000"," ETH"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"USDC"}),S.jsxs("span",{className:"text-foreground font-medium",children:["$",t.usdcBalance||"0.00"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"PLOT"}),S.jsxs("span",{className:"text-foreground font-medium",children:[t.plotBalance||"0.0000"," PLOT"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Network"}),S.jsx("span",{className:"text-foreground",children:"Base"})]})]}),S.jsxs("div",{className:"border-border border-t pt-3",children:[S.jsx("p",{className:"text-muted mb-2 text-[10px] font-medium uppercase tracking-wider",children:"Fund Wallet"}),S.jsx("p",{className:"text-muted text-[10px]",children:"Send ETH on Base for gas (~$0.01 per publish):"}),S.jsx("code",{className:"text-foreground bg-surface mt-1 block break-all rounded px-2 py-1.5 text-[10px] font-mono",children:t.address})]})]})]})}function Dx({token:e,onLogout:t}){const[n,s]=ne.useState(""),[a,o]=ne.useState(""),[c,f]=ne.useState(null),[p,h]=ne.useState(!1),[g,_]=ne.useState(!1),[b,y]=ne.useState(null),[x,E]=ne.useState("AI Writer"),[N,M]=ne.useState(""),[G,U]=ne.useState(""),[Q,K]=ne.useState(!1),[O,ee]=ne.useState(null),[oe,de]=ne.useState(""),[q,B]=ne.useState(null),[D,j]=ne.useState(!1),[P,L]=ne.useState(null),[A,I]=ne.useState(null),Y=ne.useCallback((C,se)=>fetch(C,{...se,headers:{...se==null?void 0:se.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),[e]);ne.useEffect(()=>{Y("/api/settings/link-status").then(C=>C.json()).then(C=>y(C)).catch(()=>y({linked:!1}))},[]);const le=async()=>{if(!x.trim()){ee("Agent name is required");return}if(!N.trim()){ee("Description is required");return}K(!0),ee(null);try{const C=await Y("/api/settings/register-agent",{method:"POST",body:JSON.stringify({name:x,description:N,...G.trim()&&{genre:G}})}),se=await C.json();if(!C.ok)throw new Error(se.error||"Registration failed");y({linked:!0,agentId:se.agentId,owsWallet:se.owsWallet,txHash:se.txHash})}catch(C){ee(C instanceof Error?C.message:"Registration failed")}K(!1)},k=async()=>{if(!oe.trim()||!/^0x[a-fA-F0-9]{40}$/.test(oe)){L("Enter a valid wallet address (0x...)");return}j(!0),L(null),B(null);try{const C=await Y("/api/settings/generate-binding",{method:"POST",body:JSON.stringify({humanWallet:oe})}),se=await C.json();if(!C.ok)throw new Error(se.error||"Failed to generate binding code");B(se)}catch(C){L(C instanceof Error?C.message:"Failed to generate binding code")}j(!1)},T=async(C,se)=>{await navigator.clipboard.writeText(C),I(se),setTimeout(()=>I(null),2e3)},X=async()=>{if(f(null),h(!1),!n||n.length<4){f("Passphrase must be at least 4 characters");return}if(n!==a){f("Passphrases do not match");return}_(!0);try{const C=await Y("/api/auth/reset-passphrase",{method:"POST",body:JSON.stringify({passphrase:n})});if(!C.ok){const se=await C.json();throw new Error(se.error||"Reset failed")}h(!0),s(""),o(""),setTimeout(()=>h(!1),3e3)}catch(C){f(C instanceof Error?C.message:"Reset failed")}_(!1)};return S.jsxs("div",{className:"mx-auto max-w-lg space-y-6 p-6",children:[S.jsx("h2",{className:"text-accent text-lg font-bold",children:"Settings"}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Agent Identity"}),b!=null&&b.linked?S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-sm font-medium text-accent",children:"Registered"}),S.jsxs("span",{className:"text-muted text-xs",children:["Agent #",b.agentId]})]}),b.owsWallet&&S.jsxs("p",{className:"text-muted text-xs font-mono",children:["Wallet: ",b.owsWallet.slice(0,6),"...",b.owsWallet.slice(-4)]}),b.owner&&S.jsxs("p",{className:"text-muted text-xs font-mono",children:["Owner: ",b.owner.slice(0,6),"...",b.owner.slice(-4)]}),b.txHash&&S.jsx("p",{className:"text-muted text-xs",children:S.jsx("a",{href:`https://basescan.org/tx/${b.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View transaction on BaseScan"})}),S.jsx("p",{className:"text-muted text-xs",children:S.jsx("a",{href:`https://plotlink.xyz/profile/${b.owsWallet}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View agent profile on plotlink.xyz"})})]}):S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{className:"text-muted text-xs",children:"Register this AI writer on-chain via ERC-8004. Uses your OWS wallet's existing ETH balance for gas."}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Name"}),S.jsx("input",{value:x,onChange:C=>E(C.target.value),placeholder:"AI Writer",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Description"}),S.jsx("input",{value:N,onChange:C=>M(C.target.value),placeholder:"An AI writing assistant for fiction stories",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Genre (optional)"}),S.jsx("input",{value:G,onChange:C=>U(C.target.value),placeholder:"e.g. Fiction, Sci-Fi, Fantasy",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),O&&S.jsx("p",{className:"text-error text-xs",children:O}),S.jsx("button",{onClick:le,disabled:Q||!x.trim()||!N.trim(),className:"bg-accent text-white hover:bg-accent-dim disabled:opacity-50 w-full rounded px-4 py-2 text-sm font-medium transition-colors",children:Q?"Registering...":"Register Agent Identity"})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Link to PlotLink"}),b!=null&&b.owner?S.jsxs("p",{className:"text-muted text-xs",children:["Linked to owner ",S.jsxs("span",{className:"font-mono",children:[b.owner.slice(0,6),"...",b.owner.slice(-4)]})]}):S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{className:"text-muted text-xs",children:"Link this OWS wallet to your PlotLink account so your stories appear under your profile on plotlink.xyz."}),S.jsxs("div",{className:"text-muted text-xs space-y-1 pl-3",children:[S.jsx("p",{children:"1. Enter your PlotLink wallet address below"}),S.jsx("p",{children:'2. Click "Generate Binding Code"'}),S.jsx("p",{children:"3. Copy the code and paste it on plotlink.xyz → Agents → Link AI Writer"})]}),S.jsx("input",{value:oe,onChange:C=>de(C.target.value),placeholder:"Your PlotLink wallet address (0x...)",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent font-mono"}),P&&S.jsx("p",{className:"text-error text-xs",children:P}),S.jsx("button",{onClick:k,disabled:D||!oe.trim(),className:"bg-accent text-white hover:bg-accent-dim disabled:opacity-50 w-full rounded px-4 py-2 text-sm font-medium transition-colors",children:D?"Generating...":"Generate Binding Code"}),q&&S.jsxs("div",{className:"space-y-3 mt-3",children:[S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Binding Code (signature)"}),S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"bg-surface border-border rounded border p-2 text-xs font-mono break-all text-foreground pr-16",children:q.signature}),S.jsx("button",{onClick:()=>T(q.signature,"signature"),className:"absolute top-1 right-1 text-xs px-2 py-1 rounded border border-border text-muted hover:text-accent hover:border-accent transition-colors",children:A==="signature"?"Copied!":"Copy"})]})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"OWS Wallet Address"}),S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"bg-surface border-border rounded border p-2 text-xs font-mono break-all text-foreground pr-16",children:q.owsWallet}),S.jsx("button",{onClick:()=>T(q.owsWallet,"wallet"),className:"absolute top-1 right-1 text-xs px-2 py-1 rounded border border-border text-muted hover:text-accent hover:border-accent transition-colors",children:A==="wallet"?"Copied!":"Copy"})]})]}),S.jsx("p",{className:"text-xs text-accent",children:'Now go to plotlink.xyz/agents and paste both values in the "Link AI Writer" section.'})]})]})]}),S.jsx(Zy,{token:e}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Reset Passphrase"}),S.jsxs("div",{className:"space-y-3",children:[S.jsx("input",{type:"password",value:n,onChange:C=>s(C.target.value),placeholder:"new passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"}),S.jsx("input",{type:"password",value:a,onChange:C=>o(C.target.value),placeholder:"confirm passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"}),c&&S.jsx("p",{className:"text-error text-xs",children:c}),p&&S.jsx("p",{className:"text-xs text-accent",children:"passphrase updated"}),S.jsx("button",{onClick:X,disabled:g||!n.trim(),className:"border-border text-muted hover:border-accent hover:text-accent disabled:opacity-40 w-full rounded border px-4 py-2 text-xs font-medium transition-colors",children:g?"updating...":"update passphrase"})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Session"}),S.jsx("button",{onClick:t,className:"border-border text-muted hover:border-error hover:text-error rounded border px-4 py-2 text-xs font-medium transition-colors",children:"logout"})]})]})}const Rx="http://localhost:7777";function Mx({token:e}){const[t,n]=ne.useState(null),s=(f,p)=>fetch(f,{...p,headers:{...p==null?void 0:p.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),a=()=>{s(`${Rx}/api/dashboard`).then(f=>f.json()).then(n)};ne.useEffect(()=>{a()},[]);const o=f=>`${f.slice(0,6)}...${f.slice(-4)}`,c=f=>{if(!f)return"Unknown date";const p=new Date(f);return isNaN(p.getTime())?"Unknown date":p.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})};return t?S.jsxs("div",{className:"mx-auto max-w-2xl space-y-6 p-6",children:[S.jsx("h2",{className:"text-accent text-lg font-bold",children:"Writer Dashboard"}),S.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-accent text-lg font-bold",children:t.stories.totalPublished}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"published"})]}),S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.pendingFiles}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"pending"})]}),S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.totalStories}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"stories"})]}),S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.totalFiles}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"files"})]})]}),t.wallet&&S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Wallet"}),S.jsxs("div",{className:"space-y-1.5",children:[S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Address"}),S.jsx("code",{className:"text-foreground font-mono text-[10px]",children:o(t.wallet.address)})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"ETH Balance"}),S.jsxs("span",{className:"text-foreground",children:[t.wallet.ethFormatted," ETH"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"USDC Balance"}),S.jsxs("span",{className:"text-foreground",children:["$",t.wallet.usdcBalance]})]})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Profit & Loss"}),S.jsxs("div",{className:"space-y-1.5",children:[S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Total costs (gas)"}),S.jsxs("span",{className:"text-error",children:["-",t.pnl.totalCostsEth," ETH (~$",t.pnl.totalCostsUsd,")"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Royalties earned"}),S.jsxs("span",{className:"text-accent",children:["+",t.pnl.totalRoyaltiesPlot," PLOT"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Unclaimed royalties"}),S.jsxs("span",{className:"text-foreground",children:[t.royalties.unclaimed," PLOT"]})]}),S.jsxs("div",{className:"border-border flex justify-between border-t pt-1.5 text-xs font-medium",children:[S.jsx("span",{className:"text-muted",children:"Net P&L (USD)"}),S.jsxs("span",{className:parseFloat(t.pnl.netPnlUsd)>=0?"text-accent":"text-error",children:[parseFloat(t.pnl.netPnlUsd)>=0?"+":"","$",t.pnl.netPnlUsd]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Stories published"}),S.jsx("span",{className:"text-foreground",children:t.costs.storiesPublished})]})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Published Stories"}),t.stories.published.length===0?S.jsx("p",{className:"text-muted text-xs",children:"no published stories yet"}):S.jsx("div",{className:"space-y-3",children:t.stories.published.map(f=>S.jsxs("div",{className:"bg-surface rounded border border-border p-4",children:[S.jsxs("div",{className:"flex items-start justify-between",children:[S.jsxs("div",{children:[f.genre&&S.jsx("span",{className:"bg-accent/10 text-accent rounded px-2 py-0.5 text-[10px] font-medium",children:f.genre}),S.jsx("h4",{className:"text-foreground mt-1 text-sm font-serif font-medium",children:f.title}),S.jsx("p",{className:"text-muted mt-0.5 text-[10px] font-mono",children:f.storyName})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[f.hasNotIndexed&&S.jsx("span",{className:"rounded border border-amber-600/30 px-1.5 py-0.5 text-[9px] text-amber-700",children:"not indexed"}),S.jsxs("span",{className:"rounded border border-green-700/30 px-1.5 py-0.5 text-[9px] text-green-700",children:[f.publishedFiles," published"]})]})]}),S.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-2 text-center",children:[S.jsxs("div",{className:"rounded bg-background p-1.5",children:[S.jsx("div",{className:"text-foreground text-sm font-medium",children:f.plotCount}),S.jsx("div",{className:"text-muted text-[9px]",children:"Plots"})]}),S.jsxs("div",{className:"rounded bg-background p-1.5",children:[S.jsx("div",{className:"text-foreground text-sm font-medium font-mono",children:f.storylineId?`#${f.storylineId}`:"—"}),S.jsx("div",{className:"text-muted text-[9px]",children:"Storyline"})]}),S.jsxs("div",{className:"rounded bg-background p-1.5",children:[S.jsx("div",{className:"text-foreground text-sm font-medium",children:f.totalGasCostEth??"—"}),S.jsx("div",{className:"text-muted text-[9px]",children:"Gas (ETH)"})]})]}),S.jsx("div",{className:"mt-2 space-y-1",children:f.files.map(p=>S.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("span",{className:p.status==="published-not-indexed"?"text-amber-700":"text-green-700",children:p.status==="published-not-indexed"?"⚠":"✓"}),S.jsx("span",{className:"text-muted font-mono",children:p.file})]}),p.txHash&&S.jsxs("a",{href:`https://basescan.org/tx/${p.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted hover:text-accent font-mono",children:["tx:",p.txHash.slice(0,8),"..."]})]},p.file))}),S.jsxs("div",{className:"mt-2 flex items-center justify-between text-[10px]",children:[S.jsx("span",{className:"text-muted",children:c(f.latestPublishedAt)}),f.storylineId&&S.jsx("a",{href:`https://plotlink.xyz/story/${f.storylineId}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View on PlotLink"})]})]},f.id))})]}),t.stories.pendingFiles>0&&S.jsx("div",{className:"border-border rounded border p-4",children:S.jsxs("p",{className:"text-muted text-xs",children:[t.stories.pendingFiles," file(s) pending publish — go to Stories to publish them."]})})]}):S.jsx("div",{className:"flex h-full items-center justify-center",children:S.jsx("span",{className:"text-muted text-sm",children:"loading dashboard..."})})}const Bx={published:"✓","published-not-indexed":"⚠",pending:"⏳",draft:"📝"},Nx={published:"text-green-700","published-not-indexed":"text-amber-700",pending:"text-amber-700",draft:"text-muted"};function Lx({authFetch:e,selectedStory:t,selectedFile:n,onSelectFile:s,onNewStory:a,untitledSessions:o=[]}){const[c,f]=ne.useState([]),[p,h]=ne.useState([]),[g,_]=ne.useState(new Set),[b,y]=ne.useState(!1),x=ne.useCallback(async()=>{try{const K=await e("/api/stories");if(K.ok){const O=await K.json();f(O.stories)}}catch{}},[e]),E=ne.useCallback(async()=>{try{const K=await e("/api/stories/archived");if(K.ok){const O=await K.json();h(O.stories)}}catch{}},[e]),N=ne.useCallback(async K=>{try{(await e("/api/stories/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:K})})).ok&&(E(),x())}catch{}},[e,E,x]);ne.useEffect(()=>{x();const K=setInterval(x,5e3);return()=>clearInterval(K)},[x]),ne.useEffect(()=>{b&&E()},[b,E]),ne.useEffect(()=>{t&&_(K=>new Set(K).add(t))},[t]);const M=K=>{var ee;const O=K.map(oe=>{var de;return{file:oe.file,num:(de=oe.file.match(/^plot-(\d+)\.md$/))==null?void 0:de[1]}}).filter(oe=>oe.num!=null).sort((oe,de)=>parseInt(de.num)-parseInt(oe.num));return O.length>0?O[0].file:K.some(oe=>oe.file==="genesis.md")?"genesis.md":K.some(oe=>oe.file==="structure.md")?"structure.md":((ee=K[0])==null?void 0:ee.file)??null},G=K=>{_(O=>{const ee=new Set(O);return ee.has(K)?ee.delete(K):ee.add(K),ee})},U=K=>{if(G(K.name),!g.has(K.name)){const O=M(K.files);O&&s(K.name,O)}},Q=K=>{const O=ee=>{if(ee==="structure.md")return 0;if(ee==="genesis.md")return 1;const oe=ee.match(/^plot-(\d+)\.md$/);return oe?2+parseInt(oe[1]):100};return[...K].sort((ee,oe)=>O(ee.file)-O(oe.file))};return b?S.jsxs("div",{className:"h-full flex flex-col",children:[S.jsxs("div",{className:"px-3 py-1.5 border-b border-border flex items-center justify-between",children:[S.jsx("span",{className:"text-xs font-mono text-muted",children:"Archives"}),S.jsx("span",{className:"text-xs text-muted",children:p.length})]}),S.jsx("div",{className:"px-3 py-2 border-b border-border",children:S.jsxs("button",{onClick:()=>y(!1),className:"w-full px-3 py-1.5 text-sm text-muted hover:text-foreground hover:bg-surface rounded flex items-center gap-1.5",children:[S.jsx("span",{children:"←"}),S.jsx("span",{children:"Back"})]})}),S.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:p.length===0?S.jsx("div",{className:"p-3 text-sm text-muted",children:S.jsx("p",{children:"No archived stories."})}):p.map(K=>S.jsxs("div",{className:"px-3 py-2 flex items-center justify-between hover:bg-surface",children:[S.jsx("span",{className:"text-sm font-medium truncate",title:K.name,children:K.title||K.name}),S.jsx("button",{onClick:()=>N(K.name),className:"text-xs text-accent hover:text-accent-dim flex-shrink-0 ml-2",children:"Restore"})]},K.name))})]}):S.jsxs("div",{className:"h-full flex flex-col",children:[S.jsxs("div",{className:"px-3 py-1.5 border-b border-border flex items-center justify-between",children:[S.jsx("span",{className:"text-xs font-mono text-muted",children:"Stories"}),S.jsx("span",{className:"text-xs text-muted",children:c.length})]}),a&&S.jsx("div",{className:"px-3 py-2 border-b border-border",children:S.jsxs("button",{onClick:a,className:"w-full px-3 py-1.5 text-sm bg-accent text-white rounded hover:bg-accent-dim flex items-center justify-center gap-1.5",children:[S.jsx("span",{children:"+"}),S.jsx("span",{children:"New Story"})]})}),S.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[o.map(K=>S.jsx("div",{children:S.jsxs("button",{onClick:()=>s(K,""),className:`w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-surface text-sm ${t===K?"bg-surface":""}`,children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-600 flex-shrink-0"}),S.jsx("span",{className:"font-medium italic text-muted",children:"Untitled"})]})},K)),c.length===0&&o.length===0?S.jsxs("div",{className:"p-3 text-sm text-muted",children:[S.jsx("p",{children:"No stories yet."}),S.jsx("p",{className:"mt-1 text-xs",children:'Click "+ New Story" above to start writing.'})]}):c.filter(K=>K.name!=="_example").map(K=>S.jsxs("div",{children:[S.jsxs("button",{onClick:()=>U(K),className:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-surface text-sm",children:[S.jsx("span",{className:"text-xs text-muted",children:g.has(K.name)?"▼":"▶"}),S.jsx("span",{className:"font-medium truncate",title:K.name,children:K.title||K.name}),S.jsxs("span",{className:"ml-auto text-xs text-muted",children:[K.publishedCount,"/",K.files.length]})]}),g.has(K.name)&&S.jsx("div",{className:"pl-4",children:Q(K.files).map(O=>{const ee=t===K.name&&n===O.file;return S.jsxs("button",{onClick:()=>s(K.name,O.file),className:`w-full px-3 py-1.5 text-left flex items-center gap-2 text-xs hover:bg-surface ${ee?"bg-surface font-medium":""}`,children:[S.jsx("span",{className:Nx[O.status],children:Bx[O.status]}),S.jsx("span",{className:"truncate font-mono",children:O.file})]},O.file)})})]},K.name))]}),S.jsx("div",{className:"px-3 py-2 border-t border-border",children:S.jsx("button",{onClick:()=>y(!0),className:"w-full px-3 py-1.5 text-xs text-muted hover:text-foreground hover:bg-surface rounded flex items-center justify-center gap-1.5",children:S.jsx("span",{children:"Archives"})})})]})}/**
48
+ `+u.stack}}var Qr=Object.prototype.hasOwnProperty,Jr=e.unstable_scheduleCallback,Zs=e.unstable_cancelCallback,Tu=e.unstable_shouldYield,Au=e.unstable_requestPaint,Qt=e.unstable_now,Du=e.unstable_getCurrentPriorityLevel,J=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,Me=e.unstable_LowPriority,qe=e.unstable_IdlePriority,bi=e.log,fn=e.unstable_setDisableYieldValue,Jt=null,xt=null;function oi(i){if(typeof bi=="function"&&fn(i),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(Jt,i)}catch{}}var Ge=Math.clz32?Math.clz32:t0,Hn=Math.log,Ki=Math.LN2;function t0(i){return i>>>=0,i===0?32:31-(Hn(i)/Ki|0)|0}var Ea=256,Ta=262144,Aa=4194304;function yr(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Da(i,r,l){var u=i.pendingLanes;if(u===0)return 0;var d=0,m=i.suspendedLanes,v=i.pingedLanes;i=i.warmLanes;var w=u&134217727;return w!==0?(u=w&~m,u!==0?d=yr(u):(v&=w,v!==0?d=yr(v):l||(l=w&~i,l!==0&&(d=yr(l))))):(w=u&~m,w!==0?d=yr(w):v!==0?d=yr(v):l||(l=u&~i,l!==0&&(d=yr(l)))),d===0?0:r!==0&&r!==d&&(r&m)===0&&(m=d&-d,l=r&-r,m>=l||m===32&&(l&4194048)!==0)?r:d}function Qs(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function i0(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zd(){var i=Aa;return Aa<<=1,(Aa&62914560)===0&&(Aa=4194304),i}function Ru(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function Js(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function n0(i,r,l,u,d,m){var v=i.pendingLanes;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=l,i.entangledLanes&=l,i.errorRecoveryDisabledLanes&=l,i.shellSuspendCounter=0;var w=i.entanglements,R=i.expirationTimes,W=i.hiddenUpdates;for(l=v&~l;0<l;){var Z=31-Ge(l),ie=1<<Z;w[Z]=0,R[Z]=-1;var V=W[Z];if(V!==null)for(W[Z]=null,Z=0;Z<V.length;Z++){var $=V[Z];$!==null&&($.lane&=-536870913)}l&=~ie}u!==0&&Qd(i,u,0),m!==0&&d===0&&i.tag!==0&&(i.suspendedLanes|=m&~(v&~r))}function Qd(i,r,l){i.pendingLanes|=r,i.suspendedLanes&=~r;var u=31-Ge(r);i.entangledLanes|=r,i.entanglements[u]=i.entanglements[u]|1073741824|l&261930}function Jd(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var u=31-Ge(l),d=1<<u;d&r|i[u]&r&&(i[u]|=r),l&=~d}}function ep(i,r){var l=r&-r;return l=(l&42)!==0?1:Mu(l),(l&(i.suspendedLanes|r))!==0?0:l}function Mu(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Bu(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function tp(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:Pg(i.type))}function ip(i,r){var l=I.p;try{return I.p=i,r()}finally{I.p=l}}var Un=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Un,ui="__reactProps$"+Un,es="__reactContainer$"+Un,Nu="__reactEvents$"+Un,r0="__reactListeners$"+Un,s0="__reactHandles$"+Un,np="__reactResources$"+Un,el="__reactMarker$"+Un;function Lu(i){delete i[Ht],delete i[ui],delete i[Nu],delete i[r0],delete i[s0]}function ts(i){var r=i[Ht];if(r)return r;for(var l=i.parentNode;l;){if(r=l[es]||l[Ht]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=Cg(i);i!==null;){if(l=i[Ht])return l;i=Cg(i)}return r}i=l,l=i.parentNode}return null}function is(i){if(i=i[Ht]||i[es]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function tl(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(s(33))}function ns(i){var r=i[np];return r||(r=i[np]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Tt(i){i[el]=!0}var rp=new Set,sp={};function br(i,r){rs(i,r),rs(i+"Capture",r)}function rs(i,r){for(sp[i]=r,i=0;i<r.length;i++)rp.add(r[i])}var l0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lp={},ap={};function a0(i){return Qr.call(ap,i)?!0:Qr.call(lp,i)?!1:l0.test(i)?ap[i]=!0:(lp[i]=!0,!1)}function Ra(i,r,l){if(a0(r))if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+l)}}function Ma(i,r,l){if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+l)}}function dn(i,r,l,u){if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttributeNS(r,l,""+u)}}function Bi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function op(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function o0(i,r,l){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var d=u.get,m=u.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return d.call(this)},set:function(v){l=""+v,m.call(this,v)}}),Object.defineProperty(i,r,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function zu(i){if(!i._valueTracker){var r=op(i)?"checked":"value";i._valueTracker=o0(i,r,""+i[r])}}function up(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),u="";return i&&(u=op(i)?i.checked?"true":"false":i.value),i=u,i!==l?(r.setValue(i),!0):!1}function Ba(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var u0=/[\n"\\]/g;function Ni(i){return i.replace(u0,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ou(i,r,l,u,d,m,v,w){i.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?i.type=v:i.removeAttribute("type"),r!=null?v==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Bi(r)):i.value!==""+Bi(r)&&(i.value=""+Bi(r)):v!=="submit"&&v!=="reset"||i.removeAttribute("value"),r!=null?ju(i,v,Bi(r)):l!=null?ju(i,v,Bi(l)):u!=null&&i.removeAttribute("value"),d==null&&m!=null&&(i.defaultChecked=!!m),d!=null&&(i.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+Bi(w):i.removeAttribute("name")}function cp(i,r,l,u,d,m,v,w){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(i.type=m),r!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){zu(i);return}l=l!=null?""+Bi(l):"",r=r!=null?""+Bi(r):l,w||r===i.value||(i.value=r),i.defaultValue=r}u=u??d,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=w?i.checked:!!u,i.defaultChecked=!!u,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.name=v),zu(i)}function ju(i,r,l){r==="number"&&Ba(i.ownerDocument)===i||i.defaultValue===""+l||(i.defaultValue=""+l)}function ss(i,r,l,u){if(i=i.options,r){r={};for(var d=0;d<l.length;d++)r["$"+l[d]]=!0;for(l=0;l<i.length;l++)d=r.hasOwnProperty("$"+i[l].value),i[l].selected!==d&&(i[l].selected=d),d&&u&&(i[l].defaultSelected=!0)}else{for(l=""+Bi(l),r=null,d=0;d<i.length;d++){if(i[d].value===l){i[d].selected=!0,u&&(i[d].defaultSelected=!0);return}r!==null||i[d].disabled||(r=i[d])}r!==null&&(r.selected=!0)}}function hp(i,r,l){if(r!=null&&(r=""+Bi(r),r!==i.value&&(i.value=r),l==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=l!=null?""+Bi(l):""}function fp(i,r,l,u){if(r==null){if(u!=null){if(l!=null)throw Error(s(92));if(L(u)){if(1<u.length)throw Error(s(93));u=u[0]}l=u}l==null&&(l=""),r=l}l=Bi(r),i.defaultValue=l,u=i.textContent,u===l&&u!==""&&u!==null&&(i.value=u),zu(i)}function ls(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var c0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dp(i,r,l){var u=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":u?i.setProperty(r,l):typeof l!="number"||l===0||c0.has(r)?r==="float"?i.cssFloat=l:i[r]=(""+l).trim():i[r]=l+"px"}function pp(i,r,l){if(r!=null&&typeof r!="object")throw Error(s(62));if(i=i.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var d in r)u=r[d],r.hasOwnProperty(d)&&l[d]!==u&&dp(i,d,u)}else for(var m in r)r.hasOwnProperty(m)&&dp(i,m,r[m])}function Hu(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var h0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),f0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Na(i){return f0.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function pn(){}var Uu=null;function Pu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var as=null,os=null;function mp(i){var r=is(i);if(r&&(i=r.stateNode)){var l=i[ui]||null;e:switch(i=r.stateNode,r.type){case"input":if(Ou(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ni(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var u=l[r];if(u!==i&&u.form===i.form){var d=u[ui]||null;if(!d)throw Error(s(90));Ou(u,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<l.length;r++)u=l[r],u.form===i.form&&up(u)}break e;case"textarea":hp(i,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&ss(i,!!l.multiple,r,!1)}}}var Iu=!1;function _p(i,r,l){if(Iu)return i(r,l);Iu=!0;try{var u=i(r);return u}finally{if(Iu=!1,(as!==null||os!==null)&&(So(),as&&(r=as,i=os,os=as=null,mp(r),i)))for(r=0;r<i.length;r++)mp(i[r])}}function il(i,r){var l=i.stateNode;if(l===null)return null;var u=l[ui]||null;if(u===null)return null;l=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(s(231,r,typeof l));return l}var mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fu=!1;if(mn)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{Fu=!1}var Pn=null,qu=null,La=null;function gp(){if(La)return La;var i,r=qu,l=r.length,u,d="value"in Pn?Pn.value:Pn.textContent,m=d.length;for(i=0;i<l&&r[i]===d[i];i++);var v=l-i;for(u=1;u<=v&&r[l-u]===d[m-u];u++);return La=d.slice(i,1<u?1-u:void 0)}function za(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Oa(){return!0}function vp(){return!1}function ci(i){function r(l,u,d,m,v){this._reactName=l,this._targetInst=d,this.type=u,this.nativeEvent=m,this.target=v,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(l=i[w],this[w]=l?l(m):m[w]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Oa:vp,this.isPropagationStopped=vp,this}return _(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Oa)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Oa)},persist:function(){},isPersistent:Oa}),r}var Sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ja=ci(Sr),rl=_({},Sr,{view:0,detail:0}),d0=ci(rl),Wu,Yu,sl,Ha=_({},rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ku,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==sl&&(sl&&i.type==="mousemove"?(Wu=i.screenX-sl.screenX,Yu=i.screenY-sl.screenY):Yu=Wu=0,sl=i),Wu)},movementY:function(i){return"movementY"in i?i.movementY:Yu}}),yp=ci(Ha),p0=_({},Ha,{dataTransfer:0}),m0=ci(p0),_0=_({},rl,{relatedTarget:0}),Vu=ci(_0),g0=_({},Sr,{animationName:0,elapsedTime:0,pseudoElement:0}),v0=ci(g0),y0=_({},Sr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),b0=ci(y0),S0=_({},Sr,{data:0}),bp=ci(S0),x0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w0={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"},C0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function k0(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=C0[i])?!!r[i]:!1}function Ku(){return k0}var E0=_({},rl,{key:function(i){if(i.key){var r=x0[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=za(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?w0[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ku,charCode:function(i){return i.type==="keypress"?za(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?za(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),T0=ci(E0),A0=_({},Ha,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sp=ci(A0),D0=_({},rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ku}),R0=ci(D0),M0=_({},Sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),B0=ci(M0),N0=_({},Ha,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),L0=ci(N0),z0=_({},Sr,{newState:0,oldState:0}),O0=ci(z0),j0=[9,13,27,32],Xu=mn&&"CompositionEvent"in window,ll=null;mn&&"documentMode"in document&&(ll=document.documentMode);var H0=mn&&"TextEvent"in window&&!ll,xp=mn&&(!Xu||ll&&8<ll&&11>=ll),wp=" ",Cp=!1;function kp(i,r){switch(i){case"keyup":return j0.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ep(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var us=!1;function U0(i,r){switch(i){case"compositionend":return Ep(r);case"keypress":return r.which!==32?null:(Cp=!0,wp);case"textInput":return i=r.data,i===wp&&Cp?null:i;default:return null}}function P0(i,r){if(us)return i==="compositionend"||!Xu&&kp(i,r)?(i=gp(),La=qu=Pn=null,us=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return xp&&r.locale!=="ko"?null:r.data;default:return null}}var I0={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 Tp(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!I0[i.type]:r==="textarea"}function Ap(i,r,l,u){as?os?os.push(u):os=[u]:as=u,r=Ao(r,"onChange"),0<r.length&&(l=new ja("onChange","change",null,l,u),i.push({event:l,listeners:r}))}var al=null,ol=null;function F0(i){cg(i,0)}function Ua(i){var r=tl(i);if(up(r))return i}function Dp(i,r){if(i==="change")return r}var Rp=!1;if(mn){var $u;if(mn){var Gu="oninput"in document;if(!Gu){var Mp=document.createElement("div");Mp.setAttribute("oninput","return;"),Gu=typeof Mp.oninput=="function"}$u=Gu}else $u=!1;Rp=$u&&(!document.documentMode||9<document.documentMode)}function Bp(){al&&(al.detachEvent("onpropertychange",Np),ol=al=null)}function Np(i){if(i.propertyName==="value"&&Ua(ol)){var r=[];Ap(r,ol,i,Pu(i)),_p(F0,r)}}function q0(i,r,l){i==="focusin"?(Bp(),al=r,ol=l,al.attachEvent("onpropertychange",Np)):i==="focusout"&&Bp()}function W0(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ua(ol)}function Y0(i,r){if(i==="click")return Ua(r)}function V0(i,r){if(i==="input"||i==="change")return Ua(r)}function K0(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var Si=typeof Object.is=="function"?Object.is:K0;function ul(i,r){if(Si(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),u=Object.keys(r);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var d=l[u];if(!Qr.call(r,d)||!Si(i[d],r[d]))return!1}return!0}function Lp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function zp(i,r){var l=Lp(i);i=0;for(var u;l;){if(l.nodeType===3){if(u=i+l.textContent.length,i<=r&&u>=r)return{node:l,offset:r-i};i=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Lp(l)}}function Op(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?Op(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function jp(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Ba(i.document);r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=Ba(i.document)}return r}function Zu(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var X0=mn&&"documentMode"in document&&11>=document.documentMode,cs=null,Qu=null,cl=null,Ju=!1;function Hp(i,r,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ju||cs==null||cs!==Ba(u)||(u=cs,"selectionStart"in u&&Zu(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),cl&&ul(cl,u)||(cl=u,u=Ao(Qu,"onSelect"),0<u.length&&(r=new ja("onSelect","select",null,r,l),i.push({event:r,listeners:u}),r.target=cs)))}function xr(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var hs={animationend:xr("Animation","AnimationEnd"),animationiteration:xr("Animation","AnimationIteration"),animationstart:xr("Animation","AnimationStart"),transitionrun:xr("Transition","TransitionRun"),transitionstart:xr("Transition","TransitionStart"),transitioncancel:xr("Transition","TransitionCancel"),transitionend:xr("Transition","TransitionEnd")},ec={},Up={};mn&&(Up=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function wr(i){if(ec[i])return ec[i];if(!hs[i])return i;var r=hs[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in Up)return ec[i]=r[l];return i}var Pp=wr("animationend"),Ip=wr("animationiteration"),Fp=wr("animationstart"),$0=wr("transitionrun"),G0=wr("transitionstart"),Z0=wr("transitioncancel"),qp=wr("transitionend"),Wp=new Map,tc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");tc.push("scrollEnd");function Xi(i,r){Wp.set(i,r),br(r,[i])}var Pa=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Li=[],fs=0,ic=0;function Ia(){for(var i=fs,r=ic=fs=0;r<i;){var l=Li[r];Li[r++]=null;var u=Li[r];Li[r++]=null;var d=Li[r];Li[r++]=null;var m=Li[r];if(Li[r++]=null,u!==null&&d!==null){var v=u.pending;v===null?d.next=d:(d.next=v.next,v.next=d),u.pending=d}m!==0&&Yp(l,d,m)}}function Fa(i,r,l,u){Li[fs++]=i,Li[fs++]=r,Li[fs++]=l,Li[fs++]=u,ic|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function nc(i,r,l,u){return Fa(i,r,l,u),qa(i)}function Cr(i,r){return Fa(i,null,null,r),qa(i)}function Yp(i,r,l){i.lanes|=l;var u=i.alternate;u!==null&&(u.lanes|=l);for(var d=!1,m=i.return;m!==null;)m.childLanes|=l,u=m.alternate,u!==null&&(u.childLanes|=l),m.tag===22&&(i=m.stateNode,i===null||i._visibility&1||(d=!0)),i=m,m=m.return;return i.tag===3?(m=i.stateNode,d&&r!==null&&(d=31-Ge(l),i=m.hiddenUpdates,u=i[d],u===null?i[d]=[r]:u.push(r),r.lane=l|536870912),m):null}function qa(i){if(50<Bl)throw Bl=0,fh=null,Error(s(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var ds={};function Q0(i,r,l,u){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xi(i,r,l,u){return new Q0(i,r,l,u)}function rc(i){return i=i.prototype,!(!i||!i.isReactComponent)}function _n(i,r){var l=i.alternate;return l===null?(l=xi(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&65011712,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l.refCleanup=i.refCleanup,l}function Vp(i,r){i.flags&=65011714;var l=i.alternate;return l===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,r=l.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Wa(i,r,l,u,d,m){var v=0;if(u=i,typeof i=="function")rc(i)&&(v=1);else if(typeof i=="string")v=nx(i,l,se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case de:return i=xi(31,l,r,d),i.elementType=de,i.lanes=m,i;case E:return kr(l.children,d,m,r);case N:v=8,d|=24;break;case M:return i=xi(12,l,r,d|2),i.elementType=M,i.lanes=m,i;case K:return i=xi(13,l,r,d),i.elementType=K,i.lanes=m,i;case O:return i=xi(19,l,r,d),i.elementType=O,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case U:v=10;break e;case G:v=9;break e;case Q:v=11;break e;case ee:v=14;break e;case oe:v=16,u=null;break e}v=29,l=Error(s(130,i===null?"null":typeof i,"")),u=null}return r=xi(v,l,r,d),r.elementType=i,r.type=u,r.lanes=m,r}function kr(i,r,l,u){return i=xi(7,i,u,r),i.lanes=l,i}function sc(i,r,l){return i=xi(6,i,null,r),i.lanes=l,i}function Kp(i){var r=xi(18,null,null,0);return r.stateNode=i,r}function lc(i,r,l){return r=xi(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var Xp=new WeakMap;function zi(i,r){if(typeof i=="object"&&i!==null){var l=Xp.get(i);return l!==void 0?l:(r={value:i,source:r,stack:ka(r)},Xp.set(i,r),r)}return{value:i,source:r,stack:ka(r)}}var ps=[],ms=0,Ya=null,hl=0,Oi=[],ji=0,In=null,Ji=1,en="";function gn(i,r){ps[ms++]=hl,ps[ms++]=Ya,Ya=i,hl=r}function $p(i,r,l){Oi[ji++]=Ji,Oi[ji++]=en,Oi[ji++]=In,In=i;var u=Ji;i=en;var d=32-Ge(u)-1;u&=~(1<<d),l+=1;var m=32-Ge(r)+d;if(30<m){var v=d-d%5;m=(u&(1<<v)-1).toString(32),u>>=v,d-=v,Ji=1<<32-Ge(r)+d|l<<d|u,en=m+i}else Ji=1<<m|l<<d|u,en=i}function ac(i){i.return!==null&&(gn(i,1),$p(i,1,0))}function oc(i){for(;i===Ya;)Ya=ps[--ms],ps[ms]=null,hl=ps[--ms],ps[ms]=null;for(;i===In;)In=Oi[--ji],Oi[ji]=null,en=Oi[--ji],Oi[ji]=null,Ji=Oi[--ji],Oi[ji]=null}function Gp(i,r){Oi[ji++]=Ji,Oi[ji++]=en,Oi[ji++]=In,Ji=r.id,en=r.overflow,In=i}var Ut=null,et=null,je=!1,Fn=null,Hi=!1,uc=Error(s(519));function qn(i){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fl(zi(r,i)),uc}function Zp(i){var r=i.stateNode,l=i.type,u=i.memoizedProps;switch(r[Ht]=i,r[ui]=u,l){case"dialog":Ne("cancel",r),Ne("close",r);break;case"iframe":case"object":case"embed":Ne("load",r);break;case"video":case"audio":for(l=0;l<Ll.length;l++)Ne(Ll[l],r);break;case"source":Ne("error",r);break;case"img":case"image":case"link":Ne("error",r),Ne("load",r);break;case"details":Ne("toggle",r);break;case"input":Ne("invalid",r),cp(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ne("invalid",r);break;case"textarea":Ne("invalid",r),fp(r,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||u.suppressHydrationWarning===!0||pg(r.textContent,l)?(u.popover!=null&&(Ne("beforetoggle",r),Ne("toggle",r)),u.onScroll!=null&&Ne("scroll",r),u.onScrollEnd!=null&&Ne("scrollend",r),u.onClick!=null&&(r.onclick=pn),r=!0):r=!1,r||qn(i,!0)}function Qp(i){for(Ut=i.return;Ut;)switch(Ut.tag){case 5:case 31:case 13:Hi=!1;return;case 27:case 3:Hi=!0;return;default:Ut=Ut.return}}function _s(i){if(i!==Ut)return!1;if(!je)return Qp(i),je=!0,!1;var r=i.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=i.type,l=!(l!=="form"&&l!=="button")||Th(i.type,i.memoizedProps)),l=!l),l&&et&&qn(i),Qp(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));et=wg(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));et=wg(i)}else r===27?(r=et,nr(i.type)?(i=Bh,Bh=null,et=i):et=r):et=Ut?Pi(i.stateNode.nextSibling):null;return!0}function Er(){et=Ut=null,je=!1}function cc(){var i=Fn;return i!==null&&(pi===null?pi=i:pi.push.apply(pi,i),Fn=null),i}function fl(i){Fn===null?Fn=[i]:Fn.push(i)}var hc=T(null),Tr=null,vn=null;function Wn(i,r,l){C(hc,r._currentValue),r._currentValue=l}function yn(i){i._currentValue=hc.current,X(hc)}function fc(i,r,l){for(;i!==null;){var u=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),i===l)break;i=i.return}}function dc(i,r,l,u){var d=i.child;for(d!==null&&(d.return=i);d!==null;){var m=d.dependencies;if(m!==null){var v=d.child;m=m.firstContext;e:for(;m!==null;){var w=m;m=d;for(var R=0;R<r.length;R++)if(w.context===r[R]){m.lanes|=l,w=m.alternate,w!==null&&(w.lanes|=l),fc(m.return,l,i),u||(v=null);break e}m=w.next}}else if(d.tag===18){if(v=d.return,v===null)throw Error(s(341));v.lanes|=l,m=v.alternate,m!==null&&(m.lanes|=l),fc(v,l,i),v=null}else v=d.child;if(v!==null)v.return=d;else for(v=d;v!==null;){if(v===i){v=null;break}if(d=v.sibling,d!==null){d.return=v.return,v=d;break}v=v.return}d=v}}function gs(i,r,l,u){i=null;for(var d=r,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var v=d.alternate;if(v===null)throw Error(s(387));if(v=v.memoizedProps,v!==null){var w=d.type;Si(d.pendingProps.value,v.value)||(i!==null?i.push(w):i=[w])}}else if(d===be.current){if(v=d.alternate,v===null)throw Error(s(387));v.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(i!==null?i.push(Ul):i=[Ul])}d=d.return}i!==null&&dc(r,i,l,u),r.flags|=262144}function Va(i){for(i=i.firstContext;i!==null;){if(!Si(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ar(i){Tr=i,vn=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Pt(i){return Jp(Tr,i)}function Ka(i,r){return Tr===null&&Ar(i),Jp(i,r)}function Jp(i,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},vn===null){if(i===null)throw Error(s(308));vn=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else vn=vn.next=r;return l}var J0=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(l,u){i.push(u)}};this.abort=function(){r.aborted=!0,i.forEach(function(l){return l()})}},e1=e.unstable_scheduleCallback,t1=e.unstable_NormalPriority,mt={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pc(){return{controller:new J0,data:new Map,refCount:0}}function dl(i){i.refCount--,i.refCount===0&&e1(t1,function(){i.controller.abort()})}var pl=null,mc=0,vs=0,ys=null;function i1(i,r){if(pl===null){var l=pl=[];mc=0,vs=vh(),ys={status:"pending",value:void 0,then:function(u){l.push(u)}}}return mc++,r.then(em,em),r}function em(){if(--mc===0&&pl!==null){ys!==null&&(ys.status="fulfilled");var i=pl;pl=null,vs=0,ys=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function n1(i,r){var l=[],u={status:"pending",value:null,reason:null,then:function(d){l.push(d)}};return i.then(function(){u.status="fulfilled",u.value=r;for(var d=0;d<l.length;d++)(0,l[d])(r)},function(d){for(u.status="rejected",u.reason=d,d=0;d<l.length;d++)(0,l[d])(void 0)}),u}var tm=A.S;A.S=function(i,r){H_=Qt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&i1(i,r),tm!==null&&tm(i,r)};var Dr=T(null);function _c(){var i=Dr.current;return i!==null?i:Ze.pooledCache}function Xa(i,r){r===null?C(Dr,Dr.current):C(Dr,r.pool)}function im(){var i=_c();return i===null?null:{parent:mt._currentValue,pool:i}}var bs=Error(s(460)),gc=Error(s(474)),$a=Error(s(542)),Ga={then:function(){}};function nm(i){return i=i.status,i==="fulfilled"||i==="rejected"}function rm(i,r,l){switch(l=i[l],l===void 0?i.push(r):l!==r&&(r.then(pn,pn),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,lm(i),i;default:if(typeof r.status=="string")r.then(pn,pn);else{if(i=Ze,i!==null&&100<i.shellSuspendCounter)throw Error(s(482));i=r,i.status="pending",i.then(function(u){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=u}},function(u){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,lm(i),i}throw Mr=r,bs}}function Rr(i){try{var r=i._init;return r(i._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Mr=l,bs):l}}var Mr=null;function sm(){if(Mr===null)throw Error(s(459));var i=Mr;return Mr=null,i}function lm(i){if(i===bs||i===$a)throw Error(s(483))}var Ss=null,ml=0;function Za(i){var r=ml;return ml+=1,Ss===null&&(Ss=[]),rm(Ss,i,r)}function _l(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Qa(i,r){throw r.$$typeof===b?Error(s(525)):(i=Object.prototype.toString.call(r),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function am(i){function r(H,z){if(i){var q=H.deletions;q===null?(H.deletions=[z],H.flags|=16):q.push(z)}}function l(H,z){if(!i)return null;for(;z!==null;)r(H,z),z=z.sibling;return null}function u(H){for(var z=new Map;H!==null;)H.key!==null?z.set(H.key,H):z.set(H.index,H),H=H.sibling;return z}function d(H,z){return H=_n(H,z),H.index=0,H.sibling=null,H}function m(H,z,q){return H.index=q,i?(q=H.alternate,q!==null?(q=q.index,q<z?(H.flags|=67108866,z):q):(H.flags|=67108866,z)):(H.flags|=1048576,z)}function v(H){return i&&H.alternate===null&&(H.flags|=67108866),H}function w(H,z,q,te){return z===null||z.tag!==6?(z=sc(q,H.mode,te),z.return=H,z):(z=d(z,q),z.return=H,z)}function R(H,z,q,te){var ge=q.type;return ge===E?Z(H,z,q.props.children,te,q.key):z!==null&&(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===oe&&Rr(ge)===z.type)?(z=d(z,q.props),_l(z,q),z.return=H,z):(z=Wa(q.type,q.key,q.props,null,H.mode,te),_l(z,q),z.return=H,z)}function W(H,z,q,te){return z===null||z.tag!==4||z.stateNode.containerInfo!==q.containerInfo||z.stateNode.implementation!==q.implementation?(z=lc(q,H.mode,te),z.return=H,z):(z=d(z,q.children||[]),z.return=H,z)}function Z(H,z,q,te,ge){return z===null||z.tag!==7?(z=kr(q,H.mode,te,ge),z.return=H,z):(z=d(z,q),z.return=H,z)}function ie(H,z,q){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=sc(""+z,H.mode,q),z.return=H,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case y:return q=Wa(z.type,z.key,z.props,null,H.mode,q),_l(q,z),q.return=H,q;case x:return z=lc(z,H.mode,q),z.return=H,z;case oe:return z=Rr(z),ie(H,z,q)}if(L(z)||D(z))return z=kr(z,H.mode,q,null),z.return=H,z;if(typeof z.then=="function")return ie(H,Za(z),q);if(z.$$typeof===U)return ie(H,Ka(H,z),q);Qa(H,z)}return null}function V(H,z,q,te){var ge=z!==null?z.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return ge!==null?null:w(H,z,""+q,te);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case y:return q.key===ge?R(H,z,q,te):null;case x:return q.key===ge?W(H,z,q,te):null;case oe:return q=Rr(q),V(H,z,q,te)}if(L(q)||D(q))return ge!==null?null:Z(H,z,q,te,null);if(typeof q.then=="function")return V(H,z,Za(q),te);if(q.$$typeof===U)return V(H,z,Ka(H,q),te);Qa(H,q)}return null}function $(H,z,q,te,ge){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return H=H.get(q)||null,w(z,H,""+te,ge);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return H=H.get(te.key===null?q:te.key)||null,R(z,H,te,ge);case x:return H=H.get(te.key===null?q:te.key)||null,W(z,H,te,ge);case oe:return te=Rr(te),$(H,z,q,te,ge)}if(L(te)||D(te))return H=H.get(q)||null,Z(z,H,te,ge,null);if(typeof te.then=="function")return $(H,z,q,Za(te),ge);if(te.$$typeof===U)return $(H,z,q,Ka(z,te),ge);Qa(z,te)}return null}function me(H,z,q,te){for(var ge=null,Pe=null,_e=z,ke=z=0,Oe=null;_e!==null&&ke<q.length;ke++){_e.index>ke?(Oe=_e,_e=null):Oe=_e.sibling;var Ie=V(H,_e,q[ke],te);if(Ie===null){_e===null&&(_e=Oe);break}i&&_e&&Ie.alternate===null&&r(H,_e),z=m(Ie,z,ke),Pe===null?ge=Ie:Pe.sibling=Ie,Pe=Ie,_e=Oe}if(ke===q.length)return l(H,_e),je&&gn(H,ke),ge;if(_e===null){for(;ke<q.length;ke++)_e=ie(H,q[ke],te),_e!==null&&(z=m(_e,z,ke),Pe===null?ge=_e:Pe.sibling=_e,Pe=_e);return je&&gn(H,ke),ge}for(_e=u(_e);ke<q.length;ke++)Oe=$(_e,H,ke,q[ke],te),Oe!==null&&(i&&Oe.alternate!==null&&_e.delete(Oe.key===null?ke:Oe.key),z=m(Oe,z,ke),Pe===null?ge=Oe:Pe.sibling=Oe,Pe=Oe);return i&&_e.forEach(function(or){return r(H,or)}),je&&gn(H,ke),ge}function ye(H,z,q,te){if(q==null)throw Error(s(151));for(var ge=null,Pe=null,_e=z,ke=z=0,Oe=null,Ie=q.next();_e!==null&&!Ie.done;ke++,Ie=q.next()){_e.index>ke?(Oe=_e,_e=null):Oe=_e.sibling;var or=V(H,_e,Ie.value,te);if(or===null){_e===null&&(_e=Oe);break}i&&_e&&or.alternate===null&&r(H,_e),z=m(or,z,ke),Pe===null?ge=or:Pe.sibling=or,Pe=or,_e=Oe}if(Ie.done)return l(H,_e),je&&gn(H,ke),ge;if(_e===null){for(;!Ie.done;ke++,Ie=q.next())Ie=ie(H,Ie.value,te),Ie!==null&&(z=m(Ie,z,ke),Pe===null?ge=Ie:Pe.sibling=Ie,Pe=Ie);return je&&gn(H,ke),ge}for(_e=u(_e);!Ie.done;ke++,Ie=q.next())Ie=$(_e,H,ke,Ie.value,te),Ie!==null&&(i&&Ie.alternate!==null&&_e.delete(Ie.key===null?ke:Ie.key),z=m(Ie,z,ke),Pe===null?ge=Ie:Pe.sibling=Ie,Pe=Ie);return i&&_e.forEach(function(px){return r(H,px)}),je&&gn(H,ke),ge}function Xe(H,z,q,te){if(typeof q=="object"&&q!==null&&q.type===E&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case y:e:{for(var ge=q.key;z!==null;){if(z.key===ge){if(ge=q.type,ge===E){if(z.tag===7){l(H,z.sibling),te=d(z,q.props.children),te.return=H,H=te;break e}}else if(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===oe&&Rr(ge)===z.type){l(H,z.sibling),te=d(z,q.props),_l(te,q),te.return=H,H=te;break e}l(H,z);break}else r(H,z);z=z.sibling}q.type===E?(te=kr(q.props.children,H.mode,te,q.key),te.return=H,H=te):(te=Wa(q.type,q.key,q.props,null,H.mode,te),_l(te,q),te.return=H,H=te)}return v(H);case x:e:{for(ge=q.key;z!==null;){if(z.key===ge)if(z.tag===4&&z.stateNode.containerInfo===q.containerInfo&&z.stateNode.implementation===q.implementation){l(H,z.sibling),te=d(z,q.children||[]),te.return=H,H=te;break e}else{l(H,z);break}else r(H,z);z=z.sibling}te=lc(q,H.mode,te),te.return=H,H=te}return v(H);case oe:return q=Rr(q),Xe(H,z,q,te)}if(L(q))return me(H,z,q,te);if(D(q)){if(ge=D(q),typeof ge!="function")throw Error(s(150));return q=ge.call(q),ye(H,z,q,te)}if(typeof q.then=="function")return Xe(H,z,Za(q),te);if(q.$$typeof===U)return Xe(H,z,Ka(H,q),te);Qa(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,z!==null&&z.tag===6?(l(H,z.sibling),te=d(z,q),te.return=H,H=te):(l(H,z),te=sc(q,H.mode,te),te.return=H,H=te),v(H)):l(H,z)}return function(H,z,q,te){try{ml=0;var ge=Xe(H,z,q,te);return Ss=null,ge}catch(_e){if(_e===bs||_e===$a)throw _e;var Pe=xi(29,_e,null,H.mode);return Pe.lanes=te,Pe.return=H,Pe}finally{}}}var Br=am(!0),om=am(!1),Yn=!1;function vc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yc(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Vn(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Kn(i,r,l){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(Fe&2)!==0){var d=u.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),u.pending=r,r=qa(i),Yp(i,null,l),r}return Fa(i,u,r,l),qa(i)}function gl(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,Jd(i,l)}}function bc(i,r){var l=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var d=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?d=m=v:m=m.next=v,l=l.next}while(l!==null);m===null?d=m=r:m=m.next=r}else d=m=r;l={baseState:u.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:u.shared,callbacks:u.callbacks},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}var Sc=!1;function vl(){if(Sc){var i=ys;if(i!==null)throw i}}function yl(i,r,l,u){Sc=!1;var d=i.updateQueue;Yn=!1;var m=d.firstBaseUpdate,v=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var R=w,W=R.next;R.next=null,v===null?m=W:v.next=W,v=R;var Z=i.alternate;Z!==null&&(Z=Z.updateQueue,w=Z.lastBaseUpdate,w!==v&&(w===null?Z.firstBaseUpdate=W:w.next=W,Z.lastBaseUpdate=R))}if(m!==null){var ie=d.baseState;v=0,Z=W=R=null,w=m;do{var V=w.lane&-536870913,$=V!==w.lane;if($?(ze&V)===V:(u&V)===V){V!==0&&V===vs&&(Sc=!0),Z!==null&&(Z=Z.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var me=i,ye=w;V=r;var Xe=l;switch(ye.tag){case 1:if(me=ye.payload,typeof me=="function"){ie=me.call(Xe,ie,V);break e}ie=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ye.payload,V=typeof me=="function"?me.call(Xe,ie,V):me,V==null)break e;ie=_({},ie,V);break e;case 2:Yn=!0}}V=w.callback,V!==null&&(i.flags|=64,$&&(i.flags|=8192),$=d.callbacks,$===null?d.callbacks=[V]:$.push(V))}else $={lane:V,tag:w.tag,payload:w.payload,callback:w.callback,next:null},Z===null?(W=Z=$,R=ie):Z=Z.next=$,v|=V;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;$=w,w=$.next,$.next=null,d.lastBaseUpdate=$,d.shared.pending=null}}while(!0);Z===null&&(R=ie),d.baseState=R,d.firstBaseUpdate=W,d.lastBaseUpdate=Z,m===null&&(d.shared.lanes=0),Qn|=v,i.lanes=v,i.memoizedState=ie}}function um(i,r){if(typeof i!="function")throw Error(s(191,i));i.call(r)}function cm(i,r){var l=i.callbacks;if(l!==null)for(i.callbacks=null,i=0;i<l.length;i++)um(l[i],r)}var xs=T(null),Ja=T(0);function hm(i,r){i=An,C(Ja,i),C(xs,r),An=i|r.baseLanes}function xc(){C(Ja,An),C(xs,xs.current)}function wc(){An=Ja.current,X(xs),X(Ja)}var wi=T(null),Ui=null;function Xn(i){var r=i.alternate;C(ft,ft.current&1),C(wi,i),Ui===null&&(r===null||xs.current!==null||r.memoizedState!==null)&&(Ui=i)}function Cc(i){C(ft,ft.current),C(wi,i),Ui===null&&(Ui=i)}function fm(i){i.tag===22?(C(ft,ft.current),C(wi,i),Ui===null&&(Ui=i)):$n()}function $n(){C(ft,ft.current),C(wi,wi.current)}function Ci(i){X(wi),Ui===i&&(Ui=null),X(ft)}var ft=T(0);function eo(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Rh(l)||Mh(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var bn=0,Ce=null,Ve=null,_t=null,to=!1,ws=!1,Nr=!1,io=0,bl=0,Cs=null,r1=0;function at(){throw Error(s(321))}function kc(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!Si(i[l],r[l]))return!1;return!0}function Ec(i,r,l,u,d,m){return bn=m,Ce=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,A.H=i===null||i.memoizedState===null?$m:Ic,Nr=!1,m=l(u,d),Nr=!1,ws&&(m=pm(r,l,u,d)),dm(i),m}function dm(i){A.H=wl;var r=Ve!==null&&Ve.next!==null;if(bn=0,_t=Ve=Ce=null,to=!1,bl=0,Cs=null,r)throw Error(s(300));i===null||gt||(i=i.dependencies,i!==null&&Va(i)&&(gt=!0))}function pm(i,r,l,u){Ce=i;var d=0;do{if(ws&&(Cs=null),bl=0,ws=!1,25<=d)throw Error(s(301));if(d+=1,_t=Ve=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}A.H=Gm,m=r(l,u)}while(ws);return m}function s1(){var i=A.H,r=i.useState()[0];return r=typeof r.then=="function"?Sl(r):r,i=i.useState()[0],(Ve!==null?Ve.memoizedState:null)!==i&&(Ce.flags|=1024),r}function Tc(){var i=io!==0;return io=0,i}function Ac(i,r,l){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~l}function Dc(i){if(to){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}to=!1}bn=0,_t=Ve=Ce=null,ws=!1,bl=io=0,Cs=null}function ei(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Ce.memoizedState=_t=i:_t=_t.next=i,_t}function dt(){if(Ve===null){var i=Ce.alternate;i=i!==null?i.memoizedState:null}else i=Ve.next;var r=_t===null?Ce.memoizedState:_t.next;if(r!==null)_t=r,Ve=i;else{if(i===null)throw Ce.alternate===null?Error(s(467)):Error(s(310));Ve=i,i={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},_t===null?Ce.memoizedState=_t=i:_t=_t.next=i}return _t}function no(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sl(i){var r=bl;return bl+=1,Cs===null&&(Cs=[]),i=rm(Cs,i,r),r=Ce,(_t===null?r.memoizedState:_t.next)===null&&(r=r.alternate,A.H=r===null||r.memoizedState===null?$m:Ic),i}function ro(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Sl(i);if(i.$$typeof===U)return Pt(i)}throw Error(s(438,String(i)))}function Rc(i){var r=null,l=Ce.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var u=Ce.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(d){return d.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=no(),Ce.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(i),u=0;u<i;u++)l[u]=F;return r.index++,l}function Sn(i,r){return typeof r=="function"?r(i):r}function so(i){var r=dt();return Mc(r,Ve,i)}function Mc(i,r,l){var u=i.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=l;var d=i.baseQueue,m=u.pending;if(m!==null){if(d!==null){var v=d.next;d.next=m.next,m.next=v}r.baseQueue=d=m,u.pending=null}if(m=i.baseState,d===null)i.memoizedState=m;else{r=d.next;var w=v=null,R=null,W=r,Z=!1;do{var ie=W.lane&-536870913;if(ie!==W.lane?(ze&ie)===ie:(bn&ie)===ie){var V=W.revertLane;if(V===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ie===vs&&(Z=!0);else if((bn&V)===V){W=W.next,V===vs&&(Z=!0);continue}else ie={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(w=R=ie,v=m):R=R.next=ie,Ce.lanes|=V,Qn|=V;ie=W.action,Nr&&l(m,ie),m=W.hasEagerState?W.eagerState:l(m,ie)}else V={lane:ie,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(w=R=V,v=m):R=R.next=V,Ce.lanes|=ie,Qn|=ie;W=W.next}while(W!==null&&W!==r);if(R===null?v=m:R.next=w,!Si(m,i.memoizedState)&&(gt=!0,Z&&(l=ys,l!==null)))throw l;i.memoizedState=m,i.baseState=v,i.baseQueue=R,u.lastRenderedState=m}return d===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Bc(i){var r=dt(),l=r.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var u=l.dispatch,d=l.pending,m=r.memoizedState;if(d!==null){l.pending=null;var v=d=d.next;do m=i(m,v.action),v=v.next;while(v!==d);Si(m,r.memoizedState)||(gt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),l.lastRenderedState=m}return[m,u]}function mm(i,r,l){var u=Ce,d=dt(),m=je;if(m){if(l===void 0)throw Error(s(407));l=l()}else l=r();var v=!Si((Ve||d).memoizedState,l);if(v&&(d.memoizedState=l,gt=!0),d=d.queue,zc(vm.bind(null,u,d,i),[i]),d.getSnapshot!==r||v||_t!==null&&_t.memoizedState.tag&1){if(u.flags|=2048,ks(9,{destroy:void 0},gm.bind(null,u,d,l,r),null),Ze===null)throw Error(s(349));m||(bn&127)!==0||_m(u,r,l)}return l}function _m(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=Ce.updateQueue,r===null?(r=no(),Ce.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function gm(i,r,l,u){r.value=l,r.getSnapshot=u,ym(r)&&bm(i)}function vm(i,r,l){return l(function(){ym(r)&&bm(i)})}function ym(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!Si(i,l)}catch{return!0}}function bm(i){var r=Cr(i,2);r!==null&&mi(r,i,2)}function Nc(i){var r=ei();if(typeof i=="function"){var l=i;if(i=l(),Nr){oi(!0);try{l()}finally{oi(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:i},r}function Sm(i,r,l,u){return i.baseState=l,Mc(i,Ve,typeof u=="function"?u:Sn)}function l1(i,r,l,u,d){if(oo(i))throw Error(s(485));if(i=r.action,i!==null){var m={payload:d,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){m.listeners.push(v)}};A.T!==null?l(!0):m.isTransition=!1,u(m),l=r.pending,l===null?(m.next=r.pending=m,xm(r,m)):(m.next=l.next,r.pending=l.next=m)}}function xm(i,r){var l=r.action,u=r.payload,d=i.state;if(r.isTransition){var m=A.T,v={};A.T=v;try{var w=l(d,u),R=A.S;R!==null&&R(v,w),wm(i,r,w)}catch(W){Lc(i,r,W)}finally{m!==null&&v.types!==null&&(m.types=v.types),A.T=m}}else try{m=l(d,u),wm(i,r,m)}catch(W){Lc(i,r,W)}}function wm(i,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Cm(i,r,u)},function(u){return Lc(i,r,u)}):Cm(i,r,l)}function Cm(i,r,l){r.status="fulfilled",r.value=l,km(r),i.state=l,r=i.pending,r!==null&&(l=r.next,l===r?i.pending=null:(l=l.next,r.next=l,xm(i,l)))}function Lc(i,r,l){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=l,km(r),r=r.next;while(r!==u)}i.action=null}function km(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function Em(i,r){return r}function Tm(i,r){if(je){var l=Ze.formState;if(l!==null){e:{var u=Ce;if(je){if(et){t:{for(var d=et,m=Hi;d.nodeType!==8;){if(!m){d=null;break t}if(d=Pi(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){et=Pi(d.nextSibling),u=d.data==="F!";break e}}qn(u)}u=!1}u&&(r=l[0])}}return l=ei(),l.memoizedState=l.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Em,lastRenderedState:r},l.queue=u,l=Vm.bind(null,Ce,u),u.dispatch=l,u=Nc(!1),m=Pc.bind(null,Ce,!1,u.queue),u=ei(),d={state:r,dispatch:null,action:i,pending:null},u.queue=d,l=l1.bind(null,Ce,d,m,l),d.dispatch=l,u.memoizedState=i,[r,l,!1]}function Am(i){var r=dt();return Dm(r,Ve,i)}function Dm(i,r,l){if(r=Mc(i,r,Em)[0],i=so(Sn)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=Sl(r)}catch(v){throw v===bs?$a:v}else u=r;r=dt();var d=r.queue,m=d.dispatch;return l!==r.memoizedState&&(Ce.flags|=2048,ks(9,{destroy:void 0},a1.bind(null,d,l),null)),[u,m,i]}function a1(i,r){i.action=r}function Rm(i){var r=dt(),l=Ve;if(l!==null)return Dm(r,l,i);dt(),r=r.memoizedState,l=dt();var u=l.queue.dispatch;return l.memoizedState=i,[r,u,!1]}function ks(i,r,l,u){return i={tag:i,create:l,deps:u,inst:r,next:null},r=Ce.updateQueue,r===null&&(r=no(),Ce.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=i.next=i:(u=l.next,l.next=i,i.next=u,r.lastEffect=i),i}function Mm(){return dt().memoizedState}function lo(i,r,l,u){var d=ei();Ce.flags|=i,d.memoizedState=ks(1|r,{destroy:void 0},l,u===void 0?null:u)}function ao(i,r,l,u){var d=dt();u=u===void 0?null:u;var m=d.memoizedState.inst;Ve!==null&&u!==null&&kc(u,Ve.memoizedState.deps)?d.memoizedState=ks(r,m,l,u):(Ce.flags|=i,d.memoizedState=ks(1|r,m,l,u))}function Bm(i,r){lo(8390656,8,i,r)}function zc(i,r){ao(2048,8,i,r)}function o1(i){Ce.flags|=4;var r=Ce.updateQueue;if(r===null)r=no(),Ce.updateQueue=r,r.events=[i];else{var l=r.events;l===null?r.events=[i]:l.push(i)}}function Nm(i){var r=dt().memoizedState;return o1({ref:r,nextImpl:i}),function(){if((Fe&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Lm(i,r){return ao(4,2,i,r)}function zm(i,r){return ao(4,4,i,r)}function Om(i,r){if(typeof r=="function"){i=i();var l=r(i);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function jm(i,r,l){l=l!=null?l.concat([i]):null,ao(4,4,Om.bind(null,r,i),l)}function Oc(){}function Hm(i,r){var l=dt();r=r===void 0?null:r;var u=l.memoizedState;return r!==null&&kc(r,u[1])?u[0]:(l.memoizedState=[i,r],i)}function Um(i,r){var l=dt();r=r===void 0?null:r;var u=l.memoizedState;if(r!==null&&kc(r,u[1]))return u[0];if(u=i(),Nr){oi(!0);try{i()}finally{oi(!1)}}return l.memoizedState=[u,r],u}function jc(i,r,l){return l===void 0||(bn&1073741824)!==0&&(ze&261930)===0?i.memoizedState=r:(i.memoizedState=l,i=P_(),Ce.lanes|=i,Qn|=i,l)}function Pm(i,r,l,u){return Si(l,r)?l:xs.current!==null?(i=jc(i,l,u),Si(i,r)||(gt=!0),i):(bn&42)===0||(bn&1073741824)!==0&&(ze&261930)===0?(gt=!0,i.memoizedState=l):(i=P_(),Ce.lanes|=i,Qn|=i,r)}function Im(i,r,l,u,d){var m=I.p;I.p=m!==0&&8>m?m:8;var v=A.T,w={};A.T=w,Pc(i,!1,r,l);try{var R=d(),W=A.S;if(W!==null&&W(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Z=n1(R,u);xl(i,r,Z,Ti(i))}else xl(i,r,u,Ti(i))}catch(ie){xl(i,r,{then:function(){},status:"rejected",reason:ie},Ti())}finally{I.p=m,v!==null&&w.types!==null&&(v.types=w.types),A.T=v}}function u1(){}function Hc(i,r,l,u){if(i.tag!==5)throw Error(s(476));var d=Fm(i).queue;Im(i,d,r,Y,l===null?u1:function(){return qm(i),l(u)})}function Fm(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:Y},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:l},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function qm(i){var r=Fm(i);r.next===null&&(r=i.alternate.memoizedState),xl(i,r.next.queue,{},Ti())}function Uc(){return Pt(Ul)}function Wm(){return dt().memoizedState}function Ym(){return dt().memoizedState}function c1(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var l=Ti();i=Vn(l);var u=Kn(r,i,l);u!==null&&(mi(u,r,l),gl(u,r,l)),r={cache:pc()},i.payload=r;return}r=r.return}}function h1(i,r,l){var u=Ti();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},oo(i)?Km(r,l):(l=nc(i,r,l,u),l!==null&&(mi(l,i,u),Xm(l,r,u)))}function Vm(i,r,l){var u=Ti();xl(i,r,l,u)}function xl(i,r,l,u){var d={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(oo(i))Km(r,d);else{var m=i.alternate;if(i.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var v=r.lastRenderedState,w=m(v,l);if(d.hasEagerState=!0,d.eagerState=w,Si(w,v))return Fa(i,r,d,0),Ze===null&&Ia(),!1}catch{}finally{}if(l=nc(i,r,d,u),l!==null)return mi(l,i,u),Xm(l,r,u),!0}return!1}function Pc(i,r,l,u){if(u={lane:2,revertLane:vh(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},oo(i)){if(r)throw Error(s(479))}else r=nc(i,l,u,2),r!==null&&mi(r,i,2)}function oo(i){var r=i.alternate;return i===Ce||r!==null&&r===Ce}function Km(i,r){ws=to=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function Xm(i,r,l){if((l&4194048)!==0){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,Jd(i,l)}}var wl={readContext:Pt,use:ro,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};wl.useEffectEvent=at;var $m={readContext:Pt,use:ro,useCallback:function(i,r){return ei().memoizedState=[i,r===void 0?null:r],i},useContext:Pt,useEffect:Bm,useImperativeHandle:function(i,r,l){l=l!=null?l.concat([i]):null,lo(4194308,4,Om.bind(null,r,i),l)},useLayoutEffect:function(i,r){return lo(4194308,4,i,r)},useInsertionEffect:function(i,r){lo(4,2,i,r)},useMemo:function(i,r){var l=ei();r=r===void 0?null:r;var u=i();if(Nr){oi(!0);try{i()}finally{oi(!1)}}return l.memoizedState=[u,r],u},useReducer:function(i,r,l){var u=ei();if(l!==void 0){var d=l(r);if(Nr){oi(!0);try{l(r)}finally{oi(!1)}}}else d=r;return u.memoizedState=u.baseState=d,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:d},u.queue=i,i=i.dispatch=h1.bind(null,Ce,i),[u.memoizedState,i]},useRef:function(i){var r=ei();return i={current:i},r.memoizedState=i},useState:function(i){i=Nc(i);var r=i.queue,l=Vm.bind(null,Ce,r);return r.dispatch=l,[i.memoizedState,l]},useDebugValue:Oc,useDeferredValue:function(i,r){var l=ei();return jc(l,i,r)},useTransition:function(){var i=Nc(!1);return i=Im.bind(null,Ce,i.queue,!0,!1),ei().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,l){var u=Ce,d=ei();if(je){if(l===void 0)throw Error(s(407));l=l()}else{if(l=r(),Ze===null)throw Error(s(349));(ze&127)!==0||_m(u,r,l)}d.memoizedState=l;var m={value:l,getSnapshot:r};return d.queue=m,Bm(vm.bind(null,u,m,i),[i]),u.flags|=2048,ks(9,{destroy:void 0},gm.bind(null,u,m,l,r),null),l},useId:function(){var i=ei(),r=Ze.identifierPrefix;if(je){var l=en,u=Ji;l=(u&~(1<<32-Ge(u)-1)).toString(32)+l,r="_"+r+"R_"+l,l=io++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=r1++,r="_"+r+"r_"+l.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Uc,useFormState:Tm,useActionState:Tm,useOptimistic:function(i){var r=ei();r.memoizedState=r.baseState=i;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=Pc.bind(null,Ce,!0,l),l.dispatch=r,[i,r]},useMemoCache:Rc,useCacheRefresh:function(){return ei().memoizedState=c1.bind(null,Ce)},useEffectEvent:function(i){var r=ei(),l={impl:i};return r.memoizedState=l,function(){if((Fe&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Ic={readContext:Pt,use:ro,useCallback:Hm,useContext:Pt,useEffect:zc,useImperativeHandle:jm,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Um,useReducer:so,useRef:Mm,useState:function(){return so(Sn)},useDebugValue:Oc,useDeferredValue:function(i,r){var l=dt();return Pm(l,Ve.memoizedState,i,r)},useTransition:function(){var i=so(Sn)[0],r=dt().memoizedState;return[typeof i=="boolean"?i:Sl(i),r]},useSyncExternalStore:mm,useId:Wm,useHostTransitionStatus:Uc,useFormState:Am,useActionState:Am,useOptimistic:function(i,r){var l=dt();return Sm(l,Ve,i,r)},useMemoCache:Rc,useCacheRefresh:Ym};Ic.useEffectEvent=Nm;var Gm={readContext:Pt,use:ro,useCallback:Hm,useContext:Pt,useEffect:zc,useImperativeHandle:jm,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Um,useReducer:Bc,useRef:Mm,useState:function(){return Bc(Sn)},useDebugValue:Oc,useDeferredValue:function(i,r){var l=dt();return Ve===null?jc(l,i,r):Pm(l,Ve.memoizedState,i,r)},useTransition:function(){var i=Bc(Sn)[0],r=dt().memoizedState;return[typeof i=="boolean"?i:Sl(i),r]},useSyncExternalStore:mm,useId:Wm,useHostTransitionStatus:Uc,useFormState:Rm,useActionState:Rm,useOptimistic:function(i,r){var l=dt();return Ve!==null?Sm(l,Ve,i,r):(l.baseState=i,[i,l.queue.dispatch])},useMemoCache:Rc,useCacheRefresh:Ym};Gm.useEffectEvent=Nm;function Fc(i,r,l,u){r=i.memoizedState,l=l(u,r),l=l==null?r:_({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var qc={enqueueSetState:function(i,r,l){i=i._reactInternals;var u=Ti(),d=Vn(u);d.payload=r,l!=null&&(d.callback=l),r=Kn(i,d,u),r!==null&&(mi(r,i,u),gl(r,i,u))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var u=Ti(),d=Vn(u);d.tag=1,d.payload=r,l!=null&&(d.callback=l),r=Kn(i,d,u),r!==null&&(mi(r,i,u),gl(r,i,u))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=Ti(),u=Vn(l);u.tag=2,r!=null&&(u.callback=r),r=Kn(i,u,l),r!==null&&(mi(r,i,l),gl(r,i,l))}};function Zm(i,r,l,u,d,m,v){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,m,v):r.prototype&&r.prototype.isPureReactComponent?!ul(l,u)||!ul(d,m):!0}function Qm(i,r,l,u){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,u),r.state!==i&&qc.enqueueReplaceState(r,r.state,null)}function Lr(i,r){var l=r;if("ref"in r){l={};for(var u in r)u!=="ref"&&(l[u]=r[u])}if(i=i.defaultProps){l===r&&(l=_({},l));for(var d in i)l[d]===void 0&&(l[d]=i[d])}return l}function Jm(i){Pa(i)}function e_(i){console.error(i)}function t_(i){Pa(i)}function uo(i,r){try{var l=i.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function i_(i,r,l){try{var u=i.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Wc(i,r,l){return l=Vn(l),l.tag=3,l.payload={element:null},l.callback=function(){uo(i,r)},l}function n_(i){return i=Vn(i),i.tag=3,i}function r_(i,r,l,u){var d=l.type.getDerivedStateFromError;if(typeof d=="function"){var m=u.value;i.payload=function(){return d(m)},i.callback=function(){i_(r,l,u)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(i.callback=function(){i_(r,l,u),typeof d!="function"&&(Jn===null?Jn=new Set([this]):Jn.add(this));var w=u.stack;this.componentDidCatch(u.value,{componentStack:w!==null?w:""})})}function f1(i,r,l,u,d){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=l.alternate,r!==null&&gs(r,l,d,!0),l=wi.current,l!==null){switch(l.tag){case 31:case 13:return Ui===null?xo():l.alternate===null&&ot===0&&(ot=3),l.flags&=-257,l.flags|=65536,l.lanes=d,u===Ga?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([u]):r.add(u),mh(i,u,d)),!1;case 22:return l.flags|=65536,u===Ga?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([u]):l.add(u)),mh(i,u,d)),!1}throw Error(s(435,l.tag))}return mh(i,u,d),xo(),!1}if(je)return r=wi.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=d,u!==uc&&(i=Error(s(422),{cause:u}),fl(zi(i,l)))):(u!==uc&&(r=Error(s(423),{cause:u}),fl(zi(r,l))),i=i.current.alternate,i.flags|=65536,d&=-d,i.lanes|=d,u=zi(u,l),d=Wc(i.stateNode,u,d),bc(i,d),ot!==4&&(ot=2)),!1;var m=Error(s(520),{cause:u});if(m=zi(m,l),Ml===null?Ml=[m]:Ml.push(m),ot!==4&&(ot=2),r===null)return!0;u=zi(u,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,i=d&-d,l.lanes|=i,i=Wc(l.stateNode,u,i),bc(l,i),!1;case 1:if(r=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Jn===null||!Jn.has(m))))return l.flags|=65536,d&=-d,l.lanes|=d,d=n_(d),r_(d,i,l,u),bc(l,d),!1}l=l.return}while(l!==null);return!1}var Yc=Error(s(461)),gt=!1;function It(i,r,l,u){r.child=i===null?om(r,null,l,u):Br(r,i.child,l,u)}function s_(i,r,l,u,d){l=l.render;var m=r.ref;if("ref"in u){var v={};for(var w in u)w!=="ref"&&(v[w]=u[w])}else v=u;return Ar(r),u=Ec(i,r,l,v,m,d),w=Tc(),i!==null&&!gt?(Ac(i,r,d),xn(i,r,d)):(je&&w&&ac(r),r.flags|=1,It(i,r,u,d),r.child)}function l_(i,r,l,u,d){if(i===null){var m=l.type;return typeof m=="function"&&!rc(m)&&m.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=m,a_(i,r,m,u,d)):(i=Wa(l.type,null,u,r,r.mode,d),i.ref=r.ref,i.return=r,r.child=i)}if(m=i.child,!Jc(i,d)){var v=m.memoizedProps;if(l=l.compare,l=l!==null?l:ul,l(v,u)&&i.ref===r.ref)return xn(i,r,d)}return r.flags|=1,i=_n(m,u),i.ref=r.ref,i.return=r,r.child=i}function a_(i,r,l,u,d){if(i!==null){var m=i.memoizedProps;if(ul(m,u)&&i.ref===r.ref)if(gt=!1,r.pendingProps=u=m,Jc(i,d))(i.flags&131072)!==0&&(gt=!0);else return r.lanes=i.lanes,xn(i,r,d)}return Vc(i,r,l,u,d)}function o_(i,r,l,u){var d=u.children,m=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,i!==null){for(u=r.child=i.child,d=0;u!==null;)d=d|u.lanes|u.childLanes,u=u.sibling;u=d&~m}else u=0,r.child=null;return u_(i,r,m,l,u)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Xa(r,m!==null?m.cachePool:null),m!==null?hm(r,m):xc(),fm(r);else return u=r.lanes=536870912,u_(i,r,m!==null?m.baseLanes|l:l,l,u)}else m!==null?(Xa(r,m.cachePool),hm(r,m),$n(),r.memoizedState=null):(i!==null&&Xa(r,null),xc(),$n());return It(i,r,d,l),r.child}function Cl(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function u_(i,r,l,u,d){var m=_c();return m=m===null?null:{parent:mt._currentValue,pool:m},r.memoizedState={baseLanes:l,cachePool:m},i!==null&&Xa(r,null),xc(),fm(r),i!==null&&gs(i,r,u,!0),r.childLanes=d,null}function co(i,r){return r=fo({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function c_(i,r,l){return Br(r,i.child,null,l),i=co(r,r.pendingProps),i.flags|=2,Ci(r),r.memoizedState=null,i}function d1(i,r,l){var u=r.pendingProps,d=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(je){if(u.mode==="hidden")return i=co(r,u),r.lanes=536870912,Cl(null,i);if(Cc(r),(i=et)?(i=xg(i,Hi),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:In!==null?{id:Ji,overflow:en}:null,retryLane:536870912,hydrationErrors:null},l=Kp(i),l.return=r,r.child=l,Ut=r,et=null)):i=null,i===null)throw qn(r);return r.lanes=536870912,null}return co(r,u)}var m=i.memoizedState;if(m!==null){var v=m.dehydrated;if(Cc(r),d)if(r.flags&256)r.flags&=-257,r=c_(i,r,l);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(s(558));else if(gt||gs(i,r,l,!1),d=(l&i.childLanes)!==0,gt||d){if(u=Ze,u!==null&&(v=ep(u,l),v!==0&&v!==m.retryLane))throw m.retryLane=v,Cr(i,v),mi(u,i,v),Yc;xo(),r=c_(i,r,l)}else i=m.treeContext,et=Pi(v.nextSibling),Ut=r,je=!0,Fn=null,Hi=!1,i!==null&&Gp(r,i),r=co(r,u),r.flags|=4096;return r}return i=_n(i.child,{mode:u.mode,children:u.children}),i.ref=r.ref,r.child=i,i.return=r,i}function ho(i,r){var l=r.ref;if(l===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(i===null||i.ref!==l)&&(r.flags|=4194816)}}function Vc(i,r,l,u,d){return Ar(r),l=Ec(i,r,l,u,void 0,d),u=Tc(),i!==null&&!gt?(Ac(i,r,d),xn(i,r,d)):(je&&u&&ac(r),r.flags|=1,It(i,r,l,d),r.child)}function h_(i,r,l,u,d,m){return Ar(r),r.updateQueue=null,l=pm(r,u,l,d),dm(i),u=Tc(),i!==null&&!gt?(Ac(i,r,m),xn(i,r,m)):(je&&u&&ac(r),r.flags|=1,It(i,r,l,m),r.child)}function f_(i,r,l,u,d){if(Ar(r),r.stateNode===null){var m=ds,v=l.contextType;typeof v=="object"&&v!==null&&(m=Pt(v)),m=new l(u,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=qc,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=u,m.state=r.memoizedState,m.refs={},vc(r),v=l.contextType,m.context=typeof v=="object"&&v!==null?Pt(v):ds,m.state=r.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Fc(r,l,v,u),m.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(v=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),v!==m.state&&qc.enqueueReplaceState(m,m.state,null),yl(r,u,m,d),vl(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(i===null){m=r.stateNode;var w=r.memoizedProps,R=Lr(l,w);m.props=R;var W=m.context,Z=l.contextType;v=ds,typeof Z=="object"&&Z!==null&&(v=Pt(Z));var ie=l.getDerivedStateFromProps;Z=typeof ie=="function"||typeof m.getSnapshotBeforeUpdate=="function",w=r.pendingProps!==w,Z||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w||W!==v)&&Qm(r,m,u,v),Yn=!1;var V=r.memoizedState;m.state=V,yl(r,u,m,d),vl(),W=r.memoizedState,w||V!==W||Yn?(typeof ie=="function"&&(Fc(r,l,ie,u),W=r.memoizedState),(R=Yn||Zm(r,l,R,u,V,W,v))?(Z||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=W),m.props=u,m.state=W,m.context=v,u=R):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{m=r.stateNode,yc(i,r),v=r.memoizedProps,Z=Lr(l,v),m.props=Z,ie=r.pendingProps,V=m.context,W=l.contextType,R=ds,typeof W=="object"&&W!==null&&(R=Pt(W)),w=l.getDerivedStateFromProps,(W=typeof w=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==ie||V!==R)&&Qm(r,m,u,R),Yn=!1,V=r.memoizedState,m.state=V,yl(r,u,m,d),vl();var $=r.memoizedState;v!==ie||V!==$||Yn||i!==null&&i.dependencies!==null&&Va(i.dependencies)?(typeof w=="function"&&(Fc(r,l,w,u),$=r.memoizedState),(Z=Yn||Zm(r,l,Z,u,V,$,R)||i!==null&&i.dependencies!==null&&Va(i.dependencies))?(W||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(u,$,R),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(u,$,R)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=$),m.props=u,m.state=$,m.context=R,u=Z):(typeof m.componentDidUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===i.memoizedProps&&V===i.memoizedState||(r.flags|=1024),u=!1)}return m=u,ho(i,r),u=(r.flags&128)!==0,m||u?(m=r.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,i!==null&&u?(r.child=Br(r,i.child,null,d),r.child=Br(r,null,l,d)):It(i,r,l,d),r.memoizedState=m.state,i=r.child):i=xn(i,r,d),i}function d_(i,r,l,u){return Er(),r.flags|=256,It(i,r,l,u),r.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(i){return{baseLanes:i,cachePool:im()}}function $c(i,r,l){return i=i!==null?i.childLanes&~l:0,r&&(i|=Ei),i}function p_(i,r,l){var u=r.pendingProps,d=!1,m=(r.flags&128)!==0,v;if((v=m)||(v=i!==null&&i.memoizedState===null?!1:(ft.current&2)!==0),v&&(d=!0,r.flags&=-129),v=(r.flags&32)!==0,r.flags&=-33,i===null){if(je){if(d?Xn(r):$n(),(i=et)?(i=xg(i,Hi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:In!==null?{id:Ji,overflow:en}:null,retryLane:536870912,hydrationErrors:null},l=Kp(i),l.return=r,r.child=l,Ut=r,et=null)):i=null,i===null)throw qn(r);return Mh(i)?r.lanes=32:r.lanes=536870912,null}var w=u.children;return u=u.fallback,d?($n(),d=r.mode,w=fo({mode:"hidden",children:w},d),u=kr(u,d,l,null),w.return=r,u.return=r,w.sibling=u,r.child=w,u=r.child,u.memoizedState=Xc(l),u.childLanes=$c(i,v,l),r.memoizedState=Kc,Cl(null,u)):(Xn(r),Gc(r,w))}var R=i.memoizedState;if(R!==null&&(w=R.dehydrated,w!==null)){if(m)r.flags&256?(Xn(r),r.flags&=-257,r=Zc(i,r,l)):r.memoizedState!==null?($n(),r.child=i.child,r.flags|=128,r=null):($n(),w=u.fallback,d=r.mode,u=fo({mode:"visible",children:u.children},d),w=kr(w,d,l,null),w.flags|=2,u.return=r,w.return=r,u.sibling=w,r.child=u,Br(r,i.child,null,l),u=r.child,u.memoizedState=Xc(l),u.childLanes=$c(i,v,l),r.memoizedState=Kc,r=Cl(null,u));else if(Xn(r),Mh(w)){if(v=w.nextSibling&&w.nextSibling.dataset,v)var W=v.dgst;v=W,u=Error(s(419)),u.stack="",u.digest=v,fl({value:u,source:null,stack:null}),r=Zc(i,r,l)}else if(gt||gs(i,r,l,!1),v=(l&i.childLanes)!==0,gt||v){if(v=Ze,v!==null&&(u=ep(v,l),u!==0&&u!==R.retryLane))throw R.retryLane=u,Cr(i,u),mi(v,i,u),Yc;Rh(w)||xo(),r=Zc(i,r,l)}else Rh(w)?(r.flags|=192,r.child=i.child,r=null):(i=R.treeContext,et=Pi(w.nextSibling),Ut=r,je=!0,Fn=null,Hi=!1,i!==null&&Gp(r,i),r=Gc(r,u.children),r.flags|=4096);return r}return d?($n(),w=u.fallback,d=r.mode,R=i.child,W=R.sibling,u=_n(R,{mode:"hidden",children:u.children}),u.subtreeFlags=R.subtreeFlags&65011712,W!==null?w=_n(W,w):(w=kr(w,d,l,null),w.flags|=2),w.return=r,u.return=r,u.sibling=w,r.child=u,Cl(null,u),u=r.child,w=i.child.memoizedState,w===null?w=Xc(l):(d=w.cachePool,d!==null?(R=mt._currentValue,d=d.parent!==R?{parent:R,pool:R}:d):d=im(),w={baseLanes:w.baseLanes|l,cachePool:d}),u.memoizedState=w,u.childLanes=$c(i,v,l),r.memoizedState=Kc,Cl(i.child,u)):(Xn(r),l=i.child,i=l.sibling,l=_n(l,{mode:"visible",children:u.children}),l.return=r,l.sibling=null,i!==null&&(v=r.deletions,v===null?(r.deletions=[i],r.flags|=16):v.push(i)),r.child=l,r.memoizedState=null,l)}function Gc(i,r){return r=fo({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function fo(i,r){return i=xi(22,i,null,r),i.lanes=0,i}function Zc(i,r,l){return Br(r,i.child,null,l),i=Gc(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function m_(i,r,l){i.lanes|=r;var u=i.alternate;u!==null&&(u.lanes|=r),fc(i.return,r,l)}function Qc(i,r,l,u,d,m){var v=i.memoizedState;v===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:d,treeForkCount:m}:(v.isBackwards=r,v.rendering=null,v.renderingStartTime=0,v.last=u,v.tail=l,v.tailMode=d,v.treeForkCount=m)}function __(i,r,l){var u=r.pendingProps,d=u.revealOrder,m=u.tail;u=u.children;var v=ft.current,w=(v&2)!==0;if(w?(v=v&1|2,r.flags|=128):v&=1,C(ft,v),It(i,r,u,l),u=je?hl:0,!w&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&m_(i,l,r);else if(i.tag===19)m_(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(d){case"forwards":for(l=r.child,d=null;l!==null;)i=l.alternate,i!==null&&eo(i)===null&&(d=l),l=l.sibling;l=d,l===null?(d=r.child,r.child=null):(d=l.sibling,l.sibling=null),Qc(r,!1,d,l,m,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,d=r.child,r.child=null;d!==null;){if(i=d.alternate,i!==null&&eo(i)===null){r.child=d;break}i=d.sibling,d.sibling=l,l=d,d=i}Qc(r,!0,l,null,m,u);break;case"together":Qc(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function xn(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Qn|=r.lanes,(l&r.childLanes)===0)if(i!==null){if(gs(i,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(s(153));if(r.child!==null){for(i=r.child,l=_n(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=_n(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function Jc(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Va(i)))}function p1(i,r,l){switch(r.tag){case 3:Te(r,r.stateNode.containerInfo),Wn(r,mt,i.memoizedState.cache),Er();break;case 27:case 5:jt(r);break;case 4:Te(r,r.stateNode.containerInfo);break;case 10:Wn(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Cc(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Xn(r),r.flags|=128,null):(l&r.child.childLanes)!==0?p_(i,r,l):(Xn(r),i=xn(i,r,l),i!==null?i.sibling:null);Xn(r);break;case 19:var d=(i.flags&128)!==0;if(u=(l&r.childLanes)!==0,u||(gs(i,r,l,!1),u=(l&r.childLanes)!==0),d){if(u)return __(i,r,l);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),C(ft,ft.current),u)break;return null;case 22:return r.lanes=0,o_(i,r,l,r.pendingProps);case 24:Wn(r,mt,i.memoizedState.cache)}return xn(i,r,l)}function g_(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps)gt=!0;else{if(!Jc(i,l)&&(r.flags&128)===0)return gt=!1,p1(i,r,l);gt=(i.flags&131072)!==0}else gt=!1,je&&(r.flags&1048576)!==0&&$p(r,hl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(i=Rr(r.elementType),r.type=i,typeof i=="function")rc(i)?(u=Lr(i,u),r.tag=1,r=f_(null,r,i,u,l)):(r.tag=0,r=Vc(null,r,i,u,l));else{if(i!=null){var d=i.$$typeof;if(d===Q){r.tag=11,r=s_(null,r,i,u,l);break e}else if(d===ee){r.tag=14,r=l_(null,r,i,u,l);break e}}throw r=P(i)||i,Error(s(306,r,""))}}return r;case 0:return Vc(i,r,r.type,r.pendingProps,l);case 1:return u=r.type,d=Lr(u,r.pendingProps),f_(i,r,u,d,l);case 3:e:{if(Te(r,r.stateNode.containerInfo),i===null)throw Error(s(387));u=r.pendingProps;var m=r.memoizedState;d=m.element,yc(i,r),yl(r,u,null,l);var v=r.memoizedState;if(u=v.cache,Wn(r,mt,u),u!==m.cache&&dc(r,[mt],l,!0),vl(),u=v.element,m.isDehydrated)if(m={element:u,isDehydrated:!1,cache:v.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=d_(i,r,u,l);break e}else if(u!==d){d=zi(Error(s(424)),r),fl(d),r=d_(i,r,u,l);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(et=Pi(i.firstChild),Ut=r,je=!0,Fn=null,Hi=!0,l=om(r,null,u,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Er(),u===d){r=xn(i,r,l);break e}It(i,r,u,l)}r=r.child}return r;case 26:return ho(i,r),i===null?(l=Ag(r.type,null,r.pendingProps,null))?r.memoizedState=l:je||(l=r.type,i=r.pendingProps,u=Do(he.current).createElement(l),u[Ht]=r,u[ui]=i,Ft(u,l,i),Tt(u),r.stateNode=u):r.memoizedState=Ag(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return jt(r),i===null&&je&&(u=r.stateNode=kg(r.type,r.pendingProps,he.current),Ut=r,Hi=!0,d=et,nr(r.type)?(Bh=d,et=Pi(u.firstChild)):et=d),It(i,r,r.pendingProps.children,l),ho(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&je&&((d=u=et)&&(u=W1(u,r.type,r.pendingProps,Hi),u!==null?(r.stateNode=u,Ut=r,et=Pi(u.firstChild),Hi=!1,d=!0):d=!1),d||qn(r)),jt(r),d=r.type,m=r.pendingProps,v=i!==null?i.memoizedProps:null,u=m.children,Th(d,m)?u=null:v!==null&&Th(d,v)&&(r.flags|=32),r.memoizedState!==null&&(d=Ec(i,r,s1,null,null,l),Ul._currentValue=d),ho(i,r),It(i,r,u,l),r.child;case 6:return i===null&&je&&((i=l=et)&&(l=Y1(l,r.pendingProps,Hi),l!==null?(r.stateNode=l,Ut=r,et=null,i=!0):i=!1),i||qn(r)),null;case 13:return p_(i,r,l);case 4:return Te(r,r.stateNode.containerInfo),u=r.pendingProps,i===null?r.child=Br(r,null,u,l):It(i,r,u,l),r.child;case 11:return s_(i,r,r.type,r.pendingProps,l);case 7:return It(i,r,r.pendingProps,l),r.child;case 8:return It(i,r,r.pendingProps.children,l),r.child;case 12:return It(i,r,r.pendingProps.children,l),r.child;case 10:return u=r.pendingProps,Wn(r,r.type,u.value),It(i,r,u.children,l),r.child;case 9:return d=r.type._context,u=r.pendingProps.children,Ar(r),d=Pt(d),u=u(d),r.flags|=1,It(i,r,u,l),r.child;case 14:return l_(i,r,r.type,r.pendingProps,l);case 15:return a_(i,r,r.type,r.pendingProps,l);case 19:return __(i,r,l);case 31:return d1(i,r,l);case 22:return o_(i,r,l,r.pendingProps);case 24:return Ar(r),u=Pt(mt),i===null?(d=_c(),d===null&&(d=Ze,m=pc(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=l),d=m),r.memoizedState={parent:u,cache:d},vc(r),Wn(r,mt,d)):((i.lanes&l)!==0&&(yc(i,r),yl(r,null,null,l),vl()),d=i.memoizedState,m=r.memoizedState,d.parent!==u?(d={parent:u,cache:u},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),Wn(r,mt,u)):(u=m.cache,Wn(r,mt,u),u!==d.cache&&dc(r,[mt],l,!0))),It(i,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function wn(i){i.flags|=4}function eh(i,r,l,u,d){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(d&335544128)===d)if(i.stateNode.complete)i.flags|=8192;else if(W_())i.flags|=8192;else throw Mr=Ga,gc}else i.flags&=-16777217}function v_(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Ng(r))if(W_())i.flags|=8192;else throw Mr=Ga,gc}function po(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Zd():536870912,i.lanes|=r,Ds|=r)}function kl(i,r){if(!je)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function tt(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,u=0;if(r)for(var d=i.child;d!==null;)l|=d.lanes|d.childLanes,u|=d.subtreeFlags&65011712,u|=d.flags&65011712,d.return=i,d=d.sibling;else for(d=i.child;d!==null;)l|=d.lanes|d.childLanes,u|=d.subtreeFlags,u|=d.flags,d.return=i,d=d.sibling;return i.subtreeFlags|=u,i.childLanes=l,r}function m1(i,r,l){var u=r.pendingProps;switch(oc(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(r),null;case 1:return tt(r),null;case 3:return l=r.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),yn(mt),Re(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(i===null||i.child===null)&&(_s(r)?wn(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,cc())),tt(r),null;case 26:var d=r.type,m=r.memoizedState;return i===null?(wn(r),m!==null?(tt(r),v_(r,m)):(tt(r),eh(r,d,null,u,l))):m?m!==i.memoizedState?(wn(r),tt(r),v_(r,m)):(tt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==u&&wn(r),tt(r),eh(r,d,i,u,l)),null;case 27:if(Zt(r),l=he.current,d=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&wn(r);else{if(!u){if(r.stateNode===null)throw Error(s(166));return tt(r),null}i=se.current,_s(r)?Zp(r):(i=kg(d,u,l),r.stateNode=i,wn(r))}return tt(r),null;case 5:if(Zt(r),d=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&wn(r);else{if(!u){if(r.stateNode===null)throw Error(s(166));return tt(r),null}if(m=se.current,_s(r))Zp(r);else{var v=Do(he.current);switch(m){case 1:m=v.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=v.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=v.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof u.is=="string"?v.createElement("select",{is:u.is}):v.createElement("select"),u.multiple?m.multiple=!0:u.size&&(m.size=u.size);break;default:m=typeof u.is=="string"?v.createElement(d,{is:u.is}):v.createElement(d)}}m[Ht]=r,m[ui]=u;e:for(v=r.child;v!==null;){if(v.tag===5||v.tag===6)m.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===r)break e;for(;v.sibling===null;){if(v.return===null||v.return===r)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}r.stateNode=m;e:switch(Ft(m,d,u),d){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&wn(r)}}return tt(r),eh(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,l),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==u&&wn(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(s(166));if(i=he.current,_s(r)){if(i=r.stateNode,l=r.memoizedProps,u=null,d=Ut,d!==null)switch(d.tag){case 27:case 5:u=d.memoizedProps}i[Ht]=r,i=!!(i.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||pg(i.nodeValue,l)),i||qn(r,!0)}else i=Do(i).createTextNode(u),i[Ht]=r,r.stateNode=i}return tt(r),null;case 31:if(l=r.memoizedState,i===null||i.memoizedState!==null){if(u=_s(r),l!==null){if(i===null){if(!u)throw Error(s(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(557));i[Ht]=r}else Er(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),i=!1}else l=cc(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=l),i=!0;if(!i)return r.flags&256?(Ci(r),r):(Ci(r),null);if((r.flags&128)!==0)throw Error(s(558))}return tt(r),null;case 13:if(u=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(d=_s(r),u!==null&&u.dehydrated!==null){if(i===null){if(!d)throw Error(s(318));if(d=r.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[Ht]=r}else Er(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),d=!1}else d=cc(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(Ci(r),r):(Ci(r),null)}return Ci(r),(r.flags&128)!==0?(r.lanes=l,r):(l=u!==null,i=i!==null&&i.memoizedState!==null,l&&(u=r.child,d=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(d=u.alternate.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==d&&(u.flags|=2048)),l!==i&&l&&(r.child.flags|=8192),po(r,r.updateQueue),tt(r),null);case 4:return Re(),i===null&&xh(r.stateNode.containerInfo),tt(r),null;case 10:return yn(r.type),tt(r),null;case 19:if(X(ft),u=r.memoizedState,u===null)return tt(r),null;if(d=(r.flags&128)!==0,m=u.rendering,m===null)if(d)kl(u,!1);else{if(ot!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(m=eo(i),m!==null){for(r.flags|=128,kl(u,!1),i=m.updateQueue,r.updateQueue=i,po(r,i),r.subtreeFlags=0,i=l,l=r.child;l!==null;)Vp(l,i),l=l.sibling;return C(ft,ft.current&1|2),je&&gn(r,u.treeForkCount),r.child}i=i.sibling}u.tail!==null&&Qt()>yo&&(r.flags|=128,d=!0,kl(u,!1),r.lanes=4194304)}else{if(!d)if(i=eo(m),i!==null){if(r.flags|=128,d=!0,i=i.updateQueue,r.updateQueue=i,po(r,i),kl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!m.alternate&&!je)return tt(r),null}else 2*Qt()-u.renderingStartTime>yo&&l!==536870912&&(r.flags|=128,d=!0,kl(u,!1),r.lanes=4194304);u.isBackwards?(m.sibling=r.child,r.child=m):(i=u.last,i!==null?i.sibling=m:r.child=m,u.last=m)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=Qt(),i.sibling=null,l=ft.current,C(ft,d?l&1|2:l&1),je&&gn(r,u.treeForkCount),i):(tt(r),null);case 22:case 23:return Ci(r),wc(),u=r.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(l&536870912)!==0&&(r.flags&128)===0&&(tt(r),r.subtreeFlags&6&&(r.flags|=8192)):tt(r),l=r.updateQueue,l!==null&&po(r,l.retryQueue),l=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==l&&(r.flags|=2048),i!==null&&X(Dr),null;case 24:return l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),yn(mt),tt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function _1(i,r){switch(oc(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return yn(mt),Re(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return Zt(r),null;case 31:if(r.memoizedState!==null){if(Ci(r),r.alternate===null)throw Error(s(340));Er()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Ci(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Er()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return X(ft),null;case 4:return Re(),null;case 10:return yn(r.type),null;case 22:case 23:return Ci(r),wc(),i!==null&&X(Dr),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return yn(mt),null;case 25:return null;default:return null}}function y_(i,r){switch(oc(r),r.tag){case 3:yn(mt),Re();break;case 26:case 27:case 5:Zt(r);break;case 4:Re();break;case 31:r.memoizedState!==null&&Ci(r);break;case 13:Ci(r);break;case 19:X(ft);break;case 10:yn(r.type);break;case 22:case 23:Ci(r),wc(),i!==null&&X(Dr);break;case 24:yn(mt)}}function El(i,r){try{var l=r.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var d=u.next;l=d;do{if((l.tag&i)===i){u=void 0;var m=l.create,v=l.inst;u=m(),v.destroy=u}l=l.next}while(l!==d)}}catch(w){Ye(r,r.return,w)}}function Gn(i,r,l){try{var u=r.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var m=d.next;u=m;do{if((u.tag&i)===i){var v=u.inst,w=v.destroy;if(w!==void 0){v.destroy=void 0,d=r;var R=l,W=w;try{W()}catch(Z){Ye(d,R,Z)}}}u=u.next}while(u!==m)}}catch(Z){Ye(r,r.return,Z)}}function b_(i){var r=i.updateQueue;if(r!==null){var l=i.stateNode;try{cm(r,l)}catch(u){Ye(i,i.return,u)}}}function S_(i,r,l){l.props=Lr(i.type,i.memoizedProps),l.state=i.memoizedState;try{l.componentWillUnmount()}catch(u){Ye(i,r,u)}}function Tl(i,r){try{var l=i.ref;if(l!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof l=="function"?i.refCleanup=l(u):l.current=u}}catch(d){Ye(i,r,d)}}function tn(i,r){var l=i.ref,u=i.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(d){Ye(i,r,d)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(d){Ye(i,r,d)}else l.current=null}function x_(i){var r=i.type,l=i.memoizedProps,u=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(d){Ye(i,i.return,d)}}function th(i,r,l){try{var u=i.stateNode;H1(u,i.type,l,r),u[ui]=r}catch(d){Ye(i,i.return,d)}}function w_(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&nr(i.type)||i.tag===4}function ih(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||w_(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&nr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function nh(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(i,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(i),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=pn));else if(u!==4&&(u===27&&nr(i.type)&&(l=i.stateNode,r=null),i=i.child,i!==null))for(nh(i,r,l),i=i.sibling;i!==null;)nh(i,r,l),i=i.sibling}function mo(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(u!==4&&(u===27&&nr(i.type)&&(l=i.stateNode),i=i.child,i!==null))for(mo(i,r,l),i=i.sibling;i!==null;)mo(i,r,l),i=i.sibling}function C_(i){var r=i.stateNode,l=i.memoizedProps;try{for(var u=i.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);Ft(r,u,l),r[Ht]=i,r[ui]=l}catch(m){Ye(i,i.return,m)}}var Cn=!1,vt=!1,rh=!1,k_=typeof WeakSet=="function"?WeakSet:Set,At=null;function g1(i,r){if(i=i.containerInfo,kh=Oo,i=jp(i),Zu(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var d=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var v=0,w=-1,R=-1,W=0,Z=0,ie=i,V=null;t:for(;;){for(var $;ie!==l||d!==0&&ie.nodeType!==3||(w=v+d),ie!==m||u!==0&&ie.nodeType!==3||(R=v+u),ie.nodeType===3&&(v+=ie.nodeValue.length),($=ie.firstChild)!==null;)V=ie,ie=$;for(;;){if(ie===i)break t;if(V===l&&++W===d&&(w=v),V===m&&++Z===u&&(R=v),($=ie.nextSibling)!==null)break;ie=V,V=ie.parentNode}ie=$}l=w===-1||R===-1?null:{start:w,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(Eh={focusedElem:i,selectionRange:l},Oo=!1,At=r;At!==null;)if(r=At,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,At=i;else for(;At!==null;){switch(r=At,m=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(l=0;l<i.length;l++)d=i[l],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&m!==null){i=void 0,l=r,d=m.memoizedProps,m=m.memoizedState,u=l.stateNode;try{var me=Lr(l.type,d);i=u.getSnapshotBeforeUpdate(me,m),u.__reactInternalSnapshotBeforeUpdate=i}catch(ye){Ye(l,l.return,ye)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,l=i.nodeType,l===9)Dh(i);else if(l===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Dh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(s(163))}if(i=r.sibling,i!==null){i.return=r.return,At=i;break}At=r.return}}function E_(i,r,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:En(i,l),u&4&&El(5,l);break;case 1:if(En(i,l),u&4)if(i=l.stateNode,r===null)try{i.componentDidMount()}catch(v){Ye(l,l.return,v)}else{var d=Lr(l.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(d,r,i.__reactInternalSnapshotBeforeUpdate)}catch(v){Ye(l,l.return,v)}}u&64&&b_(l),u&512&&Tl(l,l.return);break;case 3:if(En(i,l),u&64&&(i=l.updateQueue,i!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{cm(i,r)}catch(v){Ye(l,l.return,v)}}break;case 27:r===null&&u&4&&C_(l);case 26:case 5:En(i,l),r===null&&u&4&&x_(l),u&512&&Tl(l,l.return);break;case 12:En(i,l);break;case 31:En(i,l),u&4&&D_(i,l);break;case 13:En(i,l),u&4&&R_(i,l),u&64&&(i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(l=E1.bind(null,l),V1(i,l))));break;case 22:if(u=l.memoizedState!==null||Cn,!u){r=r!==null&&r.memoizedState!==null||vt,d=Cn;var m=vt;Cn=u,(vt=r)&&!m?Tn(i,l,(l.subtreeFlags&8772)!==0):En(i,l),Cn=d,vt=m}break;case 30:break;default:En(i,l)}}function T_(i){var r=i.alternate;r!==null&&(i.alternate=null,T_(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Lu(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var nt=null,hi=!1;function kn(i,r,l){for(l=l.child;l!==null;)A_(i,r,l),l=l.sibling}function A_(i,r,l){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(Jt,l)}catch{}switch(l.tag){case 26:vt||tn(l,r),kn(i,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:vt||tn(l,r);var u=nt,d=hi;nr(l.type)&&(nt=l.stateNode,hi=!1),kn(i,r,l),Ol(l.stateNode),nt=u,hi=d;break;case 5:vt||tn(l,r);case 6:if(u=nt,d=hi,nt=null,kn(i,r,l),nt=u,hi=d,nt!==null)if(hi)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(l.stateNode)}catch(m){Ye(l,r,m)}else try{nt.removeChild(l.stateNode)}catch(m){Ye(l,r,m)}break;case 18:nt!==null&&(hi?(i=nt,bg(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,l.stateNode),js(i)):bg(nt,l.stateNode));break;case 4:u=nt,d=hi,nt=l.stateNode.containerInfo,hi=!0,kn(i,r,l),nt=u,hi=d;break;case 0:case 11:case 14:case 15:Gn(2,l,r),vt||Gn(4,l,r),kn(i,r,l);break;case 1:vt||(tn(l,r),u=l.stateNode,typeof u.componentWillUnmount=="function"&&S_(l,r,u)),kn(i,r,l);break;case 21:kn(i,r,l);break;case 22:vt=(u=vt)||l.memoizedState!==null,kn(i,r,l),vt=u;break;default:kn(i,r,l)}}function D_(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{js(i)}catch(l){Ye(r,r.return,l)}}}function R_(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{js(i)}catch(l){Ye(r,r.return,l)}}function v1(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new k_),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new k_),r;default:throw Error(s(435,i.tag))}}function _o(i,r){var l=v1(i);r.forEach(function(u){if(!l.has(u)){l.add(u);var d=T1.bind(null,i,u);u.then(d,d)}})}function fi(i,r){var l=r.deletions;if(l!==null)for(var u=0;u<l.length;u++){var d=l[u],m=i,v=r,w=v;e:for(;w!==null;){switch(w.tag){case 27:if(nr(w.type)){nt=w.stateNode,hi=!1;break e}break;case 5:nt=w.stateNode,hi=!1;break e;case 3:case 4:nt=w.stateNode.containerInfo,hi=!0;break e}w=w.return}if(nt===null)throw Error(s(160));A_(m,v,d),nt=null,hi=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)M_(r,i),r=r.sibling}var $i=null;function M_(i,r){var l=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:fi(r,i),di(i),u&4&&(Gn(3,i,i.return),El(3,i),Gn(5,i,i.return));break;case 1:fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),u&64&&Cn&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(l=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var d=$i;if(fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),u&4){var m=l!==null?l.memoizedState:null;if(u=i.memoizedState,l===null)if(u===null)if(i.stateNode===null){e:{u=i.type,l=i.memoizedProps,d=d.ownerDocument||d;t:switch(u){case"title":m=d.getElementsByTagName("title")[0],(!m||m[el]||m[Ht]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(u),d.head.insertBefore(m,d.querySelector("head > title"))),Ft(m,u,l),m[Ht]=i,Tt(m),u=m;break e;case"link":var v=Mg("link","href",d).get(u+(l.href||""));if(v){for(var w=0;w<v.length;w++)if(m=v[w],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(w,1);break t}}m=d.createElement(u),Ft(m,u,l),d.head.appendChild(m);break;case"meta":if(v=Mg("meta","content",d).get(u+(l.content||""))){for(w=0;w<v.length;w++)if(m=v[w],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(w,1);break t}}m=d.createElement(u),Ft(m,u,l),d.head.appendChild(m);break;default:throw Error(s(468,u))}m[Ht]=i,Tt(m),u=m}i.stateNode=u}else Bg(d,i.type,i.stateNode);else i.stateNode=Rg(d,u,i.memoizedProps);else m!==u?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,u===null?Bg(d,i.type,i.stateNode):Rg(d,u,i.memoizedProps)):u===null&&i.stateNode!==null&&th(i,i.memoizedProps,l.memoizedProps)}break;case 27:fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),l!==null&&u&4&&th(i,i.memoizedProps,l.memoizedProps);break;case 5:if(fi(r,i),di(i),u&512&&(vt||l===null||tn(l,l.return)),i.flags&32){d=i.stateNode;try{ls(d,"")}catch(me){Ye(i,i.return,me)}}u&4&&i.stateNode!=null&&(d=i.memoizedProps,th(i,d,l!==null?l.memoizedProps:d)),u&1024&&(rh=!0);break;case 6:if(fi(r,i),di(i),u&4){if(i.stateNode===null)throw Error(s(162));u=i.memoizedProps,l=i.stateNode;try{l.nodeValue=u}catch(me){Ye(i,i.return,me)}}break;case 3:if(Bo=null,d=$i,$i=Ro(r.containerInfo),fi(r,i),$i=d,di(i),u&4&&l!==null&&l.memoizedState.isDehydrated)try{js(r.containerInfo)}catch(me){Ye(i,i.return,me)}rh&&(rh=!1,B_(i));break;case 4:u=$i,$i=Ro(i.stateNode.containerInfo),fi(r,i),di(i),$i=u;break;case 12:fi(r,i),di(i);break;case 31:fi(r,i),di(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,_o(i,u)));break;case 13:fi(r,i),di(i),i.child.flags&8192&&i.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(vo=Qt()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,_o(i,u)));break;case 22:d=i.memoizedState!==null;var R=l!==null&&l.memoizedState!==null,W=Cn,Z=vt;if(Cn=W||d,vt=Z||R,fi(r,i),vt=Z,Cn=W,di(i),u&8192)e:for(r=i.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(l===null||R||Cn||vt||zr(i)),l=null,r=i;;){if(r.tag===5||r.tag===26){if(l===null){R=l=r;try{if(m=R.stateNode,d)v=m.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{w=R.stateNode;var ie=R.memoizedProps.style,V=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;w.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(me){Ye(R,R.return,me)}}}else if(r.tag===6){if(l===null){R=r;try{R.stateNode.nodeValue=d?"":R.memoizedProps}catch(me){Ye(R,R.return,me)}}}else if(r.tag===18){if(l===null){R=r;try{var $=R.stateNode;d?Sg($,!0):Sg(R.stateNode,!1)}catch(me){Ye(R,R.return,me)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=i.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,_o(i,l))));break;case 19:fi(r,i),di(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,_o(i,u)));break;case 30:break;case 21:break;default:fi(r,i),di(i)}}function di(i){var r=i.flags;if(r&2){try{for(var l,u=i.return;u!==null;){if(w_(u)){l=u;break}u=u.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var d=l.stateNode,m=ih(i);mo(i,m,d);break;case 5:var v=l.stateNode;l.flags&32&&(ls(v,""),l.flags&=-33);var w=ih(i);mo(i,w,v);break;case 3:case 4:var R=l.stateNode.containerInfo,W=ih(i);nh(i,W,R);break;default:throw Error(s(161))}}catch(Z){Ye(i,i.return,Z)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function B_(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;B_(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function En(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)E_(i,r.alternate,r),r=r.sibling}function zr(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Gn(4,r,r.return),zr(r);break;case 1:tn(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&S_(r,r.return,l),zr(r);break;case 27:Ol(r.stateNode);case 26:case 5:tn(r,r.return),zr(r);break;case 22:r.memoizedState===null&&zr(r);break;case 30:zr(r);break;default:zr(r)}i=i.sibling}}function Tn(i,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,d=i,m=r,v=m.flags;switch(m.tag){case 0:case 11:case 15:Tn(d,m,l),El(4,m);break;case 1:if(Tn(d,m,l),u=m,d=u.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(W){Ye(u,u.return,W)}if(u=m,d=u.updateQueue,d!==null){var w=u.stateNode;try{var R=d.shared.hiddenCallbacks;if(R!==null)for(d.shared.hiddenCallbacks=null,d=0;d<R.length;d++)um(R[d],w)}catch(W){Ye(u,u.return,W)}}l&&v&64&&b_(m),Tl(m,m.return);break;case 27:C_(m);case 26:case 5:Tn(d,m,l),l&&u===null&&v&4&&x_(m),Tl(m,m.return);break;case 12:Tn(d,m,l);break;case 31:Tn(d,m,l),l&&v&4&&D_(d,m);break;case 13:Tn(d,m,l),l&&v&4&&R_(d,m);break;case 22:m.memoizedState===null&&Tn(d,m,l),Tl(m,m.return);break;case 30:break;default:Tn(d,m,l)}r=r.sibling}}function sh(i,r){var l=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==l&&(i!=null&&i.refCount++,l!=null&&dl(l))}function lh(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&dl(i))}function Gi(i,r,l,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)N_(i,r,l,u),r=r.sibling}function N_(i,r,l,u){var d=r.flags;switch(r.tag){case 0:case 11:case 15:Gi(i,r,l,u),d&2048&&El(9,r);break;case 1:Gi(i,r,l,u);break;case 3:Gi(i,r,l,u),d&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&dl(i)));break;case 12:if(d&2048){Gi(i,r,l,u),i=r.stateNode;try{var m=r.memoizedProps,v=m.id,w=m.onPostCommit;typeof w=="function"&&w(v,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(R){Ye(r,r.return,R)}}else Gi(i,r,l,u);break;case 31:Gi(i,r,l,u);break;case 13:Gi(i,r,l,u);break;case 23:break;case 22:m=r.stateNode,v=r.alternate,r.memoizedState!==null?m._visibility&2?Gi(i,r,l,u):Al(i,r):m._visibility&2?Gi(i,r,l,u):(m._visibility|=2,Es(i,r,l,u,(r.subtreeFlags&10256)!==0||!1)),d&2048&&sh(v,r);break;case 24:Gi(i,r,l,u),d&2048&&lh(r.alternate,r);break;default:Gi(i,r,l,u)}}function Es(i,r,l,u,d){for(d=d&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=i,v=r,w=l,R=u,W=v.flags;switch(v.tag){case 0:case 11:case 15:Es(m,v,w,R,d),El(8,v);break;case 23:break;case 22:var Z=v.stateNode;v.memoizedState!==null?Z._visibility&2?Es(m,v,w,R,d):Al(m,v):(Z._visibility|=2,Es(m,v,w,R,d)),d&&W&2048&&sh(v.alternate,v);break;case 24:Es(m,v,w,R,d),d&&W&2048&&lh(v.alternate,v);break;default:Es(m,v,w,R,d)}r=r.sibling}}function Al(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=i,u=r,d=u.flags;switch(u.tag){case 22:Al(l,u),d&2048&&sh(u.alternate,u);break;case 24:Al(l,u),d&2048&&lh(u.alternate,u);break;default:Al(l,u)}r=r.sibling}}var Dl=8192;function Ts(i,r,l){if(i.subtreeFlags&Dl)for(i=i.child;i!==null;)L_(i,r,l),i=i.sibling}function L_(i,r,l){switch(i.tag){case 26:Ts(i,r,l),i.flags&Dl&&i.memoizedState!==null&&rx(l,$i,i.memoizedState,i.memoizedProps);break;case 5:Ts(i,r,l);break;case 3:case 4:var u=$i;$i=Ro(i.stateNode.containerInfo),Ts(i,r,l),$i=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=Dl,Dl=16777216,Ts(i,r,l),Dl=u):Ts(i,r,l));break;default:Ts(i,r,l)}}function z_(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function Rl(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];At=u,j_(u,i)}z_(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)O_(i),i=i.sibling}function O_(i){switch(i.tag){case 0:case 11:case 15:Rl(i),i.flags&2048&&Gn(9,i,i.return);break;case 3:Rl(i);break;case 12:Rl(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,go(i)):Rl(i);break;default:Rl(i)}}function go(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];At=u,j_(u,i)}z_(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Gn(8,r,r.return),go(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,go(r));break;default:go(r)}i=i.sibling}}function j_(i,r){for(;At!==null;){var l=At;switch(l.tag){case 0:case 11:case 15:Gn(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:dl(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,At=u;else e:for(l=i;At!==null;){u=At;var d=u.sibling,m=u.return;if(T_(u),u===l){At=null;break e}if(d!==null){d.return=m,At=d;break e}At=m}}}var y1={getCacheForType:function(i){var r=Pt(mt),l=r.data.get(i);return l===void 0&&(l=i(),r.data.set(i,l)),l},cacheSignal:function(){return Pt(mt).controller.signal}},b1=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Ze=null,Be=null,ze=0,We=0,ki=null,Zn=!1,As=!1,ah=!1,An=0,ot=0,Qn=0,Or=0,oh=0,Ei=0,Ds=0,Ml=null,pi=null,uh=!1,vo=0,H_=0,yo=1/0,bo=null,Jn=null,wt=0,er=null,Rs=null,Dn=0,ch=0,hh=null,U_=null,Bl=0,fh=null;function Ti(){return(Fe&2)!==0&&ze!==0?ze&-ze:A.T!==null?vh():tp()}function P_(){if(Ei===0)if((ze&536870912)===0||je){var i=Ta;Ta<<=1,(Ta&3932160)===0&&(Ta=262144),Ei=i}else Ei=536870912;return i=wi.current,i!==null&&(i.flags|=32),Ei}function mi(i,r,l){(i===Ze&&(We===2||We===9)||i.cancelPendingCommit!==null)&&(Ms(i,0),tr(i,ze,Ei,!1)),Js(i,l),((Fe&2)===0||i!==Ze)&&(i===Ze&&((Fe&2)===0&&(Or|=l),ot===4&&tr(i,ze,Ei,!1)),nn(i))}function I_(i,r,l){if((Fe&6)!==0)throw Error(s(327));var u=!l&&(r&127)===0&&(r&i.expiredLanes)===0||Qs(i,r),d=u?w1(i,r):ph(i,r,!0),m=u;do{if(d===0){As&&!u&&tr(i,r,0,!1);break}else{if(l=i.current.alternate,m&&!S1(l)){d=ph(i,r,!1),m=!1;continue}if(d===2){if(m=r,i.errorRecoveryDisabledLanes&m)var v=0;else v=i.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){r=v;e:{var w=i;d=Ml;var R=w.current.memoizedState.isDehydrated;if(R&&(Ms(w,v).flags|=256),v=ph(w,v,!1),v!==2){if(ah&&!R){w.errorRecoveryDisabledLanes|=m,Or|=m,d=4;break e}m=pi,pi=d,m!==null&&(pi===null?pi=m:pi.push.apply(pi,m))}d=v}if(m=!1,d!==2)continue}}if(d===1){Ms(i,0),tr(i,r,0,!0);break}e:{switch(u=i,m=d,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:tr(u,r,Ei,!Zn);break e;case 2:pi=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(d=vo+300-Qt(),10<d)){if(tr(u,r,Ei,!Zn),Da(u,0,!0)!==0)break e;Dn=r,u.timeoutHandle=vg(F_.bind(null,u,l,pi,bo,uh,r,Ei,Or,Ds,Zn,m,"Throttled",-0,0),d);break e}F_(u,l,pi,bo,uh,r,Ei,Or,Ds,Zn,m,null,-0,0)}}break}while(!0);nn(i)}function F_(i,r,l,u,d,m,v,w,R,W,Z,ie,V,$){if(i.timeoutHandle=-1,ie=r.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pn},L_(r,m,ie);var me=(m&62914560)===m?vo-Qt():(m&4194048)===m?H_-Qt():0;if(me=sx(ie,me),me!==null){Dn=m,i.cancelPendingCommit=me(G_.bind(null,i,r,m,l,u,d,v,w,R,Z,ie,null,V,$)),tr(i,m,v,!W);return}}G_(i,r,m,l,u,d,v,w,R)}function S1(i){for(var r=i;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var d=l[u],m=d.getSnapshot;d=d.value;try{if(!Si(m(),d))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function tr(i,r,l,u){r&=~oh,r&=~Or,i.suspendedLanes|=r,i.pingedLanes&=~r,u&&(i.warmLanes|=r),u=i.expirationTimes;for(var d=r;0<d;){var m=31-Ge(d),v=1<<m;u[m]=-1,d&=~v}l!==0&&Qd(i,l,r)}function So(){return(Fe&6)===0?(Nl(0),!1):!0}function dh(){if(Be!==null){if(We===0)var i=Be.return;else i=Be,vn=Tr=null,Dc(i),Ss=null,ml=0,i=Be;for(;i!==null;)y_(i.alternate,i),i=i.return;Be=null}}function Ms(i,r){var l=i.timeoutHandle;l!==-1&&(i.timeoutHandle=-1,I1(l)),l=i.cancelPendingCommit,l!==null&&(i.cancelPendingCommit=null,l()),Dn=0,dh(),Ze=i,Be=l=_n(i.current,null),ze=r,We=0,ki=null,Zn=!1,As=Qs(i,r),ah=!1,Ds=Ei=oh=Or=Qn=ot=0,pi=Ml=null,uh=!1,(r&8)!==0&&(r|=r&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=r;0<u;){var d=31-Ge(u),m=1<<d;r|=i[d],u&=~m}return An=r,Ia(),l}function q_(i,r){Ce=null,A.H=wl,r===bs||r===$a?(r=sm(),We=3):r===gc?(r=sm(),We=4):We=r===Yc?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ki=r,Be===null&&(ot=1,uo(i,zi(r,i.current)))}function W_(){var i=wi.current;return i===null?!0:(ze&4194048)===ze?Ui===null:(ze&62914560)===ze||(ze&536870912)!==0?i===Ui:!1}function Y_(){var i=A.H;return A.H=wl,i===null?wl:i}function V_(){var i=A.A;return A.A=y1,i}function xo(){ot=4,Zn||(ze&4194048)!==ze&&wi.current!==null||(As=!0),(Qn&134217727)===0&&(Or&134217727)===0||Ze===null||tr(Ze,ze,Ei,!1)}function ph(i,r,l){var u=Fe;Fe|=2;var d=Y_(),m=V_();(Ze!==i||ze!==r)&&(bo=null,Ms(i,r)),r=!1;var v=ot;e:do try{if(We!==0&&Be!==null){var w=Be,R=ki;switch(We){case 8:dh(),v=6;break e;case 3:case 2:case 9:case 6:wi.current===null&&(r=!0);var W=We;if(We=0,ki=null,Bs(i,w,R,W),l&&As){v=0;break e}break;default:W=We,We=0,ki=null,Bs(i,w,R,W)}}x1(),v=ot;break}catch(Z){q_(i,Z)}while(!0);return r&&i.shellSuspendCounter++,vn=Tr=null,Fe=u,A.H=d,A.A=m,Be===null&&(Ze=null,ze=0,Ia()),v}function x1(){for(;Be!==null;)K_(Be)}function w1(i,r){var l=Fe;Fe|=2;var u=Y_(),d=V_();Ze!==i||ze!==r?(bo=null,yo=Qt()+500,Ms(i,r)):As=Qs(i,r);e:do try{if(We!==0&&Be!==null){r=Be;var m=ki;t:switch(We){case 1:We=0,ki=null,Bs(i,r,m,1);break;case 2:case 9:if(nm(m)){We=0,ki=null,X_(r);break}r=function(){We!==2&&We!==9||Ze!==i||(We=7),nn(i)},m.then(r,r);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:nm(m)?(We=0,ki=null,X_(r)):(We=0,ki=null,Bs(i,r,m,7));break;case 5:var v=null;switch(Be.tag){case 26:v=Be.memoizedState;case 5:case 27:var w=Be;if(v?Ng(v):w.stateNode.complete){We=0,ki=null;var R=w.sibling;if(R!==null)Be=R;else{var W=w.return;W!==null?(Be=W,wo(W)):Be=null}break t}}We=0,ki=null,Bs(i,r,m,5);break;case 6:We=0,ki=null,Bs(i,r,m,6);break;case 8:dh(),ot=6;break e;default:throw Error(s(462))}}C1();break}catch(Z){q_(i,Z)}while(!0);return vn=Tr=null,A.H=u,A.A=d,Fe=l,Be!==null?0:(Ze=null,ze=0,Ia(),ot)}function C1(){for(;Be!==null&&!Tu();)K_(Be)}function K_(i){var r=g_(i.alternate,i,An);i.memoizedProps=i.pendingProps,r===null?wo(i):Be=r}function X_(i){var r=i,l=r.alternate;switch(r.tag){case 15:case 0:r=h_(l,r,r.pendingProps,r.type,void 0,ze);break;case 11:r=h_(l,r,r.pendingProps,r.type.render,r.ref,ze);break;case 5:Dc(r);default:y_(l,r),r=Be=Vp(r,An),r=g_(l,r,An)}i.memoizedProps=i.pendingProps,r===null?wo(i):Be=r}function Bs(i,r,l,u){vn=Tr=null,Dc(r),Ss=null,ml=0;var d=r.return;try{if(f1(i,d,r,l,ze)){ot=1,uo(i,zi(l,i.current)),Be=null;return}}catch(m){if(d!==null)throw Be=d,m;ot=1,uo(i,zi(l,i.current)),Be=null;return}r.flags&32768?(je||u===1?i=!0:As||(ze&536870912)!==0?i=!1:(Zn=i=!0,(u===2||u===9||u===3||u===6)&&(u=wi.current,u!==null&&u.tag===13&&(u.flags|=16384))),$_(r,i)):wo(r)}function wo(i){var r=i;do{if((r.flags&32768)!==0){$_(r,Zn);return}i=r.return;var l=m1(r.alternate,r,An);if(l!==null){Be=l;return}if(r=r.sibling,r!==null){Be=r;return}Be=r=i}while(r!==null);ot===0&&(ot=5)}function $_(i,r){do{var l=_1(i.alternate,i);if(l!==null){l.flags&=32767,Be=l;return}if(l=i.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(i=i.sibling,i!==null)){Be=i;return}Be=i=l}while(i!==null);ot=6,Be=null}function G_(i,r,l,u,d,m,v,w,R){i.cancelPendingCommit=null;do Co();while(wt!==0);if((Fe&6)!==0)throw Error(s(327));if(r!==null){if(r===i.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=ic,n0(i,l,m,v,w,R),i===Ze&&(Be=Ze=null,ze=0),Rs=r,er=i,Dn=l,ch=m,hh=d,U_=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,A1(Se,function(){return tg(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=A.T,A.T=null,d=I.p,I.p=2,v=Fe,Fe|=4;try{g1(i,r,l)}finally{Fe=v,I.p=d,A.T=u}}wt=1,Z_(),Q_(),J_()}}function Z_(){if(wt===1){wt=0;var i=er,r=Rs,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=A.T,A.T=null;var u=I.p;I.p=2;var d=Fe;Fe|=4;try{M_(r,i);var m=Eh,v=jp(i.containerInfo),w=m.focusedElem,R=m.selectionRange;if(v!==w&&w&&w.ownerDocument&&Op(w.ownerDocument.documentElement,w)){if(R!==null&&Zu(w)){var W=R.start,Z=R.end;if(Z===void 0&&(Z=W),"selectionStart"in w)w.selectionStart=W,w.selectionEnd=Math.min(Z,w.value.length);else{var ie=w.ownerDocument||document,V=ie&&ie.defaultView||window;if(V.getSelection){var $=V.getSelection(),me=w.textContent.length,ye=Math.min(R.start,me),Xe=R.end===void 0?ye:Math.min(R.end,me);!$.extend&&ye>Xe&&(v=Xe,Xe=ye,ye=v);var H=zp(w,ye),z=zp(w,Xe);if(H&&z&&($.rangeCount!==1||$.anchorNode!==H.node||$.anchorOffset!==H.offset||$.focusNode!==z.node||$.focusOffset!==z.offset)){var q=ie.createRange();q.setStart(H.node,H.offset),$.removeAllRanges(),ye>Xe?($.addRange(q),$.extend(z.node,z.offset)):(q.setEnd(z.node,z.offset),$.addRange(q))}}}}for(ie=[],$=w;$=$.parentNode;)$.nodeType===1&&ie.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ie.length;w++){var te=ie[w];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Oo=!!kh,Eh=kh=null}finally{Fe=d,I.p=u,A.T=l}}i.current=r,wt=2}}function Q_(){if(wt===2){wt=0;var i=er,r=Rs,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=A.T,A.T=null;var u=I.p;I.p=2;var d=Fe;Fe|=4;try{E_(i,r.alternate,r)}finally{Fe=d,I.p=u,A.T=l}}wt=3}}function J_(){if(wt===4||wt===3){wt=0,Au();var i=er,r=Rs,l=Dn,u=U_;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?wt=5:(wt=0,Rs=er=null,eg(i,i.pendingLanes));var d=i.pendingLanes;if(d===0&&(Jn=null),Bu(l),r=r.stateNode,xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(Jt,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=A.T,d=I.p,I.p=2,A.T=null;try{for(var m=i.onRecoverableError,v=0;v<u.length;v++){var w=u[v];m(w.value,{componentStack:w.stack})}}finally{A.T=r,I.p=d}}(Dn&3)!==0&&Co(),nn(i),d=i.pendingLanes,(l&261930)!==0&&(d&42)!==0?i===fh?Bl++:(Bl=0,fh=i):Bl=0,Nl(0)}}function eg(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,dl(r)))}function Co(){return Z_(),Q_(),J_(),tg()}function tg(){if(wt!==5)return!1;var i=er,r=ch;ch=0;var l=Bu(Dn),u=A.T,d=I.p;try{I.p=32>l?32:l,A.T=null,l=hh,hh=null;var m=er,v=Dn;if(wt=0,Rs=er=null,Dn=0,(Fe&6)!==0)throw Error(s(331));var w=Fe;if(Fe|=4,O_(m.current),N_(m,m.current,v,l),Fe=w,Nl(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(Jt,m)}catch{}return!0}finally{I.p=d,A.T=u,eg(i,r)}}function ig(i,r,l){r=zi(l,r),r=Wc(i.stateNode,r,2),i=Kn(i,r,2),i!==null&&(Js(i,2),nn(i))}function Ye(i,r,l){if(i.tag===3)ig(i,i,l);else for(;r!==null;){if(r.tag===3){ig(r,i,l);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jn===null||!Jn.has(u))){i=zi(l,i),l=n_(2),u=Kn(r,l,2),u!==null&&(r_(l,u,r,i),Js(u,2),nn(u));break}}r=r.return}}function mh(i,r,l){var u=i.pingCache;if(u===null){u=i.pingCache=new b1;var d=new Set;u.set(r,d)}else d=u.get(r),d===void 0&&(d=new Set,u.set(r,d));d.has(l)||(ah=!0,d.add(l),i=k1.bind(null,i,r,l),r.then(i,i))}function k1(i,r,l){var u=i.pingCache;u!==null&&u.delete(r),i.pingedLanes|=i.suspendedLanes&l,i.warmLanes&=~l,Ze===i&&(ze&l)===l&&(ot===4||ot===3&&(ze&62914560)===ze&&300>Qt()-vo?(Fe&2)===0&&Ms(i,0):oh|=l,Ds===ze&&(Ds=0)),nn(i)}function ng(i,r){r===0&&(r=Zd()),i=Cr(i,r),i!==null&&(Js(i,r),nn(i))}function E1(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function T1(i,r){var l=0;switch(i.tag){case 31:case 13:var u=i.stateNode,d=i.memoizedState;d!==null&&(l=d.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(r),ng(i,l)}function A1(i,r){return Jr(i,r)}var ko=null,Ns=null,_h=!1,Eo=!1,gh=!1,ir=0;function nn(i){i!==Ns&&i.next===null&&(Ns===null?ko=Ns=i:Ns=Ns.next=i),Eo=!0,_h||(_h=!0,R1())}function Nl(i,r){if(!gh&&Eo){gh=!0;do for(var l=!1,u=ko;u!==null;){if(i!==0){var d=u.pendingLanes;if(d===0)var m=0;else{var v=u.suspendedLanes,w=u.pingedLanes;m=(1<<31-Ge(42|i)+1)-1,m&=d&~(v&~w),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,ag(u,m))}else m=ze,m=Da(u,u===Ze?m:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(m&3)===0||Qs(u,m)||(l=!0,ag(u,m));u=u.next}while(l);gh=!1}}function D1(){rg()}function rg(){Eo=_h=!1;var i=0;ir!==0&&P1()&&(i=ir);for(var r=Qt(),l=null,u=ko;u!==null;){var d=u.next,m=sg(u,r);m===0?(u.next=null,l===null?ko=d:l.next=d,d===null&&(Ns=l)):(l=u,(i!==0||(m&3)!==0)&&(Eo=!0)),u=d}wt!==0&&wt!==5||Nl(i),ir!==0&&(ir=0)}function sg(i,r){for(var l=i.suspendedLanes,u=i.pingedLanes,d=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var v=31-Ge(m),w=1<<v,R=d[v];R===-1?((w&l)===0||(w&u)!==0)&&(d[v]=i0(w,r)):R<=r&&(i.expiredLanes|=w),m&=~w}if(r=Ze,l=ze,l=Da(i,i===r?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,l===0||i===r&&(We===2||We===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&Zs(u),i.callbackNode=null,i.callbackPriority=0;if((l&3)===0||Qs(i,l)){if(r=l&-l,r===i.callbackPriority)return r;switch(u!==null&&Zs(u),Bu(l)){case 2:case 8:l=ce;break;case 32:l=Se;break;case 268435456:l=qe;break;default:l=Se}return u=lg.bind(null,i),l=Jr(l,u),i.callbackPriority=r,i.callbackNode=l,r}return u!==null&&u!==null&&Zs(u),i.callbackPriority=2,i.callbackNode=null,2}function lg(i,r){if(wt!==0&&wt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var l=i.callbackNode;if(Co()&&i.callbackNode!==l)return null;var u=ze;return u=Da(i,i===Ze?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(I_(i,u,r),sg(i,Qt()),i.callbackNode!=null&&i.callbackNode===l?lg.bind(null,i):null)}function ag(i,r){if(Co())return null;I_(i,r,!0)}function R1(){F1(function(){(Fe&6)!==0?Jr(J,D1):rg()})}function vh(){if(ir===0){var i=vs;i===0&&(i=Ea,Ea<<=1,(Ea&261888)===0&&(Ea=256)),ir=i}return ir}function og(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Na(""+i)}function ug(i,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,i.id&&l.setAttribute("form",i.id),r.parentNode.insertBefore(l,r),i=new FormData(i),l.parentNode.removeChild(l),i}function M1(i,r,l,u,d){if(r==="submit"&&l&&l.stateNode===d){var m=og((d[ui]||null).action),v=u.submitter;v&&(r=(r=v[ui]||null)?og(r.formAction):v.getAttribute("formAction"),r!==null&&(m=r,v=null));var w=new ja("action","action",null,u,d);i.push({event:w,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ir!==0){var R=v?ug(d,v):new FormData(d);Hc(l,{pending:!0,data:R,method:d.method,action:m},null,R)}}else typeof m=="function"&&(w.preventDefault(),R=v?ug(d,v):new FormData(d),Hc(l,{pending:!0,data:R,method:d.method,action:m},m,R))},currentTarget:d}]})}}for(var yh=0;yh<tc.length;yh++){var bh=tc[yh],B1=bh.toLowerCase(),N1=bh[0].toUpperCase()+bh.slice(1);Xi(B1,"on"+N1)}Xi(Pp,"onAnimationEnd"),Xi(Ip,"onAnimationIteration"),Xi(Fp,"onAnimationStart"),Xi("dblclick","onDoubleClick"),Xi("focusin","onFocus"),Xi("focusout","onBlur"),Xi($0,"onTransitionRun"),Xi(G0,"onTransitionStart"),Xi(Z0,"onTransitionCancel"),Xi(qp,"onTransitionEnd"),rs("onMouseEnter",["mouseout","mouseover"]),rs("onMouseLeave",["mouseout","mouseover"]),rs("onPointerEnter",["pointerout","pointerover"]),rs("onPointerLeave",["pointerout","pointerover"]),br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),br("onBeforeInput",["compositionend","keypress","textInput","paste"]),br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ll="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(" "),L1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ll));function cg(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var u=i[l],d=u.event;u=u.listeners;e:{var m=void 0;if(r)for(var v=u.length-1;0<=v;v--){var w=u[v],R=w.instance,W=w.currentTarget;if(w=w.listener,R!==m&&d.isPropagationStopped())break e;m=w,d.currentTarget=W;try{m(d)}catch(Z){Pa(Z)}d.currentTarget=null,m=R}else for(v=0;v<u.length;v++){if(w=u[v],R=w.instance,W=w.currentTarget,w=w.listener,R!==m&&d.isPropagationStopped())break e;m=w,d.currentTarget=W;try{m(d)}catch(Z){Pa(Z)}d.currentTarget=null,m=R}}}}function Ne(i,r){var l=r[Nu];l===void 0&&(l=r[Nu]=new Set);var u=i+"__bubble";l.has(u)||(hg(r,i,2,!1),l.add(u))}function Sh(i,r,l){var u=0;r&&(u|=4),hg(l,i,u,r)}var To="_reactListening"+Math.random().toString(36).slice(2);function xh(i){if(!i[To]){i[To]=!0,rp.forEach(function(l){l!=="selectionchange"&&(L1.has(l)||Sh(l,!1,i),Sh(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[To]||(r[To]=!0,Sh("selectionchange",!1,r))}}function hg(i,r,l,u){switch(Pg(r)){case 2:var d=ox;break;case 8:d=ux;break;default:d=jh}l=d.bind(null,r,l,i),d=void 0,!Fu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),u?d!==void 0?i.addEventListener(r,l,{capture:!0,passive:d}):i.addEventListener(r,l,!0):d!==void 0?i.addEventListener(r,l,{passive:d}):i.addEventListener(r,l,!1)}function wh(i,r,l,u,d){var m=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var v=u.tag;if(v===3||v===4){var w=u.stateNode.containerInfo;if(w===d)break;if(v===4)for(v=u.return;v!==null;){var R=v.tag;if((R===3||R===4)&&v.stateNode.containerInfo===d)return;v=v.return}for(;w!==null;){if(v=ts(w),v===null)return;if(R=v.tag,R===5||R===6||R===26||R===27){u=m=v;continue e}w=w.parentNode}}u=u.return}_p(function(){var W=m,Z=Pu(l),ie=[];e:{var V=Wp.get(i);if(V!==void 0){var $=ja,me=i;switch(i){case"keypress":if(za(l)===0)break e;case"keydown":case"keyup":$=T0;break;case"focusin":me="focus",$=Vu;break;case"focusout":me="blur",$=Vu;break;case"beforeblur":case"afterblur":$=Vu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=yp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=m0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=R0;break;case Pp:case Ip:case Fp:$=v0;break;case qp:$=B0;break;case"scroll":case"scrollend":$=d0;break;case"wheel":$=L0;break;case"copy":case"cut":case"paste":$=b0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=Sp;break;case"toggle":case"beforetoggle":$=O0}var ye=(r&4)!==0,Xe=!ye&&(i==="scroll"||i==="scrollend"),H=ye?V!==null?V+"Capture":null:V;ye=[];for(var z=W,q;z!==null;){var te=z;if(q=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||q===null||H===null||(te=il(z,H),te!=null&&ye.push(zl(z,te,q))),Xe)break;z=z.return}0<ye.length&&(V=new $(V,me,null,l,Z),ie.push({event:V,listeners:ye}))}}if((r&7)===0){e:{if(V=i==="mouseover"||i==="pointerover",$=i==="mouseout"||i==="pointerout",V&&l!==Uu&&(me=l.relatedTarget||l.fromElement)&&(ts(me)||me[es]))break e;if(($||V)&&(V=Z.window===Z?Z:(V=Z.ownerDocument)?V.defaultView||V.parentWindow:window,$?(me=l.relatedTarget||l.toElement,$=W,me=me?ts(me):null,me!==null&&(Xe=o(me),ye=me.tag,me!==Xe||ye!==5&&ye!==27&&ye!==6)&&(me=null)):($=null,me=W),$!==me)){if(ye=yp,te="onMouseLeave",H="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(ye=Sp,te="onPointerLeave",H="onPointerEnter",z="pointer"),Xe=$==null?V:tl($),q=me==null?V:tl(me),V=new ye(te,z+"leave",$,l,Z),V.target=Xe,V.relatedTarget=q,te=null,ts(Z)===W&&(ye=new ye(H,z+"enter",me,l,Z),ye.target=q,ye.relatedTarget=Xe,te=ye),Xe=te,$&&me)t:{for(ye=z1,H=$,z=me,q=0,te=H;te;te=ye(te))q++;te=0;for(var ge=z;ge;ge=ye(ge))te++;for(;0<q-te;)H=ye(H),q--;for(;0<te-q;)z=ye(z),te--;for(;q--;){if(H===z||z!==null&&H===z.alternate){ye=H;break t}H=ye(H),z=ye(z)}ye=null}else ye=null;$!==null&&fg(ie,V,$,ye,!1),me!==null&&Xe!==null&&fg(ie,Xe,me,ye,!0)}}e:{if(V=W?tl(W):window,$=V.nodeName&&V.nodeName.toLowerCase(),$==="select"||$==="input"&&V.type==="file")var Pe=Dp;else if(Tp(V))if(Rp)Pe=V0;else{Pe=W0;var _e=q0}else $=V.nodeName,!$||$.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?W&&Hu(W.elementType)&&(Pe=Dp):Pe=Y0;if(Pe&&(Pe=Pe(i,W))){Ap(ie,Pe,l,Z);break e}_e&&_e(i,V,W),i==="focusout"&&W&&V.type==="number"&&W.memoizedProps.value!=null&&ju(V,"number",V.value)}switch(_e=W?tl(W):window,i){case"focusin":(Tp(_e)||_e.contentEditable==="true")&&(cs=_e,Qu=W,cl=null);break;case"focusout":cl=Qu=cs=null;break;case"mousedown":Ju=!0;break;case"contextmenu":case"mouseup":case"dragend":Ju=!1,Hp(ie,l,Z);break;case"selectionchange":if(X0)break;case"keydown":case"keyup":Hp(ie,l,Z)}var ke;if(Xu)e:{switch(i){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else us?kp(i,l)&&(Oe="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Oe="onCompositionStart");Oe&&(xp&&l.locale!=="ko"&&(us||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&us&&(ke=gp()):(Pn=Z,qu="value"in Pn?Pn.value:Pn.textContent,us=!0)),_e=Ao(W,Oe),0<_e.length&&(Oe=new bp(Oe,i,null,l,Z),ie.push({event:Oe,listeners:_e}),ke?Oe.data=ke:(ke=Ep(l),ke!==null&&(Oe.data=ke)))),(ke=H0?U0(i,l):P0(i,l))&&(Oe=Ao(W,"onBeforeInput"),0<Oe.length&&(_e=new bp("onBeforeInput","beforeinput",null,l,Z),ie.push({event:_e,listeners:Oe}),_e.data=ke)),M1(ie,i,W,l,Z)}cg(ie,r)})}function zl(i,r,l){return{instance:i,listener:r,currentTarget:l}}function Ao(i,r){for(var l=r+"Capture",u=[];i!==null;){var d=i,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=il(i,l),d!=null&&u.unshift(zl(i,d,m)),d=il(i,r),d!=null&&u.push(zl(i,d,m))),i.tag===3)return u;i=i.return}return[]}function z1(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function fg(i,r,l,u,d){for(var m=r._reactName,v=[];l!==null&&l!==u;){var w=l,R=w.alternate,W=w.stateNode;if(w=w.tag,R!==null&&R===u)break;w!==5&&w!==26&&w!==27||W===null||(R=W,d?(W=il(l,m),W!=null&&v.unshift(zl(l,W,R))):d||(W=il(l,m),W!=null&&v.push(zl(l,W,R)))),l=l.return}v.length!==0&&i.push({event:r,listeners:v})}var O1=/\r\n?/g,j1=/\u0000|\uFFFD/g;function dg(i){return(typeof i=="string"?i:""+i).replace(O1,`
49
+ `).replace(j1,"")}function pg(i,r){return r=dg(r),dg(i)===r}function Ke(i,r,l,u,d,m){switch(l){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||ls(i,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&ls(i,""+u);break;case"className":Ma(i,"class",u);break;case"tabIndex":Ma(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ma(i,l,u);break;case"style":pp(i,u,m);break;case"data":if(r!=="object"){Ma(i,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||l!=="href")){i.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=Na(""+u),i.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(l==="formAction"?(r!=="input"&&Ke(i,r,"name",d.name,d,null),Ke(i,r,"formEncType",d.formEncType,d,null),Ke(i,r,"formMethod",d.formMethod,d,null),Ke(i,r,"formTarget",d.formTarget,d,null)):(Ke(i,r,"encType",d.encType,d,null),Ke(i,r,"method",d.method,d,null),Ke(i,r,"target",d.target,d,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=Na(""+u),i.setAttribute(l,u);break;case"onClick":u!=null&&(i.onclick=pn);break;case"onScroll":u!=null&&Ne("scroll",i);break;case"onScrollEnd":u!=null&&Ne("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(l=u.__html,l!=null){if(d.children!=null)throw Error(s(60));i.innerHTML=l}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}l=Na(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""+u):i.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""):i.removeAttribute(l);break;case"capture":case"download":u===!0?i.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,u):i.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(l,u):i.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(l):i.setAttribute(l,u);break;case"popover":Ne("beforetoggle",i),Ne("toggle",i),Ra(i,"popover",u);break;case"xlinkActuate":dn(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":dn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":dn(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":dn(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":dn(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":dn(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":dn(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":dn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":dn(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Ra(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=h0.get(l)||l,Ra(i,l,u))}}function Ch(i,r,l,u,d,m){switch(l){case"style":pp(i,u,m);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(l=u.__html,l!=null){if(d.children!=null)throw Error(s(60));i.innerHTML=l}}break;case"children":typeof u=="string"?ls(i,u):(typeof u=="number"||typeof u=="bigint")&&ls(i,""+u);break;case"onScroll":u!=null&&Ne("scroll",i);break;case"onScrollEnd":u!=null&&Ne("scrollend",i);break;case"onClick":u!=null&&(i.onclick=pn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sp.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(d=l.endsWith("Capture"),r=l.slice(2,d?l.length-7:void 0),m=i[ui]||null,m=m!=null?m[l]:null,typeof m=="function"&&i.removeEventListener(r,m,d),typeof u=="function")){typeof m!="function"&&m!==null&&(l in i?i[l]=null:i.hasAttribute(l)&&i.removeAttribute(l)),i.addEventListener(r,u,d);break e}l in i?i[l]=u:u===!0?i.setAttribute(l,""):Ra(i,l,u)}}}function Ft(i,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",i),Ne("load",i);var u=!1,d=!1,m;for(m in l)if(l.hasOwnProperty(m)){var v=l[m];if(v!=null)switch(m){case"src":u=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ke(i,r,m,v,l,null)}}d&&Ke(i,r,"srcSet",l.srcSet,l,null),u&&Ke(i,r,"src",l.src,l,null);return;case"input":Ne("invalid",i);var w=m=v=d=null,R=null,W=null;for(u in l)if(l.hasOwnProperty(u)){var Z=l[u];if(Z!=null)switch(u){case"name":d=Z;break;case"type":v=Z;break;case"checked":R=Z;break;case"defaultChecked":W=Z;break;case"value":m=Z;break;case"defaultValue":w=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,r));break;default:Ke(i,r,u,Z,l,null)}}cp(i,m,w,R,W,v,d,!1);return;case"select":Ne("invalid",i),u=v=m=null;for(d in l)if(l.hasOwnProperty(d)&&(w=l[d],w!=null))switch(d){case"value":m=w;break;case"defaultValue":v=w;break;case"multiple":u=w;default:Ke(i,r,d,w,l,null)}r=m,l=v,i.multiple=!!u,r!=null?ss(i,!!u,r,!1):l!=null&&ss(i,!!u,l,!0);return;case"textarea":Ne("invalid",i),m=d=u=null;for(v in l)if(l.hasOwnProperty(v)&&(w=l[v],w!=null))switch(v){case"value":u=w;break;case"defaultValue":d=w;break;case"children":m=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:Ke(i,r,v,w,l,null)}fp(i,u,d,m);return;case"option":for(R in l)if(l.hasOwnProperty(R)&&(u=l[R],u!=null))switch(R){case"selected":i.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Ke(i,r,R,u,l,null)}return;case"dialog":Ne("beforetoggle",i),Ne("toggle",i),Ne("cancel",i),Ne("close",i);break;case"iframe":case"object":Ne("load",i);break;case"video":case"audio":for(u=0;u<Ll.length;u++)Ne(Ll[u],i);break;case"image":Ne("error",i),Ne("load",i);break;case"details":Ne("toggle",i);break;case"embed":case"source":case"link":Ne("error",i),Ne("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(u=l[W],u!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ke(i,r,W,u,l,null)}return;default:if(Hu(r)){for(Z in l)l.hasOwnProperty(Z)&&(u=l[Z],u!==void 0&&Ch(i,r,Z,u,l,void 0));return}}for(w in l)l.hasOwnProperty(w)&&(u=l[w],u!=null&&Ke(i,r,w,u,l,null))}function H1(i,r,l,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,v=null,w=null,R=null,W=null,Z=null;for($ in l){var ie=l[$];if(l.hasOwnProperty($)&&ie!=null)switch($){case"checked":break;case"value":break;case"defaultValue":R=ie;default:u.hasOwnProperty($)||Ke(i,r,$,null,u,ie)}}for(var V in u){var $=u[V];if(ie=l[V],u.hasOwnProperty(V)&&($!=null||ie!=null))switch(V){case"type":m=$;break;case"name":d=$;break;case"checked":W=$;break;case"defaultChecked":Z=$;break;case"value":v=$;break;case"defaultValue":w=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(s(137,r));break;default:$!==ie&&Ke(i,r,V,$,u,ie)}}Ou(i,v,w,R,W,Z,m,d);return;case"select":$=v=w=V=null;for(m in l)if(R=l[m],l.hasOwnProperty(m)&&R!=null)switch(m){case"value":break;case"multiple":$=R;default:u.hasOwnProperty(m)||Ke(i,r,m,null,u,R)}for(d in u)if(m=u[d],R=l[d],u.hasOwnProperty(d)&&(m!=null||R!=null))switch(d){case"value":V=m;break;case"defaultValue":w=m;break;case"multiple":v=m;default:m!==R&&Ke(i,r,d,m,u,R)}r=w,l=v,u=$,V!=null?ss(i,!!l,V,!1):!!u!=!!l&&(r!=null?ss(i,!!l,r,!0):ss(i,!!l,l?[]:"",!1));return;case"textarea":$=V=null;for(w in l)if(d=l[w],l.hasOwnProperty(w)&&d!=null&&!u.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ke(i,r,w,null,u,d)}for(v in u)if(d=u[v],m=l[v],u.hasOwnProperty(v)&&(d!=null||m!=null))switch(v){case"value":V=d;break;case"defaultValue":$=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==m&&Ke(i,r,v,d,u,m)}hp(i,V,$);return;case"option":for(var me in l)if(V=l[me],l.hasOwnProperty(me)&&V!=null&&!u.hasOwnProperty(me))switch(me){case"selected":i.selected=!1;break;default:Ke(i,r,me,null,u,V)}for(R in u)if(V=u[R],$=l[R],u.hasOwnProperty(R)&&V!==$&&(V!=null||$!=null))switch(R){case"selected":i.selected=V&&typeof V!="function"&&typeof V!="symbol";break;default:Ke(i,r,R,V,u,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in l)V=l[ye],l.hasOwnProperty(ye)&&V!=null&&!u.hasOwnProperty(ye)&&Ke(i,r,ye,null,u,V);for(W in u)if(V=u[W],$=l[W],u.hasOwnProperty(W)&&V!==$&&(V!=null||$!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(s(137,r));break;default:Ke(i,r,W,V,u,$)}return;default:if(Hu(r)){for(var Xe in l)V=l[Xe],l.hasOwnProperty(Xe)&&V!==void 0&&!u.hasOwnProperty(Xe)&&Ch(i,r,Xe,void 0,u,V);for(Z in u)V=u[Z],$=l[Z],!u.hasOwnProperty(Z)||V===$||V===void 0&&$===void 0||Ch(i,r,Z,V,u,$);return}}for(var H in l)V=l[H],l.hasOwnProperty(H)&&V!=null&&!u.hasOwnProperty(H)&&Ke(i,r,H,null,u,V);for(ie in u)V=u[ie],$=l[ie],!u.hasOwnProperty(ie)||V===$||V==null&&$==null||Ke(i,r,ie,V,u,$)}function mg(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function U1(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var d=l[u],m=d.transferSize,v=d.initiatorType,w=d.duration;if(m&&w&&mg(v)){for(v=0,w=d.responseEnd,u+=1;u<l.length;u++){var R=l[u],W=R.startTime;if(W>w)break;var Z=R.transferSize,ie=R.initiatorType;Z&&mg(ie)&&(R=R.responseEnd,v+=Z*(R<w?1:(w-W)/(R-W)))}if(--u,r+=8*(m+v)/(d.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var kh=null,Eh=null;function Do(i){return i.nodeType===9?i:i.ownerDocument}function _g(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gg(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function Th(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Ah=null;function P1(){var i=window.event;return i&&i.type==="popstate"?i===Ah?!1:(Ah=i,!0):(Ah=null,!1)}var vg=typeof setTimeout=="function"?setTimeout:void 0,I1=typeof clearTimeout=="function"?clearTimeout:void 0,yg=typeof Promise=="function"?Promise:void 0,F1=typeof queueMicrotask=="function"?queueMicrotask:typeof yg<"u"?function(i){return yg.resolve(null).then(i).catch(q1)}:vg;function q1(i){setTimeout(function(){throw i})}function nr(i){return i==="head"}function bg(i,r){var l=r,u=0;do{var d=l.nextSibling;if(i.removeChild(l),d&&d.nodeType===8)if(l=d.data,l==="/$"||l==="/&"){if(u===0){i.removeChild(d),js(r);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Ol(i.ownerDocument.documentElement);else if(l==="head"){l=i.ownerDocument.head,Ol(l);for(var m=l.firstChild;m;){var v=m.nextSibling,w=m.nodeName;m[el]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=v}}else l==="body"&&Ol(i.ownerDocument.body);l=d}while(l);js(r)}function Sg(i,r){var l=i;i=0;do{var u=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(i===0)break;i--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||i++;l=u}while(l)}function Dh(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Dh(l),Lu(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}i.removeChild(l)}}function W1(i,r,l,u){for(;i.nodeType===1;){var d=l;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[el])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(m=i.getAttribute("rel"),m==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(m!==d.rel||i.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||i.getAttribute("title")!==(d.title==null?null:d.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(m=i.getAttribute("src"),(m!==(d.src==null?null:d.src)||i.getAttribute("type")!==(d.type==null?null:d.type)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&i.getAttribute("name")===m)return i}else return i;if(i=Pi(i.nextSibling),i===null)break}return null}function Y1(i,r,l){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Pi(i.nextSibling),i===null))return null;return i}function xg(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Pi(i.nextSibling),i===null))return null;return i}function Rh(i){return i.data==="$?"||i.data==="$~"}function Mh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function V1(i,r){var l=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||l.readyState!=="loading")r();else{var u=function(){r(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function Pi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var Bh=null;function wg(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"||l==="/&"){if(r===0)return Pi(i.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}i=i.nextSibling}return null}function Cg(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return i;r--}else l!=="/$"&&l!=="/&"||r++}i=i.previousSibling}return null}function kg(i,r,l){switch(r=Do(l),i){case"html":if(i=r.documentElement,!i)throw Error(s(452));return i;case"head":if(i=r.head,!i)throw Error(s(453));return i;case"body":if(i=r.body,!i)throw Error(s(454));return i;default:throw Error(s(451))}}function Ol(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Lu(i)}var Ii=new Map,Eg=new Set;function Ro(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Rn=I.d;I.d={f:K1,r:X1,D:$1,C:G1,L:Z1,m:Q1,X:ex,S:J1,M:tx};function K1(){var i=Rn.f(),r=So();return i||r}function X1(i){var r=is(i);r!==null&&r.tag===5&&r.type==="form"?qm(r):Rn.r(i)}var Ls=typeof document>"u"?null:document;function Tg(i,r,l){var u=Ls;if(u&&typeof r=="string"&&r){var d=Ni(r);d='link[rel="'+i+'"][href="'+d+'"]',typeof l=="string"&&(d+='[crossorigin="'+l+'"]'),Eg.has(d)||(Eg.add(d),i={rel:i,crossOrigin:l,href:r},u.querySelector(d)===null&&(r=u.createElement("link"),Ft(r,"link",i),Tt(r),u.head.appendChild(r)))}}function $1(i){Rn.D(i),Tg("dns-prefetch",i,null)}function G1(i,r){Rn.C(i,r),Tg("preconnect",i,r)}function Z1(i,r,l){Rn.L(i,r,l);var u=Ls;if(u&&i&&r){var d='link[rel="preload"][as="'+Ni(r)+'"]';r==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+Ni(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+Ni(l.imageSizes)+'"]')):d+='[href="'+Ni(i)+'"]';var m=d;switch(r){case"style":m=zs(i);break;case"script":m=Os(i)}Ii.has(m)||(i=_({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:i,as:r},l),Ii.set(m,i),u.querySelector(d)!==null||r==="style"&&u.querySelector(jl(m))||r==="script"&&u.querySelector(Hl(m))||(r=u.createElement("link"),Ft(r,"link",i),Tt(r),u.head.appendChild(r)))}}function Q1(i,r){Rn.m(i,r);var l=Ls;if(l&&i){var u=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+Ni(u)+'"][href="'+Ni(i)+'"]',m=d;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Os(i)}if(!Ii.has(m)&&(i=_({rel:"modulepreload",href:i},r),Ii.set(m,i),l.querySelector(d)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Hl(m)))return}u=l.createElement("link"),Ft(u,"link",i),Tt(u),l.head.appendChild(u)}}}function J1(i,r,l){Rn.S(i,r,l);var u=Ls;if(u&&i){var d=ns(u).hoistableStyles,m=zs(i);r=r||"default";var v=d.get(m);if(!v){var w={loading:0,preload:null};if(v=u.querySelector(jl(m)))w.loading=5;else{i=_({rel:"stylesheet",href:i,"data-precedence":r},l),(l=Ii.get(m))&&Nh(i,l);var R=v=u.createElement("link");Tt(R),Ft(R,"link",i),R._p=new Promise(function(W,Z){R.onload=W,R.onerror=Z}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Mo(v,r,u)}v={type:"stylesheet",instance:v,count:1,state:w},d.set(m,v)}}}function ex(i,r){Rn.X(i,r);var l=Ls;if(l&&i){var u=ns(l).hoistableScripts,d=Os(i),m=u.get(d);m||(m=l.querySelector(Hl(d)),m||(i=_({src:i,async:!0},r),(r=Ii.get(d))&&Lh(i,r),m=l.createElement("script"),Tt(m),Ft(m,"link",i),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(d,m))}}function tx(i,r){Rn.M(i,r);var l=Ls;if(l&&i){var u=ns(l).hoistableScripts,d=Os(i),m=u.get(d);m||(m=l.querySelector(Hl(d)),m||(i=_({src:i,async:!0,type:"module"},r),(r=Ii.get(d))&&Lh(i,r),m=l.createElement("script"),Tt(m),Ft(m,"link",i),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(d,m))}}function Ag(i,r,l,u){var d=(d=he.current)?Ro(d):null;if(!d)throw Error(s(446));switch(i){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=zs(l.href),l=ns(d).hoistableStyles,u=l.get(r),u||(u={type:"style",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){i=zs(l.href);var m=ns(d).hoistableStyles,v=m.get(i);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(i,v),(m=d.querySelector(jl(i)))&&!m._p&&(v.instance=m,v.state.loading=5),Ii.has(i)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ii.set(i,l),m||ix(d,i,l,v.state))),r&&u===null)throw Error(s(528,""));return v}if(r&&u!==null)throw Error(s(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Os(l),l=ns(d).hoistableScripts,u=l.get(r),u||(u={type:"script",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,i))}}function zs(i){return'href="'+Ni(i)+'"'}function jl(i){return'link[rel="stylesheet"]['+i+"]"}function Dg(i){return _({},i,{"data-precedence":i.precedence,precedence:null})}function ix(i,r,l,u){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=i.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),Ft(r,"link",l),Tt(r),i.head.appendChild(r))}function Os(i){return'[src="'+Ni(i)+'"]'}function Hl(i){return"script[async]"+i}function Rg(i,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var u=i.querySelector('style[data-href~="'+Ni(l.href)+'"]');if(u)return r.instance=u,Tt(u),u;var d=_({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Tt(u),Ft(u,"style",d),Mo(u,l.precedence,i),r.instance=u;case"stylesheet":d=zs(l.href);var m=i.querySelector(jl(d));if(m)return r.state.loading|=4,r.instance=m,Tt(m),m;u=Dg(l),(d=Ii.get(d))&&Nh(u,d),m=(i.ownerDocument||i).createElement("link"),Tt(m);var v=m;return v._p=new Promise(function(w,R){v.onload=w,v.onerror=R}),Ft(m,"link",u),r.state.loading|=4,Mo(m,l.precedence,i),r.instance=m;case"script":return m=Os(l.src),(d=i.querySelector(Hl(m)))?(r.instance=d,Tt(d),d):(u=l,(d=Ii.get(m))&&(u=_({},l),Lh(u,d)),i=i.ownerDocument||i,d=i.createElement("script"),Tt(d),Ft(d,"link",u),i.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Mo(u,l.precedence,i));return r.instance}function Mo(i,r,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=u.length?u[u.length-1]:null,m=d,v=0;v<u.length;v++){var w=u[v];if(w.dataset.precedence===r)m=w;else if(m!==d)break}m?m.parentNode.insertBefore(i,m.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(i,r.firstChild))}function Nh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Lh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Bo=null;function Mg(i,r,l){if(Bo===null){var u=new Map,d=Bo=new Map;d.set(l,u)}else d=Bo,u=d.get(l),u||(u=new Map,d.set(l,u));if(u.has(i))return u;for(u.set(i,null),l=l.getElementsByTagName(i),d=0;d<l.length;d++){var m=l[d];if(!(m[el]||m[Ht]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var v=m.getAttribute(r)||"";v=i+v;var w=u.get(v);w?w.push(m):u.set(v,[m])}}return u}function Bg(i,r,l){i=i.ownerDocument||i,i.head.insertBefore(l,r==="title"?i.querySelector("head > title"):null)}function nx(i,r,l){if(l===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Ng(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function rx(i,r,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var d=zs(u.href),m=r.querySelector(jl(d));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=No.bind(i),r.then(i,i)),l.state.loading|=4,l.instance=m,Tt(m);return}m=r.ownerDocument||r,u=Dg(u),(d=Ii.get(d))&&Nh(u,d),m=m.createElement("link"),Tt(m);var v=m;v._p=new Promise(function(w,R){v.onload=w,v.onerror=R}),Ft(m,"link",u),l.instance=m}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(i.count++,l=No.bind(i),r.addEventListener("load",l),r.addEventListener("error",l))}}var zh=0;function sx(i,r){return i.stylesheets&&i.count===0&&zo(i,i.stylesheets),0<i.count||0<i.imgCount?function(l){var u=setTimeout(function(){if(i.stylesheets&&zo(i,i.stylesheets),i.unsuspend){var m=i.unsuspend;i.unsuspend=null,m()}},6e4+r);0<i.imgBytes&&zh===0&&(zh=62500*U1());var d=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&zo(i,i.stylesheets),i.unsuspend)){var m=i.unsuspend;i.unsuspend=null,m()}},(i.imgBytes>zh?50:800)+r);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(d)}}:null}function No(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zo(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Lo=null;function zo(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Lo=new Map,r.forEach(lx,i),Lo=null,No.call(i))}function lx(i,r){if(!(r.state.loading&4)){var l=Lo.get(i);if(l)var u=l.get(null);else{l=new Map,Lo.set(i,l);for(var d=i.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var v=d[m];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),u=v)}u&&l.set(null,u)}d=r.instance,v=d.getAttribute("data-precedence"),m=l.get(v)||u,m===u&&l.set(null,d),l.set(v,d),this.count++,u=No.bind(this),d.addEventListener("load",u),d.addEventListener("error",u),m?m.parentNode.insertBefore(d,m.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(d,i.firstChild)),r.state.loading|=4}}var Ul={$$typeof:U,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function ax(i,r,l,u,d,m,v,w,R){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ru(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ru(0),this.hiddenUpdates=Ru(null),this.identifierPrefix=u,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Lg(i,r,l,u,d,m,v,w,R,W,Z,ie){return i=new ax(i,r,l,v,R,W,Z,ie,w),r=1,m===!0&&(r|=24),m=xi(3,null,null,r),i.current=m,m.stateNode=i,r=pc(),r.refCount++,i.pooledCache=r,r.refCount++,m.memoizedState={element:u,isDehydrated:l,cache:r},vc(m),i}function zg(i){return i?(i=ds,i):ds}function Og(i,r,l,u,d,m){d=zg(d),u.context===null?u.context=d:u.pendingContext=d,u=Vn(r),u.payload={element:l},m=m===void 0?null:m,m!==null&&(u.callback=m),l=Kn(i,u,r),l!==null&&(mi(l,i,r),gl(l,i,r))}function jg(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function Oh(i,r){jg(i,r),(i=i.alternate)&&jg(i,r)}function Hg(i){if(i.tag===13||i.tag===31){var r=Cr(i,67108864);r!==null&&mi(r,i,67108864),Oh(i,67108864)}}function Ug(i){if(i.tag===13||i.tag===31){var r=Ti();r=Mu(r);var l=Cr(i,r);l!==null&&mi(l,i,r),Oh(i,r)}}var Oo=!0;function ox(i,r,l,u){var d=A.T;A.T=null;var m=I.p;try{I.p=2,jh(i,r,l,u)}finally{I.p=m,A.T=d}}function ux(i,r,l,u){var d=A.T;A.T=null;var m=I.p;try{I.p=8,jh(i,r,l,u)}finally{I.p=m,A.T=d}}function jh(i,r,l,u){if(Oo){var d=Hh(u);if(d===null)wh(i,r,u,jo,l),Ig(i,u);else if(hx(d,i,r,l,u))u.stopPropagation();else if(Ig(i,u),r&4&&-1<cx.indexOf(i)){for(;d!==null;){var m=is(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var v=yr(m.pendingLanes);if(v!==0){var w=m;for(w.pendingLanes|=2,w.entangledLanes|=2;v;){var R=1<<31-Ge(v);w.entanglements[1]|=R,v&=~R}nn(m),(Fe&6)===0&&(yo=Qt()+500,Nl(0))}}break;case 31:case 13:w=Cr(m,2),w!==null&&mi(w,m,2),So(),Oh(m,2)}if(m=Hh(u),m===null&&wh(i,r,u,jo,l),m===d)break;d=m}d!==null&&u.stopPropagation()}else wh(i,r,u,null,l)}}function Hh(i){return i=Pu(i),Uh(i)}var jo=null;function Uh(i){if(jo=null,i=ts(i),i!==null){var r=o(i);if(r===null)i=null;else{var l=r.tag;if(l===13){if(i=c(r),i!==null)return i;i=null}else if(l===31){if(i=f(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return jo=i,null}function Pg(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Du()){case J:return 2;case ce:return 8;case Se:case Me:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Ph=!1,rr=null,sr=null,lr=null,Pl=new Map,Il=new Map,ar=[],cx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ig(i,r){switch(i){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":sr=null;break;case"mouseover":case"mouseout":lr=null;break;case"pointerover":case"pointerout":Pl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(r.pointerId)}}function Fl(i,r,l,u,d,m){return i===null||i.nativeEvent!==m?(i={blockedOn:r,domEventName:l,eventSystemFlags:u,nativeEvent:m,targetContainers:[d]},r!==null&&(r=is(r),r!==null&&Hg(r)),i):(i.eventSystemFlags|=u,r=i.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),i)}function hx(i,r,l,u,d){switch(r){case"focusin":return rr=Fl(rr,i,r,l,u,d),!0;case"dragenter":return sr=Fl(sr,i,r,l,u,d),!0;case"mouseover":return lr=Fl(lr,i,r,l,u,d),!0;case"pointerover":var m=d.pointerId;return Pl.set(m,Fl(Pl.get(m)||null,i,r,l,u,d)),!0;case"gotpointercapture":return m=d.pointerId,Il.set(m,Fl(Il.get(m)||null,i,r,l,u,d)),!0}return!1}function Fg(i){var r=ts(i.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=c(l),r!==null){i.blockedOn=r,ip(i.priority,function(){Ug(l)});return}}else if(r===31){if(r=f(l),r!==null){i.blockedOn=r,ip(i.priority,function(){Ug(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ho(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=Hh(i.nativeEvent);if(l===null){l=i.nativeEvent;var u=new l.constructor(l.type,l);Uu=u,l.target.dispatchEvent(u),Uu=null}else return r=is(l),r!==null&&Hg(r),i.blockedOn=l,!1;r.shift()}return!0}function qg(i,r,l){Ho(i)&&l.delete(r)}function fx(){Ph=!1,rr!==null&&Ho(rr)&&(rr=null),sr!==null&&Ho(sr)&&(sr=null),lr!==null&&Ho(lr)&&(lr=null),Pl.forEach(qg),Il.forEach(qg)}function Uo(i,r){i.blockedOn===r&&(i.blockedOn=null,Ph||(Ph=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fx)))}var Po=null;function Wg(i){Po!==i&&(Po=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Po===i&&(Po=null);for(var r=0;r<i.length;r+=3){var l=i[r],u=i[r+1],d=i[r+2];if(typeof u!="function"){if(Uh(u||l)===null)continue;break}var m=is(l);m!==null&&(i.splice(r,3),r-=3,Hc(m,{pending:!0,data:d,method:l.method,action:u},u,d))}}))}function js(i){function r(R){return Uo(R,i)}rr!==null&&Uo(rr,i),sr!==null&&Uo(sr,i),lr!==null&&Uo(lr,i),Pl.forEach(r),Il.forEach(r);for(var l=0;l<ar.length;l++){var u=ar[l];u.blockedOn===i&&(u.blockedOn=null)}for(;0<ar.length&&(l=ar[0],l.blockedOn===null);)Fg(l),l.blockedOn===null&&ar.shift();if(l=(i.ownerDocument||i).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var d=l[u],m=l[u+1],v=d[ui]||null;if(typeof m=="function")v||Wg(l);else if(v){var w=null;if(m&&m.hasAttribute("formAction")){if(d=m,v=m[ui]||null)w=v.formAction;else if(Uh(d)!==null)continue}else w=v.action;typeof w=="function"?l[u+1]=w:(l.splice(u,3),u-=3),Wg(l)}}}function Yg(){function i(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(v){return d=v})},focusReset:"manual",scroll:"manual"})}function r(){d!==null&&(d(),d=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,d=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),d!==null&&(d(),d=null)}}}function Ih(i){this._internalRoot=i}Io.prototype.render=Ih.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(s(409));var l=r.current,u=Ti();Og(l,u,i,r,null,null)},Io.prototype.unmount=Ih.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Og(i.current,2,null,i,null,null),So(),r[es]=null}};function Io(i){this._internalRoot=i}Io.prototype.unstable_scheduleHydration=function(i){if(i){var r=tp();i={blockedOn:null,target:i,priority:r};for(var l=0;l<ar.length&&r!==0&&r<ar[l].priority;l++);ar.splice(l,0,i),l===0&&Fg(i)}};var Vg=t.version;if(Vg!=="19.2.3")throw Error(s(527,Vg,"19.2.3"));I.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=h(r),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var dx={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fo.isDisabled&&Fo.supportsFiber)try{Jt=Fo.inject(dx),xt=Fo}catch{}}return Wl.createRoot=function(i,r){if(!a(i))throw Error(s(299));var l=!1,u="",d=Jm,m=e_,v=t_;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(v=r.onRecoverableError)),r=Lg(i,1,!1,null,null,l,u,null,d,m,v,Yg),i[es]=r.current,xh(i),new Ih(r)},Wl.hydrateRoot=function(i,r,l){if(!a(i))throw Error(s(299));var u=!1,d="",m=Jm,v=e_,w=t_,R=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),r=Lg(i,1,!0,r,l??null,u,d,R,m,v,w,Yg),r.context=zg(null),l=r.current,u=Ti(),u=Mu(u),d=Vn(u),d.callback=null,Kn(l,d,u),l=u,r.current.lanes=l,Js(r,l),nn(r),i[es]=r.current,xh(i),new Io(r)},Wl.version="19.2.3",Wl}var iv;function Cx(){if(iv)return Wh.exports;iv=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(),Wh.exports=wx(),Wh.exports}var kx=Cx();const Ex=gu(kx);function Tx({onLogin:e}){const[t,n]=ne.useState(""),[s,a]=ne.useState(null),[o,c]=ne.useState(!1),f=async p=>{if(p.preventDefault(),!t.trim())return;c(!0),a(null);const h=await e(t);h&&a(h),c(!1)};return S.jsx("div",{className:"flex h-screen items-center justify-center p-4",children:S.jsxs("div",{className:"w-full max-w-sm",children:[S.jsxs("div",{className:"border-border rounded border p-6",children:[S.jsxs("div",{className:"mb-6 text-center",children:[S.jsx("h1",{className:"text-accent text-lg font-bold tracking-tight",children:"PlotLink OWS"}),S.jsx("p",{className:"text-muted mt-1 text-xs",children:"local writer agent"})]}),S.jsxs("form",{onSubmit:f,className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Passphrase"}),S.jsx("input",{type:"password",value:t,onChange:p=>n(p.target.value),placeholder:"enter your passphrase",autoFocus:!0,className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),s&&S.jsx("p",{className:"text-error text-xs",children:s}),S.jsx("button",{type:"submit",disabled:o||!t.trim(),className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:o?"authenticating...":"unlock"})]})]}),S.jsx("p",{className:"text-muted mt-4 text-center text-[10px]",children:"enter your passphrase to unlock"})]})})}function Ax({onSetup:e}){const[t,n]=ne.useState(""),[s,a]=ne.useState(""),[o,c]=ne.useState(null),[f,p]=ne.useState(!1),h=async g=>{if(g.preventDefault(),!t.trim()||t.length<4){c("Passphrase must be at least 4 characters");return}if(t!==s){c("Passphrases do not match");return}p(!0),c(null);const _=await e(t);_&&c(_),p(!1)};return S.jsx("div",{className:"flex h-screen items-center justify-center p-4",children:S.jsx("div",{className:"w-full max-w-sm",children:S.jsxs("div",{className:"border-border rounded border p-6",children:[S.jsxs("div",{className:"mb-6 text-center",children:[S.jsx("h1",{className:"text-accent text-lg font-bold tracking-tight",children:"PlotLink OWS"}),S.jsx("p",{className:"text-muted mt-1 text-xs",children:"first-time setup"})]}),S.jsx("p",{className:"text-muted mb-4 text-xs leading-relaxed",children:"Choose a passphrase to protect your local writer agent. This will be used to unlock the app and secure your OWS wallet."}),S.jsxs("form",{onSubmit:h,className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Passphrase"}),S.jsx("input",{type:"password",value:t,onChange:g=>n(g.target.value),placeholder:"choose a passphrase",autoFocus:!0,className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Confirm"}),S.jsx("input",{type:"password",value:s,onChange:g=>a(g.target.value),placeholder:"repeat passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),o&&S.jsx("p",{className:"text-error text-xs",children:o}),S.jsx("button",{type:"submit",disabled:f||!t.trim()||!s.trim(),className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:f?"setting up...":"create passphrase"})]})]})})})}const nv="http://localhost:7777";function Zy({token:e}){const[t,n]=ne.useState(null),[s,a]=ne.useState(!1),[o,c]=ne.useState(!1),[f,p]=ne.useState(null),h=(x,E)=>fetch(x,{...E,headers:{...E==null?void 0:E.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),g=()=>{h(`${nv}/api/wallet`).then(x=>x.json()).then(x=>n(x)).catch(()=>n({exists:!1,error:"Failed to load wallet"}))};ne.useEffect(()=>{g()},[]);const _=async()=>{a(!0),p(null);try{const x=await h(`${nv}/api/wallet/create`,{method:"POST"}),E=await x.json();if(!x.ok)throw new Error(E.error||"Creation failed");g()}catch(x){p(x instanceof Error?x.message:"Failed to create wallet")}a(!1)},b=()=>{t!=null&&t.address&&(navigator.clipboard.writeText(t.address),c(!0),setTimeout(()=>c(!1),2e3))},y=x=>`${x.slice(0,6)}...${x.slice(-4)}`;return S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"OWS Wallet"}),!t&&S.jsx("p",{className:"text-muted text-xs",children:"loading..."}),t&&!t.exists&&S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{className:"text-muted text-xs",children:"No wallet created yet. Create one to enable autonomous transactions."}),f&&S.jsx("p",{className:"text-error text-xs",children:f}),S.jsx("button",{onClick:_,disabled:s,className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 rounded border px-4 py-2 text-xs font-medium transition-colors",children:s?"creating...":"create wallet"})]}),t&&t.exists&&t.address&&S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-muted text-[10px] uppercase tracking-wider",children:"Address (Base)"}),S.jsx("span",{className:`rounded border px-1.5 py-0.5 text-[9px] ${t.ethBalance&&parseFloat(t.ethBalance)>0?"border-accent/30 text-accent":"border-accent-dim/30 text-accent-dim"}`,children:t.ethBalance&&parseFloat(t.ethBalance)>0?"active":"no balance"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("code",{className:"text-foreground bg-surface rounded px-2 py-1 text-xs font-mono",children:y(t.address)}),S.jsx("button",{onClick:b,className:"text-muted hover:text-accent text-xs transition-colors",children:o?"copied":"copy"})]}),S.jsxs("div",{className:"border-border space-y-1 border-t pt-3",children:[S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"ETH"}),S.jsxs("span",{className:"text-foreground font-medium",children:[t.ethBalance||"0.000000"," ETH"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"USDC"}),S.jsxs("span",{className:"text-foreground font-medium",children:["$",t.usdcBalance||"0.00"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"PLOT"}),S.jsxs("span",{className:"text-foreground font-medium",children:[t.plotBalance||"0.0000"," PLOT"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Network"}),S.jsx("span",{className:"text-foreground",children:"Base"})]})]}),S.jsxs("div",{className:"border-border border-t pt-3",children:[S.jsx("p",{className:"text-muted mb-2 text-[10px] font-medium uppercase tracking-wider",children:"Fund Wallet"}),S.jsx("p",{className:"text-muted text-[10px]",children:"Send ETH on Base for gas (~$0.01 per publish):"}),S.jsx("code",{className:"text-foreground bg-surface mt-1 block break-all rounded px-2 py-1.5 text-[10px] font-mono",children:t.address})]})]})]})}function Dx({token:e,onLogout:t}){const[n,s]=ne.useState(""),[a,o]=ne.useState(""),[c,f]=ne.useState(null),[p,h]=ne.useState(!1),[g,_]=ne.useState(!1),[b,y]=ne.useState(null),[x,E]=ne.useState("AI Writer"),[N,M]=ne.useState(""),[G,U]=ne.useState(""),[Q,K]=ne.useState(!1),[O,ee]=ne.useState(null),[oe,de]=ne.useState(""),[F,B]=ne.useState(null),[D,j]=ne.useState(!1),[P,L]=ne.useState(null),[A,I]=ne.useState(null),Y=ne.useCallback((C,se)=>fetch(C,{...se,headers:{...se==null?void 0:se.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),[e]);ne.useEffect(()=>{Y("/api/settings/link-status").then(C=>C.json()).then(C=>y(C)).catch(()=>y({linked:!1}))},[]);const le=async()=>{if(!x.trim()){ee("Agent name is required");return}if(!N.trim()){ee("Description is required");return}K(!0),ee(null);try{const C=await Y("/api/settings/register-agent",{method:"POST",body:JSON.stringify({name:x,description:N,...G.trim()&&{genre:G}})}),se=await C.json();if(!C.ok)throw new Error(se.error||"Registration failed");y({linked:!0,agentId:se.agentId,owsWallet:se.owsWallet,txHash:se.txHash})}catch(C){ee(C instanceof Error?C.message:"Registration failed")}K(!1)},k=async()=>{if(!oe.trim()||!/^0x[a-fA-F0-9]{40}$/.test(oe)){L("Enter a valid wallet address (0x...)");return}j(!0),L(null),B(null);try{const C=await Y("/api/settings/generate-binding",{method:"POST",body:JSON.stringify({humanWallet:oe})}),se=await C.json();if(!C.ok)throw new Error(se.error||"Failed to generate binding code");B(se)}catch(C){L(C instanceof Error?C.message:"Failed to generate binding code")}j(!1)},T=async(C,se)=>{await navigator.clipboard.writeText(C),I(se),setTimeout(()=>I(null),2e3)},X=async()=>{if(f(null),h(!1),!n||n.length<4){f("Passphrase must be at least 4 characters");return}if(n!==a){f("Passphrases do not match");return}_(!0);try{const C=await Y("/api/auth/reset-passphrase",{method:"POST",body:JSON.stringify({passphrase:n})});if(!C.ok){const se=await C.json();throw new Error(se.error||"Reset failed")}h(!0),s(""),o(""),setTimeout(()=>h(!1),3e3)}catch(C){f(C instanceof Error?C.message:"Reset failed")}_(!1)};return S.jsxs("div",{className:"mx-auto max-w-lg space-y-6 p-6",children:[S.jsx("h2",{className:"text-accent text-lg font-bold",children:"Settings"}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Agent Identity"}),b!=null&&b.linked?S.jsxs("div",{className:"space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-sm font-medium text-accent",children:"Registered"}),S.jsxs("span",{className:"text-muted text-xs",children:["Agent #",b.agentId]})]}),b.owsWallet&&S.jsxs("p",{className:"text-muted text-xs font-mono",children:["Wallet: ",b.owsWallet.slice(0,6),"...",b.owsWallet.slice(-4)]}),b.owner&&S.jsxs("p",{className:"text-muted text-xs font-mono",children:["Owner: ",b.owner.slice(0,6),"...",b.owner.slice(-4)]}),b.txHash&&S.jsx("p",{className:"text-muted text-xs",children:S.jsx("a",{href:`https://basescan.org/tx/${b.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View transaction on BaseScan"})}),S.jsx("p",{className:"text-muted text-xs",children:S.jsx("a",{href:`https://plotlink.xyz/profile/${b.owsWallet}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View agent profile on plotlink.xyz"})})]}):S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{className:"text-muted text-xs",children:"Register this AI writer on-chain via ERC-8004. Uses your OWS wallet's existing ETH balance for gas."}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Name"}),S.jsx("input",{value:x,onChange:C=>E(C.target.value),placeholder:"AI Writer",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Description"}),S.jsx("input",{value:N,onChange:C=>M(C.target.value),placeholder:"An AI writing assistant for fiction stories",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Genre (optional)"}),S.jsx("input",{value:G,onChange:C=>U(C.target.value),placeholder:"e.g. Fiction, Sci-Fi, Fantasy",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),O&&S.jsx("p",{className:"text-error text-xs",children:O}),S.jsx("button",{onClick:le,disabled:Q||!x.trim()||!N.trim(),className:"bg-accent text-white hover:bg-accent-dim disabled:opacity-50 w-full rounded px-4 py-2 text-sm font-medium transition-colors",children:Q?"Registering...":"Register Agent Identity"})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Link to PlotLink"}),b!=null&&b.owner?S.jsxs("p",{className:"text-muted text-xs",children:["Linked to owner ",S.jsxs("span",{className:"font-mono",children:[b.owner.slice(0,6),"...",b.owner.slice(-4)]})]}):S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{className:"text-muted text-xs",children:"Link this OWS wallet to your PlotLink account so your stories appear under your profile on plotlink.xyz."}),S.jsxs("div",{className:"text-muted text-xs space-y-1 pl-3",children:[S.jsx("p",{children:"1. Enter your PlotLink wallet address below"}),S.jsx("p",{children:'2. Click "Generate Binding Code"'}),S.jsx("p",{children:"3. Copy the code and paste it on plotlink.xyz → Agents → Link AI Writer"})]}),S.jsx("input",{value:oe,onChange:C=>de(C.target.value),placeholder:"Your PlotLink wallet address (0x...)",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent font-mono"}),P&&S.jsx("p",{className:"text-error text-xs",children:P}),S.jsx("button",{onClick:k,disabled:D||!oe.trim(),className:"bg-accent text-white hover:bg-accent-dim disabled:opacity-50 w-full rounded px-4 py-2 text-sm font-medium transition-colors",children:D?"Generating...":"Generate Binding Code"}),F&&S.jsxs("div",{className:"space-y-3 mt-3",children:[S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Binding Code (signature)"}),S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"bg-surface border-border rounded border p-2 text-xs font-mono break-all text-foreground pr-16",children:F.signature}),S.jsx("button",{onClick:()=>T(F.signature,"signature"),className:"absolute top-1 right-1 text-xs px-2 py-1 rounded border border-border text-muted hover:text-accent hover:border-accent transition-colors",children:A==="signature"?"Copied!":"Copy"})]})]}),S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"OWS Wallet Address"}),S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"bg-surface border-border rounded border p-2 text-xs font-mono break-all text-foreground pr-16",children:F.owsWallet}),S.jsx("button",{onClick:()=>T(F.owsWallet,"wallet"),className:"absolute top-1 right-1 text-xs px-2 py-1 rounded border border-border text-muted hover:text-accent hover:border-accent transition-colors",children:A==="wallet"?"Copied!":"Copy"})]})]}),F.agentId&&S.jsxs("div",{children:[S.jsx("label",{className:"text-muted text-xs block mb-1",children:"Agent ID"}),S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"bg-surface border-border rounded border p-2 text-xs font-mono text-foreground pr-16",children:F.agentId}),S.jsx("button",{onClick:()=>T(String(F.agentId),"agentId"),className:"absolute top-1 right-1 text-xs px-2 py-1 rounded border border-border text-muted hover:text-accent hover:border-accent transition-colors",children:A==="agentId"?"Copied!":"Copy"})]})]}),S.jsx("p",{className:"text-xs text-accent",children:'Now go to plotlink.xyz/agents and paste the values in the "Link AI Writer" section.'})]})]})]}),S.jsx(Zy,{token:e}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Reset Passphrase"}),S.jsxs("div",{className:"space-y-3",children:[S.jsx("input",{type:"password",value:n,onChange:C=>s(C.target.value),placeholder:"new passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"}),S.jsx("input",{type:"password",value:a,onChange:C=>o(C.target.value),placeholder:"confirm passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"}),c&&S.jsx("p",{className:"text-error text-xs",children:c}),p&&S.jsx("p",{className:"text-xs text-accent",children:"passphrase updated"}),S.jsx("button",{onClick:X,disabled:g||!n.trim(),className:"border-border text-muted hover:border-accent hover:text-accent disabled:opacity-40 w-full rounded border px-4 py-2 text-xs font-medium transition-colors",children:g?"updating...":"update passphrase"})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Session"}),S.jsx("button",{onClick:t,className:"border-border text-muted hover:border-error hover:text-error rounded border px-4 py-2 text-xs font-medium transition-colors",children:"logout"})]})]})}const Rx="http://localhost:7777";function Mx({token:e}){const[t,n]=ne.useState(null),s=(f,p)=>fetch(f,{...p,headers:{...p==null?void 0:p.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),a=()=>{s(`${Rx}/api/dashboard`).then(f=>f.json()).then(n)};ne.useEffect(()=>{a()},[]);const o=f=>`${f.slice(0,6)}...${f.slice(-4)}`,c=f=>{if(!f)return"Unknown date";const p=new Date(f);return isNaN(p.getTime())?"Unknown date":p.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})};return t?S.jsxs("div",{className:"mx-auto max-w-2xl space-y-6 p-6",children:[S.jsx("h2",{className:"text-accent text-lg font-bold",children:"Writer Dashboard"}),S.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-accent text-lg font-bold",children:t.stories.totalPublished}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"published"})]}),S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.pendingFiles}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"pending"})]}),S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.totalStories}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"stories"})]}),S.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[S.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.totalFiles}),S.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"files"})]})]}),t.wallet&&S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Wallet"}),S.jsxs("div",{className:"space-y-1.5",children:[S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Address"}),S.jsx("code",{className:"text-foreground font-mono text-[10px]",children:o(t.wallet.address)})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"ETH Balance"}),S.jsxs("span",{className:"text-foreground",children:[t.wallet.ethFormatted," ETH"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"USDC Balance"}),S.jsxs("span",{className:"text-foreground",children:["$",t.wallet.usdcBalance]})]})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Profit & Loss"}),S.jsxs("div",{className:"space-y-1.5",children:[S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Total costs (gas)"}),S.jsxs("span",{className:"text-error",children:["-",t.pnl.totalCostsEth," ETH (~$",t.pnl.totalCostsUsd,")"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Royalties earned"}),S.jsxs("span",{className:"text-accent",children:["+",t.pnl.totalRoyaltiesPlot," PLOT"]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Unclaimed royalties"}),S.jsxs("span",{className:"text-foreground",children:[t.royalties.unclaimed," PLOT"]})]}),S.jsxs("div",{className:"border-border flex justify-between border-t pt-1.5 text-xs font-medium",children:[S.jsx("span",{className:"text-muted",children:"Net P&L (USD)"}),S.jsxs("span",{className:parseFloat(t.pnl.netPnlUsd)>=0?"text-accent":"text-error",children:[parseFloat(t.pnl.netPnlUsd)>=0?"+":"","$",t.pnl.netPnlUsd]})]}),S.jsxs("div",{className:"flex justify-between text-xs",children:[S.jsx("span",{className:"text-muted",children:"Stories published"}),S.jsx("span",{className:"text-foreground",children:t.costs.storiesPublished})]})]})]}),S.jsxs("div",{className:"border-border rounded border p-4",children:[S.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Published Stories"}),t.stories.published.length===0?S.jsx("p",{className:"text-muted text-xs",children:"no published stories yet"}):S.jsx("div",{className:"space-y-3",children:t.stories.published.map(f=>S.jsxs("div",{className:"bg-surface rounded border border-border p-4",children:[S.jsxs("div",{className:"flex items-start justify-between",children:[S.jsxs("div",{children:[f.genre&&S.jsx("span",{className:"bg-accent/10 text-accent rounded px-2 py-0.5 text-[10px] font-medium",children:f.genre}),S.jsx("h4",{className:"text-foreground mt-1 text-sm font-serif font-medium",children:f.title}),S.jsx("p",{className:"text-muted mt-0.5 text-[10px] font-mono",children:f.storyName})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[f.hasNotIndexed&&S.jsx("span",{className:"rounded border border-amber-600/30 px-1.5 py-0.5 text-[9px] text-amber-700",children:"not indexed"}),S.jsxs("span",{className:"rounded border border-green-700/30 px-1.5 py-0.5 text-[9px] text-green-700",children:[f.publishedFiles," published"]})]})]}),S.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-2 text-center",children:[S.jsxs("div",{className:"rounded bg-background p-1.5",children:[S.jsx("div",{className:"text-foreground text-sm font-medium",children:f.plotCount}),S.jsx("div",{className:"text-muted text-[9px]",children:"Plots"})]}),S.jsxs("div",{className:"rounded bg-background p-1.5",children:[S.jsx("div",{className:"text-foreground text-sm font-medium font-mono",children:f.storylineId?`#${f.storylineId}`:"—"}),S.jsx("div",{className:"text-muted text-[9px]",children:"Storyline"})]}),S.jsxs("div",{className:"rounded bg-background p-1.5",children:[S.jsx("div",{className:"text-foreground text-sm font-medium",children:f.totalGasCostEth??"—"}),S.jsx("div",{className:"text-muted text-[9px]",children:"Gas (ETH)"})]})]}),S.jsx("div",{className:"mt-2 space-y-1",children:f.files.map(p=>S.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("span",{className:p.status==="published-not-indexed"?"text-amber-700":"text-green-700",children:p.status==="published-not-indexed"?"⚠":"✓"}),S.jsx("span",{className:"text-muted font-mono",children:p.file})]}),p.txHash&&S.jsxs("a",{href:`https://basescan.org/tx/${p.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted hover:text-accent font-mono",children:["tx:",p.txHash.slice(0,8),"..."]})]},p.file))}),S.jsxs("div",{className:"mt-2 flex items-center justify-between text-[10px]",children:[S.jsx("span",{className:"text-muted",children:c(f.latestPublishedAt)}),f.storylineId&&S.jsx("a",{href:`https://plotlink.xyz/story/${f.storylineId}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View on PlotLink"})]})]},f.id))})]}),t.stories.pendingFiles>0&&S.jsx("div",{className:"border-border rounded border p-4",children:S.jsxs("p",{className:"text-muted text-xs",children:[t.stories.pendingFiles," file(s) pending publish — go to Stories to publish them."]})})]}):S.jsx("div",{className:"flex h-full items-center justify-center",children:S.jsx("span",{className:"text-muted text-sm",children:"loading dashboard..."})})}const Bx={published:"✓","published-not-indexed":"⚠",pending:"⏳",draft:"📝"},Nx={published:"text-green-700","published-not-indexed":"text-amber-700",pending:"text-amber-700",draft:"text-muted"};function Lx({authFetch:e,selectedStory:t,selectedFile:n,onSelectFile:s,onNewStory:a,untitledSessions:o=[]}){const[c,f]=ne.useState([]),[p,h]=ne.useState([]),[g,_]=ne.useState(new Set),[b,y]=ne.useState(!1),x=ne.useCallback(async()=>{try{const K=await e("/api/stories");if(K.ok){const O=await K.json();f(O.stories)}}catch{}},[e]),E=ne.useCallback(async()=>{try{const K=await e("/api/stories/archived");if(K.ok){const O=await K.json();h(O.stories)}}catch{}},[e]),N=ne.useCallback(async K=>{try{(await e("/api/stories/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:K})})).ok&&(E(),x())}catch{}},[e,E,x]);ne.useEffect(()=>{x();const K=setInterval(x,5e3);return()=>clearInterval(K)},[x]),ne.useEffect(()=>{b&&E()},[b,E]),ne.useEffect(()=>{t&&_(K=>new Set(K).add(t))},[t]);const M=K=>{var ee;const O=K.map(oe=>{var de;return{file:oe.file,num:(de=oe.file.match(/^plot-(\d+)\.md$/))==null?void 0:de[1]}}).filter(oe=>oe.num!=null).sort((oe,de)=>parseInt(de.num)-parseInt(oe.num));return O.length>0?O[0].file:K.some(oe=>oe.file==="genesis.md")?"genesis.md":K.some(oe=>oe.file==="structure.md")?"structure.md":((ee=K[0])==null?void 0:ee.file)??null},G=K=>{_(O=>{const ee=new Set(O);return ee.has(K)?ee.delete(K):ee.add(K),ee})},U=K=>{if(G(K.name),!g.has(K.name)){const O=M(K.files);O&&s(K.name,O)}},Q=K=>{const O=ee=>{if(ee==="structure.md")return 0;if(ee==="genesis.md")return 1;const oe=ee.match(/^plot-(\d+)\.md$/);return oe?2+parseInt(oe[1]):100};return[...K].sort((ee,oe)=>O(ee.file)-O(oe.file))};return b?S.jsxs("div",{className:"h-full flex flex-col",children:[S.jsxs("div",{className:"px-3 py-1.5 border-b border-border flex items-center justify-between",children:[S.jsx("span",{className:"text-xs font-mono text-muted",children:"Archives"}),S.jsx("span",{className:"text-xs text-muted",children:p.length})]}),S.jsx("div",{className:"px-3 py-2 border-b border-border",children:S.jsxs("button",{onClick:()=>y(!1),className:"w-full px-3 py-1.5 text-sm text-muted hover:text-foreground hover:bg-surface rounded flex items-center gap-1.5",children:[S.jsx("span",{children:"←"}),S.jsx("span",{children:"Back"})]})}),S.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:p.length===0?S.jsx("div",{className:"p-3 text-sm text-muted",children:S.jsx("p",{children:"No archived stories."})}):p.map(K=>S.jsxs("div",{className:"px-3 py-2 flex items-center justify-between hover:bg-surface",children:[S.jsx("span",{className:"text-sm font-medium truncate",title:K.name,children:K.title||K.name}),S.jsx("button",{onClick:()=>N(K.name),className:"text-xs text-accent hover:text-accent-dim flex-shrink-0 ml-2",children:"Restore"})]},K.name))})]}):S.jsxs("div",{className:"h-full flex flex-col",children:[S.jsxs("div",{className:"px-3 py-1.5 border-b border-border flex items-center justify-between",children:[S.jsx("span",{className:"text-xs font-mono text-muted",children:"Stories"}),S.jsx("span",{className:"text-xs text-muted",children:c.length})]}),a&&S.jsx("div",{className:"px-3 py-2 border-b border-border",children:S.jsxs("button",{onClick:a,className:"w-full px-3 py-1.5 text-sm bg-accent text-white rounded hover:bg-accent-dim flex items-center justify-center gap-1.5",children:[S.jsx("span",{children:"+"}),S.jsx("span",{children:"New Story"})]})}),S.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[o.map(K=>S.jsx("div",{children:S.jsxs("button",{onClick:()=>s(K,""),className:`w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-surface text-sm ${t===K?"bg-surface":""}`,children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-600 flex-shrink-0"}),S.jsx("span",{className:"font-medium italic text-muted",children:"Untitled"})]})},K)),c.length===0&&o.length===0?S.jsxs("div",{className:"p-3 text-sm text-muted",children:[S.jsx("p",{children:"No stories yet."}),S.jsx("p",{className:"mt-1 text-xs",children:'Click "+ New Story" above to start writing.'})]}):c.filter(K=>K.name!=="_example").map(K=>S.jsxs("div",{children:[S.jsxs("button",{onClick:()=>U(K),className:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-surface text-sm",children:[S.jsx("span",{className:"text-xs text-muted",children:g.has(K.name)?"▼":"▶"}),S.jsx("span",{className:"font-medium truncate",title:K.name,children:K.title||K.name}),S.jsxs("span",{className:"ml-auto text-xs text-muted",children:[K.publishedCount,"/",K.files.length]})]}),g.has(K.name)&&S.jsx("div",{className:"pl-4",children:Q(K.files).map(O=>{const ee=t===K.name&&n===O.file;return S.jsxs("button",{onClick:()=>s(K.name,O.file),className:`w-full px-3 py-1.5 text-left flex items-center gap-2 text-xs hover:bg-surface ${ee?"bg-surface font-medium":""}`,children:[S.jsx("span",{className:Nx[O.status],children:Bx[O.status]}),S.jsx("span",{className:"truncate font-mono",children:O.file})]},O.file)})})]},K.name))]}),S.jsx("div",{className:"px-3 py-2 border-t border-border",children:S.jsx("button",{onClick:()=>y(!0),className:"w-full px-3 py-1.5 text-xs text-muted hover:text-foreground hover:bg-surface rounded flex items-center justify-center gap-1.5",children:S.jsx("span",{children:"Archives"})})})]})}/**
50
50
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
51
51
  * @license MIT
52
52
  *
@@ -63,11 +63,11 @@ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){t
63
63
 
64
64
  `+e.stack):new Error(e.message+`
65
65
 
66
- `+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)}},Gx=new $x;function eu(e){Zx(e)||Gx.onUnexpectedError(e)}var Mf="Canceled";function Zx(e){return e instanceof Qx?!0:e instanceof Error&&e.name===Mf&&e.message===Mf}var Qx=class extends Error{constructor(){super(Mf),this.name=this.message}};function Jx(e){return new Error(`Illegal argument: ${e}`)}var ov=class Bf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Bf)return t;let n=new Bf;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Nf=class cb extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,cb.prototype)}};function Ai(e,t=0){return e[e.length-(1+t)]}var ew;(e=>{function t(o){return o<0}e.isLessThan=t;function n(o){return o<=0}e.isLessThanOrEqual=n;function s(o){return o>0}e.isGreaterThan=s;function a(o){return o===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(ew||(ew={}));function tw(e,t){let n=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(n,arguments))),a}}var hb;(e=>{function t(Q){return Q&&typeof Q=="object"&&typeof Q[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function s(){return n}e.empty=s;function*a(Q){yield Q}e.single=a;function o(Q){return t(Q)?Q:a(Q)}e.wrap=o;function c(Q){return Q||n}e.from=c;function*f(Q){for(let K=Q.length-1;K>=0;K--)yield Q[K]}e.reverse=f;function p(Q){return!Q||Q[Symbol.iterator]().next().done===!0}e.isEmpty=p;function h(Q){return Q[Symbol.iterator]().next().value}e.first=h;function g(Q,K){let O=0;for(let ee of Q)if(K(ee,O++))return!0;return!1}e.some=g;function _(Q,K){for(let O of Q)if(K(O))return O}e.find=_;function*b(Q,K){for(let O of Q)K(O)&&(yield O)}e.filter=b;function*y(Q,K){let O=0;for(let ee of Q)yield K(ee,O++)}e.map=y;function*x(Q,K){let O=0;for(let ee of Q)yield*K(ee,O++)}e.flatMap=x;function*E(...Q){for(let K of Q)yield*K}e.concat=E;function N(Q,K,O){let ee=O;for(let oe of Q)ee=K(ee,oe);return ee}e.reduce=N;function*M(Q,K,O=Q.length){for(K<0&&(K+=Q.length),O<0?O+=Q.length:O>Q.length&&(O=Q.length);K<O;K++)yield Q[K]}e.slice=M;function G(Q,K=Number.POSITIVE_INFINITY){let O=[];if(K===0)return[O,Q];let ee=Q[Symbol.iterator]();for(let oe=0;oe<K;oe++){let de=ee.next();if(de.done)return[O,e.empty()];O.push(de.value)}return[O,{[Symbol.iterator](){return ee}}]}e.consume=G;async function U(Q){let K=[];for await(let O of Q)K.push(O);return Promise.resolve(K)}e.asyncToArray=U})(hb||(hb={}));function Yr(e){if(hb.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(s){t.push(s)}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 iw(...e){return rt(()=>Yr(e))}function rt(e){return{dispose:tw(()=>{e()})}}var fb=class db{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{Yr(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?db.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)}};fb.DISABLE_DISPOSED_WARNING=!1;var _r=fb,De=class{constructor(){this._store=new _r,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};De.None=Object.freeze({dispose(){}});var Ys=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}},Ln=typeof window=="object"?window:globalThis,Lf=class zf{constructor(t){this.element=t,this.next=zf.Undefined,this.prev=zf.Undefined}};Lf.Undefined=new Lf(void 0);var st=Lf,uv=class{constructor(){this._first=st.Undefined,this._last=st.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===st.Undefined}clear(){let e=this._first;for(;e!==st.Undefined;){let t=e.next;e.prev=st.Undefined,e.next=st.Undefined,e=t}this._first=st.Undefined,this._last=st.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new st(e);if(this._first===st.Undefined)this._first=n,this._last=n;else if(t){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first!==st.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==st.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==st.Undefined&&e.next!==st.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===st.Undefined&&e.next===st.Undefined?(this._first=st.Undefined,this._last=st.Undefined):e.next===st.Undefined?(this._last=this._last.prev,this._last.next=st.Undefined):e.prev===st.Undefined&&(this._first=this._first.next,this._first.prev=st.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==st.Undefined;)yield e.element,e=e.next}},nw=globalThis.performance&&typeof globalThis.performance.now=="function",rw=class pb{static create(t){return new pb(t)}constructor(t){this._now=nw&&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}},Yt;(e=>{e.None=()=>De.None;function t(D,j){return _(D,()=>{},0,void 0,!0,void 0,j)}e.defer=t;function n(D){return(j,P=null,L)=>{let A=!1,I;return I=D(Y=>{if(!A)return I?I.dispose():A=!0,j.call(P,Y)},null,L),A&&I.dispose(),I}}e.once=n;function s(D,j,P){return h((L,A=null,I)=>D(Y=>L.call(A,j(Y)),null,I),P)}e.map=s;function a(D,j,P){return h((L,A=null,I)=>D(Y=>{j(Y),L.call(A,Y)},null,I),P)}e.forEach=a;function o(D,j,P){return h((L,A=null,I)=>D(Y=>j(Y)&&L.call(A,Y),null,I),P)}e.filter=o;function c(D){return D}e.signal=c;function f(...D){return(j,P=null,L)=>{let A=iw(...D.map(I=>I(Y=>j.call(P,Y))));return g(A,L)}}e.any=f;function p(D,j,P,L){let A=P;return s(D,I=>(A=j(A,I),A),L)}e.reduce=p;function h(D,j){let P,L={onWillAddFirstListener(){P=D(A.fire,A)},onDidRemoveLastListener(){P==null||P.dispose()}},A=new ue(L);return j==null||j.add(A),A.event}function g(D,j){return j instanceof Array?j.push(D):j&&j.add(D),D}function _(D,j,P=100,L=!1,A=!1,I,Y){let le,k,T,X=0,C,se={leakWarningThreshold:I,onWillAddFirstListener(){le=D(he=>{X++,k=j(k,he),L&&!T&&(pe.fire(k),k=void 0),C=()=>{let be=k;k=void 0,T=void 0,(!L||X>1)&&pe.fire(be),X=0},typeof P=="number"?(clearTimeout(T),T=setTimeout(C,P)):T===void 0&&(T=0,queueMicrotask(C))})},onWillRemoveListener(){A&&X>0&&(C==null||C())},onDidRemoveLastListener(){C=void 0,le.dispose()}},pe=new ue(se);return Y==null||Y.add(pe),pe.event}e.debounce=_;function b(D,j=0,P){return e.debounce(D,(L,A)=>L?(L.push(A),L):[A],j,void 0,!0,void 0,P)}e.accumulate=b;function y(D,j=(L,A)=>L===A,P){let L=!0,A;return o(D,I=>{let Y=L||!j(I,A);return L=!1,A=I,Y},P)}e.latch=y;function x(D,j,P){return[e.filter(D,j,P),e.filter(D,L=>!j(L),P)]}e.split=x;function E(D,j=!1,P=[],L){let A=P.slice(),I=D(k=>{A?A.push(k):le.fire(k)});L&&L.add(I);let Y=()=>{A==null||A.forEach(k=>le.fire(k)),A=null},le=new ue({onWillAddFirstListener(){I||(I=D(k=>le.fire(k)),L&&L.add(I))},onDidAddFirstListener(){A&&(j?setTimeout(Y):Y())},onDidRemoveLastListener(){I&&I.dispose(),I=null}});return L&&L.add(le),le.event}e.buffer=E;function N(D,j){return(P,L,A)=>{let I=j(new G);return D(function(Y){let le=I.evaluate(Y);le!==M&&P.call(L,le)},void 0,A)}}e.chain=N;let M=Symbol("HaltChainable");class G{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(P=>(j(P),P)),this}filter(j){return this.steps.push(P=>j(P)?P:M),this}reduce(j,P){let L=P;return this.steps.push(A=>(L=j(L,A),L)),this}latch(j=(P,L)=>P===L){let P=!0,L;return this.steps.push(A=>{let I=P||!j(A,L);return P=!1,L=A,I?A:M}),this}evaluate(j){for(let P of this.steps)if(j=P(j),j===M)break;return j}}function U(D,j,P=L=>L){let L=(...le)=>Y.fire(P(...le)),A=()=>D.on(j,L),I=()=>D.removeListener(j,L),Y=new ue({onWillAddFirstListener:A,onDidRemoveLastListener:I});return Y.event}e.fromNodeEventEmitter=U;function Q(D,j,P=L=>L){let L=(...le)=>Y.fire(P(...le)),A=()=>D.addEventListener(j,L),I=()=>D.removeEventListener(j,L),Y=new ue({onWillAddFirstListener:A,onDidRemoveLastListener:I});return Y.event}e.fromDOMEventEmitter=Q;function K(D){return new Promise(j=>n(D)(j))}e.toPromise=K;function O(D){let j=new ue;return D.then(P=>{j.fire(P)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}e.fromPromise=O;function ee(D,j){return D(P=>j.fire(P))}e.forward=ee;function oe(D,j,P){return j(P),D(L=>j(L))}e.runAndSubscribe=oe;class de{constructor(j,P){this._observable=j,this._counter=0,this._hasChanged=!1;let L={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new ue(L),P&&P.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,P){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function q(D,j){return new de(D,j).emitter.event}e.fromObservable=q;function B(D){return(j,P,L)=>{let A=0,I=!1,Y={beginUpdate(){A++},endUpdate(){A--,A===0&&(D.reportChanges(),I&&(I=!1,j.call(P)))},handlePossibleChange(){},handleChange(){I=!0}};D.addObserver(Y),D.reportChanges();let le={dispose(){D.removeObserver(Y)}};return L instanceof _r?L.add(le):Array.isArray(L)&&L.push(le),le}}e.fromObservableLight=B})(Yt||(Yt={}));var Of=class jf{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${jf._idPool++}`,jf.all.add(this)}start(t){this._stopWatch=new rw,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}}};Of.all=new Set,Of._idPool=0;var sw=Of,lw=-1,mb=class _b{constructor(t,n,s=(_b._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=s,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let s=this.threshold;if(s<=0||n<s)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[o,c]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${c}):`;console.warn(f),console.warn(o);let p=new uw(f,o);this._errorHandler(p)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[s,a]of this._stacks)(!t||n<a)&&(t=[s,a],n=a);return t}};mb._idPool=1;var aw=mb,ow=class gb{constructor(t){this.value=t}static create(){let t=new Error;return new gb(t.stack??"")}print(){console.warn(this.value.split(`
66
+ `+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)}},Gx=new $x;function eu(e){Zx(e)||Gx.onUnexpectedError(e)}var Mf="Canceled";function Zx(e){return e instanceof Qx?!0:e instanceof Error&&e.name===Mf&&e.message===Mf}var Qx=class extends Error{constructor(){super(Mf),this.name=this.message}};function Jx(e){return new Error(`Illegal argument: ${e}`)}var ov=class Bf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Bf)return t;let n=new Bf;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Nf=class cb extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,cb.prototype)}};function Ai(e,t=0){return e[e.length-(1+t)]}var ew;(e=>{function t(o){return o<0}e.isLessThan=t;function n(o){return o<=0}e.isLessThanOrEqual=n;function s(o){return o>0}e.isGreaterThan=s;function a(o){return o===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(ew||(ew={}));function tw(e,t){let n=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(n,arguments))),a}}var hb;(e=>{function t(Q){return Q&&typeof Q=="object"&&typeof Q[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function s(){return n}e.empty=s;function*a(Q){yield Q}e.single=a;function o(Q){return t(Q)?Q:a(Q)}e.wrap=o;function c(Q){return Q||n}e.from=c;function*f(Q){for(let K=Q.length-1;K>=0;K--)yield Q[K]}e.reverse=f;function p(Q){return!Q||Q[Symbol.iterator]().next().done===!0}e.isEmpty=p;function h(Q){return Q[Symbol.iterator]().next().value}e.first=h;function g(Q,K){let O=0;for(let ee of Q)if(K(ee,O++))return!0;return!1}e.some=g;function _(Q,K){for(let O of Q)if(K(O))return O}e.find=_;function*b(Q,K){for(let O of Q)K(O)&&(yield O)}e.filter=b;function*y(Q,K){let O=0;for(let ee of Q)yield K(ee,O++)}e.map=y;function*x(Q,K){let O=0;for(let ee of Q)yield*K(ee,O++)}e.flatMap=x;function*E(...Q){for(let K of Q)yield*K}e.concat=E;function N(Q,K,O){let ee=O;for(let oe of Q)ee=K(ee,oe);return ee}e.reduce=N;function*M(Q,K,O=Q.length){for(K<0&&(K+=Q.length),O<0?O+=Q.length:O>Q.length&&(O=Q.length);K<O;K++)yield Q[K]}e.slice=M;function G(Q,K=Number.POSITIVE_INFINITY){let O=[];if(K===0)return[O,Q];let ee=Q[Symbol.iterator]();for(let oe=0;oe<K;oe++){let de=ee.next();if(de.done)return[O,e.empty()];O.push(de.value)}return[O,{[Symbol.iterator](){return ee}}]}e.consume=G;async function U(Q){let K=[];for await(let O of Q)K.push(O);return Promise.resolve(K)}e.asyncToArray=U})(hb||(hb={}));function Yr(e){if(hb.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(s){t.push(s)}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 iw(...e){return rt(()=>Yr(e))}function rt(e){return{dispose:tw(()=>{e()})}}var fb=class db{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{Yr(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?db.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)}};fb.DISABLE_DISPOSED_WARNING=!1;var _r=fb,De=class{constructor(){this._store=new _r,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};De.None=Object.freeze({dispose(){}});var Ys=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}},Ln=typeof window=="object"?window:globalThis,Lf=class zf{constructor(t){this.element=t,this.next=zf.Undefined,this.prev=zf.Undefined}};Lf.Undefined=new Lf(void 0);var st=Lf,uv=class{constructor(){this._first=st.Undefined,this._last=st.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===st.Undefined}clear(){let e=this._first;for(;e!==st.Undefined;){let t=e.next;e.prev=st.Undefined,e.next=st.Undefined,e=t}this._first=st.Undefined,this._last=st.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new st(e);if(this._first===st.Undefined)this._first=n,this._last=n;else if(t){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first!==st.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==st.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==st.Undefined&&e.next!==st.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===st.Undefined&&e.next===st.Undefined?(this._first=st.Undefined,this._last=st.Undefined):e.next===st.Undefined?(this._last=this._last.prev,this._last.next=st.Undefined):e.prev===st.Undefined&&(this._first=this._first.next,this._first.prev=st.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==st.Undefined;)yield e.element,e=e.next}},nw=globalThis.performance&&typeof globalThis.performance.now=="function",rw=class pb{static create(t){return new pb(t)}constructor(t){this._now=nw&&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}},Yt;(e=>{e.None=()=>De.None;function t(D,j){return _(D,()=>{},0,void 0,!0,void 0,j)}e.defer=t;function n(D){return(j,P=null,L)=>{let A=!1,I;return I=D(Y=>{if(!A)return I?I.dispose():A=!0,j.call(P,Y)},null,L),A&&I.dispose(),I}}e.once=n;function s(D,j,P){return h((L,A=null,I)=>D(Y=>L.call(A,j(Y)),null,I),P)}e.map=s;function a(D,j,P){return h((L,A=null,I)=>D(Y=>{j(Y),L.call(A,Y)},null,I),P)}e.forEach=a;function o(D,j,P){return h((L,A=null,I)=>D(Y=>j(Y)&&L.call(A,Y),null,I),P)}e.filter=o;function c(D){return D}e.signal=c;function f(...D){return(j,P=null,L)=>{let A=iw(...D.map(I=>I(Y=>j.call(P,Y))));return g(A,L)}}e.any=f;function p(D,j,P,L){let A=P;return s(D,I=>(A=j(A,I),A),L)}e.reduce=p;function h(D,j){let P,L={onWillAddFirstListener(){P=D(A.fire,A)},onDidRemoveLastListener(){P==null||P.dispose()}},A=new ue(L);return j==null||j.add(A),A.event}function g(D,j){return j instanceof Array?j.push(D):j&&j.add(D),D}function _(D,j,P=100,L=!1,A=!1,I,Y){let le,k,T,X=0,C,se={leakWarningThreshold:I,onWillAddFirstListener(){le=D(he=>{X++,k=j(k,he),L&&!T&&(pe.fire(k),k=void 0),C=()=>{let be=k;k=void 0,T=void 0,(!L||X>1)&&pe.fire(be),X=0},typeof P=="number"?(clearTimeout(T),T=setTimeout(C,P)):T===void 0&&(T=0,queueMicrotask(C))})},onWillRemoveListener(){A&&X>0&&(C==null||C())},onDidRemoveLastListener(){C=void 0,le.dispose()}},pe=new ue(se);return Y==null||Y.add(pe),pe.event}e.debounce=_;function b(D,j=0,P){return e.debounce(D,(L,A)=>L?(L.push(A),L):[A],j,void 0,!0,void 0,P)}e.accumulate=b;function y(D,j=(L,A)=>L===A,P){let L=!0,A;return o(D,I=>{let Y=L||!j(I,A);return L=!1,A=I,Y},P)}e.latch=y;function x(D,j,P){return[e.filter(D,j,P),e.filter(D,L=>!j(L),P)]}e.split=x;function E(D,j=!1,P=[],L){let A=P.slice(),I=D(k=>{A?A.push(k):le.fire(k)});L&&L.add(I);let Y=()=>{A==null||A.forEach(k=>le.fire(k)),A=null},le=new ue({onWillAddFirstListener(){I||(I=D(k=>le.fire(k)),L&&L.add(I))},onDidAddFirstListener(){A&&(j?setTimeout(Y):Y())},onDidRemoveLastListener(){I&&I.dispose(),I=null}});return L&&L.add(le),le.event}e.buffer=E;function N(D,j){return(P,L,A)=>{let I=j(new G);return D(function(Y){let le=I.evaluate(Y);le!==M&&P.call(L,le)},void 0,A)}}e.chain=N;let M=Symbol("HaltChainable");class G{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(P=>(j(P),P)),this}filter(j){return this.steps.push(P=>j(P)?P:M),this}reduce(j,P){let L=P;return this.steps.push(A=>(L=j(L,A),L)),this}latch(j=(P,L)=>P===L){let P=!0,L;return this.steps.push(A=>{let I=P||!j(A,L);return P=!1,L=A,I?A:M}),this}evaluate(j){for(let P of this.steps)if(j=P(j),j===M)break;return j}}function U(D,j,P=L=>L){let L=(...le)=>Y.fire(P(...le)),A=()=>D.on(j,L),I=()=>D.removeListener(j,L),Y=new ue({onWillAddFirstListener:A,onDidRemoveLastListener:I});return Y.event}e.fromNodeEventEmitter=U;function Q(D,j,P=L=>L){let L=(...le)=>Y.fire(P(...le)),A=()=>D.addEventListener(j,L),I=()=>D.removeEventListener(j,L),Y=new ue({onWillAddFirstListener:A,onDidRemoveLastListener:I});return Y.event}e.fromDOMEventEmitter=Q;function K(D){return new Promise(j=>n(D)(j))}e.toPromise=K;function O(D){let j=new ue;return D.then(P=>{j.fire(P)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}e.fromPromise=O;function ee(D,j){return D(P=>j.fire(P))}e.forward=ee;function oe(D,j,P){return j(P),D(L=>j(L))}e.runAndSubscribe=oe;class de{constructor(j,P){this._observable=j,this._counter=0,this._hasChanged=!1;let L={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new ue(L),P&&P.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,P){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function F(D,j){return new de(D,j).emitter.event}e.fromObservable=F;function B(D){return(j,P,L)=>{let A=0,I=!1,Y={beginUpdate(){A++},endUpdate(){A--,A===0&&(D.reportChanges(),I&&(I=!1,j.call(P)))},handlePossibleChange(){},handleChange(){I=!0}};D.addObserver(Y),D.reportChanges();let le={dispose(){D.removeObserver(Y)}};return L instanceof _r?L.add(le):Array.isArray(L)&&L.push(le),le}}e.fromObservableLight=B})(Yt||(Yt={}));var Of=class jf{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${jf._idPool++}`,jf.all.add(this)}start(t){this._stopWatch=new rw,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}}};Of.all=new Set,Of._idPool=0;var sw=Of,lw=-1,mb=class _b{constructor(t,n,s=(_b._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=s,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let s=this.threshold;if(s<=0||n<s)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[o,c]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${c}):`;console.warn(f),console.warn(o);let p=new uw(f,o);this._errorHandler(p)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[s,a]of this._stacks)(!t||n<a)&&(t=[s,a],n=a);return t}};mb._idPool=1;var aw=mb,ow=class gb{constructor(t){this.value=t}static create(){let t=new Error;return new gb(t.stack??"")}print(){console.warn(this.value.split(`
67
67
  `).slice(2).join(`
68
68
  `))}},uw=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},cw=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},hw=0,$h=class{constructor(e){this.value=e,this.id=hw++}},fw=2,dw,ue=class{constructor(t){var n,s,a,o;this._size=0,this._options=t,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new aw((t==null?void 0:t.onListenerError)??eu,((s=this._options)==null?void 0:s.leakWarningThreshold)??lw):void 0,this._perfMon=(a=this._options)!=null&&a._profName?new sw(this._options._profName):void 0,this._deliveryQueue=(o=this._options)==null?void 0:o.deliveryQueue}dispose(){var t,n,s,a;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(s=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||s.call(n),(a=this._leakageMon)==null||a.dispose())}get event(){return this._event??(this._event=(t,n,s)=>{var f,p,h,g,_;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let b=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(b);let y=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],x=new cw(`${b}. HINT: Stack shows most frequent listener (${y[1]}-times)`,y[0]);return(((f=this._options)==null?void 0:f.onListenerError)||eu)(x),De.None}if(this._disposed)return De.None;n&&(t=t.bind(n));let a=new $h(t),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=ow.create(),o=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof $h?(this._deliveryQueue??(this._deliveryQueue=new pw),this._listeners=[this._listeners,a]):this._listeners.push(a):((h=(p=this._options)==null?void 0:p.onWillAddFirstListener)==null||h.call(p,this),this._listeners=a,(_=(g=this._options)==null?void 0:g.onDidAddFirstListener)==null||_.call(g,this)),this._size++;let c=rt(()=>{o==null||o(),this._removeListener(a)});return s instanceof _r?s.add(c):Array.isArray(s)&&s.push(c),c}),this._event}_removeListener(t){var o,c,f,p;if((c=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||c.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(p=(f=this._options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f,this),this._size=0;return}let n=this._listeners,s=n.indexOf(t);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[s]=void 0;let a=this._deliveryQueue.current===this;if(this._size*fw<=n.length){let h=0;for(let g=0;g<n.length;g++)n[g]?n[h++]=n[g]:a&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=h}}_deliver(t,n){var a;if(!t)return;let s=((a=this._options)==null?void 0:a.onListenerError)||eu;if(!s){t.value(n);return}try{t.value(n)}catch(o){s(o)}}_deliverQueue(t){let n=t.current._listeners;for(;t.i<t.end;)this._deliver(n[t.i++],t.value);t.reset()}fire(t){var n,s,a,o;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(s=this._perfMon)==null||s.stop()),(a=this._perfMon)==null||a.start(this._size),this._listeners)if(this._listeners instanceof $h)this._deliver(this._listeners,t);else{let c=this._deliveryQueue;c.enqueue(this,t,this._listeners.length),this._deliverQueue(c)}(o=this._perfMon)==null||o.stop()}hasListeners(){return this._size>0}},pw=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}},Hf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ue,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ue,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 s=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}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 s=this.getWindowId(n);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Hf.INSTANCE=new Hf;var Cd=Hf;function mw(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}Cd.INSTANCE.onDidChangeZoomLevel;function _w(e){return Cd.INSTANCE.getZoomFactor(e)}Cd.INSTANCE.onDidChangeFullscreen;var Xs=typeof navigator=="object"?navigator.userAgent:"",Uf=Xs.indexOf("Firefox")>=0,gw=Xs.indexOf("AppleWebKit")>=0,kd=Xs.indexOf("Chrome")>=0,vw=!kd&&Xs.indexOf("Safari")>=0;Xs.indexOf("Electron/")>=0;Xs.indexOf("Android")>=0;var Gh=!1;if(typeof Ln.matchMedia=="function"){let e=Ln.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Ln.matchMedia("(display-mode: fullscreen)");Gh=e.matches,mw(Ln,e,({matches:n})=>{Gh&&t.matches||(Gh=n)})}var qs="en",Pf=!1,If=!1,tu=!1,vb=!1,qo,iu=qs,cv=qs,yw,Zi,Wr=globalThis,Wt,Xy;typeof Wr.vscode<"u"&&typeof Wr.vscode.process<"u"?Wt=Wr.vscode.process:typeof process<"u"&&typeof((Xy=process==null?void 0:process.versions)==null?void 0:Xy.node)=="string"&&(Wt=process);var $y,bw=typeof(($y=Wt==null?void 0:Wt.versions)==null?void 0:$y.electron)=="string",Sw=bw&&(Wt==null?void 0:Wt.type)==="renderer",Gy;if(typeof Wt=="object"){Pf=Wt.platform==="win32",If=Wt.platform==="darwin",tu=Wt.platform==="linux",tu&&Wt.env.SNAP&&Wt.env.SNAP_REVISION,Wt.env.CI||Wt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,qo=qs,iu=qs;let e=Wt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);qo=t.userLocale,cv=t.osLocale,iu=t.resolvedLanguage||qs,yw=(Gy=t.languagePack)==null?void 0:Gy.translationsConfigFile}catch{}vb=!0}else typeof navigator=="object"&&!Sw?(Zi=navigator.userAgent,Pf=Zi.indexOf("Windows")>=0,If=Zi.indexOf("Macintosh")>=0,(Zi.indexOf("Macintosh")>=0||Zi.indexOf("iPad")>=0||Zi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,tu=Zi.indexOf("Linux")>=0,(Zi==null?void 0:Zi.indexOf("Mobi"))>=0,iu=globalThis._VSCODE_NLS_LANGUAGE||qs,qo=navigator.language.toLowerCase(),cv=qo):console.error("Unable to resolve platform.");var yb=Pf,un=If,xw=tu,hv=vb,cn=Zi,ur=iu,ww;(e=>{function t(){return ur}e.value=t;function n(){return ur.length===2?ur==="en":ur.length>=3?ur[0]==="e"&&ur[1]==="n"&&ur[2]==="-":!1}e.isDefaultVariant=n;function s(){return ur==="en"}e.isDefault=s})(ww||(ww={}));var Cw=typeof Wr.postMessage=="function"&&!Wr.importScripts;(()=>{if(Cw){let e=[];Wr.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let s=0,a=e.length;s<a;s++){let o=e[s];if(o.id===n.data.vscodeScheduleAsyncWork){e.splice(s,1),o.callback();return}}});let t=0;return n=>{let s=++t;e.push({id:s,callback:n}),Wr.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var kw=!!(cn&&cn.indexOf("Chrome")>=0);cn&&cn.indexOf("Firefox")>=0;!kw&&cn&&cn.indexOf("Safari")>=0;cn&&cn.indexOf("Edg/")>=0;cn&&cn.indexOf("Android")>=0;var Hs=typeof navigator=="object"?navigator:{};hv||document.queryCommandSupported&&document.queryCommandSupported("copy")||Hs&&Hs.clipboard&&Hs.clipboard.writeText,hv||Hs&&Hs.clipboard&&Hs.clipboard.readText;var Ed=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}},Zh=new Ed,fv=new Ed,dv=new Ed,Ew=new Array(230),bb;(e=>{function t(f){return Zh.keyCodeToStr(f)}e.toString=t;function n(f){return Zh.strToKeyCode(f)}e.fromString=n;function s(f){return fv.keyCodeToStr(f)}e.toUserSettingsUS=s;function a(f){return dv.keyCodeToStr(f)}e.toUserSettingsGeneral=a;function o(f){return fv.strToKeyCode(f)||dv.strToKeyCode(f)}e.fromUserSettings=o;function c(f){if(f>=98&&f<=113)return null;switch(f){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Zh.keyCodeToStr(f)}e.toElectronAccelerator=c})(bb||(bb={}));var Tw=class Sb{constructor(t,n,s,a,o){this.ctrlKey=t,this.shiftKey=n,this.altKey=s,this.metaKey=a,this.keyCode=o}equals(t){return t instanceof Sb&&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",s=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${n}${s}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new Aw([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},Aw=class{constructor(e){if(e.length===0)throw Jx("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 Dw(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return bb.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Uf)switch(t){case 59:return 85;case 60:if(xw)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(un)return 57;break}else if(gw&&(un&&t===93||!un&&t===92))return 57;return Ew[t]||0}var Rw=un?256:2048,Mw=512,Bw=1024,Nw=un?2048:256,pv=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=Dw(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|=Rw),this.altKey&&(t|=Mw),this.shiftKey&&(t|=Bw),this.metaKey&&(t|=Nw),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Tw(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},mv=new WeakMap;function Lw(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 zw=class{static getSameOriginWindowChain(e){let t=mv.get(e);if(!t){t=[],mv.set(e,t);let n=e,s;do s=Lw(n),s?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=s;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,s=0,a=this.getSameOriginWindowChain(e);for(let o of a){let c=o.window.deref();if(n+=(c==null?void 0:c.scrollY)??0,s+=(c==null?void 0:c.scrollX)??0,c===t||!o.iframeElement)break;let f=o.iframeElement.getBoundingClientRect();n+=f.top,s+=f.left}return{top:n,left:s}}},Wo=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=zw.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},_v=class{constructor(e,t=0,n=0){var a;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let s=!1;if(kd){let o=navigator.userAgent.match(/Chrome\/(\d+)/);s=(o?parseInt(o[1]):123)<=122}if(e){let o=e,c=e,f=((a=e.view)==null?void 0:a.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")s?this.deltaY=o.wheelDeltaY/(120*f):this.deltaY=o.wheelDeltaY/120;else if(typeof c.VERTICAL_AXIS<"u"&&c.axis===c.VERTICAL_AXIS)this.deltaY=-c.detail/3;else if(e.type==="wheel"){let p=e;p.deltaMode===p.DOM_DELTA_LINE?Uf&&!un?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")vw&&yb?this.deltaX=-(o.wheelDeltaX/120):s?this.deltaX=o.wheelDeltaX/(120*f):this.deltaX=o.wheelDeltaX/120;else if(typeof c.HORIZONTAL_AXIS<"u"&&c.axis===c.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let p=e;p.deltaMode===p.DOM_DELTA_LINE?Uf&&!un?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*f):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},xb=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Ow;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof jw?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Yt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:xb})})(Ow||(Ow={}));var jw=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?xb:(this._emitter||(this._emitter=new ue),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Td=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 Nf("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Nf("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Hw=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 Nf("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=n.setInterval(()=>{e()},t);this.disposable=rt(()=>{n.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Uw;(e=>{async function t(s){let a,o=await Promise.all(s.map(c=>c.then(f=>f,f=>{a||(a=f)})));if(typeof a<"u")throw a;return o}e.settled=t;function n(s){return new Promise(async(a,o)=>{try{await s(a,o)}catch(c){o(c)}})}e.withAsyncBody=n})(Uw||(Uw={}));var gv=class qi{static fromArray(t){return new qi(n=>{n.emitMany(t)})}static fromPromise(t){return new qi(async n=>{n.emitMany(await t)})}static fromPromises(t){return new qi(async n=>{await Promise.all(t.map(async s=>n.emitOne(await s)))})}static merge(t){return new qi(async n=>{await Promise.all(t.map(async s=>{for await(let a of s)n.emitOne(a)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new ue,queueMicrotask(async()=>{let s={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(s)),this.resolve()}catch(a){this.reject(a)}finally{s.emitOne=void 0,s.emitMany=void 0,s.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 Yt.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 qi(async s=>{for await(let a of t)s.emitOne(n(a))})}map(t){return qi.map(this,t)}static filter(t,n){return new qi(async s=>{for await(let a of t)n(a)&&s.emitOne(a)})}filter(t){return qi.filter(this,t)}static coalesce(t){return qi.filter(t,n=>!!n)}coalesce(){return qi.coalesce(this)}static async toPromise(t){let n=[];for await(let s of t)n.push(s);return n}toPromise(){return qi.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())}};gv.EMPTY=gv.fromArray([]);var{getWindow:on,getWindowId:Pw,onDidRegisterWindow:Iw}=(function(){let e=new Map,t={window:Ln,disposables:new _r};e.set(Ln.vscodeWindowId,t);let n=new ue,s=new ue,a=new ue;function o(c,f){return(typeof c=="number"?e.get(c):void 0)??(f?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:s.event,registerWindow(c){if(e.has(c.vscodeWindowId))return De.None;let f=new _r,p={window:c,disposables:f.add(new _r)};return e.set(c.vscodeWindowId,p),f.add(rt(()=>{e.delete(c.vscodeWindowId),s.fire(c)})),f.add(xe(c,Dt.BEFORE_UNLOAD,()=>{a.fire(c)})),n.fire(p),f},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(c){return c.vscodeWindowId},hasWindow(c){return e.has(c)},getWindowById:o,getWindow(c){var h;let f=c;if((h=f==null?void 0:f.ownerDocument)!=null&&h.defaultView)return f.ownerDocument.defaultView.window;let p=c;return p!=null&&p.view?p.view.window:Ln},getDocument(c){return on(c).document}}})(),Fw=class{constructor(e,t,n,s){this._node=e,this._type=t,this._handler=n,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function xe(e,t,n,s){return new Fw(e,t,n,s)}var vv=function(e,t,n,s){return xe(e,t,n,s)},Ad,qw=class extends Hw{constructor(e){super(),this.defaultTarget=e&&on(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},yv=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){eu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,s=new Map,a=o=>{n.set(o,!1);let c=e.get(o)??[];for(t.set(o,c),e.set(o,[]),s.set(o,!0);c.length>0;)c.sort(yv.sort),c.shift().execute();s.set(o,!1)};Ad=(o,c,f=0)=>{let p=Pw(o),h=new yv(c,f),g=e.get(p);return g||(g=[],e.set(p,g)),g.push(h),n.get(p)||(n.set(p,!0),o.requestAnimationFrame(()=>a(p))),h}})();function Ww(e){let t=e.getBoundingClientRect(),n=on(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Dt={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"},Yw=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=_i(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=_i(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=_i(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=_i(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=_i(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=_i(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=_i(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=_i(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=_i(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=_i(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=_i(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=_i(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=_i(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=_i(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 _i(e){return typeof e=="number"?`${e}px`:e}function la(e){return new Yw(e)}var wb=class{constructor(){this._hooks=new _r,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,s,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=a;let o=e;try{e.setPointerCapture(t),this._hooks.add(rt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=on(e)}this._hooks.add(xe(o,Dt.POINTER_MOVE,c=>{if(c.buttons!==n){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(xe(o,Dt.POINTER_UP,c=>this.stopMonitoring(!0)))}};function Vw(e,t,n){let s=null,a=null;if(typeof n.value=="function"?(s="value",a=n.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(s="get",a=n.get),!a)throw new Error("not supported");let o=`$memoize$${t}`;n[s]=function(...c){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,c)}),this[o]}}var ln;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ln||(ln={}));var ta=class Kt extends De{constructor(){super(),this.dispatched=!1,this.targets=new uv,this.ignoreTargets=new uv,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Yt.runAndSubscribe(Iw,({window:t,disposables:n})=>{n.add(xe(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),n.add(xe(t.document,"touchend",s=>this.onTouchEnd(t,s))),n.add(xe(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:Ln,disposables:this._store}))}static addTarget(t){if(!Kt.isTouchDevice())return De.None;Kt.INSTANCE||(Kt.INSTANCE=new Kt);let n=Kt.INSTANCE.targets.push(t);return rt(n)}static ignoreTarget(t){if(!Kt.isTouchDevice())return De.None;Kt.INSTANCE||(Kt.INSTANCE=new Kt);let n=Kt.INSTANCE.ignoreTargets.push(t);return rt(n)}static isTouchDevice(){return"ontouchstart"in Ln||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 s=0,a=t.targetTouches.length;s<a;s++){let o=t.targetTouches.item(s);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:n,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[n],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let c=this.newGestureEvent(ln.Start,o.target);c.pageX=o.pageX,c.pageY=o.pageY,this.dispatchEvent(c)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let s=Date.now(),a=Object.keys(this.activeTouches).length;for(let o=0,c=n.changedTouches.length;o<c;o++){let f=n.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(f.identifier))){console.warn("move of an UNKNOWN touch",f);continue}let p=this.activeTouches[f.identifier],h=Date.now()-p.initialTimeStamp;if(h<Kt.HOLD_DELAY&&Math.abs(p.initialPageX-Ai(p.rollingPageX))<30&&Math.abs(p.initialPageY-Ai(p.rollingPageY))<30){let g=this.newGestureEvent(ln.Tap,p.initialTarget);g.pageX=Ai(p.rollingPageX),g.pageY=Ai(p.rollingPageY),this.dispatchEvent(g)}else if(h>=Kt.HOLD_DELAY&&Math.abs(p.initialPageX-Ai(p.rollingPageX))<30&&Math.abs(p.initialPageY-Ai(p.rollingPageY))<30){let g=this.newGestureEvent(ln.Contextmenu,p.initialTarget);g.pageX=Ai(p.rollingPageX),g.pageY=Ai(p.rollingPageY),this.dispatchEvent(g)}else if(a===1){let g=Ai(p.rollingPageX),_=Ai(p.rollingPageY),b=Ai(p.rollingTimestamps)-p.rollingTimestamps[0],y=g-p.rollingPageX[0],x=_-p.rollingPageY[0],E=[...this.targets].filter(N=>p.initialTarget instanceof Node&&N.contains(p.initialTarget));this.inertia(t,E,s,Math.abs(y)/b,y>0?1:-1,g,Math.abs(x)/b,x>0?1:-1,_)}this.dispatchEvent(this.newGestureEvent(ln.End,p.initialTarget)),delete this.activeTouches[f.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=n,s.tapCount=0,s}dispatchEvent(t){if(t.type===ln.Tap){let n=new Date().getTime(),s=0;n-this._lastSetTapCountTime>Kt.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=n,t.tapCount=s}else(t.type===ln.Change||t.type===ln.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let n=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let a=0,o=t.initialTarget;for(;o&&o!==s;)a++,o=o.parentElement;n.push([a,s])}n.sort((s,a)=>s[0]-a[0]);for(let[s,a]of n)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,s,a,o,c,f,p,h){this.handle=Ad(t,()=>{let g=Date.now(),_=g-s,b=0,y=0,x=!0;a+=Kt.SCROLL_FRICTION*_,f+=Kt.SCROLL_FRICTION*_,a>0&&(x=!1,b=o*a*_),f>0&&(x=!1,y=p*f*_);let E=this.newGestureEvent(ln.Change);E.translationX=b,E.translationY=y,n.forEach(N=>N.dispatchEvent(E)),x||this.inertia(t,n,g,a,o,c+b,f,p,h+y)})}onTouchMove(t){let n=Date.now();for(let s=0,a=t.changedTouches.length;s<a;s++){let o=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let c=this.activeTouches[o.identifier],f=this.newGestureEvent(ln.Change,c.initialTarget);f.translationX=o.pageX-Ai(c.rollingPageX),f.translationY=o.pageY-Ai(c.rollingPageY),f.pageX=o.pageX,f.pageY=o.pageY,this.dispatchEvent(f),c.rollingPageX.length>3&&(c.rollingPageX.shift(),c.rollingPageY.shift(),c.rollingTimestamps.shift()),c.rollingPageX.push(o.pageX),c.rollingPageY.push(o.pageY),c.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ta.SCROLL_FRICTION=-.005,ta.HOLD_DELAY=700,ta.CLEAR_TAP_COUNT_TIME=400,ht([Vw],ta,"isTouchDevice",1);var Kw=ta,Dd=class extends De{onclick(e,t){this._register(xe(e,Dt.CLICK,n=>t(new Wo(on(e),n))))}onmousedown(e,t){this._register(xe(e,Dt.MOUSE_DOWN,n=>t(new Wo(on(e),n))))}onmouseover(e,t){this._register(xe(e,Dt.MOUSE_OVER,n=>t(new Wo(on(e),n))))}onmouseleave(e,t){this._register(xe(e,Dt.MOUSE_LEAVE,n=>t(new Wo(on(e),n))))}onkeydown(e,t){this._register(xe(e,Dt.KEY_DOWN,n=>t(new pv(n))))}onkeyup(e,t){this._register(xe(e,Dt.KEY_UP,n=>t(new pv(n))))}oninput(e,t){this._register(xe(e,Dt.INPUT,t))}onblur(e,t){this._register(xe(e,Dt.BLUR,t))}onfocus(e,t){this._register(xe(e,Dt.FOCUS,t))}onchange(e,t){this._register(xe(e,Dt.CHANGE,t))}ignoreGesture(e){return Kw.ignoreTarget(e)}},bv=11,Xw=class extends Dd{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=bv+"px",this.domNode.style.height=bv+"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 wb),this._register(vv(this.bgDomNode,Dt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(vv(this.domNode,Dt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new qw),this._pointerdownScheduleRepeatTimer=this._register(new Td)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,on(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()}},$w=class Ff{constructor(t,n,s,a,o,c,f){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,s=s|0,a=a|0,o=o|0,c=c|0,f=f|0),this.rawScrollLeft=a,this.rawScrollTop=f,n<0&&(n=0),a+n>s&&(a=s-n),a<0&&(a=0),o<0&&(o=0),f+o>c&&(f=c-o),f<0&&(f=0),this.width=n,this.scrollWidth=s,this.scrollLeft=a,this.height=o,this.scrollHeight=c,this.scrollTop=f}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 Ff(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 Ff(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 s=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,o=this.scrollLeft!==t.scrollLeft,c=this.height!==t.height,f=this.scrollHeight!==t.scrollHeight,p=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:s,scrollWidthChanged:a,scrollLeftChanged:o,heightChanged:c,scrollHeightChanged:f,scrollTopChanged:p}}},Gw=class extends De{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new $w(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 s;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(s=this._smoothScrolling)==null||s.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 s;t?s=new xv(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=xv.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)))}},Sv=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Qh(e,t){let n=t-e;return function(s){return e+n*Jw(s)}}function Zw(e,t,n){return function(s){return s<n?e(s/n):t((s-n)/(1-n))}}var xv=class qf{constructor(t,n,s,a){this.from=t,this.to=n,this.duration=a,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,s){if(Math.abs(t-n)>2.5*s){let a,o;return t<n?(a=t+.75*s,o=n-.75*s):(a=t-.75*s,o=n+.75*s),Zw(Qh(t,a),Qh(o,n),.33)}return Qh(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 s=this.scrollLeft(n),a=this.scrollTop(n);return new Sv(s,a,!1)}return new Sv(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,s){return qf.start(t,n,s)}static start(t,n,s){s=s+10;let a=Date.now()-10;return new qf(t,n,a,s)}};function Qw(e){return Math.pow(e,3)}function Jw(e){return 1-Qw(1-e)}var eC=class extends De{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 Td)}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":"")))}},tC=140,Cb=class extends Dd{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 eC(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new wb),this._shouldRender=!0,this.domNode=la(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(xe(this.domNode.domNode,Dt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Xw(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,s){this.slider=la(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 s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(xe(this.slider.domNode,Dt.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.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(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);n<=a&&a<=s?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 a=Ww(this.domNode.domNode);t=e.pageX-a.left,n=e.pageY-a.top}let s=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),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),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let o=this._sliderOrthogonalPointerPosition(a),c=Math.abs(o-n);if(yb&&c>tC){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let f=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(f))},()=>{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()}},kb=class Wf{constructor(t,n,s,a,o,c){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=o,this._scrollPosition=c,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Wf(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,s,a,o){let c=Math.max(0,s-t),f=Math.max(0,c-2*n),p=a>0&&a>s;if(!p)return{computedAvailableSize:Math.round(c),computedIsNeeded:p,computedSliderSize:Math.round(f),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(s*f/a))),g=(f-h)/(a-s),_=o*g;return{computedAvailableSize:Math.round(c),computedIsNeeded:p,computedSliderSize:Math.round(h),computedSliderRatio:g,computedSliderPosition:Math.round(_)}}_refreshComputedValues(){let t=Wf._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,s=this._scrollPosition;return n<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},iC=class extends Cb{constructor(e,t,n){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new kb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,a.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}},nC=class extends Cb{constructor(e,t,n){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new kb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,a.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}},rC=500,wv=50,sC=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Yf=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,s=1,a=this._rear;do{let o=a===this._front?t:Math.pow(2,-s);if(t-=o,n+=this._memory[a].score*o,a===this._front)break;a=(this._capacity+a-1)%this._capacity,s++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(kd){let n=on(t.browserEvent),s=_w(n);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,s){let a=null,o=new sC(t,n,s);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(a=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]=o),o.score=this._computeScore(o,a)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),n){let a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),c=Math.abs(n.deltaX),f=Math.abs(n.deltaY),p=Math.max(Math.min(a,c),1),h=Math.max(Math.min(o,f),1),g=Math.max(a,c),_=Math.max(o,f);g%p===0&&_%h===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Yf.INSTANCE=new Yf;var lC=Yf,aC=class extends Dd{constructor(e,t,n){super(),this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ue),this.onWillScroll=this._onWillScroll.event,this._options=uC(t),this._scrollable=n,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let s={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new nC(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new iC(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=la(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=la(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=la(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,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new Td),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Yr(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,un&&(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 _v(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Yr(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new _v(n))};this._mouseWheelToDispose.push(xe(this._listenOnDomNode,Dt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var a;if((a=e.browserEvent)!=null&&a.defaultPrevented)return;let t=lC.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,c=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&c+o===0?c=o=0:Math.abs(o)>=Math.abs(c)?c=0:o=0),this._options.flipAxes&&([o,c]=[c,o]);let f=!un&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||f)&&!c&&(c=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(c=c*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let p=this._scrollable.getFutureScrollPosition(),h={};if(o){let g=wv*o,_=p.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(h,_)}if(c){let g=wv*c,_=p.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(h,_)}h=this._scrollable.validateScrollPosition(h),(p.scrollLeft!==h.scrollLeft||p.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),n=!0)}let s=n;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(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,s=n?" left":"",a=t?" top":"",o=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${a}${s}`)}}_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(),rC)}},oC=class extends aC{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 uC(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,un&&(t.className+=" mac"),t}var Vf=class extends De{constructor(e,t,n,s,a,o,c,f){super(),this._bufferService=n,this._optionsService=c,this._renderService=f,this._onRequestScrollLines=this._register(new ue),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let p=this._register(new Gw({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>Ad(s.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{p.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new oC(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},p)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Yt.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(rt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(rt(()=>this._styleElement.remove())),this._register(Yt.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
69
69
  `)})),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}};Vf=ht([fe(2,si),fe(3,zn),fe(4,sb),fe(5,Ks),fe(6,li),fe(7,On)],Vf);var Kf=class extends De{constructor(e,t,n,s,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=s,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(rt(()=>{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 s;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)==null?void 0:s.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()}};Kf=ht([fe(1,si),fe(2,zn),fe(3,ga),fe(4,On)],Kf);var cC=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)}},rn={full:0,left:0,center:0,right:0},cr={full:0,left:0,center:0,right:0},Yl={full:0,left:0,center:0,right:0},uu=class extends De{constructor(e,t,n,s,a,o,c,f){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=s,this._renderService=a,this._optionsService=o,this._themeService=c,this._coreBrowserService=f,this._colorZoneStore=new cC,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(rt(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let p=this._canvas.getContext("2d");if(p)this._ctx=p;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);cr.full=this._canvas.width,cr.left=e,cr.center=t,cr.right=e,this._refreshDrawHeightConstants(),Yl.full=1,Yl.left=1,Yl.center=1+cr.left,Yl.right=1+cr.left+cr.center}_refreshDrawHeightConstants(){rn.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);rn.left=t,rn.center=t,rn.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rn.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rn.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rn.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*rn.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(Yl[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-rn[e.position||"full"]/2),cr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+rn[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}))}};uu=ht([fe(2,si),fe(3,ga),fe(4,On),fe(5,li),fe(6,Ks),fe(7,zn)],uu);var re;(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=`
70
- `,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=""))(re||(re={}));var nu;(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="Ÿ"))(nu||(nu={}));var Eb;(e=>e.ST=`${re.ESC}\\`)(Eb||(Eb={}));var Xf=class{constructor(e,t,n,s,a,o){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=s,this._coreService=a,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let 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(`${re.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,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Xf=ht([fe(2,si),fe(3,li),fe(4,Xr),fe(5,On)],Xf);var Rt=0,Mt=0,Bt=0,ut=0,Cv={css:"#00000000",rgba:0},St;(e=>{function t(a,o,c,f){return f!==void 0?`#${jr(a)}${jr(o)}${jr(c)}${jr(f)}`:`#${jr(a)}${jr(o)}${jr(c)}`}e.toCss=t;function n(a,o,c,f=255){return(a<<24|o<<16|c<<8|f)>>>0}e.toRgba=n;function s(a,o,c,f){return{css:e.toCss(a,o,c,f),rgba:e.toRgba(a,o,c,f)}}e.toColor=s})(St||(St={}));var it;(e=>{function t(p,h){if(ut=(h.rgba&255)/255,ut===1)return{css:h.css,rgba:h.rgba};let g=h.rgba>>24&255,_=h.rgba>>16&255,b=h.rgba>>8&255,y=p.rgba>>24&255,x=p.rgba>>16&255,E=p.rgba>>8&255;Rt=y+Math.round((g-y)*ut),Mt=x+Math.round((_-x)*ut),Bt=E+Math.round((b-E)*ut);let N=St.toCss(Rt,Mt,Bt),M=St.toRgba(Rt,Mt,Bt);return{css:N,rgba:M}}e.blend=t;function n(p){return(p.rgba&255)===255}e.isOpaque=n;function s(p,h,g){let _=ru.ensureContrastRatio(p.rgba,h.rgba,g);if(_)return St.toColor(_>>24&255,_>>16&255,_>>8&255)}e.ensureContrastRatio=s;function a(p){let h=(p.rgba|255)>>>0;return[Rt,Mt,Bt]=ru.toChannels(h),{css:St.toCss(Rt,Mt,Bt),rgba:h}}e.opaque=a;function o(p,h){return ut=Math.round(h*255),[Rt,Mt,Bt]=ru.toChannels(p.rgba),{css:St.toCss(Rt,Mt,Bt,ut),rgba:St.toRgba(Rt,Mt,Bt,ut)}}e.opacity=o;function c(p,h){return ut=p.rgba&255,o(p,ut*h/255)}e.multiplyOpacity=c;function f(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}e.toColorRGB=f})(it||(it={}));var lt;(e=>{let t,n;try{let a=document.createElement("canvas");a.width=1,a.height=1;let o=a.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function s(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Rt=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Bt=parseInt(a.slice(3,4).repeat(2),16),St.toColor(Rt,Mt,Bt);case 5:return Rt=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Bt=parseInt(a.slice(3,4).repeat(2),16),ut=parseInt(a.slice(4,5).repeat(2),16),St.toColor(Rt,Mt,Bt,ut);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let o=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return Rt=parseInt(o[1]),Mt=parseInt(o[2]),Bt=parseInt(o[3]),ut=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),St.toColor(Rt,Mt,Bt,ut);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Rt,Mt,Bt,ut]=t.getImageData(0,0,1,1).data,ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:St.toRgba(Rt,Mt,Bt,ut),css:a}}e.toColor=s})(lt||(lt={}));var ii;(e=>{function t(s){return n(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function n(s,a,o){let c=s/255,f=a/255,p=o/255,h=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),_=p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4);return h*.2126+g*.7152+_*.0722}e.relativeLuminance2=n})(ii||(ii={}));var ru;(e=>{function t(c,f){if(ut=(f&255)/255,ut===1)return f;let p=f>>24&255,h=f>>16&255,g=f>>8&255,_=c>>24&255,b=c>>16&255,y=c>>8&255;return Rt=_+Math.round((p-_)*ut),Mt=b+Math.round((h-b)*ut),Bt=y+Math.round((g-y)*ut),St.toRgba(Rt,Mt,Bt)}e.blend=t;function n(c,f,p){let h=ii.relativeLuminance(c>>8),g=ii.relativeLuminance(f>>8);if(Mn(h,g)<p){if(g<h){let y=s(c,f,p),x=Mn(h,ii.relativeLuminance(y>>8));if(x<p){let E=a(c,f,p),N=Mn(h,ii.relativeLuminance(E>>8));return x>N?y:E}return y}let _=a(c,f,p),b=Mn(h,ii.relativeLuminance(_>>8));if(b<p){let y=s(c,f,p),x=Mn(h,ii.relativeLuminance(y>>8));return b>x?_:y}return _}}e.ensureContrastRatio=n;function s(c,f,p){let h=c>>24&255,g=c>>16&255,_=c>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));for(;E<p&&(b>0||y>0||x>0);)b-=Math.max(0,Math.ceil(b*.1)),y-=Math.max(0,Math.ceil(y*.1)),x-=Math.max(0,Math.ceil(x*.1)),E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));return(b<<24|y<<16|x<<8|255)>>>0}e.reduceLuminance=s;function a(c,f,p){let h=c>>24&255,g=c>>16&255,_=c>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));for(;E<p&&(b<255||y<255||x<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));return(b<<24|y<<16|x<<8|255)>>>0}e.increaseLuminance=a;function o(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=o})(ru||(ru={}));function jr(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Mn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var hC=class extends _a{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()]}},cu=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Vi}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=[],s=t.translateToString(!0),a=0,o=0,c=0,f=t.getFg(0),p=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!==f||this._workCell.bg!==p){if(h-a>1){let g=this._getJoinedRanges(s,c,o,t,a);for(let _=0;_<g.length;_++)n.push(g[_])}a=h,c=o,f=this._workCell.fg,p=this._workCell.bg}o+=this._workCell.getChars().length||mr.length}if(this._bufferService.cols-a>1){let h=this._getJoinedRanges(s,c,o,t,a);for(let g=0;g<h.length;g++)n.push(h[g])}return n}_getJoinedRanges(e,t,n,s,a){let o=e.substring(t,n),c=[];try{c=this._characterJoiners[0].handler(o)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{let p=this._characterJoiners[f].handler(o);for(let h=0;h<p.length;h++)cu._mergeRanges(c,p[h])}catch(p){console.error(p)}return this._stringRangesToCellRanges(c,s,a),c}_stringRangesToCellRanges(e,t,n){let s=0,a=!1,o=0,c=e[s];if(c){for(let f=n;f<this._bufferService.cols;f++){let p=t.getWidth(f),h=t.getString(f).length||mr.length;if(p!==0){if(!a&&c[0]<=o&&(c[0]=f,a=!0),c[1]<=o){if(c[1]=f,c=e[++s],!c)break;c[0]<=o?(c[0]=f,a=!0):a=!1}o+=h}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let s=0;s<e.length;s++){let a=e[s];if(n){if(t[1]<=a[0])return e[s-1][1]=t[1],e;if(t[1]<=a[1])return e[s-1][1]=Math.max(t[1],a[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=a[0])return e.splice(s,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};cu=ht([fe(0,si)],cu);function fC(e){return 57508<=e&&e<=57558}function dC(e){return 9472<=e&&e<=9631}function pC(e){return fC(e)||dC(e)}function mC(){return{css:{canvas:Yo(),cell:Yo()},device:{canvas:Yo(),cell:Yo(),char:{width:0,height:0,left:0,top:0}}}}function Yo(){return{width:0,height:0}}var $f=class{constructor(e,t,n,s,a,o,c){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=s,this._coreService=a,this._decorationService=o,this._themeService=c,this._workCell=new Vi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,s,a,o,c,f,p,h,g){let _=[],b=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,x=e.getNoBgTrimmedLength();n&&x<o+1&&(x=o+1);let E,N=0,M="",G=0,U=0,Q=0,K=0,O=!1,ee=0,oe=!1,de=0,q=0,B=[],D=h!==-1&&g!==-1;for(let j=0;j<x;j++){e.loadCell(j,this._workCell);let P=this._workCell.getWidth();if(P===0)continue;let L=!1,A=j>=q,I=j,Y=this._workCell;if(b.length>0&&j===b[0][0]&&A){let He=b.shift(),yi=this._isCellInSelection(He[0],t);for(G=He[0]+1;G<He[1];G++)A&&(A=yi===this._isCellInSelection(G,t));A&&(A=!n||o<He[0]||o>=He[1]),A?(L=!0,Y=new hC(this._workCell,e.translateToString(!0,He[0],He[1]),He[1]-He[0]),I=He[1]-1,P=Y.getWidth()):q=He[1]}let le=this._isCellInSelection(j,t),k=n&&j===o,T=D&&j>=h&&j<=g,X=!1;this._decorationService.forEachDecorationAtCell(j,t,void 0,He=>{X=!0});let C=Y.getChars()||mr;if(C===" "&&(Y.isUnderline()||Y.isOverline())&&(C=" "),de=P*f-p.get(C,Y.isBold(),Y.isItalic()),!E)E=this._document.createElement("span");else if(N&&(le&&oe||!le&&!oe&&Y.bg===U)&&(le&&oe&&y.selectionForeground||Y.fg===Q)&&Y.extended.ext===K&&T===O&&de===ee&&!k&&!L&&!X&&A){Y.isInvisible()?M+=mr:M+=C,N++;continue}else N&&(E.textContent=M),E=this._document.createElement("span"),N=0,M="";if(U=Y.bg,Q=Y.fg,K=Y.extended.ext,O=T,ee=de,oe=le,L&&o>=j&&o<=I&&(o=j),!this._coreService.isCursorHidden&&k&&this._coreService.isCursorInitialized){if(B.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&B.push("xterm-cursor-blink"),B.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":B.push("xterm-cursor-outline");break;case"block":B.push("xterm-cursor-block");break;case"bar":B.push("xterm-cursor-bar");break;case"underline":B.push("xterm-cursor-underline");break}}if(Y.isBold()&&B.push("xterm-bold"),Y.isItalic()&&B.push("xterm-italic"),Y.isDim()&&B.push("xterm-dim"),Y.isInvisible()?M=mr:M=Y.getChars()||mr,Y.isUnderline()&&(B.push(`xterm-underline-${Y.extended.underlineStyle}`),M===" "&&(M=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${_a.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let He=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&He<8&&(He+=8),E.style.textDecorationColor=y.ansi[He].css}Y.isOverline()&&(B.push("xterm-overline"),M===" "&&(M=" ")),Y.isStrikethrough()&&B.push("xterm-strikethrough"),T&&(E.style.textDecoration="underline");let se=Y.getFgColor(),pe=Y.getFgColorMode(),he=Y.getBgColor(),be=Y.getBgColorMode(),Te=!!Y.isInverse();if(Te){let He=se;se=he,he=He;let yi=pe;pe=be,be=yi}let Re,jt,Zt=!1;this._decorationService.forEachDecorationAtCell(j,t,void 0,He=>{He.options.layer!=="top"&&Zt||(He.backgroundColorRGB&&(be=50331648,he=He.backgroundColorRGB.rgba>>8&16777215,Re=He.backgroundColorRGB),He.foregroundColorRGB&&(pe=50331648,se=He.foregroundColorRGB.rgba>>8&16777215,jt=He.foregroundColorRGB),Zt=He.options.layer==="top")}),!Zt&&le&&(Re=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,he=Re.rgba>>8&16777215,be=50331648,Zt=!0,y.selectionForeground&&(pe=50331648,se=y.selectionForeground.rgba>>8&16777215,jt=y.selectionForeground)),Zt&&B.push("xterm-decoration-top");let ai;switch(be){case 16777216:case 33554432:ai=y.ansi[he],B.push(`xterm-bg-${he}`);break;case 50331648:ai=St.toColor(he>>16,he>>8&255,he&255),this._addStyle(E,`background-color:#${kv((he>>>0).toString(16),"0",6)}`);break;case 0:default:Te?(ai=y.foreground,B.push("xterm-bg-257")):ai=y.background}switch(Re||Y.isDim()&&(Re=it.multiplyOpacity(ai,.5)),pe){case 16777216:case 33554432:Y.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(E,ai,y.ansi[se],Y,Re,void 0)||B.push(`xterm-fg-${se}`);break;case 50331648:let He=St.toColor(se>>16&255,se>>8&255,se&255);this._applyMinimumContrast(E,ai,He,Y,Re,jt)||this._addStyle(E,`color:#${kv(se.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(E,ai,y.foreground,Y,Re,jt)||Te&&B.push("xterm-fg-257")}B.length&&(E.className=B.join(" "),B.length=0),!k&&!L&&!X&&A?N++:E.textContent=M,de!==this.defaultSpacing&&(E.style.letterSpacing=`${de}px`),_.push(E),j=I}return E&&N&&(E.textContent=M),_}_applyMinimumContrast(e,t,n,s,a,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||pC(s.getCode()))return!1;let c=this._getContrastCache(s),f;if(!a&&!o&&(f=c.getColor(t.rgba,n.rgba)),f===void 0){let p=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);f=it.ensureContrastRatio(a||t,o||n,p),c.setColor((a||t).rgba,(o||n).rgba,f??null)}return f?(this._addStyle(e,`color:${f.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,s=this._selectionEnd;return!n||!s?!1:this._columnSelectMode?n[0]<=s[0]?e>=n[0]&&t>=n[1]&&e<s[0]&&t<=s[1]:e<n[0]&&t>=n[1]&&e>=s[0]&&t<=s[1]:t>n[1]&&t<s[1]||n[1]===s[1]&&t===n[1]&&e>=n[0]&&e<s[0]||n[1]<s[1]&&t===s[1]&&e<s[0]||n[1]<s[1]&&t===n[1]&&e>=n[0]}};$f=ht([fe(1,ob),fe(2,li),fe(3,zn),fe(4,Xr),fe(5,ga),fe(6,Ks)],$f);function kv(e,t,n){for(;e.length<n;)e=t+e;return e}var _C=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 s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,s,a,o],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(a),this._container.appendChild(o),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,s){e===this._font&&t===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,n){let s=0;if(!t&&!n&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let c=this._measure(e,0);return c>0&&(this._flat[s]=c),c}let a=e;t&&(a+="B"),n&&(a+="I");let o=this._holey.get(a);if(o===void 0){let c=0;t&&(c|=1),n&&(c|=2),o=this._measure(e,c),o>0&&this._holey.set(a,o)}return o}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},gC=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,s=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let a=e.buffers.active.ydisp,o=t[1]-a,c=n[1]-a,f=Math.max(o,0),p=Math.min(c,e.rows-1);if(f>=e.rows||p<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=o,this.viewportEndRow=c,this.viewportCappedStartRow=f,this.viewportCappedEndRow=p,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 vC(){return new gC}var Jh="xterm-dom-renderer-owner-",Fi="xterm-rows",Vo="xterm-fg-",Ev="xterm-bg-",Vl="xterm-focus",Ko="xterm-selection",yC=1,Gf=class extends De{constructor(e,t,n,s,a,o,c,f,p,h,g,_,b,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=s,this._viewportElement=a,this._helperContainer=o,this._linkifier2=c,this._charSizeService=p,this._optionsService=h,this._bufferService=g,this._coreService=_,this._coreBrowserService=b,this._themeService=y,this._terminalClass=yC++,this._rowElements=[],this._selectionRenderModel=vC(),this.onRequestRedraw=this._register(new ue).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Fi),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(Ko),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=mC(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(x=>this._injectCss(x))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance($f,document),this._element.classList.add(Jh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(x=>this._handleLinkHover(x))),this._register(this._linkifier2.onHideLinkUnderline(x=>this._handleLinkLeave(x))),this._register(rt(()=>{this._element.classList.remove(Jh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _C(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} .${Fi} 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} .${Fi} { 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} .${Fi} .xterm-dim { color: ${it.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}`,s=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Fi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Fi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Fi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Ko} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ko} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ko} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,c]of e.ansi.entries())t+=`${this._terminalSelector} .${Vo}${o} { color: ${c.css}; }${this._terminalSelector} .${Vo}${o}.xterm-dim { color: ${it.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${Ev}${o} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${Vo}257 { color: ${it.opaque(e.background).css}; }${this._terminalSelector} .${Vo}257.xterm-dim { color: ${it.multiplyOpacity(it.opaque(e.background),.5).css}; }${this._terminalSelector} .${Ev}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 s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}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(Vl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Vl),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 s=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,c=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(n){let p=e[0]>t[0];f.appendChild(this._createSelectionElement(o,p?t[0]:e[0],p?e[0]:t[0],c-o+1))}else{let p=s===o?e[0]:0,h=o===a?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(o,p,h));let g=c-o-1;if(f.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,g)),o!==c){let _=a===c?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(c,0,_))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,t,n,s=1){let a=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,c=this.dimensions.css.cell.width*(n-t);return o+c>this.dimensions.css.canvas.width&&(c=this.dimensions.css.canvas.width-o),a.style.height=`${s*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${o}px`,a.style.width=`${c}px`,a}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,s=n.ybase+n.y,a=Math.min(n.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,c=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let p=e;p<=t;p++){let h=p+n.ydisp,g=this._rowElements[p],_=n.lines.get(h);if(!g||!_)break;g.replaceChildren(...this._rowFactory.createRow(_,h,h===s,c,f,a,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Jh}${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,s,a,o){n<0&&(e=0),s<0&&(t=0);let c=this._bufferService.rows-1;n=Math.max(Math.min(n,c),0),s=Math.max(Math.min(s,c),0),a=Math.min(a,this._bufferService.cols);let f=this._bufferService.buffer,p=f.ybase+f.y,h=Math.min(f.x,a-1),g=this._optionsService.rawOptions.cursorBlink,_=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=s;++y){let x=y+f.ydisp,E=this._rowElements[y],N=f.lines.get(x);if(!E||!N)break;E.replaceChildren(...this._rowFactory.createRow(N,x,x===p,_,b,h,g,this.dimensions.css.cell.width,this._widthCache,o?y===n?e:0:-1,o?(y===s?t:a)-1:-1))}}};Gf=ht([fe(7,xd),fe(8,yu),fe(9,li),fe(10,si),fe(11,Xr),fe(12,zn),fe(13,Ks)],Gf);var Zf=class extends De{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ue),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new SC(this._optionsService))}catch{this._measureStrategy=this._register(new bC(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())}};Zf=ht([fe(2,li)],Zf);var Tb=class extends De{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)}},bC=class extends Tb{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}},SC=class extends Tb{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}},xC=class extends De{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 wC(this._window)),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ue),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Yt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(xe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(xe(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}},wC=class extends De{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ys),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(rt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=xe(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)}},CC=class extends De{constructor(){super(),this.linkProviders=[],this._register(rt(()=>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 Rd(e,t,n){let s=n.getBoundingClientRect(),a=e.getComputedStyle(n),o=parseInt(a.getPropertyValue("padding-left")),c=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-s.left-o,t.clientY-s.top-c]}function kC(e,t,n,s,a,o,c,f,p){if(!o)return;let h=Rd(e,t,n);if(h)return h[0]=Math.ceil((h[0]+(p?c/2:0))/c),h[1]=Math.ceil(h[1]/f),h[0]=Math.min(Math.max(h[0],1),s+(p?1:0)),h[1]=Math.min(Math.max(h[1],1),a),h}var Qf=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,s,a){return kC(window,e,t,n,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let n=Rd(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])}}};Qf=ht([fe(0,On),fe(1,yu)],Qf);var EC=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=[]}},Ab={};Ox(Ab,{getSafariVersion:()=>AC,isChromeOS:()=>Bb,isFirefox:()=>Db,isIpad:()=>DC,isIphone:()=>RC,isLegacyEdge:()=>TC,isLinux:()=>Md,isMac:()=>hu,isNode:()=>bu,isSafari:()=>Rb,isWindows:()=>Mb});var bu=typeof process<"u"&&"title"in process,va=bu?"node":navigator.userAgent,ya=bu?"node":navigator.platform,Db=va.includes("Firefox"),TC=va.includes("Edge"),Rb=/^((?!chrome|android).)*safari/i.test(va);function AC(){if(!Rb)return 0;let e=va.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var hu=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(ya),DC=ya==="iPad",RC=ya==="iPhone",Mb=["Windows","Win16","Win32","WinCE"].includes(ya),Md=ya.indexOf("Linux")>=0,Bb=/\bCrOS\b/.test(va),Nb=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,s=e.timeRemaining(),a=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),a=e.timeRemaining(),n*1.5>a){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=a}this.clear()}},MC=class extends Nb{_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())}}},BC=class extends Nb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},fu=!bu&&"requestIdleCallback"in window?BC:MC,NC=class{constructor(){this._queue=new fu}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Jf=class extends De{constructor(e,t,n,s,a,o,c,f,p){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=s,this._coreService=a,this._coreBrowserService=f,this._renderer=this._register(new Ys),this._pausedResizeTask=new NC,this._observerDisposable=this._register(new Ys),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 ue),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ue),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ue),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ue),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new EC((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new LC(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(rt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(c.onResize(()=>this._fullRefresh())),this._register(c.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(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(c.buffer.y,c.buffer.y,!0))),this._register(p.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(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=rt(()=>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 s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.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 s;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(s=this._renderer.value)==null||s.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Jf=ht([fe(2,li),fe(3,yu),fe(4,Xr),fe(5,ga),fe(6,si),fe(7,zn),fe(8,Ks)],Jf);var LC=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 zC(e,t,n,s){let a=n.buffer.x,o=n.buffer.y;if(!n.buffer.hasScrollback)return HC(a,o,e,t,n,s)+Su(o,t,n,s)+UC(a,o,e,t,n,s);let c;if(o===t)return c=a>e?"D":"C",ha(Math.abs(a-e),ca(c,s));c=o>t?"D":"C";let f=Math.abs(o-t),p=jC(o>t?e:a,n)+(f-1)*n.cols+1+OC(o>t?a:e);return ha(p,ca(c,s))}function OC(e,t){return e-1}function jC(e,t){return t.cols-e}function HC(e,t,n,s,a,o){return Su(t,s,a,o).length===0?"":ha(zb(e,t,e,t-Vr(t,a),!1,a).length,ca("D",o))}function Su(e,t,n,s){let a=e-Vr(e,n),o=t-Vr(t,n),c=Math.abs(a-o)-PC(e,t,n);return ha(c,ca(Lb(e,t),s))}function UC(e,t,n,s,a,o){let c;Su(t,s,a,o).length>0?c=s-Vr(s,a):c=t;let f=s,p=IC(e,t,n,s,a,o);return ha(zb(e,c,n,f,p==="C",a).length,ca(p,o))}function PC(e,t,n){var c;let s=0,a=e-Vr(e,n),o=t-Vr(t,n);for(let f=0;f<Math.abs(a-o);f++){let p=Lb(e,t)==="A"?-1:1;(c=n.buffer.lines.get(a+p*f))!=null&&c.isWrapped&&s++}return s}function Vr(e,t){let n=0,s=t.buffer.lines.get(e),a=s==null?void 0:s.isWrapped;for(;a&&e>=0&&e<t.rows;)n++,s=t.buffer.lines.get(--e),a=s==null?void 0:s.isWrapped;return n}function IC(e,t,n,s,a,o){let c;return Su(n,s,a,o).length>0?c=s-Vr(s,a):c=t,e<n&&c<=s||e>=n&&c<s?"C":"D"}function Lb(e,t){return e>t?"A":"B"}function zb(e,t,n,s,a,o){let c=e,f=t,p="";for(;(c!==n||f!==s)&&f>=0&&f<o.buffer.lines.length;)c+=a?1:-1,a&&c>o.cols-1?(p+=o.buffer.translateBufferLineToString(f,!1,e,c),c=0,e=0,f++):!a&&c<0&&(p+=o.buffer.translateBufferLineToString(f,!1,0,e+1),c=o.cols-1,e=c,f--);return p+o.buffer.translateBufferLineToString(f,!1,e,c)}function ca(e,t){let n=t?"O":"[";return re.ESC+n+e}function ha(e,t){e=Math.floor(e);let n="";for(let s=0;s<e;s++)n+=t;return n}var FC=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 Tv(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 ef=50,qC=15,WC=50,YC=500,VC=" ",KC=new RegExp(VC,"g"),ed=class extends De{constructor(e,t,n,s,a,o,c,f,p){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=s,this._coreService=a,this._mouseService=o,this._optionsService=c,this._renderService=f,this._coreBrowserService=p,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Vi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ue),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ue),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ue),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ue),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 FC(this._bufferService),this._activeSelectionMode=0,this._register(rt(()=>{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,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],o=e[0]<t[0]?t[0]:e[0];for(let c=e[1];c<=t[1];c++){let f=n.translateBufferLineToString(c,!0,a,o);s.push(f)}}else{let a=e[1]===t[1]?t[0]:void 0;s.push(n.translateBufferLineToString(e[1],!0,e[0],a));for(let o=e[1]+1;o<=t[1]-1;o++){let c=n.lines.get(o),f=n.translateBufferLineToString(o,!0);c!=null&&c.isWrapped?s[s.length-1]+=f:s.push(f)}if(e[1]!==t[1]){let o=n.lines.get(t[1]),c=n.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?s[s.length-1]+=c:s.push(c)}}return s.map(a=>a.replace(KC," ")).join(Mb?`\r
70
+ `,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=""))(re||(re={}));var nu;(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="Ÿ"))(nu||(nu={}));var Eb;(e=>e.ST=`${re.ESC}\\`)(Eb||(Eb={}));var Xf=class{constructor(e,t,n,s,a,o){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=s,this._coreService=a,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let 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(`${re.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,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Xf=ht([fe(2,si),fe(3,li),fe(4,Xr),fe(5,On)],Xf);var Rt=0,Mt=0,Bt=0,ut=0,Cv={css:"#00000000",rgba:0},St;(e=>{function t(a,o,c,f){return f!==void 0?`#${jr(a)}${jr(o)}${jr(c)}${jr(f)}`:`#${jr(a)}${jr(o)}${jr(c)}`}e.toCss=t;function n(a,o,c,f=255){return(a<<24|o<<16|c<<8|f)>>>0}e.toRgba=n;function s(a,o,c,f){return{css:e.toCss(a,o,c,f),rgba:e.toRgba(a,o,c,f)}}e.toColor=s})(St||(St={}));var it;(e=>{function t(p,h){if(ut=(h.rgba&255)/255,ut===1)return{css:h.css,rgba:h.rgba};let g=h.rgba>>24&255,_=h.rgba>>16&255,b=h.rgba>>8&255,y=p.rgba>>24&255,x=p.rgba>>16&255,E=p.rgba>>8&255;Rt=y+Math.round((g-y)*ut),Mt=x+Math.round((_-x)*ut),Bt=E+Math.round((b-E)*ut);let N=St.toCss(Rt,Mt,Bt),M=St.toRgba(Rt,Mt,Bt);return{css:N,rgba:M}}e.blend=t;function n(p){return(p.rgba&255)===255}e.isOpaque=n;function s(p,h,g){let _=ru.ensureContrastRatio(p.rgba,h.rgba,g);if(_)return St.toColor(_>>24&255,_>>16&255,_>>8&255)}e.ensureContrastRatio=s;function a(p){let h=(p.rgba|255)>>>0;return[Rt,Mt,Bt]=ru.toChannels(h),{css:St.toCss(Rt,Mt,Bt),rgba:h}}e.opaque=a;function o(p,h){return ut=Math.round(h*255),[Rt,Mt,Bt]=ru.toChannels(p.rgba),{css:St.toCss(Rt,Mt,Bt,ut),rgba:St.toRgba(Rt,Mt,Bt,ut)}}e.opacity=o;function c(p,h){return ut=p.rgba&255,o(p,ut*h/255)}e.multiplyOpacity=c;function f(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}e.toColorRGB=f})(it||(it={}));var lt;(e=>{let t,n;try{let a=document.createElement("canvas");a.width=1,a.height=1;let o=a.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function s(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Rt=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Bt=parseInt(a.slice(3,4).repeat(2),16),St.toColor(Rt,Mt,Bt);case 5:return Rt=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Bt=parseInt(a.slice(3,4).repeat(2),16),ut=parseInt(a.slice(4,5).repeat(2),16),St.toColor(Rt,Mt,Bt,ut);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let o=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return Rt=parseInt(o[1]),Mt=parseInt(o[2]),Bt=parseInt(o[3]),ut=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),St.toColor(Rt,Mt,Bt,ut);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Rt,Mt,Bt,ut]=t.getImageData(0,0,1,1).data,ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:St.toRgba(Rt,Mt,Bt,ut),css:a}}e.toColor=s})(lt||(lt={}));var ii;(e=>{function t(s){return n(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function n(s,a,o){let c=s/255,f=a/255,p=o/255,h=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),_=p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4);return h*.2126+g*.7152+_*.0722}e.relativeLuminance2=n})(ii||(ii={}));var ru;(e=>{function t(c,f){if(ut=(f&255)/255,ut===1)return f;let p=f>>24&255,h=f>>16&255,g=f>>8&255,_=c>>24&255,b=c>>16&255,y=c>>8&255;return Rt=_+Math.round((p-_)*ut),Mt=b+Math.round((h-b)*ut),Bt=y+Math.round((g-y)*ut),St.toRgba(Rt,Mt,Bt)}e.blend=t;function n(c,f,p){let h=ii.relativeLuminance(c>>8),g=ii.relativeLuminance(f>>8);if(Mn(h,g)<p){if(g<h){let y=s(c,f,p),x=Mn(h,ii.relativeLuminance(y>>8));if(x<p){let E=a(c,f,p),N=Mn(h,ii.relativeLuminance(E>>8));return x>N?y:E}return y}let _=a(c,f,p),b=Mn(h,ii.relativeLuminance(_>>8));if(b<p){let y=s(c,f,p),x=Mn(h,ii.relativeLuminance(y>>8));return b>x?_:y}return _}}e.ensureContrastRatio=n;function s(c,f,p){let h=c>>24&255,g=c>>16&255,_=c>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));for(;E<p&&(b>0||y>0||x>0);)b-=Math.max(0,Math.ceil(b*.1)),y-=Math.max(0,Math.ceil(y*.1)),x-=Math.max(0,Math.ceil(x*.1)),E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));return(b<<24|y<<16|x<<8|255)>>>0}e.reduceLuminance=s;function a(c,f,p){let h=c>>24&255,g=c>>16&255,_=c>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));for(;E<p&&(b<255||y<255||x<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),E=Mn(ii.relativeLuminance2(b,y,x),ii.relativeLuminance2(h,g,_));return(b<<24|y<<16|x<<8|255)>>>0}e.increaseLuminance=a;function o(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=o})(ru||(ru={}));function jr(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Mn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var hC=class extends _a{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()]}},cu=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Vi}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=[],s=t.translateToString(!0),a=0,o=0,c=0,f=t.getFg(0),p=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!==f||this._workCell.bg!==p){if(h-a>1){let g=this._getJoinedRanges(s,c,o,t,a);for(let _=0;_<g.length;_++)n.push(g[_])}a=h,c=o,f=this._workCell.fg,p=this._workCell.bg}o+=this._workCell.getChars().length||mr.length}if(this._bufferService.cols-a>1){let h=this._getJoinedRanges(s,c,o,t,a);for(let g=0;g<h.length;g++)n.push(h[g])}return n}_getJoinedRanges(e,t,n,s,a){let o=e.substring(t,n),c=[];try{c=this._characterJoiners[0].handler(o)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{let p=this._characterJoiners[f].handler(o);for(let h=0;h<p.length;h++)cu._mergeRanges(c,p[h])}catch(p){console.error(p)}return this._stringRangesToCellRanges(c,s,a),c}_stringRangesToCellRanges(e,t,n){let s=0,a=!1,o=0,c=e[s];if(c){for(let f=n;f<this._bufferService.cols;f++){let p=t.getWidth(f),h=t.getString(f).length||mr.length;if(p!==0){if(!a&&c[0]<=o&&(c[0]=f,a=!0),c[1]<=o){if(c[1]=f,c=e[++s],!c)break;c[0]<=o?(c[0]=f,a=!0):a=!1}o+=h}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let s=0;s<e.length;s++){let a=e[s];if(n){if(t[1]<=a[0])return e[s-1][1]=t[1],e;if(t[1]<=a[1])return e[s-1][1]=Math.max(t[1],a[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=a[0])return e.splice(s,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};cu=ht([fe(0,si)],cu);function fC(e){return 57508<=e&&e<=57558}function dC(e){return 9472<=e&&e<=9631}function pC(e){return fC(e)||dC(e)}function mC(){return{css:{canvas:Yo(),cell:Yo()},device:{canvas:Yo(),cell:Yo(),char:{width:0,height:0,left:0,top:0}}}}function Yo(){return{width:0,height:0}}var $f=class{constructor(e,t,n,s,a,o,c){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=s,this._coreService=a,this._decorationService=o,this._themeService=c,this._workCell=new Vi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,s,a,o,c,f,p,h,g){let _=[],b=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,x=e.getNoBgTrimmedLength();n&&x<o+1&&(x=o+1);let E,N=0,M="",G=0,U=0,Q=0,K=0,O=!1,ee=0,oe=!1,de=0,F=0,B=[],D=h!==-1&&g!==-1;for(let j=0;j<x;j++){e.loadCell(j,this._workCell);let P=this._workCell.getWidth();if(P===0)continue;let L=!1,A=j>=F,I=j,Y=this._workCell;if(b.length>0&&j===b[0][0]&&A){let He=b.shift(),yi=this._isCellInSelection(He[0],t);for(G=He[0]+1;G<He[1];G++)A&&(A=yi===this._isCellInSelection(G,t));A&&(A=!n||o<He[0]||o>=He[1]),A?(L=!0,Y=new hC(this._workCell,e.translateToString(!0,He[0],He[1]),He[1]-He[0]),I=He[1]-1,P=Y.getWidth()):F=He[1]}let le=this._isCellInSelection(j,t),k=n&&j===o,T=D&&j>=h&&j<=g,X=!1;this._decorationService.forEachDecorationAtCell(j,t,void 0,He=>{X=!0});let C=Y.getChars()||mr;if(C===" "&&(Y.isUnderline()||Y.isOverline())&&(C=" "),de=P*f-p.get(C,Y.isBold(),Y.isItalic()),!E)E=this._document.createElement("span");else if(N&&(le&&oe||!le&&!oe&&Y.bg===U)&&(le&&oe&&y.selectionForeground||Y.fg===Q)&&Y.extended.ext===K&&T===O&&de===ee&&!k&&!L&&!X&&A){Y.isInvisible()?M+=mr:M+=C,N++;continue}else N&&(E.textContent=M),E=this._document.createElement("span"),N=0,M="";if(U=Y.bg,Q=Y.fg,K=Y.extended.ext,O=T,ee=de,oe=le,L&&o>=j&&o<=I&&(o=j),!this._coreService.isCursorHidden&&k&&this._coreService.isCursorInitialized){if(B.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&B.push("xterm-cursor-blink"),B.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":B.push("xterm-cursor-outline");break;case"block":B.push("xterm-cursor-block");break;case"bar":B.push("xterm-cursor-bar");break;case"underline":B.push("xterm-cursor-underline");break}}if(Y.isBold()&&B.push("xterm-bold"),Y.isItalic()&&B.push("xterm-italic"),Y.isDim()&&B.push("xterm-dim"),Y.isInvisible()?M=mr:M=Y.getChars()||mr,Y.isUnderline()&&(B.push(`xterm-underline-${Y.extended.underlineStyle}`),M===" "&&(M=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${_a.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let He=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&He<8&&(He+=8),E.style.textDecorationColor=y.ansi[He].css}Y.isOverline()&&(B.push("xterm-overline"),M===" "&&(M=" ")),Y.isStrikethrough()&&B.push("xterm-strikethrough"),T&&(E.style.textDecoration="underline");let se=Y.getFgColor(),pe=Y.getFgColorMode(),he=Y.getBgColor(),be=Y.getBgColorMode(),Te=!!Y.isInverse();if(Te){let He=se;se=he,he=He;let yi=pe;pe=be,be=yi}let Re,jt,Zt=!1;this._decorationService.forEachDecorationAtCell(j,t,void 0,He=>{He.options.layer!=="top"&&Zt||(He.backgroundColorRGB&&(be=50331648,he=He.backgroundColorRGB.rgba>>8&16777215,Re=He.backgroundColorRGB),He.foregroundColorRGB&&(pe=50331648,se=He.foregroundColorRGB.rgba>>8&16777215,jt=He.foregroundColorRGB),Zt=He.options.layer==="top")}),!Zt&&le&&(Re=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,he=Re.rgba>>8&16777215,be=50331648,Zt=!0,y.selectionForeground&&(pe=50331648,se=y.selectionForeground.rgba>>8&16777215,jt=y.selectionForeground)),Zt&&B.push("xterm-decoration-top");let ai;switch(be){case 16777216:case 33554432:ai=y.ansi[he],B.push(`xterm-bg-${he}`);break;case 50331648:ai=St.toColor(he>>16,he>>8&255,he&255),this._addStyle(E,`background-color:#${kv((he>>>0).toString(16),"0",6)}`);break;case 0:default:Te?(ai=y.foreground,B.push("xterm-bg-257")):ai=y.background}switch(Re||Y.isDim()&&(Re=it.multiplyOpacity(ai,.5)),pe){case 16777216:case 33554432:Y.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(E,ai,y.ansi[se],Y,Re,void 0)||B.push(`xterm-fg-${se}`);break;case 50331648:let He=St.toColor(se>>16&255,se>>8&255,se&255);this._applyMinimumContrast(E,ai,He,Y,Re,jt)||this._addStyle(E,`color:#${kv(se.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(E,ai,y.foreground,Y,Re,jt)||Te&&B.push("xterm-fg-257")}B.length&&(E.className=B.join(" "),B.length=0),!k&&!L&&!X&&A?N++:E.textContent=M,de!==this.defaultSpacing&&(E.style.letterSpacing=`${de}px`),_.push(E),j=I}return E&&N&&(E.textContent=M),_}_applyMinimumContrast(e,t,n,s,a,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||pC(s.getCode()))return!1;let c=this._getContrastCache(s),f;if(!a&&!o&&(f=c.getColor(t.rgba,n.rgba)),f===void 0){let p=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);f=it.ensureContrastRatio(a||t,o||n,p),c.setColor((a||t).rgba,(o||n).rgba,f??null)}return f?(this._addStyle(e,`color:${f.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,s=this._selectionEnd;return!n||!s?!1:this._columnSelectMode?n[0]<=s[0]?e>=n[0]&&t>=n[1]&&e<s[0]&&t<=s[1]:e<n[0]&&t>=n[1]&&e>=s[0]&&t<=s[1]:t>n[1]&&t<s[1]||n[1]===s[1]&&t===n[1]&&e>=n[0]&&e<s[0]||n[1]<s[1]&&t===s[1]&&e<s[0]||n[1]<s[1]&&t===n[1]&&e>=n[0]}};$f=ht([fe(1,ob),fe(2,li),fe(3,zn),fe(4,Xr),fe(5,ga),fe(6,Ks)],$f);function kv(e,t,n){for(;e.length<n;)e=t+e;return e}var _C=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 s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,s,a,o],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(a),this._container.appendChild(o),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,s){e===this._font&&t===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,n){let s=0;if(!t&&!n&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let c=this._measure(e,0);return c>0&&(this._flat[s]=c),c}let a=e;t&&(a+="B"),n&&(a+="I");let o=this._holey.get(a);if(o===void 0){let c=0;t&&(c|=1),n&&(c|=2),o=this._measure(e,c),o>0&&this._holey.set(a,o)}return o}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},gC=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,s=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let a=e.buffers.active.ydisp,o=t[1]-a,c=n[1]-a,f=Math.max(o,0),p=Math.min(c,e.rows-1);if(f>=e.rows||p<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=o,this.viewportEndRow=c,this.viewportCappedStartRow=f,this.viewportCappedEndRow=p,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 vC(){return new gC}var Jh="xterm-dom-renderer-owner-",Fi="xterm-rows",Vo="xterm-fg-",Ev="xterm-bg-",Vl="xterm-focus",Ko="xterm-selection",yC=1,Gf=class extends De{constructor(e,t,n,s,a,o,c,f,p,h,g,_,b,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=s,this._viewportElement=a,this._helperContainer=o,this._linkifier2=c,this._charSizeService=p,this._optionsService=h,this._bufferService=g,this._coreService=_,this._coreBrowserService=b,this._themeService=y,this._terminalClass=yC++,this._rowElements=[],this._selectionRenderModel=vC(),this.onRequestRedraw=this._register(new ue).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Fi),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(Ko),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=mC(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(x=>this._injectCss(x))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance($f,document),this._element.classList.add(Jh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(x=>this._handleLinkHover(x))),this._register(this._linkifier2.onHideLinkUnderline(x=>this._handleLinkLeave(x))),this._register(rt(()=>{this._element.classList.remove(Jh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _C(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} .${Fi} 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} .${Fi} { 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} .${Fi} .xterm-dim { color: ${it.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}`,s=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Fi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Fi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Fi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Fi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Ko} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ko} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ko} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,c]of e.ansi.entries())t+=`${this._terminalSelector} .${Vo}${o} { color: ${c.css}; }${this._terminalSelector} .${Vo}${o}.xterm-dim { color: ${it.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${Ev}${o} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${Vo}257 { color: ${it.opaque(e.background).css}; }${this._terminalSelector} .${Vo}257.xterm-dim { color: ${it.multiplyOpacity(it.opaque(e.background),.5).css}; }${this._terminalSelector} .${Ev}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 s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}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(Vl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Vl),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 s=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,c=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(n){let p=e[0]>t[0];f.appendChild(this._createSelectionElement(o,p?t[0]:e[0],p?e[0]:t[0],c-o+1))}else{let p=s===o?e[0]:0,h=o===a?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(o,p,h));let g=c-o-1;if(f.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,g)),o!==c){let _=a===c?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(c,0,_))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,t,n,s=1){let a=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,c=this.dimensions.css.cell.width*(n-t);return o+c>this.dimensions.css.canvas.width&&(c=this.dimensions.css.canvas.width-o),a.style.height=`${s*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${o}px`,a.style.width=`${c}px`,a}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,s=n.ybase+n.y,a=Math.min(n.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,c=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let p=e;p<=t;p++){let h=p+n.ydisp,g=this._rowElements[p],_=n.lines.get(h);if(!g||!_)break;g.replaceChildren(...this._rowFactory.createRow(_,h,h===s,c,f,a,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Jh}${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,s,a,o){n<0&&(e=0),s<0&&(t=0);let c=this._bufferService.rows-1;n=Math.max(Math.min(n,c),0),s=Math.max(Math.min(s,c),0),a=Math.min(a,this._bufferService.cols);let f=this._bufferService.buffer,p=f.ybase+f.y,h=Math.min(f.x,a-1),g=this._optionsService.rawOptions.cursorBlink,_=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=s;++y){let x=y+f.ydisp,E=this._rowElements[y],N=f.lines.get(x);if(!E||!N)break;E.replaceChildren(...this._rowFactory.createRow(N,x,x===p,_,b,h,g,this.dimensions.css.cell.width,this._widthCache,o?y===n?e:0:-1,o?(y===s?t:a)-1:-1))}}};Gf=ht([fe(7,xd),fe(8,yu),fe(9,li),fe(10,si),fe(11,Xr),fe(12,zn),fe(13,Ks)],Gf);var Zf=class extends De{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ue),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new SC(this._optionsService))}catch{this._measureStrategy=this._register(new bC(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())}};Zf=ht([fe(2,li)],Zf);var Tb=class extends De{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)}},bC=class extends Tb{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}},SC=class extends Tb{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}},xC=class extends De{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 wC(this._window)),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ue),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Yt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(xe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(xe(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}},wC=class extends De{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ys),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(rt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=xe(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)}},CC=class extends De{constructor(){super(),this.linkProviders=[],this._register(rt(()=>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 Rd(e,t,n){let s=n.getBoundingClientRect(),a=e.getComputedStyle(n),o=parseInt(a.getPropertyValue("padding-left")),c=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-s.left-o,t.clientY-s.top-c]}function kC(e,t,n,s,a,o,c,f,p){if(!o)return;let h=Rd(e,t,n);if(h)return h[0]=Math.ceil((h[0]+(p?c/2:0))/c),h[1]=Math.ceil(h[1]/f),h[0]=Math.min(Math.max(h[0],1),s+(p?1:0)),h[1]=Math.min(Math.max(h[1],1),a),h}var Qf=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,s,a){return kC(window,e,t,n,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let n=Rd(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])}}};Qf=ht([fe(0,On),fe(1,yu)],Qf);var EC=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=[]}},Ab={};Ox(Ab,{getSafariVersion:()=>AC,isChromeOS:()=>Bb,isFirefox:()=>Db,isIpad:()=>DC,isIphone:()=>RC,isLegacyEdge:()=>TC,isLinux:()=>Md,isMac:()=>hu,isNode:()=>bu,isSafari:()=>Rb,isWindows:()=>Mb});var bu=typeof process<"u"&&"title"in process,va=bu?"node":navigator.userAgent,ya=bu?"node":navigator.platform,Db=va.includes("Firefox"),TC=va.includes("Edge"),Rb=/^((?!chrome|android).)*safari/i.test(va);function AC(){if(!Rb)return 0;let e=va.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var hu=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(ya),DC=ya==="iPad",RC=ya==="iPhone",Mb=["Windows","Win16","Win32","WinCE"].includes(ya),Md=ya.indexOf("Linux")>=0,Bb=/\bCrOS\b/.test(va),Nb=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,s=e.timeRemaining(),a=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),a=e.timeRemaining(),n*1.5>a){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=a}this.clear()}},MC=class extends Nb{_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())}}},BC=class extends Nb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},fu=!bu&&"requestIdleCallback"in window?BC:MC,NC=class{constructor(){this._queue=new fu}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Jf=class extends De{constructor(e,t,n,s,a,o,c,f,p){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=s,this._coreService=a,this._coreBrowserService=f,this._renderer=this._register(new Ys),this._pausedResizeTask=new NC,this._observerDisposable=this._register(new Ys),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 ue),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ue),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ue),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ue),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new EC((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new LC(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(rt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(c.onResize(()=>this._fullRefresh())),this._register(c.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(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(c.buffer.y,c.buffer.y,!0))),this._register(p.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(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=rt(()=>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 s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.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 s;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(s=this._renderer.value)==null||s.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Jf=ht([fe(2,li),fe(3,yu),fe(4,Xr),fe(5,ga),fe(6,si),fe(7,zn),fe(8,Ks)],Jf);var LC=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 zC(e,t,n,s){let a=n.buffer.x,o=n.buffer.y;if(!n.buffer.hasScrollback)return HC(a,o,e,t,n,s)+Su(o,t,n,s)+UC(a,o,e,t,n,s);let c;if(o===t)return c=a>e?"D":"C",ha(Math.abs(a-e),ca(c,s));c=o>t?"D":"C";let f=Math.abs(o-t),p=jC(o>t?e:a,n)+(f-1)*n.cols+1+OC(o>t?a:e);return ha(p,ca(c,s))}function OC(e,t){return e-1}function jC(e,t){return t.cols-e}function HC(e,t,n,s,a,o){return Su(t,s,a,o).length===0?"":ha(zb(e,t,e,t-Vr(t,a),!1,a).length,ca("D",o))}function Su(e,t,n,s){let a=e-Vr(e,n),o=t-Vr(t,n),c=Math.abs(a-o)-PC(e,t,n);return ha(c,ca(Lb(e,t),s))}function UC(e,t,n,s,a,o){let c;Su(t,s,a,o).length>0?c=s-Vr(s,a):c=t;let f=s,p=IC(e,t,n,s,a,o);return ha(zb(e,c,n,f,p==="C",a).length,ca(p,o))}function PC(e,t,n){var c;let s=0,a=e-Vr(e,n),o=t-Vr(t,n);for(let f=0;f<Math.abs(a-o);f++){let p=Lb(e,t)==="A"?-1:1;(c=n.buffer.lines.get(a+p*f))!=null&&c.isWrapped&&s++}return s}function Vr(e,t){let n=0,s=t.buffer.lines.get(e),a=s==null?void 0:s.isWrapped;for(;a&&e>=0&&e<t.rows;)n++,s=t.buffer.lines.get(--e),a=s==null?void 0:s.isWrapped;return n}function IC(e,t,n,s,a,o){let c;return Su(n,s,a,o).length>0?c=s-Vr(s,a):c=t,e<n&&c<=s||e>=n&&c<s?"C":"D"}function Lb(e,t){return e>t?"A":"B"}function zb(e,t,n,s,a,o){let c=e,f=t,p="";for(;(c!==n||f!==s)&&f>=0&&f<o.buffer.lines.length;)c+=a?1:-1,a&&c>o.cols-1?(p+=o.buffer.translateBufferLineToString(f,!1,e,c),c=0,e=0,f++):!a&&c<0&&(p+=o.buffer.translateBufferLineToString(f,!1,0,e+1),c=o.cols-1,e=c,f--);return p+o.buffer.translateBufferLineToString(f,!1,e,c)}function ca(e,t){let n=t?"O":"[";return re.ESC+n+e}function ha(e,t){e=Math.floor(e);let n="";for(let s=0;s<e;s++)n+=t;return n}var FC=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 Tv(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 ef=50,qC=15,WC=50,YC=500,VC=" ",KC=new RegExp(VC,"g"),ed=class extends De{constructor(e,t,n,s,a,o,c,f,p){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=s,this._coreService=a,this._mouseService=o,this._optionsService=c,this._renderService=f,this._coreBrowserService=p,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Vi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ue),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ue),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ue),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ue),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 FC(this._bufferService),this._activeSelectionMode=0,this._register(rt(()=>{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,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],o=e[0]<t[0]?t[0]:e[0];for(let c=e[1];c<=t[1];c++){let f=n.translateBufferLineToString(c,!0,a,o);s.push(f)}}else{let a=e[1]===t[1]?t[0]:void 0;s.push(n.translateBufferLineToString(e[1],!0,e[0],a));for(let o=e[1]+1;o<=t[1]-1;o++){let c=n.lines.get(o),f=n.translateBufferLineToString(o,!0);c!=null&&c.isWrapped?s[s.length-1]+=f:s.push(f)}if(e[1]!==t[1]){let o=n.lines.get(t[1]),c=n.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?s[s.length-1]+=c:s.push(c)}}return s.map(a=>a.replace(KC," ")).join(Mb?`\r
71
71
  `:`
72
72
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Md&&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,s=this._model.finalSelectionEnd;return!n||!s||!t?!1:this._areCoordsInSelection(t,n,s)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s?!1:this._areCoordsInSelection([e,t],n,s)}_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 a,o;let n=(o=(a=this._linkifier.currentLink)==null?void 0:a.link)==null?void 0:o.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Tv(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,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=Rd(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,-ef),ef),t/=ef,t/Math.abs(t)+Math.round(t*(qC-1)))}shouldForceSelection(e){return hu?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(),WC)}_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&&!(hu&&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 s=n.lines.get(this._model.selectionEnd[1]);s&&s.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<YC&&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 s=zC(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!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 s=0;t>=s;s++){let a=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:a>1&&t!==s&&(n+=a-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,s=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,o=a.lines.get(e[1]);if(!o)return;let c=a.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(o,e[0]),p=f,h=e[0]-f,g=0,_=0,b=0,y=0;if(c.charAt(f)===" "){for(;f>0&&c.charAt(f-1)===" ";)f--;for(;p<c.length&&c.charAt(p+1)===" ";)p++}else{let N=e[0],M=e[0];o.getWidth(N)===0&&(g++,N--),o.getWidth(M)===2&&(_++,M++);let G=o.getString(M).length;for(G>1&&(y+=G-1,p+=G-1);N>0&&f>0&&!this._isCharWordSeparator(o.loadCell(N-1,this._workCell));){o.loadCell(N-1,this._workCell);let U=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,N--):U>1&&(b+=U-1,f-=U-1),f--,N--}for(;M<o.length&&p+1<c.length&&!this._isCharWordSeparator(o.loadCell(M+1,this._workCell));){o.loadCell(M+1,this._workCell);let U=this._workCell.getChars().length;this._workCell.getWidth()===2?(_++,M++):U>1&&(y+=U-1,p+=U-1),p++,M++}}p++;let x=f+h-g+b,E=Math.min(this._bufferService.cols,p-f+g+_-b-y);if(!(!t&&c.slice(f,p).trim()==="")){if(n&&x===0&&o.getCodePoint(0)!==32){let N=a.lines.get(e[1]-1);if(N&&o.isWrapped&&N.getCodePoint(this._bufferService.cols-1)!==32){let M=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(M){let G=this._bufferService.cols-M.start;x-=G,E+=G}}}if(s&&x+E===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let N=a.lines.get(e[1]+1);if(N!=null&&N.isWrapped&&N.getCodePoint(0)!==32){let M=this._getWordAt([0,e[1]+1],!1,!1,!0);M&&(E+=M.length)}}return{start:x,length:E}}}_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=Tv(n,this._bufferService.cols)}};ed=ht([fe(3,si),fe(4,Xr),fe(5,wd),fe(6,li),fe(7,On),fe(8,zn)],ed);var Av=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={}}},Dv=class{constructor(){this._color=new Av,this._css=new Av}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()}},Ct=Object.freeze((()=>{let e=[lt.toColor("#2e3436"),lt.toColor("#cc0000"),lt.toColor("#4e9a06"),lt.toColor("#c4a000"),lt.toColor("#3465a4"),lt.toColor("#75507b"),lt.toColor("#06989a"),lt.toColor("#d3d7cf"),lt.toColor("#555753"),lt.toColor("#ef2929"),lt.toColor("#8ae234"),lt.toColor("#fce94f"),lt.toColor("#729fcf"),lt.toColor("#ad7fa8"),lt.toColor("#34e2e2"),lt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let s=t[n/36%6|0],a=t[n/6%6|0],o=t[n%6];e.push({css:St.toCss(s,a,o),rgba:St.toRgba(s,a,o)})}for(let n=0;n<24;n++){let s=8+n*10;e.push({css:St.toCss(s,s,s),rgba:St.toRgba(s,s,s)})}return e})()),Ir=lt.toColor("#ffffff"),ia=lt.toColor("#000000"),Rv=lt.toColor("#ffffff"),Mv=ia,Kl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},XC=Ir,td=class extends De{constructor(e){super(),this._optionsService=e,this._contrastCache=new Dv,this._halfContrastCache=new Dv,this._onChangeColors=this._register(new ue),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ir,background:ia,cursor:Rv,cursorAccent:Mv,selectionForeground:void 0,selectionBackgroundTransparent:Kl,selectionBackgroundOpaque:it.blend(ia,Kl),selectionInactiveBackgroundTransparent:Kl,selectionInactiveBackgroundOpaque:it.blend(ia,Kl),scrollbarSliderBackground:it.opacity(Ir,.2),scrollbarSliderHoverBackground:it.opacity(Ir,.4),scrollbarSliderActiveBackground:it.opacity(Ir,.5),overviewRulerBorder:Ir,ansi:Ct.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=$e(e.foreground,Ir),t.background=$e(e.background,ia),t.cursor=it.blend(t.background,$e(e.cursor,Rv)),t.cursorAccent=it.blend(t.background,$e(e.cursorAccent,Mv)),t.selectionBackgroundTransparent=$e(e.selectionBackground,Kl),t.selectionBackgroundOpaque=it.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=$e(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=it.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?$e(e.selectionForeground,Cv):void 0,t.selectionForeground===Cv&&(t.selectionForeground=void 0),it.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=it.opacity(t.selectionBackgroundTransparent,.3)),it.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=it.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=$e(e.scrollbarSliderBackground,it.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=$e(e.scrollbarSliderHoverBackground,it.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=$e(e.scrollbarSliderActiveBackground,it.opacity(t.foreground,.5)),t.overviewRulerBorder=$e(e.overviewRulerBorder,XC),t.ansi=Ct.slice(),t.ansi[0]=$e(e.black,Ct[0]),t.ansi[1]=$e(e.red,Ct[1]),t.ansi[2]=$e(e.green,Ct[2]),t.ansi[3]=$e(e.yellow,Ct[3]),t.ansi[4]=$e(e.blue,Ct[4]),t.ansi[5]=$e(e.magenta,Ct[5]),t.ansi[6]=$e(e.cyan,Ct[6]),t.ansi[7]=$e(e.white,Ct[7]),t.ansi[8]=$e(e.brightBlack,Ct[8]),t.ansi[9]=$e(e.brightRed,Ct[9]),t.ansi[10]=$e(e.brightGreen,Ct[10]),t.ansi[11]=$e(e.brightYellow,Ct[11]),t.ansi[12]=$e(e.brightBlue,Ct[12]),t.ansi[13]=$e(e.brightMagenta,Ct[13]),t.ansi[14]=$e(e.brightCyan,Ct[14]),t.ansi[15]=$e(e.brightWhite,Ct[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<n;s++)t.ansi[s+16]=$e(e.extendedAnsi[s],Ct[s+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()}}};td=ht([fe(0,li)],td);function $e(e,t){if(e!==void 0)try{return lt.toColor(e)}catch{}return t}var $C=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)}},GC=class{constructor(){this._services=new $C,this._services.set(xd,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=qx(e).sort((o,c)=>o.index-c.index),s=[];for(let o of n){let c=this._services.get(o.id);if(!c)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${o.id._id}.`);s.push(c)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},ZC={trace:0,debug:1,info:2,warn:3,error:4,off:5},QC="xterm.js: ",id=class extends De{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=ZC[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?"":QC)+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)}};id=ht([fe(0,li)],id);var Bv=class extends De{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ue),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ue),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ue),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 s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+n.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<n.length;s++)this._array[this._getCyclicIndex(e+s)]=n[s];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let s=this._length+n.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}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 a=t-1;a>=0;a--)this.set(e+a+n,this.get(e+a));let s=e+t+n-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+n,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ae=3,bt=Object.freeze(new _a),Xo=0,tf=2,na=class Ob{constructor(t,n,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ae);let a=n||Vi.fromCharData([0,tb,1,0]);for(let o=0;o<t;++o)this.setCell(o,a);this.length=t}get(t){let n=this._data[t*Ae+0],s=n&2097151;return[this._data[t*Ae+1],n&2097152?this._combined[t]:s?dr(s):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,n){this._data[t*Ae+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ae+0]=t|2097152|n[2]<<22):this._data[t*Ae+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ae+0]>>22}hasWidth(t){return this._data[t*Ae+0]&12582912}getFg(t){return this._data[t*Ae+1]}getBg(t){return this._data[t*Ae+2]}hasContent(t){return this._data[t*Ae+0]&4194303}getCodePoint(t){let n=this._data[t*Ae+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ae+0]&2097152}getString(t){let n=this._data[t*Ae+0];return n&2097152?this._combined[t]:n&2097151?dr(n&2097151):""}isProtected(t){return this._data[t*Ae+2]&536870912}loadCell(t,n){return Xo=t*Ae,n.content=this._data[Xo+0],n.fg=this._data[Xo+1],n.bg=this._data[Xo+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*Ae+0]=n.content,this._data[t*Ae+1]=n.fg,this._data[t*Ae+2]=n.bg}setCellFromCodepoint(t,n,s,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ae+0]=n|s<<22,this._data[t*Ae+1]=a.fg,this._data[t*Ae+2]=a.bg}addCodepointToCell(t,n,s){let a=this._data[t*Ae+0];a&2097152?this._combined[t]+=dr(n):a&2097151?(this._combined[t]=dr(a&2097151)+dr(n),a&=-2097152,a|=2097152):a=n|1<<22,s&&(a&=-12582913,a|=s<<22),this._data[t*Ae+0]=a}insertCells(t,n,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length-t){let a=new Vi;for(let o=this.length-t-n-1;o>=0;--o)this.setCell(t+n+o,this.loadCell(t+o,a));for(let o=0;o<n;++o)this.setCell(t+o,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,n,s){if(t%=this.length,n<this.length-t){let a=new Vi;for(let o=0;o<this.length-t-n;++o)this.setCell(t+o,this.loadCell(t+n+o,a));for(let o=this.length-n;o<this.length;++o)this.setCell(o,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,n,s,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,s);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,s);t<n&&t<this.length;)this.setCell(t++,s)}resize(t,n){if(t===this.length)return this._data.length*4*tf<this._data.buffer.byteLength;let s=t*Ae;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let a=new Uint32Array(s);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,n)}else{this._data=this._data.subarray(0,s);let a=Object.keys(this._combined);for(let c=0;c<a.length;c++){let f=parseInt(a[c],10);f>=t&&delete this._combined[f]}let o=Object.keys(this._extendedAttrs);for(let c=0;c<o.length;c++){let f=parseInt(o[c],10);f>=t&&delete this._extendedAttrs[f]}}return this.length=t,s*4*tf<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*tf<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 s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,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 Ob(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*Ae+0]&4194303)return t+(this._data[t*Ae+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ae+0]&4194303||this._data[t*Ae+2]&50331648)return t+(this._data[t*Ae+0]>>22);return 0}copyCellsFrom(t,n,s,a,o){let c=t._data;if(o)for(let p=a-1;p>=0;p--){for(let h=0;h<Ae;h++)this._data[(s+p)*Ae+h]=c[(n+p)*Ae+h];c[(n+p)*Ae+2]&268435456&&(this._extendedAttrs[s+p]=t._extendedAttrs[n+p])}else for(let p=0;p<a;p++){for(let h=0;h<Ae;h++)this._data[(s+p)*Ae+h]=c[(n+p)*Ae+h];c[(n+p)*Ae+2]&268435456&&(this._extendedAttrs[s+p]=t._extendedAttrs[n+p])}let f=Object.keys(t._combined);for(let p=0;p<f.length;p++){let h=parseInt(f[p],10);h>=n&&(this._combined[h-n+s]=t._combined[h])}}translateToString(t,n,s,a){n=n??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),a&&(a.length=0);let o="";for(;n<s;){let c=this._data[n*Ae+0],f=c&2097151,p=c&2097152?this._combined[n]:f?dr(f):mr;if(o+=p,a)for(let h=0;h<p.length;++h)a.push(n);n+=c>>22||1}return a&&a.push(n),o}};function JC(e,t,n,s,a,o){let c=[];for(let f=0;f<e.length-1;f++){let p=f,h=e.get(++p);if(!h.isWrapped)continue;let g=[e.get(f)];for(;p<e.length&&h.isWrapped;)g.push(h),h=e.get(++p);if(!o&&s>=f&&s<p){f+=g.length-1;continue}let _=0,b=fa(g,_,t),y=1,x=0;for(;y<g.length;){let N=fa(g,y,t),M=N-x,G=n-b,U=Math.min(M,G);g[_].copyCellsFrom(g[y],x,b,U,!1),b+=U,b===n&&(_++,b=0),x+=U,x===N&&(y++,x=0),b===0&&_!==0&&g[_-1].getWidth(n-1)===2&&(g[_].copyCellsFrom(g[_-1],n-1,b++,1,!1),g[_-1].setCell(n-1,a))}g[_].replaceCells(b,n,a);let E=0;for(let N=g.length-1;N>0&&(N>_||g[N].getTrimmedLength()===0);N--)E++;E>0&&(c.push(f+g.length-E),c.push(E)),f+=g.length-1}return c}function e2(e,t){let n=[],s=0,a=t[s],o=0;for(let c=0;c<e.length;c++)if(a===c){let f=t[++s];e.onDeleteEmitter.fire({index:c-o,amount:f}),c+=f-1,o+=f,a=t[++s]}else n.push(c);return{layout:n,countRemoved:o}}function t2(e,t){let n=[];for(let s=0;s<t.length;s++)n.push(e.get(t[s]));for(let s=0;s<n.length;s++)e.set(s,n[s]);e.length=t.length}function i2(e,t,n){let s=[],a=e.map((p,h)=>fa(e,h,t)).reduce((p,h)=>p+h),o=0,c=0,f=0;for(;f<a;){if(a-f<n){s.push(a-f);break}o+=n;let p=fa(e,c,t);o>p&&(o-=p,c++);let h=e[c].getWidth(o-1)===2;h&&o--;let g=h?n-1:n;s.push(g),f+=g}return s}function fa(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,a=e[t+1].getWidth(0)===2;return s&&a?n-1:n}var jb=class Hb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Hb._nextId++,this._onDispose=this.register(new ue),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Yr(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};jb._nextId=1;var n2=jb,Et={},Fr=Et.B;Et[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Et.A={"#":"£"};Et.B=void 0;Et[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Et.C=Et[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Et.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Et.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Et.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Et.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Et.E=Et[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Et.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Et.H=Et[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Et["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Nv=4294967295,Lv=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=bt.clone(),this.savedCharset=Fr,this.markers=[],this._nullCell=Vi.fromCharData([0,tb,1,0]),this._whitespaceCell=Vi.fromCharData([0,mr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new fu,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Bv(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 ou),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 ou),this._whitespaceCell}getBlankLine(e,t){return new na(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>Nv?Nv:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=bt);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 Bv(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(bt),s=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let c=0;c<this.lines.length;c++)s+=+this.lines.get(c).resize(e,n);let o=0;if(this._rows<t)for(let c=this._rows;c<t;c++)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 na(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new na(e,n)));else for(let c=this._rows;c>t;c--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let c=this.lines.length-a;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),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 o=0;o<this.lines.length;o++)s+=+this.lines.get(o).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.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,s=JC(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(bt),n);if(s.length>0){let a=e2(this.lines,s);t2(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let s=this.getNullCell(bt),a=n;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new na(e,s))):(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,s=this.getNullCell(bt),a=[],o=0;for(let c=this.lines.length-1;c>=0;c--){let f=this.lines.get(c);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;let p=[f];for(;f.isWrapped&&c>0;)f=this.lines.get(--c),p.unshift(f);if(!n){let U=this.ybase+this.y;if(U>=c&&U<c+p.length)continue}let h=p[p.length-1].getTrimmedLength(),g=i2(p,this._cols,e),_=g.length-p.length,b;this.ybase===0&&this.y!==this.lines.length-1?b=Math.max(0,this.y-this.lines.maxLength+_):b=Math.max(0,this.lines.length-this.lines.maxLength+_);let y=[];for(let U=0;U<_;U++){let Q=this.getBlankLine(bt,!0);y.push(Q)}y.length>0&&(a.push({start:c+p.length+o,newLines:y}),o+=y.length),p.push(...y);let x=g.length-1,E=g[x];E===0&&(x--,E=g[x]);let N=p.length-_-1,M=h;for(;N>=0;){let U=Math.min(M,E);if(p[x]===void 0)break;if(p[x].copyCellsFrom(p[N],M-U,E-U,U,!0),E-=U,E===0&&(x--,E=g[x]),M-=U,M===0){N--;let Q=Math.max(N,0);M=fa(p,Q,this._cols)}}for(let U=0;U<p.length;U++)g[U]<e&&p[U].setCell(g[U],s);let G=_-b;for(;G-- >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+o)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+_,this.ybase+t-1)}if(a.length>0){let c=[],f=[];for(let E=0;E<this.lines.length;E++)f.push(this.lines.get(E));let p=this.lines.length,h=p-1,g=0,_=a[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let b=0;for(let E=Math.min(this.lines.maxLength-1,p+o-1);E>=0;E--)if(_&&_.start>h+b){for(let N=_.newLines.length-1;N>=0;N--)this.lines.set(E--,_.newLines[N]);E++,c.push({index:h+1,amount:_.newLines.length}),b+=_.newLines.length,_=a[++g]}else this.lines.set(E,f[h--]);let y=0;for(let E=c.length-1;E>=0;E--)c[E].index+=y,this.lines.onInsertEmitter.fire(c[E]),y+=c[E].amount;let x=Math.max(0,p+o-this.lines.maxLength);x>0&&this.lines.onTrimEmitter.fire(x)}}translateBufferLineToString(e,t,n=0,s){let a=this.lines.get(e);return a?a.translateToString(t,n,s):""}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 n2(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)}},r2=class extends De{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ue),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 Lv(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Lv(!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)}},Ub=2,Pb=1,nd=class extends De{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ue),this.onResize=this._onResize.event,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Ub),this.rows=Math.max(e.rawOptions.rows||0,Pb),this.buffers=this._register(new r2(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,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=n.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let a=n.ybase+n.scrollTop,o=n.ybase+n.scrollBottom;if(n.scrollTop===0){let c=n.lines.isFull;o===n.lines.length-1?c?n.lines.recycle().copyFrom(s):n.lines.push(s.clone()):n.lines.splice(o+1,0,s.clone()),c?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let c=o-a+1;n.lines.shiftElements(a+1,c-1,-1),n.lines.set(o,s.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 s=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),s!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};nd=ht([fe(0,li)],nd);var Us={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:hu,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},s2=["normal","bold","100","200","300","400","500","600","700","800","900"],l2=class extends De{constructor(e){super(),this._onOptionChange=this._register(new ue),this.onOptionChange=this._onOptionChange.event;let t={...Us};for(let n in e)if(n in t)try{let s=e[n];t[n]=this._sanitizeAndValidateOption(n,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(rt(()=>{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 Us))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,s)=>{if(!(n in Us))throw new Error(`No option with key "${n}"`);s=this._sanitizeAndValidateOption(n,s),this.rawOptions[n]!==s&&(this.rawOptions[n]=s,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let s={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Us[e]),!a2(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Us[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=s2.includes(t)?t:Us[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 a2(e){return e==="block"||e==="underline"||e==="bar"}function ra(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let s in e)n[s]=t<=1?e[s]:e[s]&&ra(e[s],t-1);return n}var zv=Object.freeze({insertMode:!1}),Ov=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 De{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 ue),this.onData=this._onData.event,this._onUserInput=this._register(new ue),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ue),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ue),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ra(zv),this.decPrivateModes=ra(Ov)}reset(){this.modes=ra(zv),this.decPrivateModes=ra(Ov)}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(s=>s.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=ht([fe(0,si),fe(1,lb),fe(2,li)],rd);var jv={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 nf(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 rf=String.fromCharCode,Hv={DEFAULT:e=>{let t=[nf(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${rf(t[0])}${rf(t[1])}${rf(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${nf(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${nf(e,!0)};${e.x};${e.y}${t}`}},sd=class extends De{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 ue),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(jv))this.addProtocol(s,jv[s]);for(let s of Object.keys(Hv))this.addEncoding(s,Hv[s]);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 s=t/n,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=s+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_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)}};sd=ht([fe(0,si),fe(1,Xr),fe(2,li)],sd);var sf=[[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]],o2=[[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]],kt;function u2(e,t){let n=0,s=t.length-1,a;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=n;)if(a=n+s>>1,e>t[a][1])n=a+1;else if(e<t[a][0])s=a-1;else return!0;return!1}var c2=class{constructor(){if(this.version="6",!kt){kt=new Uint8Array(65536),kt.fill(1),kt[0]=0,kt.fill(0,1,32),kt.fill(0,127,160),kt.fill(2,4352,4448),kt[9001]=2,kt[9002]=2,kt.fill(2,11904,42192),kt[12351]=1,kt.fill(2,44032,55204),kt.fill(2,63744,64256),kt.fill(2,65040,65050),kt.fill(2,65072,65136),kt.fill(2,65280,65377),kt.fill(2,65504,65511);for(let e=0;e<sf.length;++e)kt.fill(0,sf[e][0],sf[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?kt[e]:u2(e,o2)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),s=n===0&&t!==0;if(s){let a=qr.extractWidth(t);a===0?s=!1:a>n&&(n=a)}return qr.createPropertyValue(0,n,s)}},qr=class su{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ue,this.onChange=this._onChange.event;let t=new c2;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,s=!1){return(t&16777215)<<3|(n&3)<<1|(s?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,s=0,a=t.length;for(let o=0;o<a;++o){let c=t.charCodeAt(o);if(55296<=c&&c<=56319){if(++o>=a)return n+this.wcwidth(c);let h=t.charCodeAt(o);56320<=h&&h<=57343?c=(c-55296)*1024+h-56320+65536:n+=this.wcwidth(h)}let f=this.charProperties(c,s),p=su.extractWidth(f);su.extractShouldJoin(f)&&(p-=su.extractWidth(s)),n+=p,s=f}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},h2=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 Uv(e){var s;let t=(s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:s.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 Xl=2147483647,f2=256,Ib=class ld{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>f2)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 ld;if(!t.length)return n;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let a=t[s];if(Array.isArray(a))for(let o=0;o<a.length;++o)n.addSubParam(a[o]);else n.addParam(a)}return n}clone(){let t=new ld(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 s=this._subParamsIdx[n]>>8,a=this._subParamsIdx[n]&255;a-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,a))}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>Xl?Xl: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>Xl?Xl: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,s=this._subParamsIdx[t]&255;return s-n>0?this._subParams.subarray(n,s):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let s=this._subParamsIdx[n]>>8,a=this._subParamsIdx[n]&255;a-s>0&&(t[n]=this._subParams.slice(s,a))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,a=s[n-1];s[n-1]=~a?Math.min(a*10+t,Xl):t}},$l=[],d2=class{constructor(){this._state=0,this._active=$l,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 s=n.indexOf(t);s!==-1&&n.splice(s,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=$l}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=$l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||$l,!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",vu(e,t,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].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 s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-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,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&n===!1){for(;s>=0&&(n=this._active[s].end(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=$l,this._id=-1,this._state=0}}},Di=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+=vu(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}},Gl=[],p2=class{constructor(){this._handlers=Object.create(null),this._active=Gl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Gl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,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=Gl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Gl,!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",vu(e,t,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&n===!1){for(;s>=0&&(n=this._active[s].unhook(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=Gl,this._ident=0}},sa=new Ib;sa.addParam(0);var Pv=class{constructor(e){this._handler=e,this._data="",this._params=sa,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():sa,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=vu(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=sa,this._data="",this._hitLimit=!1,n));return this._params=sa,this._data="",this._hitLimit=!1,t}},m2=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,s){this.table[t<<8|e]=n<<4|s}addMany(e,t,n,s){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=n<<4|s}},Wi=160,_2=(function(){let e=new m2(4095),t=Array.apply(null,Array(256)).map((f,p)=>p),n=(f,p)=>t.slice(f,p),s=n(32,127),a=n(0,24);a.push(25),a.push.apply(a,n(28,32));let o=n(0,14),c;e.setDefault(1,0),e.addMany(s,0,2,0);for(c in o)e.addMany([24,26,153,154],c,3,0),e.addMany(n(128,144),c,3,0),e.addMany(n(144,152),c,3,0),e.add(156,c,0,0),e.add(27,c,11,1),e.add(157,c,4,8),e.addMany([152,158,159],c,0,7),e.add(155,c,11,3),e.add(144,c,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,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(s,7,0,7),e.addMany(a,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(a,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(a,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(a,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(a,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(a,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Wi,0,2,0),e.add(Wi,8,5,8),e.add(Wi,6,0,6),e.add(Wi,11,0,11),e.add(Wi,13,13,13),e})(),g2=class extends De{constructor(e=_2){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 Ib,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,s)=>{},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(rt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new d2),this._dcsParser=this._register(new p2),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 a=0;a<e.intermediates.length;++a){let o=e.intermediates.charCodeAt(a);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=s,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 s=this._escHandlers[n];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.splice(a,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 s=this._csiHandlers[n];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.splice(a,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,s,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=s,this._parseStack.chunkPos=a}parse(e,t,n){let s=0,a=0,o=0,c;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let f=this._parseStack.handlers,p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&p>-1){for(;p>=0&&(c=f[p](this._params),c!==!0);p--)if(c instanceof Promise)return this._parseStack.handlerPos=p,c}this._parseStack.handlers=[];break;case 4:if(n===!1&&p>-1){for(;p>=0&&(c=f[p](),c!==!0);p--)if(c instanceof Promise)return this._parseStack.handlerPos=p,c}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],c=this._dcsParser.unhook(s!==24&&s!==26,n),c)return c;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],c=this._oscParser.end(s!==24&&s!==26,n),c)return c;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let f=o;f<t;++f){switch(s=e[f],a=this._transitions.table[this.currentState<<8|(s<160?s:Wi)],a>>4){case 2:for(let b=f+1;;++b){if(b>=t||(s=e[b])<32||s>126&&s<Wi){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(s=e[b])<32||s>126&&s<Wi){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(s=e[b])<32||s>126&&s<Wi){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(s=e[b])<32||s>126&&s<Wi){this._printHandler(e,f,b),f=b-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let p=this._csiHandlers[this._collect<<8|s],h=p?p.length-1:-1;for(;h>=0&&(c=p[h](this._params),c!==!0);h--)if(c instanceof Promise)return this._preserveStack(3,p,h,a,f),c;h<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++f<t&&(s=e[f])>47&&s<60);f--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let g=this._escHandlers[this._collect<<8|s],_=g?g.length-1:-1;for(;_>=0&&(c=g[_](),c!==!0);_--)if(c instanceof Promise)return this._preserveStack(4,g,_,a,f),c;_<0&&this._escHandlerFb(this._collect<<8|s),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|s,this._params);break;case 13:for(let b=f+1;;++b)if(b>=t||(s=e[b])===24||s===26||s===27||s>127&&s<Wi){this._dcsParser.put(e,f,b),f=b-1;break}break;case 14:if(c=this._dcsParser.unhook(s!==24&&s!==26),c)return this._preserveStack(6,[],0,a,f),c;s===27&&(a|=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 b=f+1;;b++)if(b>=t||(s=e[b])<32||s>127&&s<Wi){this._oscParser.put(e,f,b),f=b-1;break}break;case 6:if(c=this._oscParser.end(s!==24&&s!==26),c)return this._preserveStack(5,[],0,a,f),c;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},v2=/^([\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})$/,y2=/^[\da-f]+$/;function Iv(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=v2.exec(t);if(n){let s=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/s*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/s*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),y2.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,s=[0,0,0];for(let a=0;a<3;++a){let o=parseInt(t.slice(n*a,n*a+n),16);s[a]=n===1?o<<4:n===2?o:n===3?o>>4:o>>8}return s}}function lf(e,t){let n=e.toString(16),s=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function b2(e,t=16){let[n,s,a]=e;return`rgb:${lf(n,t)}/${lf(s,t)}/${lf(a,t)}`}var S2={"(":0,")":1,"*":2,"+":3,"-":1,".":2},hr=131072,Fv=10;function qv(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 Wv=5e3,Yv=0,x2=class extends De{constructor(e,t,n,s,a,o,c,f,p=new g2){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=s,this._optionsService=a,this._oscLinkService=o,this._coreMouseService=c,this._unicodeService=f,this._parser=p,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Ix,this._utf8Decoder=new Fx,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=bt.clone(),this._eraseAttrDataInternal=bt.clone(),this._onRequestBell=this._register(new ue),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ue),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ue),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ue),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ue),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ue),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ue),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ue),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ue),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ue),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ue),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ue),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 ad(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,_)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:g,data:_})}),this._parser.setDcsHandlerFallback((h,g,_)=>{g==="HOOK"&&(_=_.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:g,payload:_})}),this._parser.setPrintHandler((h,g,_)=>this.print(h,g,_)),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(re.BEL,()=>this.bell()),this._parser.setExecuteHandler(re.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(re.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(re.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(re.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(re.BS,()=>this.backspace()),this._parser.setExecuteHandler(re.HT,()=>this.tab()),this._parser.setExecuteHandler(re.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(re.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(nu.IND,()=>this.index()),this._parser.setExecuteHandler(nu.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(nu.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Di(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new Di(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new Di(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new Di(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new Di(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new Di(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new Di(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new Di(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new Di(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new Di(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new Di(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new Di(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 Et)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 Pv((h,g)=>this.requestStatusString(h,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),Wv))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Wv} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,s=this._activeBuffer.x,a=this._activeBuffer.y,o=0,c=this._parseStack.paused;if(c){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;s=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>hr&&(o=this._parseStack.position+hr)}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<hr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,hr))),c||this._dirtyRowTracker.clearRange(),e.length>hr)for(let h=o;h<e.length;h+=hr){let g=h+hr<e.length?h+hr:e.length,_=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,_))return this._preserveStack(s,a,_,h),this._logSlowResolvingAsync(n),n}else if(!c){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(s,a,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==s||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let f=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),p=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);p<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(p,this._bufferService.rows-1),end:Math.min(f,this._bufferService.rows-1)})}print(e,t,n){let s,a,o=this._charsetService.charset,c=this._optionsService.rawOptions.screenReaderMode,f=this._bufferService.cols,p=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,g=this._curAttrData,_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&_.getWidth(this._activeBuffer.x-1)===2&&_.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let b=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(s=e[y],s<127&&o){let M=o[String.fromCharCode(s)];M&&(s=M.charCodeAt(0))}let x=this._unicodeService.charProperties(s,b);a=qr.extractWidth(x);let E=qr.extractShouldJoin(x),N=E?qr.extractWidth(b):0;if(b=x,c&&this._onA11yChar.fire(dr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-N>f){if(p){let M=_,G=this._activeBuffer.x-N;for(this._activeBuffer.x=N,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),_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),N>0&&_ instanceof na&&_.copyCellsFrom(M,G,0,N,!1);G<f;)M.setCellFromCodepoint(G++,0,1,g)}else if(this._activeBuffer.x=f-1,a===2)continue}if(E&&this._activeBuffer.x){let M=_.getWidth(this._activeBuffer.x-1)?1:2;_.addCodepointToCell(this._activeBuffer.x-M,s,a);for(let G=a-N;--G>=0;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(h&&(_.insertCells(this._activeBuffer.x,a-N,this._activeBuffer.getNullCell(g)),_.getWidth(f-1)===2&&_.setCellFromCodepoint(f-1,0,1,g)),_.setCellFromCodepoint(this._activeBuffer.x++,s,a,g),a>0)for(;--a;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=b,this._activeBuffer.x<f&&n-t>0&&_.getWidth(this._activeBuffer.x)===0&&!_.hasContent(this._activeBuffer.x)&&_.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=>qv(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Pv(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Di(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,s=!1,a=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),a),s&&(o.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 s;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--&&!((s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&s.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 a=this._activeBuffer.lines.length-this._bufferService.rows;a>0&&(this._activeBuffer.lines.trimStart(a),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-a,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-a,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,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(a-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,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(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(bt));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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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,s=qr.extractWidth(t),a=this._activeBuffer.x-s,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),c=new Uint32Array(o.length*n),f=0;for(let h=0;h<o.length;){let g=o.codePointAt(h)||0;c[f++]=g,h+=g>65535?2:1}let p=f;for(let h=1;h<n;++h)c.copyWithin(p,0,f),p+=f;return this.print(c,0,p),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(re.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(re.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(re.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(re.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(re.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,Fr),this._charsetService.setgCharset(1,Fr),this._charsetService.setgCharset(2,Fr),this._charsetService.setgCharset(3,Fr);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){(E=>(E[E.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",E[E.SET=1]="SET",E[E.RESET=2]="RESET",E[E.PERMANENTLY_SET=3]="PERMANENTLY_SET",E[E.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let s=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:o}=this._coreMouseService,c=this._coreService,{buffers:f,cols:p}=this._bufferService,{active:h,alt:g}=f,_=this._optionsService.rawOptions,b=(E,N)=>(c.triggerDataEvent(`${re.ESC}[${t?"":"?"}${E};${N}$y`),!0),y=E=>E?1:2,x=e.params[0];return t?x===2?b(x,4):x===4?b(x,y(c.modes.insertMode)):x===12?b(x,3):x===20?b(x,y(_.convertEol)):b(x,0):x===1?b(x,y(s.applicationCursorKeys)):x===3?b(x,_.windowOptions.setWinLines?p===80?2:p===132?1:0:0):x===6?b(x,y(s.origin)):x===7?b(x,y(s.wraparound)):x===8?b(x,3):x===9?b(x,y(a==="X10")):x===12?b(x,y(_.cursorBlink)):x===25?b(x,y(!c.isCursorHidden)):x===45?b(x,y(s.reverseWraparound)):x===66?b(x,y(s.applicationKeypad)):x===67?b(x,4):x===1e3?b(x,y(a==="VT200")):x===1002?b(x,y(a==="DRAG")):x===1003?b(x,y(a==="ANY")):x===1004?b(x,y(s.sendFocus)):x===1005?b(x,4):x===1006?b(x,y(o==="SGR")):x===1015?b(x,4):x===1016?b(x,y(o==="SGR_PIXELS")):x===1048?b(x,1):x===47||x===1047||x===1049?b(x,y(h===g)):x===2004?b(x,y(s.bracketedPasteMode)):x===2026?b(x,y(s.synchronizedOutput)):b(x,0)}_updateAttrColor(e,t,n,s,a){return t===2?(e|=50331648,e&=-16777216,e|=_a.fromColorRGB([n,s,a])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let s=[0,0,-1,0,0,0],a=0,o=0;do{if(s[o+a]=e.params[t+o],e.hasSubParams(t+o)){let c=e.getSubParams(t+o),f=0;do s[1]===5&&(a=1),s[o+f+1+a]=c[f];while(++f<c.length&&f+o+1+a<s.length);break}if(s[1]===5&&o+a>=2||s[1]===2&&o+a>=5)break;s[1]&&(a=1)}while(++o+t<e.length&&o+a<s.length);for(let c=2;c<s.length;++c)s[c]===-1&&(s[c]=0);switch(s[0]){case 38:n.fg=this._updateAttrColor(n.fg,s[1],s[3],s[4],s[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,s[1],s[3],s[4],s[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,s[1],s[3],s[4],s[5])}return o}_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=bt.fg,e.bg=bt.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,s=this._curAttrData;for(let a=0;a<t;a++)n=e.params[a],n>=30&&n<=37?(s.fg&=-50331904,s.fg|=16777216|n-30):n>=40&&n<=47?(s.bg&=-50331904,s.bg|=16777216|n-40):n>=90&&n<=97?(s.fg&=-50331904,s.fg|=16777216|n-90|8):n>=100&&n<=107?(s.bg&=-50331904,s.bg|=16777216|n-100|8):n===0?this._processSGR0(s):n===1?s.fg|=134217728:n===3?s.bg|=67108864:n===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,s)):n===5?s.fg|=536870912:n===7?s.fg|=67108864:n===8?s.fg|=1073741824:n===9?s.fg|=2147483648:n===2?s.bg|=134217728:n===21?this._processUnderline(2,s):n===22?(s.fg&=-134217729,s.bg&=-134217729):n===23?s.bg&=-67108865:n===24?(s.fg&=-268435457,this._processUnderline(0,s)):n===25?s.fg&=-536870913:n===27?s.fg&=-67108865:n===28?s.fg&=-1073741825:n===29?s.fg&=2147483647:n===39?(s.fg&=-67108864,s.fg|=bt.fg&16777215):n===49?(s.bg&=-67108864,s.bg|=bt.bg&16777215):n===38||n===48||n===58?a+=this._extractColor(e,a,s):n===53?s.bg|=1073741824:n===55?s.bg&=-1073741825:n===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):n===100?(s.fg&=-67108864,s.fg|=bt.fg&16777215,s.bg&=-67108864,s.bg|=bt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${re.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${re.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(`${re.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=bt.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(!qv(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(`${re.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Fv&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Fv&&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 s=n.shift(),a=n.shift();if(/^\d+$/.exec(s)){let o=parseInt(s);if(Vv(o))if(a==="?")t.push({type:0,index:o});else{let c=Iv(a);c&&t.push({type:1,index:o,color:c})}}}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(),s=e.slice(t+1);return s?this._createHyperlink(n,s):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),s,a=n.findIndex(o=>o.startsWith("id="));return a!==-1&&(s=n[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,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 s=0;s<n.length&&!(t>=this._specialColors.length);++s,++t)if(n[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=Iv(n[s]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}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 s=0;s<n.length;++s)if(/^\d+$/.exec(n[s])){let a=parseInt(n[s]);Vv(a)&&t.push({type:2,index:a})}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,Fr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(S2[e[0]],Et[e[1]]||Fr),!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=bt.clone(),this._eraseAttrDataInternal=bt.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 Vi;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,s=this._activeBuffer.lines.get(n);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=c=>(this._coreService.triggerDataEvent(`${re.ESC}${c}${re.ESC}\\`),!0),s=this._bufferService.buffer,a=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${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},ad=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&&(Yv=e,e=t,t=Yv),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};ad=ht([fe(0,si)],ad);function Vv(e){return 0<=e&&e<256}var w2=5e7,Kv=12,C2=50,k2=class extends De{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 ue),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 s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>w2)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 s=this._writeBuffer[this._bufferOffset],a=this._action(s,t);if(a){let c=f=>performance.now()-n>=Kv?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(n,f);a.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(c);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-n>=Kv)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>C2&&(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()}},od=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 f=t.addMarker(t.ybase+t.y),p={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(p,f)),this._dataByLinkId.set(p.id,p),p.id}let n=e,s=this._getEntryIdKey(n),a=this._entriesWithId.get(s);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let o=t.addMarker(t.ybase+t.y),c={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(c,o)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);n.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(n,s))}}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)))}};od=ht([fe(0,si)],od);var Xv=!1,E2=class extends De{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ys),this._onBinary=this._register(new ue),this.onBinary=this._onBinary.event,this._onData=this._register(new ue),this.onData=this._onData.event,this._onLineFeed=this._register(new ue),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ue),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ue),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ue),this._instantiationService=new GC,this.optionsService=this._register(new l2(e)),this._instantiationService.setService(li,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(nd)),this._instantiationService.setService(si,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(id)),this._instantiationService.setService(lb,this._logService),this.coreService=this._register(this._instantiationService.createInstance(rd)),this._instantiationService.setService(Xr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(sd)),this._instantiationService.setService(sb,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(qr)),this._instantiationService.setService(Vx,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h2),this._instantiationService.setService(Yx,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(od),this._instantiationService.setService(ab,this._oscLinkService),this._inputHandler=this._register(new x2(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Yt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Yt.forward(this._bufferService.onResize,this._onResize)),this._register(Yt.forward(this.coreService.onData,this._onData)),this._register(Yt.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 k2((t,n)=>this._inputHandler.parse(t,n))),this._register(Yt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ue),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&&!Xv&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Xv=!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,Ub),t=Math.max(t,Pb),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(Uv.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Uv(this._bufferService),!1))),this._windowsWrappingHeuristics.value=rt(()=>{for(let t of e)t.dispose()})}}},T2={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 A2(e,t,n,s){var c;let a={type:0,cancel:!1,key:void 0},o=(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?a.key=re.ESC+"OA":a.key=re.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=re.ESC+"OD":a.key=re.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=re.ESC+"OC":a.key=re.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=re.ESC+"OB":a.key=re.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":re.DEL,e.altKey&&(a.key=re.ESC+a.key);break;case 9:if(e.shiftKey){a.key=re.ESC+"[Z";break}a.key=re.HT,a.cancel=!0;break;case 13:a.key=e.altKey?re.ESC+re.CR:re.CR,a.cancel=!0;break;case 27:a.key=re.ESC,e.altKey&&(a.key=re.ESC+re.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;o?a.key=re.ESC+"[1;"+(o+1)+"D":t?a.key=re.ESC+"OD":a.key=re.ESC+"[D";break;case 39:if(e.metaKey)break;o?a.key=re.ESC+"[1;"+(o+1)+"C":t?a.key=re.ESC+"OC":a.key=re.ESC+"[C";break;case 38:if(e.metaKey)break;o?a.key=re.ESC+"[1;"+(o+1)+"A":t?a.key=re.ESC+"OA":a.key=re.ESC+"[A";break;case 40:if(e.metaKey)break;o?a.key=re.ESC+"[1;"+(o+1)+"B":t?a.key=re.ESC+"OB":a.key=re.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=re.ESC+"[2~");break;case 46:o?a.key=re.ESC+"[3;"+(o+1)+"~":a.key=re.ESC+"[3~";break;case 36:o?a.key=re.ESC+"[1;"+(o+1)+"H":t?a.key=re.ESC+"OH":a.key=re.ESC+"[H";break;case 35:o?a.key=re.ESC+"[1;"+(o+1)+"F":t?a.key=re.ESC+"OF":a.key=re.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=re.ESC+"[5;"+(o+1)+"~":a.key=re.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=re.ESC+"[6;"+(o+1)+"~":a.key=re.ESC+"[6~";break;case 112:o?a.key=re.ESC+"[1;"+(o+1)+"P":a.key=re.ESC+"OP";break;case 113:o?a.key=re.ESC+"[1;"+(o+1)+"Q":a.key=re.ESC+"OQ";break;case 114:o?a.key=re.ESC+"[1;"+(o+1)+"R":a.key=re.ESC+"OR";break;case 115:o?a.key=re.ESC+"[1;"+(o+1)+"S":a.key=re.ESC+"OS";break;case 116:o?a.key=re.ESC+"[15;"+(o+1)+"~":a.key=re.ESC+"[15~";break;case 117:o?a.key=re.ESC+"[17;"+(o+1)+"~":a.key=re.ESC+"[17~";break;case 118:o?a.key=re.ESC+"[18;"+(o+1)+"~":a.key=re.ESC+"[18~";break;case 119:o?a.key=re.ESC+"[19;"+(o+1)+"~":a.key=re.ESC+"[19~";break;case 120:o?a.key=re.ESC+"[20;"+(o+1)+"~":a.key=re.ESC+"[20~";break;case 121:o?a.key=re.ESC+"[21;"+(o+1)+"~":a.key=re.ESC+"[21~";break;case 122:o?a.key=re.ESC+"[23;"+(o+1)+"~":a.key=re.ESC+"[23~";break;case 123:o?a.key=re.ESC+"[24;"+(o+1)+"~":a.key=re.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=re.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=re.DEL:e.keyCode===219?a.key=re.ESC:e.keyCode===220?a.key=re.FS:e.keyCode===221&&(a.key=re.GS);else if((!n||s)&&e.altKey&&!e.metaKey){let f=(c=T2[e.keyCode])==null?void 0:c[e.shiftKey?1:0];if(f)a.key=re.ESC+f;else if(e.keyCode>=65&&e.keyCode<=90){let p=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(p);e.shiftKey&&(h=h.toUpperCase()),a.key=re.ESC+h}else if(e.keyCode===32)a.key=re.ESC+(e.ctrlKey?re.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let p=e.code.slice(3,4);e.shiftKey||(p=p.toLowerCase()),a.key=re.ESC+p,a.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=re.US),e.key==="@"&&(a.key=re.NUL));break}return a}var pt=0,D2=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new fu,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new fu,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((a,o)=>this._getKey(a)-this._getKey(o)),t=0,n=0,s=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<s.length;a++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(s[a]=e[t],t++):s[a]=this._array[n++];this._array=s,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||(pt=this._search(t),pt===-1)||this._getKey(this._array[pt])!==t)return!1;do if(this._array[pt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(pt),!0;while(++pt<this._array.length&&this._getKey(this._array[pt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,o)=>a-o),t=0,n=new Array(this._array.length-e.length),s=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:n[s++]=this._array[a];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&&(pt=this._search(e),!(pt<0||pt>=this._array.length)&&this._getKey(this._array[pt])===e))do yield this._array[pt];while(++pt<this._array.length&&this._getKey(this._array[pt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(pt=this._search(e),!(pt<0||pt>=this._array.length)&&this._getKey(this._array[pt])===e))do t(this._array[pt]);while(++pt<this._array.length&&this._getKey(this._array[pt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let s=t+n>>1,a=this._getKey(this._array[s]);if(a>e)n=s-1;else if(a<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},af=0,$v=0,R2=class extends De{constructor(){super(),this._decorations=new D2(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new ue),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ue),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(rt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new M2(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.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 s=0,a=0;for(let o of this._decorations.getKeyIterator(t))s=o.options.x??0,a=s+(o.options.width??1),e>=s&&e<a&&(!n||(o.options.layer??"bottom")===n)&&(yield o)}forEachDecorationAtCell(e,t,n,s){this._decorations.forEachByKey(t,a=>{af=a.options.x??0,$v=af+(a.options.width??1),e>=af&&e<$v&&(!n||(a.options.layer??"bottom")===n)&&s(a)})}},M2=class extends _r{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ue),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ue),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=lt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=lt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},B2=1e3,N2=class{constructor(e,t=B2){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 s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=s-this._lastRefreshMs,o=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Gv=20,du=class extends De{constructor(e,t,n,s){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let o=0;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);if(this._topBoundaryFocusListener=o=>this._handleBoundaryFocus(o,0),this._bottomBoundaryFocusListener=o=>this._handleBoundaryFocus(o,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=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new N2(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(o=>this._handleResize(o.rows))),this._register(this._terminal.onRender(o=>this._refreshRows(o.start,o.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(o=>this._handleChar(o))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
73
73
  `))),this._register(this._terminal.onA11yTab(o=>this._handleTab(o))),this._register(this._terminal.onKey(o=>this._handleKey(o.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(xe(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(rt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Gv+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
@@ -98,10 +98,10 @@ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){t
98
98
  `,this._lastCursorRow=e+1,this._lastCursorCol=0;else{n="";let c=a.getCell(a.length-1,this._thisRowLastChar),f=a.getCell(a.length-2,this._thisRowLastSecondChar),p=o.getCell(0,this._nextRowFirstChar),h=p.getWidth()>1,g=!1;(p.getChars()&&h?this._nullCellCount<=1:this._nullCellCount<=0)&&((c.getChars()||c.getWidth()===0)&&Nn(c,p)&&(g=!0),h&&(f.getChars()||f.getWidth()===0)&&Nn(c,p)&&Nn(f,p)&&(g=!0)),g||(n="-".repeat(this._nullCellCount+1),n+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(n+="\x1B[A",n+=`\x1B[${a.length-this._nullCellCount}C`,n+=`\x1B[${this._nullCellCount}X`,n+=`\x1B[${a.length-this._nullCellCount}D`,n+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=n,this._currentRow="",this._nullCellCount=0}_diffStyle(e,t){let n=[],s=!qb(e,t),a=!Nn(e,t),o=!Wb(e,t);if(s||a||o)if(e.isAttributeDefault())t.isAttributeDefault()||n.push(0);else{if(s){let c=e.getFgColor();e.isFgRGB()?n.push(38,2,c>>>16&255,c>>>8&255,c&255):e.isFgPalette()?c>=16?n.push(38,5,c):n.push(c&8?90+(c&7):30+(c&7)):n.push(39)}if(a){let c=e.getBgColor();e.isBgRGB()?n.push(48,2,c>>>16&255,c>>>8&255,c&255):e.isBgPalette()?c>=16?n.push(48,5,c):n.push(c&8?100+(c&7):40+(c&7)):n.push(49)}o&&(e.isInverse()!==t.isInverse()&&n.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&n.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&n.push(e.isUnderline()?4:24),e.isOverline()!==t.isOverline()&&n.push(e.isOverline()?53:55),e.isBlink()!==t.isBlink()&&n.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&n.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&n.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&n.push(e.isDim()?2:22),e.isStrikethrough()!==t.isStrikethrough()&&n.push(e.isStrikethrough()?9:29))}return n}_nextCell(e,t,n,s){if(e.getWidth()===0)return;let a=e.getChars()==="",o=this._diffStyle(e,this._cursorStyle);if(a?!Nn(this._cursorStyle,e):o.length>0){this._nullCellCount>0&&(Nn(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=s,this._currentRow+=`\x1B[${o.join(";")}m`;let c=this._buffer.getLine(n);c!==void 0&&(c.getCell(s,this._cursorStyle),this._cursorStyleRow=n,this._cursorStyleCol=s)}a?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(Nn(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=s+e.getWidth())}_serializeString(e){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let n="";for(let o=0;o<t;o++)n+=this._allRows[o],o+1<t&&(n+=this._allRowSeparators[o]);if(!e){let o=this._buffer.baseY+this._buffer.cursorY,c=this._buffer.cursorX,f=o!==this._lastCursorRow||c!==this._lastCursorCol,p=h=>{h>0?n+=`\x1B[${h}C`:h<0&&(n+=`\x1B[${-h}D`)};f&&((h=>{h>0?n+=`\x1B[${h}B`:h<0&&(n+=`\x1B[${-h}A`)})(o-this._lastCursorRow),p(c-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,a=this._diffStyle(s,this._cursorStyle);return a.length>0&&(n+=`\x1B[${a.join(";")}m`),n}},Z2=class{activate(e){this._terminal=e}_serializeBufferByScrollback(e,t,n){let s=t.length,a=n===void 0?s:Qv(n+e.rows,0,s);return this._serializeBufferByRange(e,t,{start:s-a,end:s-1},!1)}_serializeBufferByRange(e,t,n,s){return new G2(t,e).serialize({start:{x:0,y:typeof n.start=="number"?n.start:n.start.line},end:{x:e.cols,y:typeof n.end=="number"?n.end:n.end.line}},s)}_serializeBufferAsHTML(e,t){var f;let n=e.buffer.active,s=new Q2(n,e,t),a=t.onlySelection??!1,o=t.range;if(o)return s.serialize({start:{x:o.startCol,y:(o.startLine,o.startLine)},end:{x:e.cols,y:(o.endLine,o.endLine)}});if(!a){let p=n.length,h=t.scrollback,g=h===void 0?p:Qv(h+e.rows,0,p);return s.serialize({start:{x:0,y:p-g},end:{x:e.cols,y:p-1}})}let c=(f=this._terminal)==null?void 0:f.getSelectionPosition();return c!==void 0?s.serialize({start:{x:c.start.x,y:c.start.y},end:{x:c.end.x,y:c.end.y}}):""}_serializeModes(e){let t="",n=e.modes;if(n.applicationCursorKeysMode&&(t+="\x1B[?1h"),n.applicationKeypadMode&&(t+="\x1B[?66h"),n.bracketedPasteMode&&(t+="\x1B[?2004h"),n.insertMode&&(t+="\x1B[4h"),n.originMode&&(t+="\x1B[?6h"),n.reverseWraparoundMode&&(t+="\x1B[?45h"),n.sendFocusMode&&(t+="\x1B[?1004h"),n.wraparoundMode===!1&&(t+="\x1B[?7l"),n.mouseTrackingMode!=="none")switch(n.mouseTrackingMode){case"x10":t+="\x1B[?9h";break;case"vt200":t+="\x1B[?1000h";break;case"drag":t+="\x1B[?1002h";break;case"any":t+="\x1B[?1003h";break}return t}serialize(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let t=e!=null&&e.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,e.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,e==null?void 0:e.scrollback);if(!(e!=null&&e.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let n=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);t+=`\x1B[?1049h\x1B[H${n}`}return e!=null&&e.excludeModes||(t+=this._serializeModes(this._terminal)),t}serializeAsHTML(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,e||{})}dispose(){}},Q2=class extends Fb{constructor(e,t,n){super(e),this._terminal=t,this._options=n,this._currentRow="",this._htmlContent="",t._core._themeService?this._ansiColors=t._core._themeService.colors.ansi:this._ansiColors=X2}_padStart(e,t,n){return t=t>>0,n=n??" ",e.length>t?e:(t-=e.length,t>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+e)}_beforeSerialize(e,t,n){var c,f;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",a="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((c=this._terminal.options.theme)==null?void 0:c.foreground)??"#ffffff",a=((f=this._terminal.options.theme)==null?void 0:f.background)??"#000000");let o=[];o.push("color: "+s+";"),o.push("background-color: "+a+";"),o.push("font-family: "+this._terminal.options.fontFamily+";"),o.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+o.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,t){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,t){let n=t?e.getFgColor():e.getBgColor();if(t?e.isFgRGB():e.isBgRGB())return"#"+[n>>16&255,n>>8&255,n&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(t?e.isFgPalette():e.isBgPalette())return this._ansiColors[n].css}_diffStyle(e,t){let n=[],s=!qb(e,t),a=!Nn(e,t),o=!Wb(e,t);if(s||a||o){let c=this._getHexColor(e,!0);c&&n.push("color: "+c+";");let f=this._getHexColor(e,!1);return f&&n.push("background-color: "+f+";"),e.isInverse()&&n.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&n.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?n.push("text-decoration: overline underline;"):e.isUnderline()?n.push("text-decoration: underline;"):e.isOverline()&&n.push("text-decoration: overline;"),e.isBlink()&&n.push("text-decoration: blink;"),e.isInvisible()&&n.push("visibility: hidden;"),e.isItalic()&&n.push("font-style: italic;"),e.isDim()&&n.push("opacity: 0.5;"),e.isStrikethrough()&&n.push("text-decoration: line-through;"),n}}_nextCell(e,t,n,s){if(e.getWidth()===0)return;let a=e.getChars()==="",o=this._diffStyle(e,t);o&&(this._currentRow+=o.length===0?"</span><span>":"</span><span style='"+o.join(" ")+"'>"),a?this._currentRow+=" ":this._currentRow+=$2(e.getChars())}_serializeString(){return this._htmlContent}};const J2={background:"#F0EBE1",foreground:"#2C1810",cursor:"#8B4513",cursorAccent:"#F0EBE1",selectionBackground:"#D4C5B0",selectionForeground:"#2C1810",black:"#2C1810",red:"#A63D40",green:"#4A7A4A",yellow:"#8B6914",blue:"#4A6FA5",magenta:"#7B4B8A",cyan:"#3D7A7A",white:"#E6DDD0",brightBlack:"#8B7355",brightRed:"#B85C5C",brightGreen:"#5A8A5A",brightYellow:"#A07D1C",brightBlue:"#5A82BA",brightMagenta:"#8E5D9F",brightCyan:"#5A8F8F",brightWhite:"#4A3728"},ek="plotlink-terminal",tk=1,gr="scrollback",Jv=10*1024*1024;function Bd(){return new Promise((e,t)=>{const n=indexedDB.open(ek,tk);n.onupgradeneeded=()=>{const s=n.result;s.objectStoreNames.contains(gr)||s.createObjectStore(gr)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function $o(e,t){const n=t.length>Jv?t.slice(-Jv):t,s=await Bd();return new Promise((a,o)=>{const c=s.transaction(gr,"readwrite");c.objectStore(gr).put(n,e),c.oncomplete=()=>{s.close(),a()},c.onerror=()=>{s.close(),o(c.error)}})}async function ik(e){const t=await Bd();return new Promise((n,s)=>{const o=t.transaction(gr,"readonly").objectStore(gr).get(e);o.onsuccess=()=>{t.close(),n(o.result??null)},o.onerror=()=>{t.close(),s(o.error)}})}async function nk(e){const t=await Bd();return new Promise((n,s)=>{const a=t.transaction(gr,"readwrite");a.objectStore(gr).delete(e),a.oncomplete=()=>{t.close(),n()},a.onerror=()=>{t.close(),s(a.error)}})}const ti=new Map;function rk({token:e,storyName:t,authFetch:n,onSelectStory:s,onDestroySession:a,onArchiveStory:o,confirmedStories:c}){const f=ne.useRef(null),p=ne.useRef(n),[h,g]=ne.useState([]),[_,b]=ne.useState(new Set),[y,x]=ne.useState(null),[E,N]=ne.useState(null),M=ne.useRef(()=>{});ne.useEffect(()=>{p.current=n},[n]);const G=ne.useCallback(B=>{var j;const{width:D}=B.container.getBoundingClientRect();if(!(D<50))try{B.fit.fit(),((j=B.ws)==null?void 0:j.readyState)===WebSocket.OPEN&&B.ws.send(JSON.stringify({type:"resize",cols:B.term.cols,rows:B.term.rows}))}catch{}},[]),U=ne.useCallback(B=>{for(const[D,j]of ti)j.container.style.display=D===B?"block":"none";if(B){const D=ti.get(B);D&&setTimeout(()=>G(D),50)}},[G]),Q=ne.useCallback((B,D,j)=>{const P=window.location.protocol==="https:"?"wss:":"ws:",L=new WebSocket(`${P}//${window.location.host}/ws/terminal?story=${encodeURIComponent(B)}&token=${e}&resume=${j}`);L.onopen=()=>{D.connected=!0,D._retried=!1,b(A=>{const I=new Set(A);return I.delete(B),I}),L.send(JSON.stringify({type:"resize",cols:D.term.cols,rows:D.term.rows}))},L.onmessage=A=>{D.term.write(A.data)},L.onclose=A=>{if(D.connected=!1,D.ws===L){D.ws=null;try{const I=D.serialize.serialize();$o(B,I).catch(()=>{})}catch{}if(A.code===4e3&&!D._retried){D._retried=!0,D.term.write(`\r
99
99
  \x1B[33m[Resume failed — starting fresh session...]\x1B[0m\r
100
100
  `),M.current(B,D,!1);return}b(I=>new Set(I).add(B))}},D.term.onData(A=>{L.readyState===WebSocket.OPEN&&L.send(A)}),D.ws=L},[e]);ne.useEffect(()=>{M.current=Q},[Q]);const K=ne.useCallback(async(B,D)=>{if(!f.current||ti.has(B))return;const{resume:j=!1,autoConnect:P=!0}=D??{},L=document.createElement("div");L.style.width="100%",L.style.height="100%",L.style.display="none",L.style.paddingLeft="10px",L.style.boxSizing="border-box",f.current.appendChild(L);const A=new q2({cols:80,scrollback:5e3,fontSize:13,fontFamily:'"Geist Mono", ui-monospace, monospace',lineHeight:1.05,letterSpacing:0,cursorBlink:!0,cursorStyle:"block",theme:J2,allowTransparency:!1,drawBoldTextInBrightColors:!1,minimumContrastRatio:7}),I=new V2,Y=new Z2;A.loadAddon(I),A.loadAddon(Y),A.open(L);const le={term:A,fit:I,serialize:Y,ws:null,container:L,observer:null,connected:!1},k=new ResizeObserver(()=>{var X;const{width:T}=L.getBoundingClientRect();if(!(T<50))try{I.fit(),((X=le.ws)==null?void 0:X.readyState)===WebSocket.OPEN&&le.ws.send(JSON.stringify({type:"resize",cols:A.cols,rows:A.rows}))}catch{}});k.observe(L),le.observer=k,ti.set(B,le),g(T=>[...T,B]);try{const T=await ik(B);T&&A.write(T)}catch{}P?Q(B,le,j):b(T=>new Set(T).add(B)),setTimeout(()=>G(le),50)},[Q,G]),O=ne.useCallback(async(B,D)=>{const j=ti.get(B);j&&(j.ws&&(j.ws.close(),j.ws=null),D||(await p.current(`/api/terminal/${encodeURIComponent(B)}`,{method:"DELETE"}).catch(()=>{}),j.term.clear()),Q(B,j,D))},[Q]),ee=ne.useCallback(B=>{const D=ti.get(B);if(D){try{const j=D.serialize.serialize();$o(B,j).catch(()=>{})}catch{}D.observer.disconnect(),D.ws&&D.ws.close(),D.term.dispose(),D.container.remove(),ti.delete(B),g(j=>j.filter(P=>P!==B)),b(j=>{const P=new Set(j);return P.delete(B),P}),n(`/api/terminal/${encodeURIComponent(B)}`,{method:"DELETE"}).catch(()=>{}),a==null||a(B)}},[n,a]),oe=ne.useCallback(B=>{var j;const D=ti.get(B);D&&(((j=D.ws)==null?void 0:j.readyState)===WebSocket.OPEN&&D.ws.send(`exit
101
- `),nk(B).catch(()=>{}),D.observer.disconnect(),D.ws&&D.ws.close(),D.term.dispose(),D.container.remove(),ti.delete(B),g(P=>P.filter(L=>L!==B)),b(P=>{const L=new Set(P);return L.delete(B),L}),n(`/api/terminal/${encodeURIComponent(B)}/discard`,{method:"DELETE"}).catch(()=>{}),a==null||a(B))},[n,a]);ne.useEffect(()=>{t&&(ti.has(t)?U(t):p.current(`/api/terminal/session/${encodeURIComponent(t)}`).then(B=>B.ok?B.json():null).then(B=>{if(!ti.has(t)){const D=(B==null?void 0:B.sessionId)&&!(B!=null&&B.running);K(t,{autoConnect:!D}),U(t)}}).catch(()=>{ti.has(t)||(K(t),U(t))}))},[t,K,U]),ne.useEffect(()=>{const B=setInterval(()=>{for(const[D,j]of ti)if(j.connected)try{const P=j.serialize.serialize();$o(D,P).catch(()=>{})}catch{}},3e4);return()=>clearInterval(B)},[]),ne.useEffect(()=>()=>{for(const[B,D]of ti){try{const j=D.serialize.serialize();$o(B,j).catch(()=>{})}catch{}D.observer.disconnect(),D.ws&&D.ws.close(),D.term.dispose(),D.container.remove(),p.current(`/api/terminal/${encodeURIComponent(B)}`,{method:"DELETE"}).catch(()=>{})}ti.clear()},[]);const de=t?_.has(t):!1,q=h.length===0;return S.jsxs("div",{className:"h-full flex flex-col",children:[!q&&S.jsxs("div",{className:"px-2 py-1 border-b border-border flex items-center gap-1 overflow-x-auto",children:[h.map(B=>S.jsxs("div",{onClick:()=>s==null?void 0:s(B),className:`flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono cursor-pointer ${B===t?"bg-accent/10 text-accent":"text-muted hover:text-foreground"}`,children:[S.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${_.has(B)?"bg-amber-500":B===t?"bg-green-600":"bg-muted/50"}`}),S.jsx("span",{className:`truncate max-w-[120px] ${B.startsWith("_new_")?"italic":""}`,children:B.startsWith("_new_")?"Untitled":B}),S.jsx("button",{onClick:D=>{D.stopPropagation(),B.startsWith("_new_")?x(B):ee(B)},className:"ml-0.5 text-muted hover:text-error text-[10px] leading-none",title:"Close terminal",children:"×"})]},B)),t!=null&&t.startsWith("_new_")?S.jsx("button",{onClick:()=>x(t),className:"ml-auto px-2 py-0.5 text-xs text-error hover:bg-surface rounded flex items-center gap-1 flex-shrink-0",children:"Cancel ×"}):t&&o&&(c!=null&&c.has(t))?S.jsx("button",{onClick:()=>N(t),className:"ml-auto px-2 py-0.5 text-xs text-muted hover:text-foreground hover:bg-surface rounded flex items-center gap-1 flex-shrink-0",children:"Archive"}):null]}),S.jsxs("div",{className:"relative flex-1 min-h-0",children:[S.jsx("div",{ref:f,className:"h-full"}),q&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-lg font-serif",children:"Select a story on the left menu"}),S.jsx("p",{className:"text-sm mt-1",children:"to start an AI Writer session"})]})}),y&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",style:{background:"rgba(240, 235, 225, 0.9)"},children:S.jsxs("div",{className:"text-center space-y-3 p-6 bg-surface border border-border rounded-lg shadow-lg max-w-sm",children:[S.jsx("p",{className:"text-sm font-serif text-foreground font-medium",children:"Discard this session?"}),S.jsx("p",{className:"text-xs text-muted",children:"This session will be lost — your AI hasn't created a story structure yet."}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("button",{onClick:()=>x(null),className:"px-4 py-1.5 border border-border text-sm rounded hover:bg-surface",children:"Cancel"}),S.jsx("button",{onClick:()=>{const B=y;x(null),oe(B)},className:"px-4 py-1.5 bg-error text-white text-sm rounded hover:opacity-80",children:"Discard"})]})]})}),E&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",style:{background:"rgba(240, 235, 225, 0.9)"},children:S.jsxs("div",{className:"text-center space-y-3 p-6 bg-surface border border-border rounded-lg shadow-lg max-w-sm",children:[S.jsx("p",{className:"text-sm font-serif text-foreground font-medium",children:"Archive this story?"}),S.jsx("p",{className:"text-xs text-muted",children:"You can restore it later from the Archives view."}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("button",{onClick:()=>N(null),className:"px-4 py-1.5 border border-border text-sm rounded hover:bg-surface",children:"Cancel"}),S.jsx("button",{onClick:async()=>{const B=E;N(null);try{(await p.current("/api/stories/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:B})})).ok&&(ee(B),o==null||o(B))}catch{}},className:"px-4 py-1.5 bg-accent text-white text-sm rounded hover:bg-accent-dim",children:"Archive"})]})]})}),de&&t&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"rgba(240, 235, 225, 0.9)"},children:S.jsxs("div",{className:"text-center space-y-3",children:[S.jsx("p",{className:"text-sm font-serif text-foreground",children:"Terminal disconnected"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:()=>O(t,!0),className:"px-4 py-1.5 bg-accent text-white text-sm rounded hover:bg-accent-dim",children:"Resume Session"}),S.jsx("button",{onClick:()=>O(t,!1),className:"px-4 py-1.5 border border-border text-sm rounded hover:bg-surface",children:"Start Fresh"})]}),S.jsx("p",{className:"text-xs text-muted",children:"Resume continues your previous Claude conversation"})]})})]})]})}function sk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ak=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ok={};function ey(e,t){return(ok.jsx?ak:lk).test(e)}const uk=/[ \t\n\f\r]/g;function ck(e){return typeof e=="object"?e.type==="text"?ty(e.value):!1:ty(e)}function ty(e){return e.replace(uk,"")===""}class ba{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}ba.prototype.normal={};ba.prototype.property={};ba.prototype.space=void 0;function Yb(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new ba(n,s,t)}function cd(e){return e.toLowerCase()}class vi{constructor(t,n){this.attribute=n,this.property=t}}vi.prototype.attribute="";vi.prototype.booleanish=!1;vi.prototype.boolean=!1;vi.prototype.commaOrSpaceSeparated=!1;vi.prototype.commaSeparated=!1;vi.prototype.defined=!1;vi.prototype.mustUseProperty=!1;vi.prototype.number=!1;vi.prototype.overloadedBoolean=!1;vi.prototype.property="";vi.prototype.spaceSeparated=!1;vi.prototype.space=void 0;let hk=0;const Ee=$r(),yt=$r(),hd=$r(),ae=$r(),Je=$r(),Ws=$r(),Ri=$r();function $r(){return 2**++hk}const fd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:yt,commaOrSpaceSeparated:Ri,commaSeparated:Ws,number:ae,overloadedBoolean:hd,spaceSeparated:Je},Symbol.toStringTag,{value:"Module"})),of=Object.keys(fd);class Nd extends vi{constructor(t,n,s,a){let o=-1;if(super(t,n),iy(this,"space",a),typeof s=="number")for(;++o<of.length;){const c=of[o];iy(this,of[o],(s&fd[c])===fd[c])}}}Nd.prototype.defined=!0;function iy(e,t,n){n&&(e[t]=n)}function $s(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const o=new Nd(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(o.mustUseProperty=!0),t[s]=o,n[cd(s)]=s,n[cd(o.attribute)]=s}return new ba(t,n,e.space)}const Vb=$s({properties:{ariaActiveDescendant:null,ariaAtomic:yt,ariaAutoComplete:null,ariaBusy:yt,ariaChecked:yt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Je,ariaCurrent:null,ariaDescribedBy:Je,ariaDetails:null,ariaDisabled:yt,ariaDropEffect:Je,ariaErrorMessage:null,ariaExpanded:yt,ariaFlowTo:Je,ariaGrabbed:yt,ariaHasPopup:null,ariaHidden:yt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Je,ariaLevel:ae,ariaLive:null,ariaModal:yt,ariaMultiLine:yt,ariaMultiSelectable:yt,ariaOrientation:null,ariaOwns:Je,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:yt,ariaReadOnly:yt,ariaRelevant:null,ariaRequired:yt,ariaRoleDescription:Je,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:yt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kb(e,t){return t in e?e[t]:t}function Xb(e,t){return Kb(e,t.toLowerCase())}const fk=$s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ws,acceptCharset:Je,accessKey:Je,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:Je,autoFocus:Ee,autoPlay:Ee,blocking:Je,capture:null,charSet:null,checked:Ee,cite:null,className:Je,cols:ae,colSpan:null,content:null,contentEditable:yt,controls:Ee,controlsList:Je,coords:ae|Ws,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:hd,draggable:yt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:Je,height:ae,hidden:hd,high:ae,href:null,hrefLang:null,htmlFor:Je,httpEquiv:Je,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:Je,itemRef:Je,itemScope:Ee,itemType:Je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,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:Ee,optimum:ae,pattern:null,ping:Je,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:Je,required:Ee,reversed:Ee,rows:ae,rowSpan:ae,sandbox:Je,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:yt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:yt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Je,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:yt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:Xb}),dk=$s({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ri,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Je,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:Ws,g2:Ws,glyphName:Ws,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:Ri,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ri,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ri,rev:Ri,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ri,requiredFeatures:Ri,requiredFonts:Ri,requiredFormats:Ri,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:Ri,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ri,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ri,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kb}),$b=$s({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()}}),Gb=$s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xb}),Zb=$s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),pk={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"},mk=/[A-Z]/g,ny=/-[a-z]/g,_k=/^data[-\w.:]+$/i;function gk(e,t){const n=cd(t);let s=t,a=vi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_k.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ny,yk);s="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ny.test(o)){let c=o.replace(mk,vk);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=Nd}return new a(s,t)}function vk(e){return"-"+e.toLowerCase()}function yk(e){return e.charAt(1).toUpperCase()}const bk=Yb([Vb,fk,$b,Gb,Zb],"html"),Ld=Yb([Vb,dk,$b,Gb,Zb],"svg");function Sk(e){return e.join(" ").trim()}var Ps={},uf,ry;function xk(){if(ry)return uf;ry=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
102
- `,h="/",g="*",_="",b="comment",y="declaration";function x(N,M){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];M=M||{};var G=1,U=1;function Q(P){var L=P.match(t);L&&(G+=L.length);var A=P.lastIndexOf(p);U=~A?P.length-A:U+P.length}function K(){var P={line:G,column:U};return function(L){return L.position=new O(P),de(),L}}function O(P){this.start=P,this.end={line:G,column:U},this.source=M.source}O.prototype.content=N;function ee(P){var L=new Error(M.source+":"+G+":"+U+": "+P);if(L.reason=P,L.filename=M.source,L.line=G,L.column=U,L.source=N,!M.silent)throw L}function oe(P){var L=P.exec(N);if(L){var A=L[0];return Q(A),N=N.slice(A.length),L}}function de(){oe(n)}function q(P){var L;for(P=P||[];L=B();)L!==!1&&P.push(L);return P}function B(){var P=K();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var L=2;_!=N.charAt(L)&&(g!=N.charAt(L)||h!=N.charAt(L+1));)++L;if(L+=2,_===N.charAt(L-1))return ee("End of comment missing");var A=N.slice(2,L-2);return U+=2,Q(A),N=N.slice(L),U+=2,P({type:b,comment:A})}}function D(){var P=K(),L=oe(s);if(L){if(B(),!oe(a))return ee("property missing ':'");var A=oe(o),I=P({type:y,property:E(L[0].replace(e,_)),value:A?E(A[0].replace(e,_)):_});return oe(c),I}}function j(){var P=[];q(P);for(var L;L=D();)L!==!1&&(P.push(L),q(P));return P}return de(),j()}function E(N){return N?N.replace(f,_):_}return uf=x,uf}var sy;function wk(){if(sy)return Ps;sy=1;var e=Ps&&Ps.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=n;const t=e(xk());function n(s,a){let o=null;if(!s||typeof s!="string")return o;const c=(0,t.default)(s),f=typeof a=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:g}=p;f?a(h,g,p):g&&(o=o||{},o[h]=g)}),o}return Ps}var Zl={},ly;function Ck(){if(ly)return Zl;ly=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},p=function(h,g){return g===void 0&&(g={}),o(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,f):h=h.replace(s,f),h.replace(t,c))};return Zl.camelCase=p,Zl}var Ql,ay;function kk(){if(ay)return Ql;ay=1;var e=Ql&&Ql.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(wk()),n=Ck();function s(a,o){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(f,p){f&&p&&(c[(0,n.camelCase)(f,o)]=p)}),c}return s.default=s,Ql=s,Ql}var Ek=kk();const Tk=gu(Ek),Qb=Jb("end"),zd=Jb("start");function Jb(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function eS(e){const t=zd(e),n=Qb(e);if(t&&n)return{start:t,end:n}}function aa(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?oy(e.position):"start"in e||"end"in e?oy(e):"line"in e||"column"in e?dd(e):""}function dd(e){return uy(e&&e.line)+":"+uy(e&&e.column)}function oy(e){return dd(e&&e.start)+"-"+dd(e&&e.end)}function uy(e){return e&&typeof e=="number"?e:1}class Gt extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(c=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?o.ruleId=s:(o.source=s.slice(0,p),o.ruleId=s.slice(p+1))}if(!o.place&&o.ancestors&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=f?f.line:void 0,this.name=aa(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gt.prototype.file="";Gt.prototype.name="";Gt.prototype.reason="";Gt.prototype.message="";Gt.prototype.stack="";Gt.prototype.column=void 0;Gt.prototype.line=void 0;Gt.prototype.ancestors=void 0;Gt.prototype.cause=void 0;Gt.prototype.fatal=void 0;Gt.prototype.place=void 0;Gt.prototype.ruleId=void 0;Gt.prototype.source=void 0;const Od={}.hasOwnProperty,Ak=new Map,Dk=/[A-Z]/g,Rk=new Set(["table","tbody","thead","tfoot","tr"]),Mk=new Set(["td","th"]),tS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Bk(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Pk(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");s=Uk(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,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"?Ld:bk,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=iS(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function iS(e,t,n){if(t.type==="element")return Nk(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Lk(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ok(e,t,n);if(t.type==="mdxjsEsm")return zk(e,t);if(t.type==="root")return jk(e,t,n);if(t.type==="text")return Hk(e,t)}function Nk(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=Ld,e.schema=a),e.ancestors.push(t);const o=rS(e,t.tagName,!1),c=Ik(e,t);let f=Hd(e,t);return Rk.has(t.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!ck(p):!0})),nS(e,c,o,t),jd(c,f),e.ancestors.pop(),e.schema=s,e.create(t,o,c,n)}function Lk(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}da(e,t.position)}function zk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);da(e,t.position)}function Ok(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=Ld,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:rS(e,t.name,!0),c=Fk(e,t),f=Hd(e,t);return nS(e,c,o,t),jd(c,f),e.ancestors.pop(),e.schema=s,e.create(t,o,c,n)}function jk(e,t,n){const s={};return jd(s,Hd(e,t)),e.create(t,e.Fragment,s,n)}function Hk(e,t){return t.value}function nS(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function jd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Uk(e,t,n){return s;function s(a,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function Pk(e,t){return n;function n(s,a,o,c){const f=Array.isArray(o.children),p=zd(s);return t(a,o,c,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function Ik(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&Od.call(t.properties,a)){const o=qk(e,a,t.properties[a]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&Mk.has(t.tagName)?s=f:n[c]=f}}if(s){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function Fk(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const o=s.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else da(e,t.position);else{const a=s.name;let o;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else da(e,t.position);else o=s.value===null?!0:s.value;n[a]=o}return n}function Hd(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:Ak;for(;++s<t.children.length;){const o=t.children[s];let c;if(e.passKeys){const p=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(p){const h=a.get(p)||0;c=p+"-"+h,a.set(p,h+1)}}const f=iS(e,o,c);f!==void 0&&n.push(f)}return n}function qk(e,t,n){const s=gk(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?sk(n):Sk(n)),s.property==="style"){let a=typeof n=="object"?n:Wk(e,String(n));return e.stylePropertyNameCase==="css"&&(a=Yk(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?pk[s.property]||s.property:s.attribute,n]}}function Wk(e,t){try{return Tk(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new Gt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=tS+"#cannot-parse-style-attribute",a}}function rS(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,c;for(;++o<a.length;){const f=ey(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}s=c}else s=ey(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return Od.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);da(e)}function da(e,t){const n=new Gt("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=tS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yk(e){const t={};let n;for(n in e)Od.call(e,n)&&(t[Vk(n)]=e[n]);return t}function Vk(e){let t=e.replace(Dk,Kk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Kk(e){return"-"+e.toLowerCase()}const cf={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"]},Xk={};function Ud(e,t){const n=Xk,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sS(e,s,a)}function sS(e,t,n){if($k(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 cy(e.children,t,n)}return Array.isArray(e)?cy(e,t,n):""}function cy(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=sS(e[a],t,n);return s.join("")}function $k(e){return!!(e&&typeof e=="object")}const hy=document.createElement("i");function Pd(e){const t="&"+e+";";hy.innerHTML=t;const n=hy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Mi(e,t,n,s){const a=e.length;let o=0,c;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,s.length<1e4)c=Array.from(s),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<s.length;)c=s.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function Yi(e,t){return e.length>0?(Mi(e,e.length,0,t),e):t}const fy={}.hasOwnProperty;function lS(e){const t={};let n=-1;for(;++n<e.length;)Gk(t,e[n]);return t}function Gk(e,t){let n;for(n in t){const a=(fy.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){fy.call(a,c)||(a[c]=[]);const f=o[c];Zk(a[c],Array.isArray(f)?f:f?[f]:[])}}}function Zk(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Mi(e,0,0,s)}function aS(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 Qi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ri=vr(/[A-Za-z]/),$t=vr(/[\dA-Za-z]/),Qk=vr(/[#-'*+\--9=?A-Z^-~]/);function pu(e){return e!==null&&(e<32||e===127)}const pd=vr(/\d/),Jk=vr(/[\dA-Fa-f]/),eE=vr(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function Qe(e){return e!==null&&(e<0||e===32)}function Le(e){return e===-2||e===-1||e===32}const xu=vr(new RegExp("\\p{P}|\\p{S}","u")),Kr=vr(/\s/);function vr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gs(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&$t(e.charCodeAt(n+1))&&$t(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),a=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+a+1,c=""),a&&(n+=a,a=0)}return t.join("")+e.slice(s)}function Ue(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(p){return Le(p)?(e.enter(n),f(p)):t(p)}function f(p){return Le(p)&&o++<a?(e.consume(p),f):(e.exit(n),t(p))}}const tE={tokenize:iE};function iE(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ue(e,t,"linePrefix")}function a(f){return e.enter("paragraph"),o(f)}function o(f){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return ve(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const nE={tokenize:rE},dy={tokenize:sE};function rE(e){const t=this,n=[];let s=0,a,o,c;return f;function f(U){if(s<n.length){const Q=n[s];return t.containerState=Q[1],e.attempt(Q[0].continuation,p,h)(U)}return h(U)}function p(U){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&G();const Q=t.events.length;let K=Q,O;for(;K--;)if(t.events[K][0]==="exit"&&t.events[K][1].type==="chunkFlow"){O=t.events[K][1].end;break}M(s);let ee=Q;for(;ee<t.events.length;)t.events[ee][1].end={...O},ee++;return Mi(t.events,K+1,0,t.events.slice(Q)),t.events.length=ee,h(U)}return f(U)}function h(U){if(s===n.length){if(!a)return b(U);if(a.currentConstruct&&a.currentConstruct.concrete)return x(U);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dy,g,_)(U)}function g(U){return a&&G(),M(s),b(U)}function _(U){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,x(U)}function b(U){return t.containerState={},e.attempt(dy,y,x)(U)}function y(U){return s++,n.push([t.currentConstruct,t.containerState]),b(U)}function x(U){if(U===null){a&&G(),M(0),e.consume(U);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),E(U)}function E(U){if(U===null){N(e.exit("chunkFlow"),!0),M(0),e.consume(U);return}return ve(U)?(e.consume(U),N(e.exit("chunkFlow")),s=0,t.interrupt=void 0,f):(e.consume(U),E)}function N(U,Q){const K=t.sliceStream(U);if(Q&&K.push(null),U.previous=o,o&&(o.next=U),o=U,a.defineSkip(U.start),a.write(K),t.parser.lazy[U.start.line]){let O=a.events.length;for(;O--;)if(a.events[O][1].start.offset<c&&(!a.events[O][1].end||a.events[O][1].end.offset>c))return;const ee=t.events.length;let oe=ee,de,q;for(;oe--;)if(t.events[oe][0]==="exit"&&t.events[oe][1].type==="chunkFlow"){if(de){q=t.events[oe][1].end;break}de=!0}for(M(s),O=ee;O<t.events.length;)t.events[O][1].end={...q},O++;Mi(t.events,oe+1,0,t.events.slice(ee)),t.events.length=O}}function M(U){let Q=n.length;for(;Q-- >U;){const K=n[Q];t.containerState=K[1],K[0].exit.call(t,e)}n.length=U}function G(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function sE(e,t,n){return Ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vs(e){if(e===null||Qe(e)||Kr(e))return 1;if(xu(e))return 2}function wu(e,t,n){const s=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!s.includes(o)&&(t=o(t,n),s.push(o))}return t}const md={name:"attention",resolveAll:lE,tokenize:aE};function lE(e,t){let n=-1,s,a,o,c,f,p,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const _={...e[s][1].end},b={...e[n][1].start};py(_,-p),py(b,p),c={type:p>1?"strongSequence":"emphasisSequence",start:_,end:{...e[s][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:p>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[s][1].end={...c.start},e[n][1].start={...f.end},h=[],e[s][1].end.offset-e[s][1].start.offset&&(h=Yi(h,[["enter",e[s][1],t],["exit",e[s][1],t]])),h=Yi(h,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=Yi(h,wu(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),h=Yi(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Yi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Mi(e,s-1,n-s+3,h),n=s+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function aE(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=Vs(s);let o;return c;function c(p){return o=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===o)return e.consume(p),f;const h=e.exit("attentionSequence"),g=Vs(p),_=!g||g===2&&a||n.includes(p),b=!a||a===2&&g||n.includes(s);return h._open=!!(o===42?_:_&&(a||!b)),h._close=!!(o===42?b:b&&(g||!_)),t(p)}}function py(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oE={name:"autolink",tokenize:uE};function uE(e,t,n){let s=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return ri(y)?(e.consume(y),c):y===64?n(y):h(y)}function c(y){return y===43||y===45||y===46||$t(y)?(s=1,f(y)):h(y)}function f(y){return y===58?(e.consume(y),s=0,p):(y===43||y===45||y===46||$t(y))&&s++<32?(e.consume(y),f):(s=0,h(y))}function p(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||pu(y)?n(y):(e.consume(y),p)}function h(y){return y===64?(e.consume(y),g):Qk(y)?(e.consume(y),h):n(y)}function g(y){return $t(y)?_(y):n(y)}function _(y){return y===46?(e.consume(y),s=0,g):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):b(y)}function b(y){if((y===45||$t(y))&&s++<63){const x=y===45?b:_;return e.consume(y),x}return n(y)}}const Sa={partial:!0,tokenize:cE};function cE(e,t,n){return s;function s(o){return Le(o)?Ue(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||ve(o)?t(o):n(o)}}const oS={continuation:{tokenize:fE},exit:dE,name:"blockQuote",tokenize:hE};function hE(e,t,n){const s=this;return a;function a(c){if(c===62){const f=s.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return Le(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function fE(e,t,n){const s=this;return a;function a(c){return Le(c)?Ue(e,o,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(oS,t,n)(c)}}function dE(e){e.exit("blockQuote")}const uS={name:"characterEscape",tokenize:pE};function pE(e,t,n){return s;function s(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return eE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const cS={name:"characterReference",tokenize:mE};function mE(e,t,n){const s=this;let a=0,o,c;return f;function f(_){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(_),e.exit("characterReferenceMarker"),p}function p(_){return _===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(_),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=$t,g(_))}function h(_){return _===88||_===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(_),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=Jk,g):(e.enter("characterReferenceValue"),o=7,c=pd,g(_))}function g(_){if(_===59&&a){const b=e.exit("characterReferenceValue");return c===$t&&!Pd(s.sliceSerialize(b))?n(_):(e.enter("characterReferenceMarker"),e.consume(_),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(_)&&a++<o?(e.consume(_),g):n(_)}}const my={partial:!0,tokenize:gE},_y={concrete:!0,name:"codeFenced",tokenize:_E};function _E(e,t,n){const s=this,a={partial:!0,tokenize:K};let o=0,c=0,f;return p;function p(O){return h(O)}function h(O){const ee=s.events[s.events.length-1];return o=ee&&ee[1].type==="linePrefix"?ee[2].sliceSerialize(ee[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(O)}function g(O){return O===f?(c++,e.consume(O),g):c<3?n(O):(e.exit("codeFencedFenceSequence"),Le(O)?Ue(e,_,"whitespace")(O):_(O))}function _(O){return O===null||ve(O)?(e.exit("codeFencedFence"),s.interrupt?t(O):e.check(my,E,Q)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||ve(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_(O)):Le(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,y,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),b)}function y(O){return O===null||ve(O)?_(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||ve(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),_(O)):O===96&&O===f?n(O):(e.consume(O),x)}function E(O){return e.attempt(a,Q,N)(O)}function N(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),M}function M(O){return o>0&&Le(O)?Ue(e,G,"linePrefix",o+1)(O):G(O)}function G(O){return O===null||ve(O)?e.check(my,E,Q)(O):(e.enter("codeFlowValue"),U(O))}function U(O){return O===null||ve(O)?(e.exit("codeFlowValue"),G(O)):(e.consume(O),U)}function Q(O){return e.exit("codeFenced"),t(O)}function K(O,ee,oe){let de=0;return q;function q(L){return O.enter("lineEnding"),O.consume(L),O.exit("lineEnding"),B}function B(L){return O.enter("codeFencedFence"),Le(L)?Ue(O,D,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):D(L)}function D(L){return L===f?(O.enter("codeFencedFenceSequence"),j(L)):oe(L)}function j(L){return L===f?(de++,O.consume(L),j):de>=c?(O.exit("codeFencedFenceSequence"),Le(L)?Ue(O,P,"whitespace")(L):P(L)):oe(L)}function P(L){return L===null||ve(L)?(O.exit("codeFencedFence"),ee(L)):oe(L)}}}function gE(e,t,n){const s=this;return a;function a(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}const hf={name:"codeIndented",tokenize:yE},vE={partial:!0,tokenize:bE};function yE(e,t,n){const s=this;return a;function a(h){return e.enter("codeIndented"),Ue(e,o,"linePrefix",5)(h)}function o(h){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?p(h):ve(h)?e.attempt(vE,c,p)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||ve(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function p(h){return e.exit("codeIndented"),t(h)}}function bE(e,t,n){const s=this;return a;function a(c){return s.parser.lazy[s.now().line]?n(c):ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):Ue(e,o,"linePrefix",5)(c)}function o(c){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):ve(c)?a(c):n(c)}}const SE={name:"codeText",previous:wE,resolve:xE,tokenize:CE};function xE(e){let t=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)a===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(a=s):(s===t||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),t-=s-a-2,s=a+2),a=void 0);return e}function wE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CE(e,t,n){let s=0,a,o;return c;function c(_){return e.enter("codeText"),e.enter("codeTextSequence"),f(_)}function f(_){return _===96?(e.consume(_),s++,f):(e.exit("codeTextSequence"),p(_))}function p(_){return _===null?n(_):_===32?(e.enter("space"),e.consume(_),e.exit("space"),p):_===96?(o=e.enter("codeTextSequence"),a=0,g(_)):ve(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p):(e.enter("codeTextData"),h(_))}function h(_){return _===null||_===32||_===96||ve(_)?(e.exit("codeTextData"),p(_)):(e.consume(_),h)}function g(_){return _===96?(e.consume(_),a++,g):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(_)):(o.type="codeTextData",h(_))}}class kE{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 s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&Jl(this.left,s),o.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),Jl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jl(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);Jl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jl(this.left,n.reverse())}}}function Jl(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 hS(e){const t={};let n=-1,s,a,o,c,f,p,h;const g=new kE(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(s=g.get(n),n&&s[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(p=s[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,EE(g,n)),n=t[n],h=!0);else if(s[1]._container){for(o=n,a=void 0;o--;)if(c=g.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(s[1].end={...g.get(a)[1].start},f=g.slice(a,n),f.unshift(s),g.splice(a,n-a+1,f))}}return Mi(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function EE(e,t){const n=e.get(t)[1],s=e.get(t)[2];let a=t-1;const o=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,p=[],h={};let g,_,b=-1,y=n,x=0,E=0;const N=[E];for(;y;){for(;e.get(++a)[1]!==y;);o.push(a),y._tokenizer||(g=s.sliceStream(y),y.next||g.push(null),_&&c.defineSkip(y.start),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),_=y,y=y.next}for(y=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(E=b+1,N.push(E),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(c.events=[],y?(y._tokenizer=void 0,y.previous=void 0):N.pop(),b=N.length;b--;){const M=f.slice(N[b],N[b+1]),G=o.pop();p.push([G,G+M.length-1]),e.splice(G,2,M)}for(p.reverse(),b=-1;++b<p.length;)h[x+p[b][0]]=x+p[b][1],x+=p[b][1]-p[b][0]-1;return h}const TE={resolve:DE,tokenize:RE},AE={partial:!0,tokenize:ME};function DE(e){return hS(e),e}function RE(e,t){let n;return s;function s(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(f)}function a(f){return f===null?o(f):ve(f)?e.check(AE,c,o)(f):(e.consume(f),a)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function ME(e,t,n){const s=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ue(e,o,"linePrefix")}function o(c){if(c===null||ve(c))return n(c);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function fS(e,t,n,s,a,o,c,f,p){const h=p||Number.POSITIVE_INFINITY;let g=0;return _;function _(M){return M===60?(e.enter(s),e.enter(a),e.enter(o),e.consume(M),e.exit(o),b):M===null||M===32||M===41||pu(M)?n(M):(e.enter(s),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(M))}function b(M){return M===62?(e.enter(o),e.consume(M),e.exit(o),e.exit(a),e.exit(s),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===62?(e.exit("chunkString"),e.exit(f),b(M)):M===null||M===60||ve(M)?n(M):(e.consume(M),M===92?x:y)}function x(M){return M===60||M===62||M===92?(e.consume(M),y):y(M)}function E(M){return!g&&(M===null||M===41||Qe(M))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(s),t(M)):g<h&&M===40?(e.consume(M),g++,E):M===41?(e.consume(M),g--,E):M===null||M===32||M===40||pu(M)?n(M):(e.consume(M),M===92?N:E)}function N(M){return M===40||M===41||M===92?(e.consume(M),E):E(M)}}function dS(e,t,n,s,a,o){const c=this;let f=0,p;return h;function h(y){return e.enter(s),e.enter(a),e.consume(y),e.exit(a),e.enter(o),g}function g(y){return f>999||y===null||y===91||y===93&&!p||y===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(y):y===93?(e.exit(o),e.enter(a),e.consume(y),e.exit(a),e.exit(s),t):ve(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),_(y))}function _(y){return y===null||y===91||y===93||ve(y)||f++>999?(e.exit("chunkString"),g(y)):(e.consume(y),p||(p=!Le(y)),y===92?b:_)}function b(y){return y===91||y===92||y===93?(e.consume(y),f++,_):_(y)}}function pS(e,t,n,s,a,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(s),e.enter(a),e.consume(b),e.exit(a),c=b===40?41:b,p):n(b)}function p(b){return b===c?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),p(c)):b===null?n(b):ve(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Ue(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===c||b===null||ve(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?_:g)}function _(b){return b===c||b===92?(e.consume(b),g):g(b)}}function oa(e,t){let n;return s;function s(a){return ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):Le(a)?Ue(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const BE={name:"definition",tokenize:LE},NE={partial:!0,tokenize:zE};function LE(e,t,n){const s=this;let a;return o;function o(y){return e.enter("definition"),c(y)}function c(y){return dS.call(s,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function f(y){return a=Qi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),p):n(y)}function p(y){return Qe(y)?oa(e,h)(y):h(y)}function h(y){return fS(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(NE,_,_)(y)}function _(y){return Le(y)?Ue(e,b,"whitespace")(y):b(y)}function b(y){return y===null||ve(y)?(e.exit("definition"),s.parser.defined.push(a),t(y)):n(y)}}function zE(e,t,n){return s;function s(f){return Qe(f)?oa(e,a)(f):n(f)}function a(f){return pS(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Le(f)?Ue(e,c,"whitespace")(f):c(f)}function c(f){return f===null||ve(f)?t(f):n(f)}}const OE={name:"hardBreakEscape",tokenize:jE};function jE(e,t,n){return s;function s(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return ve(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const HE={name:"headingAtx",resolve:UE,tokenize:PE};function UE(e,t){let n=e.length-2,s=3,a,o;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},o={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Mi(e,s,n-s+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function PE(e,t,n){let s=0;return a;function a(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&s++<6?(e.consume(g),c):g===null||Qe(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),p(g)):g===null||ve(g)?(e.exit("atxHeading"),t(g)):Le(g)?Ue(e,f,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function p(g){return g===35?(e.consume(g),p):(e.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||Qe(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),h)}}const IE=["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"],gy=["pre","script","style","textarea"],FE={concrete:!0,name:"htmlFlow",resolveTo:YE,tokenize:VE},qE={partial:!0,tokenize:XE},WE={partial:!0,tokenize:KE};function YE(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 VE(e,t,n){const s=this;let a,o,c,f,p;return h;function h(C){return g(C)}function g(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),_}function _(C){return C===33?(e.consume(C),b):C===47?(e.consume(C),o=!0,E):C===63?(e.consume(C),a=3,s.interrupt?t:k):ri(C)?(e.consume(C),c=String.fromCharCode(C),N):n(C)}function b(C){return C===45?(e.consume(C),a=2,y):C===91?(e.consume(C),a=5,f=0,x):ri(C)?(e.consume(C),a=4,s.interrupt?t:k):n(C)}function y(C){return C===45?(e.consume(C),s.interrupt?t:k):n(C)}function x(C){const se="CDATA[";return C===se.charCodeAt(f++)?(e.consume(C),f===se.length?s.interrupt?t:D:x):n(C)}function E(C){return ri(C)?(e.consume(C),c=String.fromCharCode(C),N):n(C)}function N(C){if(C===null||C===47||C===62||Qe(C)){const se=C===47,pe=c.toLowerCase();return!se&&!o&&gy.includes(pe)?(a=1,s.interrupt?t(C):D(C)):IE.includes(c.toLowerCase())?(a=6,se?(e.consume(C),M):s.interrupt?t(C):D(C)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(C):o?G(C):U(C))}return C===45||$t(C)?(e.consume(C),c+=String.fromCharCode(C),N):n(C)}function M(C){return C===62?(e.consume(C),s.interrupt?t:D):n(C)}function G(C){return Le(C)?(e.consume(C),G):q(C)}function U(C){return C===47?(e.consume(C),q):C===58||C===95||ri(C)?(e.consume(C),Q):Le(C)?(e.consume(C),U):q(C)}function Q(C){return C===45||C===46||C===58||C===95||$t(C)?(e.consume(C),Q):K(C)}function K(C){return C===61?(e.consume(C),O):Le(C)?(e.consume(C),K):U(C)}function O(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),p=C,ee):Le(C)?(e.consume(C),O):oe(C)}function ee(C){return C===p?(e.consume(C),p=null,de):C===null||ve(C)?n(C):(e.consume(C),ee)}function oe(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Qe(C)?K(C):(e.consume(C),oe)}function de(C){return C===47||C===62||Le(C)?U(C):n(C)}function q(C){return C===62?(e.consume(C),B):n(C)}function B(C){return C===null||ve(C)?D(C):Le(C)?(e.consume(C),B):n(C)}function D(C){return C===45&&a===2?(e.consume(C),A):C===60&&a===1?(e.consume(C),I):C===62&&a===4?(e.consume(C),T):C===63&&a===3?(e.consume(C),k):C===93&&a===5?(e.consume(C),le):ve(C)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(qE,X,j)(C)):C===null||ve(C)?(e.exit("htmlFlowData"),j(C)):(e.consume(C),D)}function j(C){return e.check(WE,P,X)(C)}function P(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),L}function L(C){return C===null||ve(C)?j(C):(e.enter("htmlFlowData"),D(C))}function A(C){return C===45?(e.consume(C),k):D(C)}function I(C){return C===47?(e.consume(C),c="",Y):D(C)}function Y(C){if(C===62){const se=c.toLowerCase();return gy.includes(se)?(e.consume(C),T):D(C)}return ri(C)&&c.length<8?(e.consume(C),c+=String.fromCharCode(C),Y):D(C)}function le(C){return C===93?(e.consume(C),k):D(C)}function k(C){return C===62?(e.consume(C),T):C===45&&a===2?(e.consume(C),k):D(C)}function T(C){return C===null||ve(C)?(e.exit("htmlFlowData"),X(C)):(e.consume(C),T)}function X(C){return e.exit("htmlFlow"),t(C)}}function KE(e,t,n){const s=this;return a;function a(c){return ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}function XE(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Sa,t,n)}}const $E={name:"htmlText",tokenize:GE};function GE(e,t,n){const s=this;let a,o,c;return f;function f(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),p}function p(k){return k===33?(e.consume(k),h):k===47?(e.consume(k),K):k===63?(e.consume(k),U):ri(k)?(e.consume(k),oe):n(k)}function h(k){return k===45?(e.consume(k),g):k===91?(e.consume(k),o=0,x):ri(k)?(e.consume(k),G):n(k)}function g(k){return k===45?(e.consume(k),y):n(k)}function _(k){return k===null?n(k):k===45?(e.consume(k),b):ve(k)?(c=_,I(k)):(e.consume(k),_)}function b(k){return k===45?(e.consume(k),y):_(k)}function y(k){return k===62?A(k):k===45?b(k):_(k)}function x(k){const T="CDATA[";return k===T.charCodeAt(o++)?(e.consume(k),o===T.length?E:x):n(k)}function E(k){return k===null?n(k):k===93?(e.consume(k),N):ve(k)?(c=E,I(k)):(e.consume(k),E)}function N(k){return k===93?(e.consume(k),M):E(k)}function M(k){return k===62?A(k):k===93?(e.consume(k),M):E(k)}function G(k){return k===null||k===62?A(k):ve(k)?(c=G,I(k)):(e.consume(k),G)}function U(k){return k===null?n(k):k===63?(e.consume(k),Q):ve(k)?(c=U,I(k)):(e.consume(k),U)}function Q(k){return k===62?A(k):U(k)}function K(k){return ri(k)?(e.consume(k),O):n(k)}function O(k){return k===45||$t(k)?(e.consume(k),O):ee(k)}function ee(k){return ve(k)?(c=ee,I(k)):Le(k)?(e.consume(k),ee):A(k)}function oe(k){return k===45||$t(k)?(e.consume(k),oe):k===47||k===62||Qe(k)?de(k):n(k)}function de(k){return k===47?(e.consume(k),A):k===58||k===95||ri(k)?(e.consume(k),q):ve(k)?(c=de,I(k)):Le(k)?(e.consume(k),de):A(k)}function q(k){return k===45||k===46||k===58||k===95||$t(k)?(e.consume(k),q):B(k)}function B(k){return k===61?(e.consume(k),D):ve(k)?(c=B,I(k)):Le(k)?(e.consume(k),B):de(k)}function D(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),a=k,j):ve(k)?(c=D,I(k)):Le(k)?(e.consume(k),D):(e.consume(k),P)}function j(k){return k===a?(e.consume(k),a=void 0,L):k===null?n(k):ve(k)?(c=j,I(k)):(e.consume(k),j)}function P(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Qe(k)?de(k):(e.consume(k),P)}function L(k){return k===47||k===62||Qe(k)?de(k):n(k)}function A(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function I(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),Y}function Y(k){return Le(k)?Ue(e,le,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):le(k)}function le(k){return e.enter("htmlTextData"),c(k)}}const Id={name:"labelEnd",resolveAll:e5,resolveTo:t5,tokenize:i5},ZE={tokenize:n5},QE={tokenize:r5},JE={tokenize:s5};function e5(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",t+=a}}return e.length!==n.length&&Mi(e,0,e.length,n),e}function t5(e,t){let n=e.length,s=0,a,o,c,f;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(c=n);const p={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[o+s+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",p,t],["enter",h,t]],f=Yi(f,e.slice(o+1,o+s+3)),f=Yi(f,[["enter",g,t]]),f=Yi(f,wu(t.parser.constructs.insideSpan.null,e.slice(o+s+4,c-3),t)),f=Yi(f,[["exit",g,t],e[c-2],e[c-1],["exit",h,t]]),f=Yi(f,e.slice(c+1)),f=Yi(f,[["exit",p,t]]),Mi(e,o,e.length,f),e}function i5(e,t,n){const s=this;let a=s.events.length,o,c;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){o=s.events[a][1];break}return f;function f(b){return o?o._inactive?_(b):(c=s.parser.defined.includes(Qi(s.sliceSerialize({start:o.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),p):n(b)}function p(b){return b===40?e.attempt(ZE,g,c?g:_)(b):b===91?e.attempt(QE,g,c?h:_)(b):c?g(b):_(b)}function h(b){return e.attempt(JE,g,_)(b)}function g(b){return t(b)}function _(b){return o._balanced=!0,n(b)}}function n5(e,t,n){return s;function s(_){return e.enter("resource"),e.enter("resourceMarker"),e.consume(_),e.exit("resourceMarker"),a}function a(_){return Qe(_)?oa(e,o)(_):o(_)}function o(_){return _===41?g(_):fS(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(_)}function c(_){return Qe(_)?oa(e,p)(_):g(_)}function f(_){return n(_)}function p(_){return _===34||_===39||_===40?pS(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(_):g(_)}function h(_){return Qe(_)?oa(e,g)(_):g(_)}function g(_){return _===41?(e.enter("resourceMarker"),e.consume(_),e.exit("resourceMarker"),e.exit("resource"),t):n(_)}}function r5(e,t,n){const s=this;return a;function a(f){return dS.call(s,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return s.parser.defined.includes(Qi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function s5(e,t,n){return s;function s(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const l5={name:"labelStartImage",resolveAll:Id.resolveAll,tokenize:a5};function a5(e,t,n){const s=this;return a;function a(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):t(f)}}const o5={name:"labelStartLink",resolveAll:Id.resolveAll,tokenize:u5};function u5(e,t,n){const s=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):t(c)}}const ff={name:"lineEnding",tokenize:c5};function c5(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ue(e,t,"linePrefix")}}const au={name:"thematicBreak",tokenize:h5};function h5(e,t,n){let s=0,a;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return a=h,f(h)}function f(h){return h===a?(e.enter("thematicBreakSequence"),p(h)):s>=3&&(h===null||ve(h))?(e.exit("thematicBreak"),t(h)):n(h)}function p(h){return h===a?(e.consume(h),s++,p):(e.exit("thematicBreakSequence"),Le(h)?Ue(e,f,"whitespace")(h):f(h))}}const gi={continuation:{tokenize:m5},exit:g5,name:"list",tokenize:p5},f5={partial:!0,tokenize:v5},d5={partial:!0,tokenize:_5};function p5(e,t,n){const s=this,a=s.events[s.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return f;function f(y){const x=s.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!s.containerState.marker||y===s.containerState.marker:pd(y)){if(s.containerState.type||(s.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(au,n,h)(y):h(y);if(!s.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(y)}return n(y)}function p(y){return pd(y)&&++c<10?(e.consume(y),p):(!s.interrupt||c<2)&&(s.containerState.marker?y===s.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"),s.containerState.marker=s.containerState.marker||y,e.check(Sa,s.interrupt?n:g,e.attempt(f5,b,_))}function g(y){return s.containerState.initialBlankLine=!0,o++,b(y)}function _(y){return Le(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return s.containerState.size=o+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function m5(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Sa,a,o);function a(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Ue(e,t,"listItemIndent",s.containerState.size+1)(f)}function o(f){return s.containerState.furtherBlankLines||!Le(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(d5,t,c)(f))}function c(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,Ue(e,e.attempt(gi,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function _5(e,t,n){const s=this;return Ue(e,a,"listItemIndent",s.containerState.size+1);function a(o){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?t(o):n(o)}}function g5(e){e.exit(this.containerState.type)}function v5(e,t,n){const s=this;return Ue(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const c=s.events[s.events.length-1];return!Le(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const vy={name:"setextUnderline",resolveTo:y5,tokenize:b5};function y5(e,t){let n=e.length,s,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",c,t]),e.splice(o+1,0,["exit",e[s][1],t]),e[s][1].end={...e[o][1].end}):e[s][1]=c,e.push(["exit",c,t]),e}function b5(e,t,n){const s=this;let a;return o;function o(h){let g=s.events.length,_;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){_=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||_)?(e.enter("setextHeadingLine"),a=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===a?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Le(h)?Ue(e,p,"lineSuffix")(h):p(h))}function p(h){return h===null||ve(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const S5={tokenize:x5};function x5(e){const t=this,n=e.attempt(Sa,s,e.attempt(this.parser.constructs.flowInitial,a,Ue(e,e.attempt(this.parser.constructs.flow,a,e.attempt(TE,a)),"linePrefix")));return n;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const w5={resolveAll:_S()},C5=mS("string"),k5=mS("text");function mS(e){return{resolveAll:_S(e==="text"?E5:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],o=n.attempt(a,c,f);return c;function c(g){return h(g)?o(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),p}function p(g){return h(g)?(n.exit("data"),o(g)):(n.consume(g),p)}function h(g){if(g===null)return!0;const _=a[g];let b=-1;if(_)for(;++b<_.length;){const y=_[b];if(!y.previous||y.previous.call(s,s.previous))return!0}return!1}}}function _S(e){return t;function t(n,s){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,s):n}}function E5(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 s=e[n-1][1],a=t.sliceStream(s);let o=a.length,c=-1,f=0,p;for(;o--;){const h=a[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)p=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:s.start._bufferIndex+c,_index:s.start._index+o,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const T5={42:gi,43:gi,45:gi,48:gi,49:gi,50:gi,51:gi,52:gi,53:gi,54:gi,55:gi,56:gi,57:gi,62:oS},A5={91:BE},D5={[-2]:hf,[-1]:hf,32:hf},R5={35:HE,42:au,45:[vy,au],60:FE,61:vy,95:au,96:_y,126:_y},M5={38:cS,92:uS},B5={[-5]:ff,[-4]:ff,[-3]:ff,33:l5,38:cS,42:md,60:[oE,$E],91:o5,92:[OE,uS],93:Id,95:md,96:SE},N5={null:[md,w5]},L5={null:[42,95]},z5={null:[]},O5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:L5,contentInitial:A5,disable:z5,document:T5,flow:R5,flowInitial:D5,insideSpan:N5,string:M5,text:B5},Symbol.toStringTag,{value:"Module"}));function j5(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let c=[],f=[];const p={attempt:ee(K),check:ee(O),consume:G,enter:U,exit:Q,interrupt:ee(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:x,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:_};let g=t.tokenize.call(h,p);return t.resolveAll&&o.push(t),h;function _(B){return c=Yi(c,B),N(),c[c.length-1]!==null?[]:(oe(t,0),h.events=wu(o,h.events,h),h.events)}function b(B,D){return U5(y(B),D)}function y(B){return H5(c,B)}function x(){const{_bufferIndex:B,_index:D,line:j,column:P,offset:L}=s;return{_bufferIndex:B,_index:D,line:j,column:P,offset:L}}function E(B){a[B.line]=B.column,q()}function N(){let B;for(;s._index<c.length;){const D=c[s._index];if(typeof D=="string")for(B=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===B&&s._bufferIndex<D.length;)M(D.charCodeAt(s._bufferIndex));else M(D)}}function M(B){g=g(B)}function G(B){ve(B)?(s.line++,s.column=1,s.offset+=B===-3?2:1,q()):B!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=B}function U(B,D){const j=D||{};return j.type=B,j.start=x(),h.events.push(["enter",j,h]),f.push(j),j}function Q(B){const D=f.pop();return D.end=x(),h.events.push(["exit",D,h]),D}function K(B,D){oe(B,D.from)}function O(B,D){D.restore()}function ee(B,D){return j;function j(P,L,A){let I,Y,le,k;return Array.isArray(P)?X(P):"tokenize"in P?X([P]):T(P);function T(he){return be;function be(Te){const Re=Te!==null&&he[Te],jt=Te!==null&&he.null,Zt=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(jt)?jt:jt?[jt]:[]];return X(Zt)(Te)}}function X(he){return I=he,Y=0,he.length===0?A:C(he[Y])}function C(he){return be;function be(Te){return k=de(),le=he,he.partial||(h.currentConstruct=he),he.name&&h.parser.constructs.disable.null.includes(he.name)?pe():he.tokenize.call(D?Object.assign(Object.create(h),D):h,p,se,pe)(Te)}}function se(he){return B(le,k),L}function pe(he){return k.restore(),++Y<I.length?C(I[Y]):A}}}function oe(B,D){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&Mi(h.events,D,h.events.length-D,B.resolve(h.events.slice(D),h)),B.resolveTo&&(h.events=B.resolveTo(h.events,h))}function de(){const B=x(),D=h.previous,j=h.currentConstruct,P=h.events.length,L=Array.from(f);return{from:P,restore:A};function A(){s=B,h.previous=D,h.currentConstruct=j,h.events.length=P,f=L,q()}}function q(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function H5(e,t){const n=t.start._index,s=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let c;if(n===a)c=[e[n].slice(s,o)];else{if(c=e.slice(n,a),s>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(s):c.shift()}o>0&&c.push(e[a].slice(0,o))}return c}function U5(e,t){let n=-1;const s=[];let a;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
101
+ `),nk(B).catch(()=>{}),D.observer.disconnect(),D.ws&&D.ws.close(),D.term.dispose(),D.container.remove(),ti.delete(B),g(P=>P.filter(L=>L!==B)),b(P=>{const L=new Set(P);return L.delete(B),L}),n(`/api/terminal/${encodeURIComponent(B)}/discard`,{method:"DELETE"}).catch(()=>{}),a==null||a(B))},[n,a]);ne.useEffect(()=>{t&&(ti.has(t)?U(t):p.current(`/api/terminal/session/${encodeURIComponent(t)}`).then(B=>B.ok?B.json():null).then(B=>{if(!ti.has(t)){const D=(B==null?void 0:B.sessionId)&&!(B!=null&&B.running);K(t,{autoConnect:!D}),U(t)}}).catch(()=>{ti.has(t)||(K(t),U(t))}))},[t,K,U]),ne.useEffect(()=>{const B=setInterval(()=>{for(const[D,j]of ti)if(j.connected)try{const P=j.serialize.serialize();$o(D,P).catch(()=>{})}catch{}},3e4);return()=>clearInterval(B)},[]),ne.useEffect(()=>()=>{for(const[B,D]of ti){try{const j=D.serialize.serialize();$o(B,j).catch(()=>{})}catch{}D.observer.disconnect(),D.ws&&D.ws.close(),D.term.dispose(),D.container.remove(),p.current(`/api/terminal/${encodeURIComponent(B)}`,{method:"DELETE"}).catch(()=>{})}ti.clear()},[]);const de=t?_.has(t):!1,F=h.length===0;return S.jsxs("div",{className:"h-full flex flex-col",children:[!F&&S.jsxs("div",{className:"px-2 py-1 border-b border-border flex items-center gap-1 overflow-x-auto",children:[h.map(B=>S.jsxs("div",{onClick:()=>s==null?void 0:s(B),className:`flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono cursor-pointer ${B===t?"bg-accent/10 text-accent":"text-muted hover:text-foreground"}`,children:[S.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${_.has(B)?"bg-amber-500":B===t?"bg-green-600":"bg-muted/50"}`}),S.jsx("span",{className:`truncate max-w-[120px] ${B.startsWith("_new_")?"italic":""}`,children:B.startsWith("_new_")?"Untitled":B}),S.jsx("button",{onClick:D=>{D.stopPropagation(),B.startsWith("_new_")?x(B):ee(B)},className:"ml-0.5 text-muted hover:text-error text-[10px] leading-none",title:"Close terminal",children:"×"})]},B)),t!=null&&t.startsWith("_new_")?S.jsx("button",{onClick:()=>x(t),className:"ml-auto px-2 py-0.5 text-xs text-error hover:bg-surface rounded flex items-center gap-1 flex-shrink-0",children:"Cancel ×"}):t&&o&&(c!=null&&c.has(t))?S.jsx("button",{onClick:()=>N(t),className:"ml-auto px-2 py-0.5 text-xs text-muted hover:text-foreground hover:bg-surface rounded flex items-center gap-1 flex-shrink-0",children:"Archive"}):null]}),S.jsxs("div",{className:"relative flex-1 min-h-0",children:[S.jsx("div",{ref:f,className:"h-full"}),F&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-lg font-serif",children:"Select a story on the left menu"}),S.jsx("p",{className:"text-sm mt-1",children:"to start an AI Writer session"})]})}),y&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",style:{background:"rgba(240, 235, 225, 0.9)"},children:S.jsxs("div",{className:"text-center space-y-3 p-6 bg-surface border border-border rounded-lg shadow-lg max-w-sm",children:[S.jsx("p",{className:"text-sm font-serif text-foreground font-medium",children:"Discard this session?"}),S.jsx("p",{className:"text-xs text-muted",children:"This session will be lost — your AI hasn't created a story structure yet."}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("button",{onClick:()=>x(null),className:"px-4 py-1.5 border border-border text-sm rounded hover:bg-surface",children:"Cancel"}),S.jsx("button",{onClick:()=>{const B=y;x(null),oe(B)},className:"px-4 py-1.5 bg-error text-white text-sm rounded hover:opacity-80",children:"Discard"})]})]})}),E&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",style:{background:"rgba(240, 235, 225, 0.9)"},children:S.jsxs("div",{className:"text-center space-y-3 p-6 bg-surface border border-border rounded-lg shadow-lg max-w-sm",children:[S.jsx("p",{className:"text-sm font-serif text-foreground font-medium",children:"Archive this story?"}),S.jsx("p",{className:"text-xs text-muted",children:"You can restore it later from the Archives view."}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("button",{onClick:()=>N(null),className:"px-4 py-1.5 border border-border text-sm rounded hover:bg-surface",children:"Cancel"}),S.jsx("button",{onClick:async()=>{const B=E;N(null);try{(await p.current("/api/stories/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:B})})).ok&&(ee(B),o==null||o(B))}catch{}},className:"px-4 py-1.5 bg-accent text-white text-sm rounded hover:bg-accent-dim",children:"Archive"})]})]})}),de&&t&&S.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"rgba(240, 235, 225, 0.9)"},children:S.jsxs("div",{className:"text-center space-y-3",children:[S.jsx("p",{className:"text-sm font-serif text-foreground",children:"Terminal disconnected"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:()=>O(t,!0),className:"px-4 py-1.5 bg-accent text-white text-sm rounded hover:bg-accent-dim",children:"Resume Session"}),S.jsx("button",{onClick:()=>O(t,!1),className:"px-4 py-1.5 border border-border text-sm rounded hover:bg-surface",children:"Start Fresh"})]}),S.jsx("p",{className:"text-xs text-muted",children:"Resume continues your previous Claude conversation"})]})})]})]})}function sk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ak=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ok={};function ey(e,t){return(ok.jsx?ak:lk).test(e)}const uk=/[ \t\n\f\r]/g;function ck(e){return typeof e=="object"?e.type==="text"?ty(e.value):!1:ty(e)}function ty(e){return e.replace(uk,"")===""}class ba{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}ba.prototype.normal={};ba.prototype.property={};ba.prototype.space=void 0;function Yb(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new ba(n,s,t)}function cd(e){return e.toLowerCase()}class vi{constructor(t,n){this.attribute=n,this.property=t}}vi.prototype.attribute="";vi.prototype.booleanish=!1;vi.prototype.boolean=!1;vi.prototype.commaOrSpaceSeparated=!1;vi.prototype.commaSeparated=!1;vi.prototype.defined=!1;vi.prototype.mustUseProperty=!1;vi.prototype.number=!1;vi.prototype.overloadedBoolean=!1;vi.prototype.property="";vi.prototype.spaceSeparated=!1;vi.prototype.space=void 0;let hk=0;const Ee=$r(),yt=$r(),hd=$r(),ae=$r(),Je=$r(),Ws=$r(),Ri=$r();function $r(){return 2**++hk}const fd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:yt,commaOrSpaceSeparated:Ri,commaSeparated:Ws,number:ae,overloadedBoolean:hd,spaceSeparated:Je},Symbol.toStringTag,{value:"Module"})),of=Object.keys(fd);class Nd extends vi{constructor(t,n,s,a){let o=-1;if(super(t,n),iy(this,"space",a),typeof s=="number")for(;++o<of.length;){const c=of[o];iy(this,of[o],(s&fd[c])===fd[c])}}}Nd.prototype.defined=!0;function iy(e,t,n){n&&(e[t]=n)}function $s(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const o=new Nd(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(o.mustUseProperty=!0),t[s]=o,n[cd(s)]=s,n[cd(o.attribute)]=s}return new ba(t,n,e.space)}const Vb=$s({properties:{ariaActiveDescendant:null,ariaAtomic:yt,ariaAutoComplete:null,ariaBusy:yt,ariaChecked:yt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Je,ariaCurrent:null,ariaDescribedBy:Je,ariaDetails:null,ariaDisabled:yt,ariaDropEffect:Je,ariaErrorMessage:null,ariaExpanded:yt,ariaFlowTo:Je,ariaGrabbed:yt,ariaHasPopup:null,ariaHidden:yt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Je,ariaLevel:ae,ariaLive:null,ariaModal:yt,ariaMultiLine:yt,ariaMultiSelectable:yt,ariaOrientation:null,ariaOwns:Je,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:yt,ariaReadOnly:yt,ariaRelevant:null,ariaRequired:yt,ariaRoleDescription:Je,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:yt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kb(e,t){return t in e?e[t]:t}function Xb(e,t){return Kb(e,t.toLowerCase())}const fk=$s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ws,acceptCharset:Je,accessKey:Je,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:Je,autoFocus:Ee,autoPlay:Ee,blocking:Je,capture:null,charSet:null,checked:Ee,cite:null,className:Je,cols:ae,colSpan:null,content:null,contentEditable:yt,controls:Ee,controlsList:Je,coords:ae|Ws,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:hd,draggable:yt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:Je,height:ae,hidden:hd,high:ae,href:null,hrefLang:null,htmlFor:Je,httpEquiv:Je,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:Je,itemRef:Je,itemScope:Ee,itemType:Je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,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:Ee,optimum:ae,pattern:null,ping:Je,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:Je,required:Ee,reversed:Ee,rows:ae,rowSpan:ae,sandbox:Je,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:yt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:yt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Je,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:yt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:Xb}),dk=$s({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ri,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Je,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:Ws,g2:Ws,glyphName:Ws,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:Ri,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ri,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ri,rev:Ri,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ri,requiredFeatures:Ri,requiredFonts:Ri,requiredFormats:Ri,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:Ri,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ri,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ri,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kb}),$b=$s({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()}}),Gb=$s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xb}),Zb=$s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),pk={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"},mk=/[A-Z]/g,ny=/-[a-z]/g,_k=/^data[-\w.:]+$/i;function gk(e,t){const n=cd(t);let s=t,a=vi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_k.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ny,yk);s="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ny.test(o)){let c=o.replace(mk,vk);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=Nd}return new a(s,t)}function vk(e){return"-"+e.toLowerCase()}function yk(e){return e.charAt(1).toUpperCase()}const bk=Yb([Vb,fk,$b,Gb,Zb],"html"),Ld=Yb([Vb,dk,$b,Gb,Zb],"svg");function Sk(e){return e.join(" ").trim()}var Ps={},uf,ry;function xk(){if(ry)return uf;ry=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
102
+ `,h="/",g="*",_="",b="comment",y="declaration";function x(N,M){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];M=M||{};var G=1,U=1;function Q(P){var L=P.match(t);L&&(G+=L.length);var A=P.lastIndexOf(p);U=~A?P.length-A:U+P.length}function K(){var P={line:G,column:U};return function(L){return L.position=new O(P),de(),L}}function O(P){this.start=P,this.end={line:G,column:U},this.source=M.source}O.prototype.content=N;function ee(P){var L=new Error(M.source+":"+G+":"+U+": "+P);if(L.reason=P,L.filename=M.source,L.line=G,L.column=U,L.source=N,!M.silent)throw L}function oe(P){var L=P.exec(N);if(L){var A=L[0];return Q(A),N=N.slice(A.length),L}}function de(){oe(n)}function F(P){var L;for(P=P||[];L=B();)L!==!1&&P.push(L);return P}function B(){var P=K();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var L=2;_!=N.charAt(L)&&(g!=N.charAt(L)||h!=N.charAt(L+1));)++L;if(L+=2,_===N.charAt(L-1))return ee("End of comment missing");var A=N.slice(2,L-2);return U+=2,Q(A),N=N.slice(L),U+=2,P({type:b,comment:A})}}function D(){var P=K(),L=oe(s);if(L){if(B(),!oe(a))return ee("property missing ':'");var A=oe(o),I=P({type:y,property:E(L[0].replace(e,_)),value:A?E(A[0].replace(e,_)):_});return oe(c),I}}function j(){var P=[];F(P);for(var L;L=D();)L!==!1&&(P.push(L),F(P));return P}return de(),j()}function E(N){return N?N.replace(f,_):_}return uf=x,uf}var sy;function wk(){if(sy)return Ps;sy=1;var e=Ps&&Ps.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=n;const t=e(xk());function n(s,a){let o=null;if(!s||typeof s!="string")return o;const c=(0,t.default)(s),f=typeof a=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:g}=p;f?a(h,g,p):g&&(o=o||{},o[h]=g)}),o}return Ps}var Zl={},ly;function Ck(){if(ly)return Zl;ly=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},p=function(h,g){return g===void 0&&(g={}),o(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,f):h=h.replace(s,f),h.replace(t,c))};return Zl.camelCase=p,Zl}var Ql,ay;function kk(){if(ay)return Ql;ay=1;var e=Ql&&Ql.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(wk()),n=Ck();function s(a,o){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(f,p){f&&p&&(c[(0,n.camelCase)(f,o)]=p)}),c}return s.default=s,Ql=s,Ql}var Ek=kk();const Tk=gu(Ek),Qb=Jb("end"),zd=Jb("start");function Jb(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function eS(e){const t=zd(e),n=Qb(e);if(t&&n)return{start:t,end:n}}function aa(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?oy(e.position):"start"in e||"end"in e?oy(e):"line"in e||"column"in e?dd(e):""}function dd(e){return uy(e&&e.line)+":"+uy(e&&e.column)}function oy(e){return dd(e&&e.start)+"-"+dd(e&&e.end)}function uy(e){return e&&typeof e=="number"?e:1}class Gt extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(c=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?o.ruleId=s:(o.source=s.slice(0,p),o.ruleId=s.slice(p+1))}if(!o.place&&o.ancestors&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=f?f.line:void 0,this.name=aa(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gt.prototype.file="";Gt.prototype.name="";Gt.prototype.reason="";Gt.prototype.message="";Gt.prototype.stack="";Gt.prototype.column=void 0;Gt.prototype.line=void 0;Gt.prototype.ancestors=void 0;Gt.prototype.cause=void 0;Gt.prototype.fatal=void 0;Gt.prototype.place=void 0;Gt.prototype.ruleId=void 0;Gt.prototype.source=void 0;const Od={}.hasOwnProperty,Ak=new Map,Dk=/[A-Z]/g,Rk=new Set(["table","tbody","thead","tfoot","tr"]),Mk=new Set(["td","th"]),tS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Bk(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Pk(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");s=Uk(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,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"?Ld:bk,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=iS(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function iS(e,t,n){if(t.type==="element")return Nk(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Lk(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ok(e,t,n);if(t.type==="mdxjsEsm")return zk(e,t);if(t.type==="root")return jk(e,t,n);if(t.type==="text")return Hk(e,t)}function Nk(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=Ld,e.schema=a),e.ancestors.push(t);const o=rS(e,t.tagName,!1),c=Ik(e,t);let f=Hd(e,t);return Rk.has(t.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!ck(p):!0})),nS(e,c,o,t),jd(c,f),e.ancestors.pop(),e.schema=s,e.create(t,o,c,n)}function Lk(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}da(e,t.position)}function zk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);da(e,t.position)}function Ok(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=Ld,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:rS(e,t.name,!0),c=Fk(e,t),f=Hd(e,t);return nS(e,c,o,t),jd(c,f),e.ancestors.pop(),e.schema=s,e.create(t,o,c,n)}function jk(e,t,n){const s={};return jd(s,Hd(e,t)),e.create(t,e.Fragment,s,n)}function Hk(e,t){return t.value}function nS(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function jd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Uk(e,t,n){return s;function s(a,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function Pk(e,t){return n;function n(s,a,o,c){const f=Array.isArray(o.children),p=zd(s);return t(a,o,c,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function Ik(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&Od.call(t.properties,a)){const o=qk(e,a,t.properties[a]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&Mk.has(t.tagName)?s=f:n[c]=f}}if(s){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function Fk(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const o=s.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else da(e,t.position);else{const a=s.name;let o;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else da(e,t.position);else o=s.value===null?!0:s.value;n[a]=o}return n}function Hd(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:Ak;for(;++s<t.children.length;){const o=t.children[s];let c;if(e.passKeys){const p=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(p){const h=a.get(p)||0;c=p+"-"+h,a.set(p,h+1)}}const f=iS(e,o,c);f!==void 0&&n.push(f)}return n}function qk(e,t,n){const s=gk(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?sk(n):Sk(n)),s.property==="style"){let a=typeof n=="object"?n:Wk(e,String(n));return e.stylePropertyNameCase==="css"&&(a=Yk(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?pk[s.property]||s.property:s.attribute,n]}}function Wk(e,t){try{return Tk(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new Gt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=tS+"#cannot-parse-style-attribute",a}}function rS(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,c;for(;++o<a.length;){const f=ey(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}s=c}else s=ey(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return Od.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);da(e)}function da(e,t){const n=new Gt("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=tS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yk(e){const t={};let n;for(n in e)Od.call(e,n)&&(t[Vk(n)]=e[n]);return t}function Vk(e){let t=e.replace(Dk,Kk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Kk(e){return"-"+e.toLowerCase()}const cf={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"]},Xk={};function Ud(e,t){const n=Xk,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sS(e,s,a)}function sS(e,t,n){if($k(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 cy(e.children,t,n)}return Array.isArray(e)?cy(e,t,n):""}function cy(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=sS(e[a],t,n);return s.join("")}function $k(e){return!!(e&&typeof e=="object")}const hy=document.createElement("i");function Pd(e){const t="&"+e+";";hy.innerHTML=t;const n=hy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Mi(e,t,n,s){const a=e.length;let o=0,c;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,s.length<1e4)c=Array.from(s),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<s.length;)c=s.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function Yi(e,t){return e.length>0?(Mi(e,e.length,0,t),e):t}const fy={}.hasOwnProperty;function lS(e){const t={};let n=-1;for(;++n<e.length;)Gk(t,e[n]);return t}function Gk(e,t){let n;for(n in t){const a=(fy.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){fy.call(a,c)||(a[c]=[]);const f=o[c];Zk(a[c],Array.isArray(f)?f:f?[f]:[])}}}function Zk(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Mi(e,0,0,s)}function aS(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 Qi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ri=vr(/[A-Za-z]/),$t=vr(/[\dA-Za-z]/),Qk=vr(/[#-'*+\--9=?A-Z^-~]/);function pu(e){return e!==null&&(e<32||e===127)}const pd=vr(/\d/),Jk=vr(/[\dA-Fa-f]/),eE=vr(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function Qe(e){return e!==null&&(e<0||e===32)}function Le(e){return e===-2||e===-1||e===32}const xu=vr(new RegExp("\\p{P}|\\p{S}","u")),Kr=vr(/\s/);function vr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gs(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&$t(e.charCodeAt(n+1))&&$t(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),a=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+a+1,c=""),a&&(n+=a,a=0)}return t.join("")+e.slice(s)}function Ue(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(p){return Le(p)?(e.enter(n),f(p)):t(p)}function f(p){return Le(p)&&o++<a?(e.consume(p),f):(e.exit(n),t(p))}}const tE={tokenize:iE};function iE(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ue(e,t,"linePrefix")}function a(f){return e.enter("paragraph"),o(f)}function o(f){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return ve(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const nE={tokenize:rE},dy={tokenize:sE};function rE(e){const t=this,n=[];let s=0,a,o,c;return f;function f(U){if(s<n.length){const Q=n[s];return t.containerState=Q[1],e.attempt(Q[0].continuation,p,h)(U)}return h(U)}function p(U){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&G();const Q=t.events.length;let K=Q,O;for(;K--;)if(t.events[K][0]==="exit"&&t.events[K][1].type==="chunkFlow"){O=t.events[K][1].end;break}M(s);let ee=Q;for(;ee<t.events.length;)t.events[ee][1].end={...O},ee++;return Mi(t.events,K+1,0,t.events.slice(Q)),t.events.length=ee,h(U)}return f(U)}function h(U){if(s===n.length){if(!a)return b(U);if(a.currentConstruct&&a.currentConstruct.concrete)return x(U);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dy,g,_)(U)}function g(U){return a&&G(),M(s),b(U)}function _(U){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,x(U)}function b(U){return t.containerState={},e.attempt(dy,y,x)(U)}function y(U){return s++,n.push([t.currentConstruct,t.containerState]),b(U)}function x(U){if(U===null){a&&G(),M(0),e.consume(U);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),E(U)}function E(U){if(U===null){N(e.exit("chunkFlow"),!0),M(0),e.consume(U);return}return ve(U)?(e.consume(U),N(e.exit("chunkFlow")),s=0,t.interrupt=void 0,f):(e.consume(U),E)}function N(U,Q){const K=t.sliceStream(U);if(Q&&K.push(null),U.previous=o,o&&(o.next=U),o=U,a.defineSkip(U.start),a.write(K),t.parser.lazy[U.start.line]){let O=a.events.length;for(;O--;)if(a.events[O][1].start.offset<c&&(!a.events[O][1].end||a.events[O][1].end.offset>c))return;const ee=t.events.length;let oe=ee,de,F;for(;oe--;)if(t.events[oe][0]==="exit"&&t.events[oe][1].type==="chunkFlow"){if(de){F=t.events[oe][1].end;break}de=!0}for(M(s),O=ee;O<t.events.length;)t.events[O][1].end={...F},O++;Mi(t.events,oe+1,0,t.events.slice(ee)),t.events.length=O}}function M(U){let Q=n.length;for(;Q-- >U;){const K=n[Q];t.containerState=K[1],K[0].exit.call(t,e)}n.length=U}function G(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function sE(e,t,n){return Ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vs(e){if(e===null||Qe(e)||Kr(e))return 1;if(xu(e))return 2}function wu(e,t,n){const s=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!s.includes(o)&&(t=o(t,n),s.push(o))}return t}const md={name:"attention",resolveAll:lE,tokenize:aE};function lE(e,t){let n=-1,s,a,o,c,f,p,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const _={...e[s][1].end},b={...e[n][1].start};py(_,-p),py(b,p),c={type:p>1?"strongSequence":"emphasisSequence",start:_,end:{...e[s][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:p>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[s][1].end={...c.start},e[n][1].start={...f.end},h=[],e[s][1].end.offset-e[s][1].start.offset&&(h=Yi(h,[["enter",e[s][1],t],["exit",e[s][1],t]])),h=Yi(h,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=Yi(h,wu(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),h=Yi(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Yi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Mi(e,s-1,n-s+3,h),n=s+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function aE(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=Vs(s);let o;return c;function c(p){return o=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===o)return e.consume(p),f;const h=e.exit("attentionSequence"),g=Vs(p),_=!g||g===2&&a||n.includes(p),b=!a||a===2&&g||n.includes(s);return h._open=!!(o===42?_:_&&(a||!b)),h._close=!!(o===42?b:b&&(g||!_)),t(p)}}function py(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oE={name:"autolink",tokenize:uE};function uE(e,t,n){let s=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return ri(y)?(e.consume(y),c):y===64?n(y):h(y)}function c(y){return y===43||y===45||y===46||$t(y)?(s=1,f(y)):h(y)}function f(y){return y===58?(e.consume(y),s=0,p):(y===43||y===45||y===46||$t(y))&&s++<32?(e.consume(y),f):(s=0,h(y))}function p(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||pu(y)?n(y):(e.consume(y),p)}function h(y){return y===64?(e.consume(y),g):Qk(y)?(e.consume(y),h):n(y)}function g(y){return $t(y)?_(y):n(y)}function _(y){return y===46?(e.consume(y),s=0,g):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):b(y)}function b(y){if((y===45||$t(y))&&s++<63){const x=y===45?b:_;return e.consume(y),x}return n(y)}}const Sa={partial:!0,tokenize:cE};function cE(e,t,n){return s;function s(o){return Le(o)?Ue(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||ve(o)?t(o):n(o)}}const oS={continuation:{tokenize:fE},exit:dE,name:"blockQuote",tokenize:hE};function hE(e,t,n){const s=this;return a;function a(c){if(c===62){const f=s.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return Le(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function fE(e,t,n){const s=this;return a;function a(c){return Le(c)?Ue(e,o,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(oS,t,n)(c)}}function dE(e){e.exit("blockQuote")}const uS={name:"characterEscape",tokenize:pE};function pE(e,t,n){return s;function s(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return eE(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const cS={name:"characterReference",tokenize:mE};function mE(e,t,n){const s=this;let a=0,o,c;return f;function f(_){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(_),e.exit("characterReferenceMarker"),p}function p(_){return _===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(_),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=$t,g(_))}function h(_){return _===88||_===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(_),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=Jk,g):(e.enter("characterReferenceValue"),o=7,c=pd,g(_))}function g(_){if(_===59&&a){const b=e.exit("characterReferenceValue");return c===$t&&!Pd(s.sliceSerialize(b))?n(_):(e.enter("characterReferenceMarker"),e.consume(_),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(_)&&a++<o?(e.consume(_),g):n(_)}}const my={partial:!0,tokenize:gE},_y={concrete:!0,name:"codeFenced",tokenize:_E};function _E(e,t,n){const s=this,a={partial:!0,tokenize:K};let o=0,c=0,f;return p;function p(O){return h(O)}function h(O){const ee=s.events[s.events.length-1];return o=ee&&ee[1].type==="linePrefix"?ee[2].sliceSerialize(ee[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(O)}function g(O){return O===f?(c++,e.consume(O),g):c<3?n(O):(e.exit("codeFencedFenceSequence"),Le(O)?Ue(e,_,"whitespace")(O):_(O))}function _(O){return O===null||ve(O)?(e.exit("codeFencedFence"),s.interrupt?t(O):e.check(my,E,Q)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||ve(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_(O)):Le(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,y,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),b)}function y(O){return O===null||ve(O)?_(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||ve(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),_(O)):O===96&&O===f?n(O):(e.consume(O),x)}function E(O){return e.attempt(a,Q,N)(O)}function N(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),M}function M(O){return o>0&&Le(O)?Ue(e,G,"linePrefix",o+1)(O):G(O)}function G(O){return O===null||ve(O)?e.check(my,E,Q)(O):(e.enter("codeFlowValue"),U(O))}function U(O){return O===null||ve(O)?(e.exit("codeFlowValue"),G(O)):(e.consume(O),U)}function Q(O){return e.exit("codeFenced"),t(O)}function K(O,ee,oe){let de=0;return F;function F(L){return O.enter("lineEnding"),O.consume(L),O.exit("lineEnding"),B}function B(L){return O.enter("codeFencedFence"),Le(L)?Ue(O,D,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):D(L)}function D(L){return L===f?(O.enter("codeFencedFenceSequence"),j(L)):oe(L)}function j(L){return L===f?(de++,O.consume(L),j):de>=c?(O.exit("codeFencedFenceSequence"),Le(L)?Ue(O,P,"whitespace")(L):P(L)):oe(L)}function P(L){return L===null||ve(L)?(O.exit("codeFencedFence"),ee(L)):oe(L)}}}function gE(e,t,n){const s=this;return a;function a(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}const hf={name:"codeIndented",tokenize:yE},vE={partial:!0,tokenize:bE};function yE(e,t,n){const s=this;return a;function a(h){return e.enter("codeIndented"),Ue(e,o,"linePrefix",5)(h)}function o(h){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?p(h):ve(h)?e.attempt(vE,c,p)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||ve(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function p(h){return e.exit("codeIndented"),t(h)}}function bE(e,t,n){const s=this;return a;function a(c){return s.parser.lazy[s.now().line]?n(c):ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):Ue(e,o,"linePrefix",5)(c)}function o(c){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):ve(c)?a(c):n(c)}}const SE={name:"codeText",previous:wE,resolve:xE,tokenize:CE};function xE(e){let t=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)a===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(a=s):(s===t||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),t-=s-a-2,s=a+2),a=void 0);return e}function wE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CE(e,t,n){let s=0,a,o;return c;function c(_){return e.enter("codeText"),e.enter("codeTextSequence"),f(_)}function f(_){return _===96?(e.consume(_),s++,f):(e.exit("codeTextSequence"),p(_))}function p(_){return _===null?n(_):_===32?(e.enter("space"),e.consume(_),e.exit("space"),p):_===96?(o=e.enter("codeTextSequence"),a=0,g(_)):ve(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p):(e.enter("codeTextData"),h(_))}function h(_){return _===null||_===32||_===96||ve(_)?(e.exit("codeTextData"),p(_)):(e.consume(_),h)}function g(_){return _===96?(e.consume(_),a++,g):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(_)):(o.type="codeTextData",h(_))}}class kE{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 s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&Jl(this.left,s),o.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),Jl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jl(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);Jl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jl(this.left,n.reverse())}}}function Jl(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 hS(e){const t={};let n=-1,s,a,o,c,f,p,h;const g=new kE(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(s=g.get(n),n&&s[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(p=s[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,EE(g,n)),n=t[n],h=!0);else if(s[1]._container){for(o=n,a=void 0;o--;)if(c=g.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(s[1].end={...g.get(a)[1].start},f=g.slice(a,n),f.unshift(s),g.splice(a,n-a+1,f))}}return Mi(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function EE(e,t){const n=e.get(t)[1],s=e.get(t)[2];let a=t-1;const o=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,p=[],h={};let g,_,b=-1,y=n,x=0,E=0;const N=[E];for(;y;){for(;e.get(++a)[1]!==y;);o.push(a),y._tokenizer||(g=s.sliceStream(y),y.next||g.push(null),_&&c.defineSkip(y.start),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),_=y,y=y.next}for(y=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(E=b+1,N.push(E),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(c.events=[],y?(y._tokenizer=void 0,y.previous=void 0):N.pop(),b=N.length;b--;){const M=f.slice(N[b],N[b+1]),G=o.pop();p.push([G,G+M.length-1]),e.splice(G,2,M)}for(p.reverse(),b=-1;++b<p.length;)h[x+p[b][0]]=x+p[b][1],x+=p[b][1]-p[b][0]-1;return h}const TE={resolve:DE,tokenize:RE},AE={partial:!0,tokenize:ME};function DE(e){return hS(e),e}function RE(e,t){let n;return s;function s(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(f)}function a(f){return f===null?o(f):ve(f)?e.check(AE,c,o)(f):(e.consume(f),a)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function ME(e,t,n){const s=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ue(e,o,"linePrefix")}function o(c){if(c===null||ve(c))return n(c);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function fS(e,t,n,s,a,o,c,f,p){const h=p||Number.POSITIVE_INFINITY;let g=0;return _;function _(M){return M===60?(e.enter(s),e.enter(a),e.enter(o),e.consume(M),e.exit(o),b):M===null||M===32||M===41||pu(M)?n(M):(e.enter(s),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(M))}function b(M){return M===62?(e.enter(o),e.consume(M),e.exit(o),e.exit(a),e.exit(s),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===62?(e.exit("chunkString"),e.exit(f),b(M)):M===null||M===60||ve(M)?n(M):(e.consume(M),M===92?x:y)}function x(M){return M===60||M===62||M===92?(e.consume(M),y):y(M)}function E(M){return!g&&(M===null||M===41||Qe(M))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(s),t(M)):g<h&&M===40?(e.consume(M),g++,E):M===41?(e.consume(M),g--,E):M===null||M===32||M===40||pu(M)?n(M):(e.consume(M),M===92?N:E)}function N(M){return M===40||M===41||M===92?(e.consume(M),E):E(M)}}function dS(e,t,n,s,a,o){const c=this;let f=0,p;return h;function h(y){return e.enter(s),e.enter(a),e.consume(y),e.exit(a),e.enter(o),g}function g(y){return f>999||y===null||y===91||y===93&&!p||y===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(y):y===93?(e.exit(o),e.enter(a),e.consume(y),e.exit(a),e.exit(s),t):ve(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),_(y))}function _(y){return y===null||y===91||y===93||ve(y)||f++>999?(e.exit("chunkString"),g(y)):(e.consume(y),p||(p=!Le(y)),y===92?b:_)}function b(y){return y===91||y===92||y===93?(e.consume(y),f++,_):_(y)}}function pS(e,t,n,s,a,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(s),e.enter(a),e.consume(b),e.exit(a),c=b===40?41:b,p):n(b)}function p(b){return b===c?(e.enter(a),e.consume(b),e.exit(a),e.exit(s),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),p(c)):b===null?n(b):ve(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Ue(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===c||b===null||ve(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?_:g)}function _(b){return b===c||b===92?(e.consume(b),g):g(b)}}function oa(e,t){let n;return s;function s(a){return ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):Le(a)?Ue(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const BE={name:"definition",tokenize:LE},NE={partial:!0,tokenize:zE};function LE(e,t,n){const s=this;let a;return o;function o(y){return e.enter("definition"),c(y)}function c(y){return dS.call(s,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function f(y){return a=Qi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),p):n(y)}function p(y){return Qe(y)?oa(e,h)(y):h(y)}function h(y){return fS(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(NE,_,_)(y)}function _(y){return Le(y)?Ue(e,b,"whitespace")(y):b(y)}function b(y){return y===null||ve(y)?(e.exit("definition"),s.parser.defined.push(a),t(y)):n(y)}}function zE(e,t,n){return s;function s(f){return Qe(f)?oa(e,a)(f):n(f)}function a(f){return pS(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Le(f)?Ue(e,c,"whitespace")(f):c(f)}function c(f){return f===null||ve(f)?t(f):n(f)}}const OE={name:"hardBreakEscape",tokenize:jE};function jE(e,t,n){return s;function s(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return ve(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const HE={name:"headingAtx",resolve:UE,tokenize:PE};function UE(e,t){let n=e.length-2,s=3,a,o;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},o={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Mi(e,s,n-s+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function PE(e,t,n){let s=0;return a;function a(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&s++<6?(e.consume(g),c):g===null||Qe(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),p(g)):g===null||ve(g)?(e.exit("atxHeading"),t(g)):Le(g)?Ue(e,f,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function p(g){return g===35?(e.consume(g),p):(e.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||Qe(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),h)}}const IE=["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"],gy=["pre","script","style","textarea"],FE={concrete:!0,name:"htmlFlow",resolveTo:YE,tokenize:VE},qE={partial:!0,tokenize:XE},WE={partial:!0,tokenize:KE};function YE(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 VE(e,t,n){const s=this;let a,o,c,f,p;return h;function h(C){return g(C)}function g(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),_}function _(C){return C===33?(e.consume(C),b):C===47?(e.consume(C),o=!0,E):C===63?(e.consume(C),a=3,s.interrupt?t:k):ri(C)?(e.consume(C),c=String.fromCharCode(C),N):n(C)}function b(C){return C===45?(e.consume(C),a=2,y):C===91?(e.consume(C),a=5,f=0,x):ri(C)?(e.consume(C),a=4,s.interrupt?t:k):n(C)}function y(C){return C===45?(e.consume(C),s.interrupt?t:k):n(C)}function x(C){const se="CDATA[";return C===se.charCodeAt(f++)?(e.consume(C),f===se.length?s.interrupt?t:D:x):n(C)}function E(C){return ri(C)?(e.consume(C),c=String.fromCharCode(C),N):n(C)}function N(C){if(C===null||C===47||C===62||Qe(C)){const se=C===47,pe=c.toLowerCase();return!se&&!o&&gy.includes(pe)?(a=1,s.interrupt?t(C):D(C)):IE.includes(c.toLowerCase())?(a=6,se?(e.consume(C),M):s.interrupt?t(C):D(C)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(C):o?G(C):U(C))}return C===45||$t(C)?(e.consume(C),c+=String.fromCharCode(C),N):n(C)}function M(C){return C===62?(e.consume(C),s.interrupt?t:D):n(C)}function G(C){return Le(C)?(e.consume(C),G):F(C)}function U(C){return C===47?(e.consume(C),F):C===58||C===95||ri(C)?(e.consume(C),Q):Le(C)?(e.consume(C),U):F(C)}function Q(C){return C===45||C===46||C===58||C===95||$t(C)?(e.consume(C),Q):K(C)}function K(C){return C===61?(e.consume(C),O):Le(C)?(e.consume(C),K):U(C)}function O(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),p=C,ee):Le(C)?(e.consume(C),O):oe(C)}function ee(C){return C===p?(e.consume(C),p=null,de):C===null||ve(C)?n(C):(e.consume(C),ee)}function oe(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Qe(C)?K(C):(e.consume(C),oe)}function de(C){return C===47||C===62||Le(C)?U(C):n(C)}function F(C){return C===62?(e.consume(C),B):n(C)}function B(C){return C===null||ve(C)?D(C):Le(C)?(e.consume(C),B):n(C)}function D(C){return C===45&&a===2?(e.consume(C),A):C===60&&a===1?(e.consume(C),I):C===62&&a===4?(e.consume(C),T):C===63&&a===3?(e.consume(C),k):C===93&&a===5?(e.consume(C),le):ve(C)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(qE,X,j)(C)):C===null||ve(C)?(e.exit("htmlFlowData"),j(C)):(e.consume(C),D)}function j(C){return e.check(WE,P,X)(C)}function P(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),L}function L(C){return C===null||ve(C)?j(C):(e.enter("htmlFlowData"),D(C))}function A(C){return C===45?(e.consume(C),k):D(C)}function I(C){return C===47?(e.consume(C),c="",Y):D(C)}function Y(C){if(C===62){const se=c.toLowerCase();return gy.includes(se)?(e.consume(C),T):D(C)}return ri(C)&&c.length<8?(e.consume(C),c+=String.fromCharCode(C),Y):D(C)}function le(C){return C===93?(e.consume(C),k):D(C)}function k(C){return C===62?(e.consume(C),T):C===45&&a===2?(e.consume(C),k):D(C)}function T(C){return C===null||ve(C)?(e.exit("htmlFlowData"),X(C)):(e.consume(C),T)}function X(C){return e.exit("htmlFlow"),t(C)}}function KE(e,t,n){const s=this;return a;function a(c){return ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}function XE(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Sa,t,n)}}const $E={name:"htmlText",tokenize:GE};function GE(e,t,n){const s=this;let a,o,c;return f;function f(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),p}function p(k){return k===33?(e.consume(k),h):k===47?(e.consume(k),K):k===63?(e.consume(k),U):ri(k)?(e.consume(k),oe):n(k)}function h(k){return k===45?(e.consume(k),g):k===91?(e.consume(k),o=0,x):ri(k)?(e.consume(k),G):n(k)}function g(k){return k===45?(e.consume(k),y):n(k)}function _(k){return k===null?n(k):k===45?(e.consume(k),b):ve(k)?(c=_,I(k)):(e.consume(k),_)}function b(k){return k===45?(e.consume(k),y):_(k)}function y(k){return k===62?A(k):k===45?b(k):_(k)}function x(k){const T="CDATA[";return k===T.charCodeAt(o++)?(e.consume(k),o===T.length?E:x):n(k)}function E(k){return k===null?n(k):k===93?(e.consume(k),N):ve(k)?(c=E,I(k)):(e.consume(k),E)}function N(k){return k===93?(e.consume(k),M):E(k)}function M(k){return k===62?A(k):k===93?(e.consume(k),M):E(k)}function G(k){return k===null||k===62?A(k):ve(k)?(c=G,I(k)):(e.consume(k),G)}function U(k){return k===null?n(k):k===63?(e.consume(k),Q):ve(k)?(c=U,I(k)):(e.consume(k),U)}function Q(k){return k===62?A(k):U(k)}function K(k){return ri(k)?(e.consume(k),O):n(k)}function O(k){return k===45||$t(k)?(e.consume(k),O):ee(k)}function ee(k){return ve(k)?(c=ee,I(k)):Le(k)?(e.consume(k),ee):A(k)}function oe(k){return k===45||$t(k)?(e.consume(k),oe):k===47||k===62||Qe(k)?de(k):n(k)}function de(k){return k===47?(e.consume(k),A):k===58||k===95||ri(k)?(e.consume(k),F):ve(k)?(c=de,I(k)):Le(k)?(e.consume(k),de):A(k)}function F(k){return k===45||k===46||k===58||k===95||$t(k)?(e.consume(k),F):B(k)}function B(k){return k===61?(e.consume(k),D):ve(k)?(c=B,I(k)):Le(k)?(e.consume(k),B):de(k)}function D(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),a=k,j):ve(k)?(c=D,I(k)):Le(k)?(e.consume(k),D):(e.consume(k),P)}function j(k){return k===a?(e.consume(k),a=void 0,L):k===null?n(k):ve(k)?(c=j,I(k)):(e.consume(k),j)}function P(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Qe(k)?de(k):(e.consume(k),P)}function L(k){return k===47||k===62||Qe(k)?de(k):n(k)}function A(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function I(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),Y}function Y(k){return Le(k)?Ue(e,le,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):le(k)}function le(k){return e.enter("htmlTextData"),c(k)}}const Id={name:"labelEnd",resolveAll:e5,resolveTo:t5,tokenize:i5},ZE={tokenize:n5},QE={tokenize:r5},JE={tokenize:s5};function e5(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",t+=a}}return e.length!==n.length&&Mi(e,0,e.length,n),e}function t5(e,t){let n=e.length,s=0,a,o,c,f;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(c=n);const p={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[o+s+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",p,t],["enter",h,t]],f=Yi(f,e.slice(o+1,o+s+3)),f=Yi(f,[["enter",g,t]]),f=Yi(f,wu(t.parser.constructs.insideSpan.null,e.slice(o+s+4,c-3),t)),f=Yi(f,[["exit",g,t],e[c-2],e[c-1],["exit",h,t]]),f=Yi(f,e.slice(c+1)),f=Yi(f,[["exit",p,t]]),Mi(e,o,e.length,f),e}function i5(e,t,n){const s=this;let a=s.events.length,o,c;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){o=s.events[a][1];break}return f;function f(b){return o?o._inactive?_(b):(c=s.parser.defined.includes(Qi(s.sliceSerialize({start:o.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),p):n(b)}function p(b){return b===40?e.attempt(ZE,g,c?g:_)(b):b===91?e.attempt(QE,g,c?h:_)(b):c?g(b):_(b)}function h(b){return e.attempt(JE,g,_)(b)}function g(b){return t(b)}function _(b){return o._balanced=!0,n(b)}}function n5(e,t,n){return s;function s(_){return e.enter("resource"),e.enter("resourceMarker"),e.consume(_),e.exit("resourceMarker"),a}function a(_){return Qe(_)?oa(e,o)(_):o(_)}function o(_){return _===41?g(_):fS(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(_)}function c(_){return Qe(_)?oa(e,p)(_):g(_)}function f(_){return n(_)}function p(_){return _===34||_===39||_===40?pS(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(_):g(_)}function h(_){return Qe(_)?oa(e,g)(_):g(_)}function g(_){return _===41?(e.enter("resourceMarker"),e.consume(_),e.exit("resourceMarker"),e.exit("resource"),t):n(_)}}function r5(e,t,n){const s=this;return a;function a(f){return dS.call(s,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return s.parser.defined.includes(Qi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function s5(e,t,n){return s;function s(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const l5={name:"labelStartImage",resolveAll:Id.resolveAll,tokenize:a5};function a5(e,t,n){const s=this;return a;function a(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):t(f)}}const o5={name:"labelStartLink",resolveAll:Id.resolveAll,tokenize:u5};function u5(e,t,n){const s=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):t(c)}}const ff={name:"lineEnding",tokenize:c5};function c5(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ue(e,t,"linePrefix")}}const au={name:"thematicBreak",tokenize:h5};function h5(e,t,n){let s=0,a;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return a=h,f(h)}function f(h){return h===a?(e.enter("thematicBreakSequence"),p(h)):s>=3&&(h===null||ve(h))?(e.exit("thematicBreak"),t(h)):n(h)}function p(h){return h===a?(e.consume(h),s++,p):(e.exit("thematicBreakSequence"),Le(h)?Ue(e,f,"whitespace")(h):f(h))}}const gi={continuation:{tokenize:m5},exit:g5,name:"list",tokenize:p5},f5={partial:!0,tokenize:v5},d5={partial:!0,tokenize:_5};function p5(e,t,n){const s=this,a=s.events[s.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return f;function f(y){const x=s.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!s.containerState.marker||y===s.containerState.marker:pd(y)){if(s.containerState.type||(s.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(au,n,h)(y):h(y);if(!s.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(y)}return n(y)}function p(y){return pd(y)&&++c<10?(e.consume(y),p):(!s.interrupt||c<2)&&(s.containerState.marker?y===s.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"),s.containerState.marker=s.containerState.marker||y,e.check(Sa,s.interrupt?n:g,e.attempt(f5,b,_))}function g(y){return s.containerState.initialBlankLine=!0,o++,b(y)}function _(y){return Le(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return s.containerState.size=o+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function m5(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Sa,a,o);function a(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Ue(e,t,"listItemIndent",s.containerState.size+1)(f)}function o(f){return s.containerState.furtherBlankLines||!Le(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(d5,t,c)(f))}function c(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,Ue(e,e.attempt(gi,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function _5(e,t,n){const s=this;return Ue(e,a,"listItemIndent",s.containerState.size+1);function a(o){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?t(o):n(o)}}function g5(e){e.exit(this.containerState.type)}function v5(e,t,n){const s=this;return Ue(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const c=s.events[s.events.length-1];return!Le(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const vy={name:"setextUnderline",resolveTo:y5,tokenize:b5};function y5(e,t){let n=e.length,s,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",c,t]),e.splice(o+1,0,["exit",e[s][1],t]),e[s][1].end={...e[o][1].end}):e[s][1]=c,e.push(["exit",c,t]),e}function b5(e,t,n){const s=this;let a;return o;function o(h){let g=s.events.length,_;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){_=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||_)?(e.enter("setextHeadingLine"),a=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===a?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Le(h)?Ue(e,p,"lineSuffix")(h):p(h))}function p(h){return h===null||ve(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const S5={tokenize:x5};function x5(e){const t=this,n=e.attempt(Sa,s,e.attempt(this.parser.constructs.flowInitial,a,Ue(e,e.attempt(this.parser.constructs.flow,a,e.attempt(TE,a)),"linePrefix")));return n;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const w5={resolveAll:_S()},C5=mS("string"),k5=mS("text");function mS(e){return{resolveAll:_S(e==="text"?E5:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],o=n.attempt(a,c,f);return c;function c(g){return h(g)?o(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),p}function p(g){return h(g)?(n.exit("data"),o(g)):(n.consume(g),p)}function h(g){if(g===null)return!0;const _=a[g];let b=-1;if(_)for(;++b<_.length;){const y=_[b];if(!y.previous||y.previous.call(s,s.previous))return!0}return!1}}}function _S(e){return t;function t(n,s){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,s):n}}function E5(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 s=e[n-1][1],a=t.sliceStream(s);let o=a.length,c=-1,f=0,p;for(;o--;){const h=a[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)p=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:s.start._bufferIndex+c,_index:s.start._index+o,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const T5={42:gi,43:gi,45:gi,48:gi,49:gi,50:gi,51:gi,52:gi,53:gi,54:gi,55:gi,56:gi,57:gi,62:oS},A5={91:BE},D5={[-2]:hf,[-1]:hf,32:hf},R5={35:HE,42:au,45:[vy,au],60:FE,61:vy,95:au,96:_y,126:_y},M5={38:cS,92:uS},B5={[-5]:ff,[-4]:ff,[-3]:ff,33:l5,38:cS,42:md,60:[oE,$E],91:o5,92:[OE,uS],93:Id,95:md,96:SE},N5={null:[md,w5]},L5={null:[42,95]},z5={null:[]},O5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:L5,contentInitial:A5,disable:z5,document:T5,flow:R5,flowInitial:D5,insideSpan:N5,string:M5,text:B5},Symbol.toStringTag,{value:"Module"}));function j5(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let c=[],f=[];const p={attempt:ee(K),check:ee(O),consume:G,enter:U,exit:Q,interrupt:ee(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:x,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:_};let g=t.tokenize.call(h,p);return t.resolveAll&&o.push(t),h;function _(B){return c=Yi(c,B),N(),c[c.length-1]!==null?[]:(oe(t,0),h.events=wu(o,h.events,h),h.events)}function b(B,D){return U5(y(B),D)}function y(B){return H5(c,B)}function x(){const{_bufferIndex:B,_index:D,line:j,column:P,offset:L}=s;return{_bufferIndex:B,_index:D,line:j,column:P,offset:L}}function E(B){a[B.line]=B.column,F()}function N(){let B;for(;s._index<c.length;){const D=c[s._index];if(typeof D=="string")for(B=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===B&&s._bufferIndex<D.length;)M(D.charCodeAt(s._bufferIndex));else M(D)}}function M(B){g=g(B)}function G(B){ve(B)?(s.line++,s.column=1,s.offset+=B===-3?2:1,F()):B!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=B}function U(B,D){const j=D||{};return j.type=B,j.start=x(),h.events.push(["enter",j,h]),f.push(j),j}function Q(B){const D=f.pop();return D.end=x(),h.events.push(["exit",D,h]),D}function K(B,D){oe(B,D.from)}function O(B,D){D.restore()}function ee(B,D){return j;function j(P,L,A){let I,Y,le,k;return Array.isArray(P)?X(P):"tokenize"in P?X([P]):T(P);function T(he){return be;function be(Te){const Re=Te!==null&&he[Te],jt=Te!==null&&he.null,Zt=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(jt)?jt:jt?[jt]:[]];return X(Zt)(Te)}}function X(he){return I=he,Y=0,he.length===0?A:C(he[Y])}function C(he){return be;function be(Te){return k=de(),le=he,he.partial||(h.currentConstruct=he),he.name&&h.parser.constructs.disable.null.includes(he.name)?pe():he.tokenize.call(D?Object.assign(Object.create(h),D):h,p,se,pe)(Te)}}function se(he){return B(le,k),L}function pe(he){return k.restore(),++Y<I.length?C(I[Y]):A}}}function oe(B,D){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&Mi(h.events,D,h.events.length-D,B.resolve(h.events.slice(D),h)),B.resolveTo&&(h.events=B.resolveTo(h.events,h))}function de(){const B=x(),D=h.previous,j=h.currentConstruct,P=h.events.length,L=Array.from(f);return{from:P,restore:A};function A(){s=B,h.previous=D,h.currentConstruct=j,h.events.length=P,f=L,F()}}function F(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function H5(e,t){const n=t.start._index,s=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let c;if(n===a)c=[e[n].slice(s,o)];else{if(c=e.slice(n,a),s>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(s):c.shift()}o>0&&c.push(e[a].slice(0,o))}return c}function U5(e,t){let n=-1;const s=[];let a;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
103
103
  `;break}case-3:{c=`\r
104
- `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&a)continue;c=" ";break}default:c=String.fromCharCode(o)}a=o===-2,s.push(c)}return s.join("")}function P5(e){const s={constructs:lS([O5,...(e||{}).extensions||[]]),content:a(tE),defined:[],document:a(nE),flow:a(S5),lazy:{},string:a(C5),text:a(k5)};return s;function a(o){return c;function c(f){return j5(s,o,f)}}}function I5(e){for(;!hS(e););return e}const yy=/[\0\t\n\r]/g;function F5(){let e=1,t="",n=!0,s;return a;function a(o,c,f){const p=[];let h,g,_,b,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),_=0,t="",n&&(o.charCodeAt(0)===65279&&_++,n=void 0);_<o.length;){if(yy.lastIndex=_,h=yy.exec(o),b=h&&h.index!==void 0?h.index:o.length,y=o.charCodeAt(b),!h){t=o.slice(_);break}if(y===10&&_===b&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),_<b&&(p.push(o.slice(_,b)),e+=b-_),y){case 0:{p.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,p.push(-2);e++<g;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:s=!0,e=1}_=b+1}return f&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const q5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function W5(e){return e.replace(q5,Y5)}function Y5(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return aS(n.slice(o?2:1),o?16:10)}return Pd(n)||e}const gS={}.hasOwnProperty;function V5(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),K5(n)(I5(P5(n).document().write(F5()(e,t,!0))))}function K5(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Qr),autolinkProtocol:de,autolinkEmail:de,atxHeading:o(Gr),blockQuote:o(jt),characterEscape:de,characterReference:de,codeFenced:o(Zt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Zt,c),codeText:o(ai,c),codeTextData:de,data:de,codeFlowValue:de,definition:o(He),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(yi),hardBreakEscape:o(Zr),hardBreakTrailing:o(Zr),htmlFlow:o(Ca,c),htmlFlowData:de,htmlText:o(Ca,c),htmlTextData:de,image:o(ka),label:c,link:o(Qr),listItem:o(Zs),listItemValue:b,listOrdered:o(Jr,_),listUnordered:o(Jr),paragraph:o(Tu),reference:C,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Gr),strong:o(Au),thematicBreak:o(Du)},exit:{atxHeading:p(),atxHeadingSequence:K,autolink:p(),autolinkEmail:Re,autolinkProtocol:Te,blockQuote:p(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:he,characterReference:be,codeFenced:p(N),codeFencedFence:E,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:q,codeIndented:p(M),codeText:p(L),codeTextData:q,data:q,definition:p(),definitionDestinationString:Q,definitionLabelString:G,definitionTitleString:U,emphasis:p(),hardBreakEscape:p(D),hardBreakTrailing:p(D),htmlFlow:p(j),htmlFlowData:q,htmlText:p(P),htmlTextData:q,image:p(I),label:le,labelText:Y,lineEnding:B,link:p(A),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:se,resourceDestinationString:k,resourceTitleString:T,resource:X,setextHeading:p(oe),setextHeadingLineSequence:ee,setextHeadingText:O,strong:p(),thematicBreak:p()}};vS(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(J){let ce={type:"root",children:[]};const Se={stack:[ce],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:g,data:n},Me=[];let qe=-1;for(;++qe<J.length;)if(J[qe][1].type==="listOrdered"||J[qe][1].type==="listUnordered")if(J[qe][0]==="enter")Me.push(qe);else{const bi=Me.pop();qe=a(J,bi,qe)}for(qe=-1;++qe<J.length;){const bi=t[J[qe][0]];gS.call(bi,J[qe][1].type)&&bi[J[qe][1].type].call(Object.assign({sliceSerialize:J[qe][2].sliceSerialize},Se),J[qe][1])}if(Se.tokenStack.length>0){const bi=Se.tokenStack[Se.tokenStack.length-1];(bi[1]||by).call(Se,void 0,bi[0])}for(ce.position={start:fr(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:fr(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)ce=t.transforms[qe](ce)||ce;return ce}function a(J,ce,Se){let Me=ce-1,qe=-1,bi=!1,fn,Jt,xt,oi;for(;++Me<=Se;){const Ge=J[Me];switch(Ge[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ge[0]==="enter"?qe++:qe--,oi=void 0;break}case"lineEndingBlank":{Ge[0]==="enter"&&(fn&&!oi&&!qe&&!xt&&(xt=Me),oi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:oi=void 0}if(!qe&&Ge[0]==="enter"&&Ge[1].type==="listItemPrefix"||qe===-1&&Ge[0]==="exit"&&(Ge[1].type==="listUnordered"||Ge[1].type==="listOrdered")){if(fn){let Hn=Me;for(Jt=void 0;Hn--;){const Ki=J[Hn];if(Ki[1].type==="lineEnding"||Ki[1].type==="lineEndingBlank"){if(Ki[0]==="exit")continue;Jt&&(J[Jt][1].type="lineEndingBlank",bi=!0),Ki[1].type="lineEnding",Jt=Hn}else if(!(Ki[1].type==="linePrefix"||Ki[1].type==="blockQuotePrefix"||Ki[1].type==="blockQuotePrefixWhitespace"||Ki[1].type==="blockQuoteMarker"||Ki[1].type==="listItemIndent"))break}xt&&(!Jt||xt<Jt)&&(fn._spread=!0),fn.end=Object.assign({},Jt?J[Jt][1].start:Ge[1].end),J.splice(Jt||Me,0,["exit",fn,Ge[2]]),Me++,Se++}if(Ge[1].type==="listItemPrefix"){const Hn={type:"listItem",_spread:!1,start:Object.assign({},Ge[1].start),end:void 0};fn=Hn,J.splice(Me,0,["enter",Hn,Ge[2]]),Me++,Se++,xt=void 0,oi=!0}}}return J[ce][1]._spread=bi,Se}function o(J,ce){return Se;function Se(Me){f.call(this,J(Me),Me),ce&&ce.call(this,Me)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(J,ce,Se){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([ce,Se||void 0]),J.position={start:fr(ce.start),end:void 0}}function p(J){return ce;function ce(Se){J&&J.call(this,Se),h.call(this,Se)}}function h(J,ce){const Se=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==J.type&&(ce?ce.call(this,J,Me[0]):(Me[1]||by).call(this,J,Me[0]));else throw new Error("Cannot close `"+J.type+"` ("+aa({start:J.start,end:J.end})+"): it’s not open");Se.position.end=fr(J.end)}function g(){return Ud(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function b(J){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function y(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=J}function x(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=J}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/(\r?\n|\r)$/g,"")}function G(J){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ce,Se.identifier=Qi(this.sliceSerialize(J)).toLowerCase()}function U(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function Q(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function K(J){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Se=this.sliceSerialize(J).length;ce.depth=Se}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function ee(J){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function oe(){this.data.setextHeadingSlurpLineEnding=void 0}function de(J){const Se=this.stack[this.stack.length-1].children;let Me=Se[Se.length-1];(!Me||Me.type!=="text")&&(Me=Qt(),Me.position={start:fr(J.start),end:void 0},Se.push(Me)),this.stack.push(Me)}function q(J){const ce=this.stack.pop();ce.value+=this.sliceSerialize(J),ce.position.end=fr(J.end)}function B(J){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=ce.children[ce.children.length-1];Se.position.end=fr(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(de.call(this,J),q.call(this,J))}function D(){this.data.atHardBreak=!0}function j(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function P(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function L(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function A(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function I(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function Y(J){const ce=this.sliceSerialize(J),Se=this.stack[this.stack.length-2];Se.label=W5(ce),Se.identifier=Qi(ce).toLowerCase()}function le(){const J=this.stack[this.stack.length-1],ce=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Me=J.children;Se.children=Me}else Se.alt=ce}function k(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function T(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function X(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function se(J){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ce,Se.identifier=Qi(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function pe(J){this.data.characterReferenceType=J.type}function he(J){const ce=this.sliceSerialize(J),Se=this.data.characterReferenceType;let Me;Se?(Me=aS(ce,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=Pd(ce);const qe=this.stack[this.stack.length-1];qe.value+=Me}function be(J){const ce=this.stack.pop();ce.position.end=fr(J.end)}function Te(J){q.call(this,J);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(J)}function Re(J){q.call(this,J);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(J)}function jt(){return{type:"blockquote",children:[]}}function Zt(){return{type:"code",lang:null,meta:null,value:""}}function ai(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yi(){return{type:"emphasis",children:[]}}function Gr(){return{type:"heading",depth:0,children:[]}}function Zr(){return{type:"break"}}function Ca(){return{type:"html",value:""}}function ka(){return{type:"image",title:null,url:"",alt:null}}function Qr(){return{type:"link",title:null,url:"",children:[]}}function Jr(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[]}}function Zs(J){return{type:"listItem",spread:J._spread,checked:null,children:[]}}function Tu(){return{type:"paragraph",children:[]}}function Au(){return{type:"strong",children:[]}}function Qt(){return{type:"text",value:""}}function Du(){return{type:"thematicBreak"}}}function fr(e){return{line:e.line,column:e.column,offset:e.offset}}function vS(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?vS(e,s):X5(e,s)}}function X5(e,t){let n;for(n in t)if(gS.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function by(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+aa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+aa({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+aa({start:t.start,end:t.end})+") is still open")}function $5(e){const t=this;t.parser=n;function n(s){return V5(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function G5(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 Z5(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
104
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&a)continue;c=" ";break}default:c=String.fromCharCode(o)}a=o===-2,s.push(c)}return s.join("")}function P5(e){const s={constructs:lS([O5,...(e||{}).extensions||[]]),content:a(tE),defined:[],document:a(nE),flow:a(S5),lazy:{},string:a(C5),text:a(k5)};return s;function a(o){return c;function c(f){return j5(s,o,f)}}}function I5(e){for(;!hS(e););return e}const yy=/[\0\t\n\r]/g;function F5(){let e=1,t="",n=!0,s;return a;function a(o,c,f){const p=[];let h,g,_,b,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),_=0,t="",n&&(o.charCodeAt(0)===65279&&_++,n=void 0);_<o.length;){if(yy.lastIndex=_,h=yy.exec(o),b=h&&h.index!==void 0?h.index:o.length,y=o.charCodeAt(b),!h){t=o.slice(_);break}if(y===10&&_===b&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),_<b&&(p.push(o.slice(_,b)),e+=b-_),y){case 0:{p.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,p.push(-2);e++<g;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:s=!0,e=1}_=b+1}return f&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const q5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function W5(e){return e.replace(q5,Y5)}function Y5(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return aS(n.slice(o?2:1),o?16:10)}return Pd(n)||e}const gS={}.hasOwnProperty;function V5(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),K5(n)(I5(P5(n).document().write(F5()(e,t,!0))))}function K5(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Qr),autolinkProtocol:de,autolinkEmail:de,atxHeading:o(Gr),blockQuote:o(jt),characterEscape:de,characterReference:de,codeFenced:o(Zt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Zt,c),codeText:o(ai,c),codeTextData:de,data:de,codeFlowValue:de,definition:o(He),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(yi),hardBreakEscape:o(Zr),hardBreakTrailing:o(Zr),htmlFlow:o(Ca,c),htmlFlowData:de,htmlText:o(Ca,c),htmlTextData:de,image:o(ka),label:c,link:o(Qr),listItem:o(Zs),listItemValue:b,listOrdered:o(Jr,_),listUnordered:o(Jr),paragraph:o(Tu),reference:C,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Gr),strong:o(Au),thematicBreak:o(Du)},exit:{atxHeading:p(),atxHeadingSequence:K,autolink:p(),autolinkEmail:Re,autolinkProtocol:Te,blockQuote:p(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:he,characterReference:be,codeFenced:p(N),codeFencedFence:E,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:F,codeIndented:p(M),codeText:p(L),codeTextData:F,data:F,definition:p(),definitionDestinationString:Q,definitionLabelString:G,definitionTitleString:U,emphasis:p(),hardBreakEscape:p(D),hardBreakTrailing:p(D),htmlFlow:p(j),htmlFlowData:F,htmlText:p(P),htmlTextData:F,image:p(I),label:le,labelText:Y,lineEnding:B,link:p(A),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:se,resourceDestinationString:k,resourceTitleString:T,resource:X,setextHeading:p(oe),setextHeadingLineSequence:ee,setextHeadingText:O,strong:p(),thematicBreak:p()}};vS(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(J){let ce={type:"root",children:[]};const Se={stack:[ce],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:g,data:n},Me=[];let qe=-1;for(;++qe<J.length;)if(J[qe][1].type==="listOrdered"||J[qe][1].type==="listUnordered")if(J[qe][0]==="enter")Me.push(qe);else{const bi=Me.pop();qe=a(J,bi,qe)}for(qe=-1;++qe<J.length;){const bi=t[J[qe][0]];gS.call(bi,J[qe][1].type)&&bi[J[qe][1].type].call(Object.assign({sliceSerialize:J[qe][2].sliceSerialize},Se),J[qe][1])}if(Se.tokenStack.length>0){const bi=Se.tokenStack[Se.tokenStack.length-1];(bi[1]||by).call(Se,void 0,bi[0])}for(ce.position={start:fr(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:fr(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)ce=t.transforms[qe](ce)||ce;return ce}function a(J,ce,Se){let Me=ce-1,qe=-1,bi=!1,fn,Jt,xt,oi;for(;++Me<=Se;){const Ge=J[Me];switch(Ge[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ge[0]==="enter"?qe++:qe--,oi=void 0;break}case"lineEndingBlank":{Ge[0]==="enter"&&(fn&&!oi&&!qe&&!xt&&(xt=Me),oi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:oi=void 0}if(!qe&&Ge[0]==="enter"&&Ge[1].type==="listItemPrefix"||qe===-1&&Ge[0]==="exit"&&(Ge[1].type==="listUnordered"||Ge[1].type==="listOrdered")){if(fn){let Hn=Me;for(Jt=void 0;Hn--;){const Ki=J[Hn];if(Ki[1].type==="lineEnding"||Ki[1].type==="lineEndingBlank"){if(Ki[0]==="exit")continue;Jt&&(J[Jt][1].type="lineEndingBlank",bi=!0),Ki[1].type="lineEnding",Jt=Hn}else if(!(Ki[1].type==="linePrefix"||Ki[1].type==="blockQuotePrefix"||Ki[1].type==="blockQuotePrefixWhitespace"||Ki[1].type==="blockQuoteMarker"||Ki[1].type==="listItemIndent"))break}xt&&(!Jt||xt<Jt)&&(fn._spread=!0),fn.end=Object.assign({},Jt?J[Jt][1].start:Ge[1].end),J.splice(Jt||Me,0,["exit",fn,Ge[2]]),Me++,Se++}if(Ge[1].type==="listItemPrefix"){const Hn={type:"listItem",_spread:!1,start:Object.assign({},Ge[1].start),end:void 0};fn=Hn,J.splice(Me,0,["enter",Hn,Ge[2]]),Me++,Se++,xt=void 0,oi=!0}}}return J[ce][1]._spread=bi,Se}function o(J,ce){return Se;function Se(Me){f.call(this,J(Me),Me),ce&&ce.call(this,Me)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(J,ce,Se){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([ce,Se||void 0]),J.position={start:fr(ce.start),end:void 0}}function p(J){return ce;function ce(Se){J&&J.call(this,Se),h.call(this,Se)}}function h(J,ce){const Se=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==J.type&&(ce?ce.call(this,J,Me[0]):(Me[1]||by).call(this,J,Me[0]));else throw new Error("Cannot close `"+J.type+"` ("+aa({start:J.start,end:J.end})+"): it’s not open");Se.position.end=fr(J.end)}function g(){return Ud(this.stack.pop())}function _(){this.data.expectingFirstListItemValue=!0}function b(J){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function y(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=J}function x(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=J}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/(\r?\n|\r)$/g,"")}function G(J){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ce,Se.identifier=Qi(this.sliceSerialize(J)).toLowerCase()}function U(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function Q(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function K(J){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Se=this.sliceSerialize(J).length;ce.depth=Se}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function ee(J){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function oe(){this.data.setextHeadingSlurpLineEnding=void 0}function de(J){const Se=this.stack[this.stack.length-1].children;let Me=Se[Se.length-1];(!Me||Me.type!=="text")&&(Me=Qt(),Me.position={start:fr(J.start),end:void 0},Se.push(Me)),this.stack.push(Me)}function F(J){const ce=this.stack.pop();ce.value+=this.sliceSerialize(J),ce.position.end=fr(J.end)}function B(J){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=ce.children[ce.children.length-1];Se.position.end=fr(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(de.call(this,J),F.call(this,J))}function D(){this.data.atHardBreak=!0}function j(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function P(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function L(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function A(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function I(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function Y(J){const ce=this.sliceSerialize(J),Se=this.stack[this.stack.length-2];Se.label=W5(ce),Se.identifier=Qi(ce).toLowerCase()}function le(){const J=this.stack[this.stack.length-1],ce=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Me=J.children;Se.children=Me}else Se.alt=ce}function k(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function T(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function X(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function se(J){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ce,Se.identifier=Qi(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function pe(J){this.data.characterReferenceType=J.type}function he(J){const ce=this.sliceSerialize(J),Se=this.data.characterReferenceType;let Me;Se?(Me=aS(ce,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=Pd(ce);const qe=this.stack[this.stack.length-1];qe.value+=Me}function be(J){const ce=this.stack.pop();ce.position.end=fr(J.end)}function Te(J){F.call(this,J);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(J)}function Re(J){F.call(this,J);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(J)}function jt(){return{type:"blockquote",children:[]}}function Zt(){return{type:"code",lang:null,meta:null,value:""}}function ai(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yi(){return{type:"emphasis",children:[]}}function Gr(){return{type:"heading",depth:0,children:[]}}function Zr(){return{type:"break"}}function Ca(){return{type:"html",value:""}}function ka(){return{type:"image",title:null,url:"",alt:null}}function Qr(){return{type:"link",title:null,url:"",children:[]}}function Jr(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[]}}function Zs(J){return{type:"listItem",spread:J._spread,checked:null,children:[]}}function Tu(){return{type:"paragraph",children:[]}}function Au(){return{type:"strong",children:[]}}function Qt(){return{type:"text",value:""}}function Du(){return{type:"thematicBreak"}}}function fr(e){return{line:e.line,column:e.column,offset:e.offset}}function vS(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?vS(e,s):X5(e,s)}}function X5(e,t){let n;for(n in t)if(gS.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function by(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+aa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+aa({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+aa({start:t.start,end:t.end})+") is still open")}function $5(e){const t=this;t.parser=n;function n(s){return V5(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function G5(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 Z5(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
105
105
  `}]}function Q5(e,t){const n=t.value?t.value+`
106
106
  `:"",s={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function J5(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tT(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),a=Gs(s.toLowerCase()),o=e.footnoteOrder.indexOf(s);let c,f=e.footnoteCounts.get(s);f===void 0?(f=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(s,f);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,h),e.applyData(t,h)}function iT(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 nT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yS(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const c=a[a.length-1];return c&&c.type==="text"?c.value+=s:a.push({type:"text",value:s}),a}function rT(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return yS(e,t);const a={src:Gs(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function sT(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 s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function lT(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function aT(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return yS(e,t);const a={href:Gs(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function oT(e,t){const n={href:Gs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function uT(e,t,n){const s=e.all(t),a=n?cT(n):bS(t),o={},c=[];if(typeof t.checked=="boolean"){const g=s[0];let _;g&&g.type==="element"&&g.tagName==="p"?_=g:(_={type:"element",tagName:"p",properties:{},children:[]},s.unshift(_)),_.children.length>0&&_.children.unshift({type:"text",value:" "}),_.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<s.length;){const g=s[f];(a||f!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
107
107
  `}),g.type==="element"&&g.tagName==="p"&&!a?c.push(...g.children):c.push(g)}const p=s[s.length-1];p&&(a||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
@@ -126,5 +126,5 @@ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){t
126
126
  `))+1))}const c="#".repeat(a),f=n.enter("headingAtx"),p=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
127
127
  `,...o.current()});return/^[\t ]/.test(h)&&(h=ma(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),p(),f(),h}NS.peek=vA;function NS(e){return e.value||""}function vA(){return"<"}LS.peek=yA;function LS(e,t,n,s){const a=Xd(n),o=a==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const p=n.createTracker(s);let h=p.move("![");return h+=p.move(n.safe(e.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(n.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(f=n.enter("destinationRaw"),h+=p.move(n.safe(e.url,{before:h,after:e.title?" ":")",...p.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=p.move(" "+a),h+=p.move(n.safe(e.title,{before:h,after:a,...p.current()})),h+=p.move(a),f()),h+=p.move(")"),c(),h}function yA(){return"!"}zS.peek=bA;function zS(e,t,n,s){const a=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(s);let p=f.move("![");const h=n.safe(e.alt,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const _=n.safe(n.associationId(e),{before:p,after:"]",...f.current()});return c(),n.stack=g,o(),a==="full"||!h||h!==_?p+=f.move(_+"]"):a==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function bA(){return"!"}OS.peek=SA;function OS(e,t,n){let s=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(s);)a+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++o<n.unsafe.length;){const c=n.unsafe[o],f=n.compilePattern(c);let p;if(c.atBreak)for(;p=f.exec(s);){let h=p.index;s.charCodeAt(h)===10&&s.charCodeAt(h-1)===13&&h--,s=s.slice(0,h)+" "+s.slice(p.index+1)}}return a+s+a}function SA(){return"`"}function jS(e,t){const n=Ud(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))}HS.peek=xA;function HS(e,t,n,s){const a=Xd(n),o=a==='"'?"Quote":"Apostrophe",c=n.createTracker(s);let f,p;if(jS(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let _=c.move("<");return _+=c.move(n.containerPhrasing(e,{before:_,after:">",...c.current()})),_+=c.move(">"),f(),n.stack=g,_}f=n.enter("link"),p=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(p=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),p(),e.title&&(p=n.enter(`title${o}`),h+=c.move(" "+a),h+=c.move(n.safe(e.title,{before:h,after:a,...c.current()})),h+=c.move(a),p()),h+=c.move(")"),f(),h}function xA(e,t,n){return jS(e,n)?"<":"["}US.peek=wA;function US(e,t,n,s){const a=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(s);let p=f.move("[");const h=n.containerPhrasing(e,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const _=n.safe(n.associationId(e),{before:p,after:"]",...f.current()});return c(),n.stack=g,o(),a==="full"||!h||h!==_?p+=f.move(_+"]"):a==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function wA(){return"["}function $d(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 CA(e){const t=$d(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 kA(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 PS(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 EA(e,t,n,s){const a=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?kA(n):$d(n);const f=e.ordered?c==="."?")":".":CA(n);let p=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&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&&(p=!0),PS(n)===c&&g){let _=-1;for(;++_<e.children.length;){const b=e.children[_];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,s);return n.bulletLastUsed=c,n.bulletCurrent=o,a(),h}function TA(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 AA(e,t,n,s){const a=TA(n);let o=n.bulletCurrent||$d(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(s);f.move(o+" ".repeat(c-o.length)),f.shift(c);const p=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),g);return p(),h;function g(_,b,y){return b?(y?"":" ".repeat(c))+_:(y?o:o+" ".repeat(c-o.length))+_}}function DA(e,t,n,s){const a=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,s);return o(),a(),c}const RA=ku(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MA(e,t,n,s){return(e.children.some(function(c){return RA(c)})?n.containerPhrasing:n.containerFlow).call(n,e,s)}function BA(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}IS.peek=NA;function IS(e,t,n,s){const a=BA(n),o=n.enter("strong"),c=n.createTracker(s),f=c.move(a+a);let p=c.move(n.containerPhrasing(e,{after:a,before:f,...c.current()}));const h=p.charCodeAt(0),g=_u(s.before.charCodeAt(s.before.length-1),h,a);g.inside&&(p=ma(h)+p.slice(1));const _=p.charCodeAt(p.length-1),b=_u(s.after.charCodeAt(0),_,a);b.inside&&(p=p.slice(0,-1)+ma(_));const y=c.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+p+y}function NA(e,t,n){return n.options.strong||"*"}function LA(e,t,n,s){return n.safe(e.value,s)}function zA(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 OA(e,t,n){const s=(PS(n)+(n.options.ruleSpaces?" ":"")).repeat(zA(n));return n.options.ruleSpaces?s.slice(0,-1):s}const FS={blockquote:sA,break:Uy,code:hA,definition:dA,emphasis:BS,hardBreak:Uy,heading:gA,html:NS,image:LS,imageReference:zS,inlineCode:OS,link:HS,linkReference:US,list:EA,listItem:AA,paragraph:DA,root:MA,strong:IS,text:LA,thematicBreak:OA};function jA(){return{enter:{table:HA,tableData:Py,tableHeader:Py,tableRow:PA},exit:{codeText:IA,table:UA,tableData:Cf,tableHeader:Cf,tableRow:Cf}}}function HA(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 UA(e){this.exit(e),this.data.inTable=void 0}function PA(e){this.enter({type:"tableRow",children:[]},e)}function Cf(e){this.exit(e)}function Py(e){this.enter({type:"tableCell",children:[]},e)}function IA(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FA));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FA(e,t){return t==="|"?t:e}function qA(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
128
128
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:p,tableRow:f}};function c(y,x,E,N){return h(g(y,E,N),y.align)}function f(y,x,E,N){const M=_(y,E,N),G=h([M]);return G.slice(0,G.indexOf(`
129
- `))}function p(y,x,E,N){const M=E.enter("tableCell"),G=E.enter("phrasing"),U=E.containerPhrasing(y,{...N,before:o,after:o});return G(),M(),U}function h(y,x){return nA(y,{align:x,alignDelimiters:s,padding:n,stringLength:a})}function g(y,x,E){const N=y.children;let M=-1;const G=[],U=x.enter("table");for(;++M<N.length;)G[M]=_(N[M],x,E);return U(),G}function _(y,x,E){const N=y.children;let M=-1;const G=[],U=x.enter("tableRow");for(;++M<N.length;)G[M]=p(N[M],y,x,E);return U(),G}function b(y,x,E){let N=FS.inlineCode(y,x,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function WA(){return{exit:{taskListCheckValueChecked:Iy,taskListCheckValueUnchecked:Iy,paragraph:VA}}}function YA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:KA}}}function Iy(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function VA(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 s=n.children[0];if(s&&s.type==="text"){const a=t.children;let o=-1,c;for(;++o<a.length;){const f=a[o];if(f.type==="paragraph"){c=f;break}}c===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function KA(e,t,n,s){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(s);o&&f.move(c);let p=FS.listItem(e,t,n,{...s,...f.current()});return o&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(g){return g+c}}function XA(){return[E3(),K3(),Z3(),jA(),WA()]}function $A(e){return{extensions:[T3(),X3(e),Q3(),qA(e),YA()]}}const GA={tokenize:iD,partial:!0},qS={tokenize:nD,partial:!0},WS={tokenize:rD,partial:!0},YS={tokenize:sD,partial:!0},ZA={tokenize:lD,partial:!0},VS={name:"wwwAutolink",tokenize:eD,previous:XS},KS={name:"protocolAutolink",tokenize:tD,previous:$S},jn={name:"emailAutolink",tokenize:JA,previous:GS},hn={};function QA(){return{text:hn}}let Ur=48;for(;Ur<123;)hn[Ur]=jn,Ur++,Ur===58?Ur=65:Ur===91&&(Ur=97);hn[43]=jn;hn[45]=jn;hn[46]=jn;hn[95]=jn;hn[72]=[jn,KS];hn[104]=[jn,KS];hn[87]=[jn,VS];hn[119]=[jn,VS];function JA(e,t,n){const s=this;let a,o;return c;function c(_){return!bd(_)||!GS.call(s,s.previous)||Gd(s.events)?n(_):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(_))}function f(_){return bd(_)?(e.consume(_),f):_===64?(e.consume(_),p):n(_)}function p(_){return _===46?e.check(ZA,g,h)(_):_===45||_===95||$t(_)?(o=!0,e.consume(_),p):g(_)}function h(_){return e.consume(_),a=!0,p}function g(_){return o&&a&&ri(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(_)):n(_)}}function eD(e,t,n){const s=this;return a;function a(c){return c!==87&&c!==119||!XS.call(s,s.previous)||Gd(s.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(GA,e.attempt(qS,e.attempt(WS,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function tD(e,t,n){const s=this;let a="",o=!1;return c;function c(_){return(_===72||_===104)&&$S.call(s,s.previous)&&!Gd(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(_),e.consume(_),f):n(_)}function f(_){if(ri(_)&&a.length<5)return a+=String.fromCodePoint(_),e.consume(_),f;if(_===58){const b=a.toLowerCase();if(b==="http"||b==="https")return e.consume(_),p}return n(_)}function p(_){return _===47?(e.consume(_),o?h:(o=!0,p)):n(_)}function h(_){return _===null||pu(_)||Qe(_)||Kr(_)||xu(_)?n(_):e.attempt(qS,e.attempt(WS,g),n)(_)}function g(_){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(_)}}function iD(e,t,n){let s=0;return a;function a(c){return(c===87||c===119)&&s<3?(s++,e.consume(c),a):c===46&&s===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function nD(e,t,n){let s,a,o;return c;function c(h){return h===46||h===95?e.check(YS,p,f)(h):h===null||Qe(h)||Kr(h)||h!==45&&xu(h)?p(h):(o=!0,e.consume(h),c)}function f(h){return h===95?s=!0:(a=s,s=void 0),e.consume(h),c}function p(h){return a||s||!o?n(h):t(h)}}function rD(e,t){let n=0,s=0;return a;function a(c){return c===40?(n++,e.consume(c),a):c===41&&s<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(YS,t,o)(c):c===null||Qe(c)||Kr(c)?t(c):(e.consume(c),a)}function o(c){return c===41&&s++,e.consume(c),a}}function sD(e,t,n){return s;function s(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),s):f===38?(e.consume(f),o):f===93?(e.consume(f),a):f===60||f===null||Qe(f)||Kr(f)?t(f):n(f)}function a(f){return f===null||f===40||f===91||Qe(f)||Kr(f)?t(f):s(f)}function o(f){return ri(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),s):ri(f)?(e.consume(f),c):n(f)}}function lD(e,t,n){return s;function s(o){return e.consume(o),a}function a(o){return $t(o)?n(o):t(o)}}function XS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qe(e)}function $S(e){return!ri(e)}function GS(e){return!(e===47||bd(e))}function bd(e){return e===43||e===45||e===46||e===95||$t(e)}function Gd(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aD={tokenize:mD,partial:!0};function oD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fD,continuation:{tokenize:dD},exit:pD}},text:{91:{name:"gfmFootnoteCall",tokenize:hD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uD,resolveTo:cD}}}}function uD(e,t,n){const s=this;let a=s.events.length;const o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c;for(;a--;){const p=s.events[a][1];if(p.type==="labelImage"){c=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!c||!c._balanced)return n(p);const h=Qi(s.sliceSerialize({start:c.end,end:s.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function cD(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 s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...f),e}function hD(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o=0,c;return f;function f(_){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),p}function p(_){return _!==94?n(_):(e.enter("gfmFootnoteCallMarker"),e.consume(_),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(_){if(o>999||_===93&&!c||_===null||_===91||Qe(_))return n(_);if(_===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return a.includes(Qi(s.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(_)}return Qe(_)||(c=!0),o++,e.consume(_),_===92?g:h}function g(_){return _===91||_===92||_===93?(e.consume(_),o++,h):h(_)}}function fD(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o,c=0,f;return p;function p(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(x)}function g(x){if(c>999||x===93&&!f||x===null||x===91||Qe(x))return n(x);if(x===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return o=Qi(s.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Qe(x)||(f=!0),c++,e.consume(x),x===92?_:g}function _(x){return x===91||x===92||x===93?(e.consume(x),c++,g):g(x)}function b(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(o)||a.push(o),Ue(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function dD(e,t,n){return e.check(Sa,t,e.attempt(aD,t,n))}function pD(e){e.exit("gfmFootnoteDefinition")}function mD(e,t,n){const s=this;return Ue(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const c=s.events[s.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function _D(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function a(c,f){let p=-1;for(;++p<c.length;)if(c[p][0]==="enter"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._close){let h=p;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[p][1].end.offset-c[p][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[p][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[p][1].end)},_={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[p][1].start)},b=[["enter",g,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",_,f]],y=f.parser.constructs.insideSpan.null;y&&Mi(b,b.length,0,wu(y,c.slice(h+1,p),f)),Mi(b,b.length,0,[["exit",_,f],["enter",c[p][1],f],["exit",c[p][1],f],["exit",g,f]]),Mi(c,h-1,p-h+3,b),p=h+b.length-2;break}}for(p=-1;++p<c.length;)c[p][1].type==="strikethroughSequenceTemporary"&&(c[p][1].type="data");return c}function o(c,f,p){const h=this.previous,g=this.events;let _=0;return b;function b(x){return h===126&&g[g.length-1][1].type!=="characterEscape"?p(x):(c.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const E=Vs(h);if(x===126)return _>1?p(x):(c.consume(x),_++,y);if(_<2&&!n)return p(x);const N=c.exit("strikethroughSequenceTemporary"),M=Vs(x);return N._open=!M||M===2&&!!E,N._close=!E||E===2&&!!M,f(x)}}}class gD{constructor(){this.map=[]}add(t,n,s){vD(this,t,n,s)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let a=s.pop();for(;a;){for(const o of a)t.push(o);a=s.pop()}this.map.length=0}}function vD(e,t,n,s){let a=0;if(!(n===0&&s.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...s);return}a+=1}e.map.push([t,n,s])}}function yD(e,t){let n=!1;const s=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=s.length-1;s[o]=s[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function bD(){return{flow:{null:{name:"table",tokenize:SD,resolveAll:xD}}}}function SD(e,t,n){const s=this;let a=0,o=0,c;return f;function f(q){let B=s.events.length-1;for(;B>-1;){const P=s.events[B][1].type;if(P==="lineEnding"||P==="linePrefix")B--;else break}const D=B>-1?s.events[B][1].type:null,j=D==="tableHead"||D==="tableRow"?O:p;return j===O&&s.parser.lazy[s.now().line]?n(q):j(q)}function p(q){return e.enter("tableHead"),e.enter("tableRow"),h(q)}function h(q){return q===124||(c=!0,o+=1),g(q)}function g(q){return q===null?n(q):ve(q)?o>1?(o=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),y):n(q):Le(q)?Ue(e,g,"whitespace")(q):(o+=1,c&&(c=!1,a+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),_(q)))}function _(q){return q===null||q===124||Qe(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?b:_)}function b(q){return q===92||q===124?(e.consume(q),_):_(q)}function y(q){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(q):(e.enter("tableDelimiterRow"),c=!1,Le(q)?Ue(e,x,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):x(q))}function x(q){return q===45||q===58?N(q):q===124?(c=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),E):K(q)}function E(q){return Le(q)?Ue(e,N,"whitespace")(q):N(q)}function N(q){return q===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),M):q===45?(o+=1,M(q)):q===null||ve(q)?Q(q):K(q)}function M(q){return q===45?(e.enter("tableDelimiterFiller"),G(q)):K(q)}function G(q){return q===45?(e.consume(q),G):q===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),U):(e.exit("tableDelimiterFiller"),U(q))}function U(q){return Le(q)?Ue(e,Q,"whitespace")(q):Q(q)}function Q(q){return q===124?x(q):q===null||ve(q)?!c||a!==o?K(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(q)):K(q)}function K(q){return n(q)}function O(q){return e.enter("tableRow"),ee(q)}function ee(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),ee):q===null||ve(q)?(e.exit("tableRow"),t(q)):Le(q)?Ue(e,ee,"whitespace")(q):(e.enter("data"),oe(q))}function oe(q){return q===null||q===124||Qe(q)?(e.exit("data"),ee(q)):(e.consume(q),q===92?de:oe)}function de(q){return q===92||q===124?(e.consume(q),oe):oe(q)}}function xD(e,t){let n=-1,s=!0,a=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,p=0,h,g,_;const b=new gD;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(f=!1,p!==0&&(Fy(b,t,p,h,g),g=void 0,p=0),h={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",h,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(s=!0,_=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",g,t]])),a=x.type==="tableDelimiterRow"?2:g?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(s=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],_=Jo(b,t,o,a,void 0,_),o=[0,0,0,0]),c[2]=n)):x.type==="tableCellDivider"&&(s?s=!1:(o[1]!==0&&(c[0]=c[1],_=Jo(b,t,o,a,void 0,_)),o=c,c=[o[1],n,0,0])):x.type==="tableHead"?(f=!0,p=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(p=n,o[1]!==0?(c[0]=c[1],_=Jo(b,t,o,a,n,_)):c[1]!==0&&(_=Jo(b,t,c,a,n,_)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(c[3]=n)}for(p!==0&&Fy(b,t,p,h,g),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=yD(t.events,n))}return e}function Jo(e,t,n,s,a,o){const c=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},Fs(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const p=Fs(t.events,n[1]);if(o={type:c,start:Object.assign({},p),end:Object.assign({},p)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=Fs(t.events,n[2]),g=Fs(t.events,n[3]),_={type:f,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",_,t]]),s!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,E=n[3]-n[2]-1;e.add(x,E,[])}}e.add(n[3]+1,0,[["exit",_,t]])}return a!==void 0&&(o.end=Object.assign({},Fs(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function Fy(e,t,n,s,a){const o=[],c=Fs(t.events,n);a&&(a.end=Object.assign({},c),o.push(["exit",a,t])),s.end=Object.assign({},c),o.push(["exit",s,t]),e.add(n+1,0,o)}function Fs(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const wD={name:"tasklistCheck",tokenize:kD};function CD(){return{text:{91:wD}}}function kD(e,t,n){const s=this;return a;function a(p){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),o)}function o(p){return Qe(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),c):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),c):n(p)}function c(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(p)}function f(p){return ve(p)?t(p):Le(p)?e.check({tokenize:ED},t,n)(p):n(p)}}function ED(e,t,n){return Ue(e,s,"whitespace");function s(a){return a===null?n(a):t(a)}}function TD(e){return lS([QA(),oD(),_D(e),bD(),CD()])}const AD={};function DD(e){const t=this,n=e||AD,s=t.data(),a=s.micromarkExtensions||(s.micromarkExtensions=[]),o=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),c=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);a.push(TD(n)),o.push(XA()),c.push($A(n))}const Pr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],qy={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Pr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Pr],h2:[["className","sr-only"]],img:[...Pr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Pr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Pr],table:[...Pr],ul:[...Pr,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},pr={}.hasOwnProperty;function RD(e,t){let n={type:"root",children:[]};const s={schema:t?{...qy,...t}:qy,stack:[]},a=ZS(s,e);return a&&(Array.isArray(a)?a.length===1?n=a[0]:n.children=a:n=a),n}function ZS(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return MD(e,n);case"doctype":return BD(e,n);case"element":return ND(e,n);case"root":return LD(e,n);case"text":return zD(e,n)}}}function MD(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",s=n.indexOf("-->"),o={type:"comment",value:s<0?n:n.slice(0,s)};return wa(o,t),o}}function BD(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return wa(n,t),n}}function ND(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const s=QS(e,t.children),a=OD(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&pr.call(e.schema.ancestors,n))){const f=e.schema.ancestors[n];let p=-1;for(o=!1;++p<f.length;)e.stack.includes(f[p])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?s:void 0;const c={type:"element",tagName:n,properties:a,children:s};return wa(c,t),c}function LD(e,t){const s={type:"root",children:QS(e,t.children)};return wa(s,t),s}function zD(e,t){const s={type:"text",value:typeof t.value=="string"?t.value:""};return wa(s,t),s}function QS(e,t){const n=[];if(Array.isArray(t)){const s=t;let a=-1;for(;++a<s.length;){const o=ZS(e,s[a]);o&&(Array.isArray(o)?n.push(...o):n.push(o))}}return n}function OD(e,t){const n=e.stack[e.stack.length-1],s=e.schema.attributes,a=e.schema.required,o=s&&pr.call(s,n)?s[n]:void 0,c=s&&pr.call(s,"*")?s["*"]:void 0,f=t&&typeof t=="object"?t:{},p={};let h;for(h in f)if(pr.call(f,h)){const g=f[h];let _=Wy(e,Yy(o,h),h,g);_==null&&(_=Wy(e,Yy(c,h),h,g)),_!=null&&(p[h]=_)}if(a&&pr.call(a,n)){const g=a[n];for(h in g)pr.call(g,h)&&!pr.call(p,h)&&(p[h]=g[h])}return p}function Wy(e,t,n,s){return t?Array.isArray(s)?jD(e,t,n,s):JS(e,t,n,s):void 0}function jD(e,t,n,s){let a=-1;const o=[];for(;++a<s.length;){const c=JS(e,t,n,s[a]);(typeof c=="number"||typeof c=="string")&&o.push(c)}return o}function JS(e,t,n,s){if(!(typeof s!="boolean"&&typeof s!="number"&&typeof s!="string")&&HD(e,n,s)){if(typeof t=="object"&&t.length>1){let a=!1,o=0;for(;++o<t.length;){const c=t[o];if(c&&typeof c=="object"&&"flags"in c){if(c.test(String(s))){a=!0;break}}else if(c===s){a=!0;break}}if(!a)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+s:s}}function HD(e,t,n){const s=e.schema.protocols&&pr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!s||s.length===0)return!0;const a=String(n),o=a.indexOf(":"),c=a.indexOf("?"),f=a.indexOf("#"),p=a.indexOf("/");if(o<0||p>-1&&o>p||c>-1&&o>c||f>-1&&o>f)return!0;let h=-1;for(;++h<s.length;){const g=s[h];if(o===g.length&&a.slice(0,g.length)===g)return!0}return!1}function wa(e,t){const n=eS(t);t.data&&(e.data=pa(t.data)),n&&(e.position=n)}function Yy(e,t){let n,s=-1;if(e)for(;++s<e.length;){const a=e[s],o=typeof a=="string"?a:a[0];if(o===t)return a;o==="data*"&&(n=a)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function UD(e){return function(t){return RD(t,e)}}function PD({storyName:e,fileName:t,authFetch:n,onPublish:s,publishingFile:a}){const[o,c]=ne.useState(null),[f,p]=ne.useState(!1),[h,g]=ne.useState("preview"),[_,b]=ne.useState(""),[y,x]=ne.useState(!1),[E,N]=ne.useState(!1),[M,G]=ne.useState(!1),[U,Q]=ne.useState(null),K=ne.useRef(null),O=ne.useRef(!1),ee=ne.useRef(null),oe=ne.useCallback(async()=>{if(!e||!t){c(null);return}const le=`${e}/${t}`,k=ee.current!==le;k&&(ee.current=le);try{const T=await n(`/api/stories/${e}/${t}`);if(T.ok){const X=await T.json();c(X),(k||!O.current)&&(b(X.content??""),k&&(N(!1),O.current=!1))}}catch{}},[e,t,n]);ne.useEffect(()=>{p(!0),oe().finally(()=>p(!1))},[oe]),ne.useEffect(()=>{if(!e||!t||h==="edit"&&E)return;const le=setInterval(oe,3e3);return()=>clearInterval(le)},[e,t,oe,h,E]);const de=ne.useCallback(async()=>{if(!(!e||!t)){x(!0);try{(await n(`/api/stories/${e}/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:_})})).ok&&(N(!1),O.current=!1,c(k=>k&&{...k,content:_}))}catch{}x(!1)}},[e,t,n,_]);ne.useEffect(()=>{if(h!=="edit")return;const le=k=>{(k.metaKey||k.ctrlKey)&&k.key==="s"&&(k.preventDefault(),de())};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[h,de]),ne.useEffect(()=>{if((o==null?void 0:o.status)!=="published-not-indexed"||!o.publishedAt)return;const le=new Date(o.publishedAt).getTime(),k=300*1e3,T=()=>{const C=Math.max(0,k-(Date.now()-le));Q(C)};T();const X=setInterval(T,1e3);return()=>clearInterval(X)},[o==null?void 0:o.status,o==null?void 0:o.publishedAt]);const q=U!==null&&U<=0,B=U!==null&&U>0?`${Math.floor(U/6e4)}:${String(Math.floor(U%6e4/1e3)).padStart(2,"0")}`:null;if(!e||!t)return S.jsx("div",{className:"h-full flex items-center justify-center text-muted",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-lg font-serif",children:"Select a file to preview"}),S.jsx("p",{className:"text-sm mt-1",children:"Click a story file in the sidebar"})]})});if(f&&!o)return S.jsx("div",{className:"h-full flex items-center justify-center text-muted",children:"Loading..."});const j=(h==="edit"?_:(o==null?void 0:o.content)??"").length,P=t==="genesis.md",L=t?/^plot-\d+\.md$/.test(t):!1,A=(o==null?void 0:o.status)==="published"||(o==null?void 0:o.status)==="published-not-indexed",I=P?1e3:L?1e4:null,Y=!A&&I!==null&&j>I;return S.jsxs("div",{className:"h-full flex flex-col",children:[S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"px-3 py-1.5 flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-muted",children:[S.jsxs("span",{children:[e,"/",t]}),(o==null?void 0:o.status)==="published"&&S.jsx("span",{className:"text-green-700 font-medium",children:"Published"}),(o==null?void 0:o.status)==="published-not-indexed"&&S.jsx("span",{className:"text-amber-700 font-medium",title:o.indexError,children:"Published (not indexed)"}),(o==null?void 0:o.status)==="pending"&&S.jsx("span",{className:"text-amber-700 font-medium",children:"Pending"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("span",{className:`text-xs font-mono ${Y?"text-error font-medium":"text-muted"}`,children:[j.toLocaleString(),I!==null?`/${I.toLocaleString()}`:" chars"]}),Y&&S.jsxs("span",{className:"text-error text-xs font-medium",children:[(j-I).toLocaleString()," over limit"]})]})]}),S.jsxs("div",{className:"flex px-3 gap-1",children:[S.jsx("button",{onClick:()=>g("preview"),className:`px-3 py-1 text-xs font-medium border-b-2 transition-colors ${h==="preview"?"border-accent text-accent":"border-transparent text-muted hover:text-foreground"}`,children:"Preview"}),S.jsxs("button",{onClick:()=>g("edit"),className:`px-3 py-1 text-xs font-medium border-b-2 transition-colors ${h==="edit"?"border-accent text-accent":"border-transparent text-muted hover:text-foreground"}`,children:["Edit",E&&S.jsx("span",{className:"ml-1 text-amber-600",children:"*"})]})]})]}),h==="preview"?S.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",style:{background:"var(--paper-bg)"},children:o!=null&&o.content?S.jsx("div",{className:"prose max-w-none",children:S.jsx(p3,{remarkPlugins:[k3,DD],rehypePlugins:[UD],children:o.content})}):S.jsx("p",{className:"text-muted italic",children:"No content"})}):S.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",style:{background:"var(--paper-bg)"},children:[S.jsx("textarea",{ref:K,value:_,onChange:le=>{b(le.target.value),N(!0),O.current=!0},className:"flex-1 min-h-0 w-full resize-none px-4 py-3 text-sm leading-relaxed focus:outline-none",style:{fontFamily:'"Geist Mono", ui-monospace, monospace',background:"var(--paper-bg)",color:"var(--text)"},spellCheck:!1}),S.jsxs("div",{className:"px-3 py-1.5 border-t border-border flex items-center justify-between",children:[S.jsx("span",{className:"text-xs text-muted",children:E?"Unsaved changes":"No changes"}),S.jsx("button",{onClick:de,disabled:!E||y,className:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent-dim disabled:opacity-50 disabled:cursor-not-allowed",children:y?"Saving...":"Save"})]})]}),S.jsx("div",{className:"px-3 py-2 border-t border-border flex items-center justify-between",children:t==="structure.md"?S.jsx("p",{className:"text-muted text-xs italic",children:"This is your story outline — not publishable. Ask AI to write the genesis next."}):(o==null?void 0:o.status)==="published-not-indexed"?S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[S.jsx("span",{className:"text-amber-700",children:"Published on-chain but not indexed on PlotLink"}),!q&&S.jsx("button",{onClick:async()=>{if(!(!e||!t||!o.txHash)){G(!0);try{(await(await n("/api/publish/retry-index",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyName:e,fileName:t,txHash:o.txHash,content:o.content,storylineId:o.storylineId})})).json()).ok&&(await n(`/api/stories/${e}/${t}/publish-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({txHash:o.txHash,storylineId:o.storylineId,contentCid:"",gasCost:""})}),oe())}catch{}G(!1)}},disabled:M,className:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent-dim disabled:opacity-50",children:M?"Retrying...":`Retry Index${B?` (${B})`:""}`}),L&&S.jsx("button",{onClick:()=>e&&t&&(s==null?void 0:s(e,t)),disabled:!!a,className:"px-3 py-1 border border-border text-xs rounded hover:bg-surface disabled:opacity-50",children:a===t?"Publishing...":"Retry Publish"}),o.txHash&&S.jsx("a",{href:`https://basescan.org/tx/${o.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted underline",children:"BaseScan"})]}),S.jsx("p",{className:"text-muted text-xs",children:q?L?"Index window expired. Use Retry Publish to create a new on-chain tx.":"Index window expired. Contact support or re-publish manually.":L?"Try Retry Index first (available for 5 min after publish). If that fails, Retry Publish creates a new on-chain tx.":"Retry Index is available for 5 min after publish."}),o.indexError&&S.jsx("p",{className:"text-error text-xs",children:o.indexError})]}):(o==null?void 0:o.status)==="published"?S.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[S.jsx("span",{className:"text-green-700",children:"Published"}),o.storylineId&&S.jsx("a",{href:(()=>{var T;const le=`https://plotlink.xyz/story/${o.storylineId}`;if(!L)return le;const k=o.plotIndex!=null&&o.plotIndex>0?o.plotIndex:parseInt(((T=t==null?void 0:t.match(/^plot-(\d+)\.md$/))==null?void 0:T[1])??"1");return`${le}/${k}`})(),target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View on PlotLink"}),o.txHash&&S.jsx("a",{href:`https://basescan.org/tx/${o.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted underline",children:"BaseScan"})]}):S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:()=>e&&t&&(s==null?void 0:s(e,t)),disabled:!!a||Y,className:"px-4 py-1.5 bg-accent text-white text-sm rounded hover:bg-accent-dim disabled:opacity-50 disabled:cursor-not-allowed",children:a===t?"Publishing...":"Publish to PlotLink"}),Y&&S.jsx("span",{className:"text-error text-xs",children:"Reduce content to publish"})]})})]})}const e0="plotlink-panel-ratio",ID=.6,Vy=300,kf=224,Ef=6;function FD(){try{const e=localStorage.getItem(e0);if(e){const t=parseFloat(e);if(t>0&&t<1)return t}}catch{}return ID}function Ky(e,t){if(t<=0)return e;const n=Vy/t,s=1-Vy/t;return n>=s?.5:Math.min(s,Math.max(n,e))}function qD({token:e,authFetch:t}){const[n,s]=ne.useState(null),[a,o]=ne.useState(null),[c,f]=ne.useState(null),[p,h]=ne.useState(""),[g,_]=ne.useState(FD),[b,y]=ne.useState([]),x=ne.useRef(new Set),E=ne.useRef(null),N=ne.useRef(!1);ne.useEffect(()=>{try{localStorage.setItem(e0,String(g))}catch{}},[g]),ne.useEffect(()=>{const B=()=>{if(!E.current)return;const D=E.current.getBoundingClientRect().width-kf-Ef;_(j=>Ky(j,D))};return window.addEventListener("resize",B),B(),()=>window.removeEventListener("resize",B)},[]);const M=ne.useCallback(()=>{const B=`_new_${Date.now()}`;y(D=>[...D,B]),s(B),o(null)},[]);ne.useEffect(()=>{if(b.length===0)return;const B=setInterval(async()=>{try{const D=await t("/api/stories");if(!D.ok)return;const j=await D.json(),P=new Set(j.stories.filter(L=>L.name!=="_example").map(L=>L.name));for(const L of P)!x.current.has(L)&&b.length>0&&(y(A=>A.slice(1)),s(L),o(null));x.current=P}catch{}},3e3);return()=>clearInterval(B)},[t,b]),ne.useEffect(()=>{t("/api/stories").then(B=>{if(B.ok)return B.json()}).then(B=>{B!=null&&B.stories&&(x.current=new Set(B.stories.filter(D=>D.name!=="_example").map(D=>D.name)))}).catch(()=>{})},[t]);const G=ne.useCallback((B,D)=>{s(B),o(D)},[]),U=ne.useRef(null),Q=ne.useCallback(async B=>{var D,j,P,L;U.current=B,s(B),o(null);try{const A=await t(`/api/stories/${B}`);if(A.ok&&U.current===B){const Y=(await A.json()).files||[],k=((D=Y.map(T=>{var X;return{file:T.file,num:(X=T.file.match(/^plot-(\d+)\.md$/))==null?void 0:X[1]}}).filter(T=>T.num!=null).sort((T,X)=>parseInt(X.num)-parseInt(T.num))[0])==null?void 0:D.file)??((j=Y.find(T=>T.file==="genesis.md"))==null?void 0:j.file)??((P=Y.find(T=>T.file==="structure.md"))==null?void 0:P.file)??((L=Y[0])==null?void 0:L.file);k&&U.current===B&&o(k)}}catch{}},[t]),K=ne.useCallback(B=>{B.preventDefault(),N.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const D=P=>{if(!N.current||!E.current)return;const L=E.current.getBoundingClientRect(),A=L.width-kf-Ef,I=P.clientX-L.left-kf;_(Ky(I/A,A))},j=()=>{N.current=!1,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",j)};window.addEventListener("mousemove",D),window.addEventListener("mouseup",j)},[]),O=ne.useCallback(async(B,D)=>{var j;f(D),h("Reading file...");try{const P=await t(`/api/stories/${B}/${D}`);if(!P.ok)throw new Error("Failed to read file");const L=await P.json(),A=L.content.match(/^#\s+(.+)$/m),I=A?A[1].slice(0,60):D.replace(".md","");let Y="Fiction";try{const C=await t(`/api/stories/${B}/structure.md`);if(C.ok){const pe=(await C.json()).content.match(/genre[:\s]+(.+)/i);pe&&(Y=pe[1].trim().slice(0,30))}}catch{}let le;if(D.match(/^plot-\d+\.md$/)){try{const C=await t(`/api/stories/${B}`);if(C.ok){const pe=(await C.json()).files.find(he=>he.file==="genesis.md"&&he.storylineId);le=pe==null?void 0:pe.storylineId}}catch{}if(!le){h("Error: Publish genesis first to create the storyline"),setTimeout(()=>{f(null),h("")},3e3);return}}h("Publishing...");const k=await t("/api/publish/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyName:B,fileName:D,title:I,content:L.content,genre:Y,storylineId:le})});if(!k.ok){const C=await k.json();throw new Error(C.error||"Publish failed")}const T=(j=k.body)==null?void 0:j.getReader(),X=new TextDecoder;if(T)for(;;){const{done:C,value:se}=await T.read();if(C)break;const he=X.decode(se).split(`
130
- `).filter(be=>be.startsWith("data: "));for(const be of he)try{const Te=JSON.parse(be.slice(6));Te.step&&h(Te.message||Te.step),Te.step==="done"&&Te.txHash&&await t(`/api/stories/${B}/${D}/publish-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({txHash:Te.txHash,storylineId:Te.storylineId,plotIndex:Te.plotIndex,contentCid:Te.contentCid,gasCost:Te.gasCost,indexError:Te.indexError})})}catch{}}h("Published!")}catch(P){const L=P instanceof Error?P.message:"Publish failed";h(`Error: ${L}`)}finally{setTimeout(()=>{f(null),h("")},3e3)}},[t]),ee=ne.useCallback(B=>{B.startsWith("_new_")&&y(D=>D.filter(j=>j!==B))},[]),[oe,de]=ne.useState(new Set);ne.useEffect(()=>{t("/api/stories").then(D=>D.ok?D.json():null).then(D=>{D!=null&&D.stories&&de(new Set(D.stories.filter(j=>j.hasStructure).map(j=>j.name)))}).catch(()=>{});const B=setInterval(async()=>{try{const D=await t("/api/stories");if(D.ok){const j=await D.json();de(new Set(j.stories.filter(P=>P.hasStructure).map(P=>P.name)))}}catch{}},5e3);return()=>clearInterval(B)},[t]);const q=ne.useCallback(B=>{n===B&&(s(null),o(null))},[n]);return S.jsxs("div",{ref:E,className:"h-[calc(100vh-3.5rem)] flex",children:[S.jsx("div",{className:"w-56 border-r border-border flex-shrink-0",children:S.jsx(Lx,{authFetch:t,selectedStory:n,selectedFile:a,onSelectFile:G,onNewStory:M,untitledSessions:b})}),S.jsx("div",{className:"min-w-0 border-r border-border",style:{flex:`${g} 0 0`},children:S.jsx(rk,{token:e,storyName:n,authFetch:t,onSelectStory:Q,onDestroySession:ee,onArchiveStory:q,confirmedStories:oe})}),S.jsx("div",{onMouseDown:K,className:"flex-shrink-0 flex items-center justify-center hover:bg-border/50 transition-colors",style:{width:Ef,cursor:"col-resize",background:"var(--border)"},children:S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("div",{className:"w-0.5 h-0.5 rounded-full",style:{background:"var(--text-muted)"}}),S.jsx("div",{className:"w-0.5 h-0.5 rounded-full",style:{background:"var(--text-muted)"}}),S.jsx("div",{className:"w-0.5 h-0.5 rounded-full",style:{background:"var(--text-muted)"}})]})}),S.jsxs("div",{className:"min-w-0 flex flex-col",style:{flex:`${1-g} 0 0`},children:[S.jsx(PD,{storyName:n,fileName:a,authFetch:t,onPublish:O,publishingFile:c}),p&&S.jsx("div",{className:"px-3 py-1.5 bg-surface border-t border-border text-xs text-muted",children:p})]})]})}function WD({token:e,onComplete:t}){const[n,s]=ne.useState(!1),[a,o]=ne.useState(null),[c,f]=ne.useState(!1),p=async()=>{s(!0),o(null);try{const h=await fetch("/api/wallet/create",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),g=await h.json();if(!h.ok)throw new Error(g.error||"Wallet creation failed");f(!0)}catch(h){o(h instanceof Error?h.message:"Wallet creation failed")}s(!1)};return ne.useEffect(()=>{p()},[]),S.jsxs("div",{className:"mx-auto max-w-sm p-6 text-center",children:[S.jsx("h2",{className:"text-accent mb-1 text-lg font-bold",children:"Wallet Setup"}),S.jsx("p",{className:"text-muted mb-6 text-xs",children:"creating your OWS wallet for on-chain publishing"}),n&&S.jsx("p",{className:"text-accent text-sm",children:"creating wallet..."}),a&&S.jsxs("div",{className:"space-y-4",children:[S.jsx("div",{className:"rounded border border-red-700/30 p-3 text-xs text-red-700",children:a}),S.jsx("button",{onClick:p,className:"border-accent text-accent hover:bg-accent/10 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:"retry"})]}),c&&S.jsxs("div",{className:"space-y-4",children:[S.jsx("div",{className:"text-accent text-2xl",children:"✓"}),S.jsx("p",{className:"text-foreground text-sm font-medium",children:"wallet created"}),S.jsx("button",{onClick:t,className:"border-accent text-accent hover:bg-accent/10 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:"continue"})]})]})}function YD({token:e,onLogout:t}){const[n,s]=ne.useState("home"),[a,o]=ne.useState(0),c=ne.useCallback(async(f,p)=>fetch(f,{...p,headers:{...(p==null?void 0:p.headers)||{},Authorization:`Bearer ${e}`}}),[e]);return ne.useEffect(()=>{async function f(){try{if(!(await(await c("/api/wallet")).json()).exists){s("wallet-setup");return}const g=await c("/api/stories");if(g.ok){const _=await g.json();o(_.stories.filter(b=>b.name!=="_example").length)}}catch{}}f()},[e]),S.jsxs("div",{className:"flex h-screen flex-col",children:[S.jsxs("header",{className:"border-border flex h-14 items-center justify-between border-b px-4 flex-shrink-0",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("button",{onClick:()=>{n!=="wallet-setup"&&s("home")},className:"flex items-center gap-2 hover:opacity-80",children:S.jsx("span",{className:"text-accent text-sm font-bold tracking-tight",children:"PlotLink OWS"})}),S.jsx("span",{className:"text-muted text-[10px] uppercase tracking-wider",children:"writer"})]}),n!=="wallet-setup"&&S.jsxs("nav",{className:"flex items-center gap-4",children:[S.jsx("button",{onClick:()=>s("stories"),className:`text-xs transition-colors ${n==="stories"?"text-accent":"text-muted hover:text-foreground"}`,children:"stories"}),S.jsx("button",{onClick:()=>s("dashboard"),className:`text-xs transition-colors ${n==="dashboard"?"text-accent":"text-muted hover:text-foreground"}`,children:"dashboard"}),S.jsx("button",{onClick:()=>s("settings"),className:`text-xs transition-colors ${n==="settings"?"text-accent":"text-muted hover:text-foreground"}`,children:"settings"}),S.jsx("button",{onClick:t,className:"text-muted hover:text-foreground text-xs transition-colors",children:"logout"})]})]}),S.jsxs("main",{className:"flex-1 min-h-0",children:[n==="home"&&S.jsxs("div",{className:"mx-auto max-w-lg space-y-6 p-8",children:[S.jsxs("div",{className:"text-center space-y-2",children:[S.jsx("h1",{className:"text-2xl font-serif text-foreground",children:"Write. Publish. Earn."}),S.jsx("p",{className:"text-muted text-sm",children:"Claude CLI writes stories. You publish them on-chain."})]}),S.jsxs("div",{className:"text-center space-y-3",children:[S.jsx("button",{onClick:()=>s("stories"),className:"bg-accent text-white hover:bg-accent-dim px-6 py-2.5 rounded text-sm font-medium transition-colors",children:"Start Writing"}),a>0&&S.jsxs("p",{className:"text-muted text-xs",children:[a," ",a===1?"story":"stories"," in progress"]})]}),S.jsxs("div",{className:"rounded border border-border p-4 space-y-2 text-xs text-muted",children:[S.jsx("p",{className:"font-medium text-foreground text-sm",children:"How it works"}),S.jsxs("ol",{className:"space-y-1.5 list-decimal list-inside",children:[S.jsxs("li",{children:["Open the ",S.jsx("strong",{children:"Stories"})," tab — Claude CLI launches in the terminal"]}),S.jsx("li",{children:"Tell Claude your story idea — it brainstorms, outlines, and writes"}),S.jsx("li",{children:"Review the live preview as Claude creates files"}),S.jsxs("li",{children:["Click ",S.jsx("strong",{children:"Publish"})," to put your story on-chain"]}),S.jsxs("li",{children:["Earn 5% royalties on every trade at ",S.jsx("a",{href:"https://plotlink.xyz",target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"plotlink.xyz"})]})]})]}),S.jsx(Zy,{token:e})]}),n==="stories"&&S.jsx(qD,{token:e,authFetch:c}),n==="dashboard"&&S.jsx(Mx,{token:e}),n==="wallet-setup"&&S.jsx(WD,{token:e,onComplete:()=>s("home")}),n==="settings"&&S.jsx(Dx,{token:e,onLogout:t})]})]})}function VD(){const[e,t]=ne.useState(()=>localStorage.getItem("ows-token")),[n,s]=ne.useState(null),[a,o]=ne.useState(!0);ne.useEffect(()=>{fetch("/api/auth/status").then(h=>h.json()).then(h=>s(h.configured)).catch(()=>s(null))},[]),ne.useEffect(()=>{if(!e){o(!1);return}fetch("/api/auth/verify",{headers:{Authorization:`Bearer ${e}`}}).then(h=>{h.ok||(localStorage.removeItem("ows-token"),t(null))}).catch(()=>{localStorage.removeItem("ows-token"),t(null)}).finally(()=>o(!1))},[e]);const c=async h=>{try{const g=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({passphrase:h})}),_=await g.json();return g.ok?(localStorage.setItem("ows-token",_.token),t(_.token),null):_.error||"Login failed"}catch{return"Cannot connect to server"}},f=async h=>{try{const g=await fetch("/api/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({passphrase:h})}),_=await g.json();return g.ok?(localStorage.setItem("ows-token",_.token),t(_.token),s(!0),null):_.error||"Setup failed"}catch{return"Cannot connect to server"}},p=()=>{localStorage.removeItem("ows-token"),t(null)};return a||n===null?S.jsx("div",{className:"flex h-screen items-center justify-center",children:S.jsx("span",{className:"text-muted text-sm",children:"connecting..."})}):n?e?S.jsx(YD,{token:e,onLogout:p}):S.jsx(Tx,{onLogin:c}):S.jsx(Ax,{onSetup:f})}Ex.createRoot(document.getElementById("root")).render(S.jsx(vx.StrictMode,{children:S.jsx(VD,{})}));
129
+ `))}function p(y,x,E,N){const M=E.enter("tableCell"),G=E.enter("phrasing"),U=E.containerPhrasing(y,{...N,before:o,after:o});return G(),M(),U}function h(y,x){return nA(y,{align:x,alignDelimiters:s,padding:n,stringLength:a})}function g(y,x,E){const N=y.children;let M=-1;const G=[],U=x.enter("table");for(;++M<N.length;)G[M]=_(N[M],x,E);return U(),G}function _(y,x,E){const N=y.children;let M=-1;const G=[],U=x.enter("tableRow");for(;++M<N.length;)G[M]=p(N[M],y,x,E);return U(),G}function b(y,x,E){let N=FS.inlineCode(y,x,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function WA(){return{exit:{taskListCheckValueChecked:Iy,taskListCheckValueUnchecked:Iy,paragraph:VA}}}function YA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:KA}}}function Iy(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function VA(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 s=n.children[0];if(s&&s.type==="text"){const a=t.children;let o=-1,c;for(;++o<a.length;){const f=a[o];if(f.type==="paragraph"){c=f;break}}c===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function KA(e,t,n,s){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(s);o&&f.move(c);let p=FS.listItem(e,t,n,{...s,...f.current()});return o&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(g){return g+c}}function XA(){return[E3(),K3(),Z3(),jA(),WA()]}function $A(e){return{extensions:[T3(),X3(e),Q3(),qA(e),YA()]}}const GA={tokenize:iD,partial:!0},qS={tokenize:nD,partial:!0},WS={tokenize:rD,partial:!0},YS={tokenize:sD,partial:!0},ZA={tokenize:lD,partial:!0},VS={name:"wwwAutolink",tokenize:eD,previous:XS},KS={name:"protocolAutolink",tokenize:tD,previous:$S},jn={name:"emailAutolink",tokenize:JA,previous:GS},hn={};function QA(){return{text:hn}}let Ur=48;for(;Ur<123;)hn[Ur]=jn,Ur++,Ur===58?Ur=65:Ur===91&&(Ur=97);hn[43]=jn;hn[45]=jn;hn[46]=jn;hn[95]=jn;hn[72]=[jn,KS];hn[104]=[jn,KS];hn[87]=[jn,VS];hn[119]=[jn,VS];function JA(e,t,n){const s=this;let a,o;return c;function c(_){return!bd(_)||!GS.call(s,s.previous)||Gd(s.events)?n(_):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(_))}function f(_){return bd(_)?(e.consume(_),f):_===64?(e.consume(_),p):n(_)}function p(_){return _===46?e.check(ZA,g,h)(_):_===45||_===95||$t(_)?(o=!0,e.consume(_),p):g(_)}function h(_){return e.consume(_),a=!0,p}function g(_){return o&&a&&ri(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(_)):n(_)}}function eD(e,t,n){const s=this;return a;function a(c){return c!==87&&c!==119||!XS.call(s,s.previous)||Gd(s.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(GA,e.attempt(qS,e.attempt(WS,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function tD(e,t,n){const s=this;let a="",o=!1;return c;function c(_){return(_===72||_===104)&&$S.call(s,s.previous)&&!Gd(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(_),e.consume(_),f):n(_)}function f(_){if(ri(_)&&a.length<5)return a+=String.fromCodePoint(_),e.consume(_),f;if(_===58){const b=a.toLowerCase();if(b==="http"||b==="https")return e.consume(_),p}return n(_)}function p(_){return _===47?(e.consume(_),o?h:(o=!0,p)):n(_)}function h(_){return _===null||pu(_)||Qe(_)||Kr(_)||xu(_)?n(_):e.attempt(qS,e.attempt(WS,g),n)(_)}function g(_){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(_)}}function iD(e,t,n){let s=0;return a;function a(c){return(c===87||c===119)&&s<3?(s++,e.consume(c),a):c===46&&s===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function nD(e,t,n){let s,a,o;return c;function c(h){return h===46||h===95?e.check(YS,p,f)(h):h===null||Qe(h)||Kr(h)||h!==45&&xu(h)?p(h):(o=!0,e.consume(h),c)}function f(h){return h===95?s=!0:(a=s,s=void 0),e.consume(h),c}function p(h){return a||s||!o?n(h):t(h)}}function rD(e,t){let n=0,s=0;return a;function a(c){return c===40?(n++,e.consume(c),a):c===41&&s<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(YS,t,o)(c):c===null||Qe(c)||Kr(c)?t(c):(e.consume(c),a)}function o(c){return c===41&&s++,e.consume(c),a}}function sD(e,t,n){return s;function s(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),s):f===38?(e.consume(f),o):f===93?(e.consume(f),a):f===60||f===null||Qe(f)||Kr(f)?t(f):n(f)}function a(f){return f===null||f===40||f===91||Qe(f)||Kr(f)?t(f):s(f)}function o(f){return ri(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),s):ri(f)?(e.consume(f),c):n(f)}}function lD(e,t,n){return s;function s(o){return e.consume(o),a}function a(o){return $t(o)?n(o):t(o)}}function XS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qe(e)}function $S(e){return!ri(e)}function GS(e){return!(e===47||bd(e))}function bd(e){return e===43||e===45||e===46||e===95||$t(e)}function Gd(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aD={tokenize:mD,partial:!0};function oD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fD,continuation:{tokenize:dD},exit:pD}},text:{91:{name:"gfmFootnoteCall",tokenize:hD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uD,resolveTo:cD}}}}function uD(e,t,n){const s=this;let a=s.events.length;const o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c;for(;a--;){const p=s.events[a][1];if(p.type==="labelImage"){c=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!c||!c._balanced)return n(p);const h=Qi(s.sliceSerialize({start:c.end,end:s.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function cD(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 s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...f),e}function hD(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o=0,c;return f;function f(_){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),p}function p(_){return _!==94?n(_):(e.enter("gfmFootnoteCallMarker"),e.consume(_),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(_){if(o>999||_===93&&!c||_===null||_===91||Qe(_))return n(_);if(_===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return a.includes(Qi(s.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(_)}return Qe(_)||(c=!0),o++,e.consume(_),_===92?g:h}function g(_){return _===91||_===92||_===93?(e.consume(_),o++,h):h(_)}}function fD(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o,c=0,f;return p;function p(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(x)}function g(x){if(c>999||x===93&&!f||x===null||x===91||Qe(x))return n(x);if(x===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return o=Qi(s.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Qe(x)||(f=!0),c++,e.consume(x),x===92?_:g}function _(x){return x===91||x===92||x===93?(e.consume(x),c++,g):g(x)}function b(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(o)||a.push(o),Ue(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function dD(e,t,n){return e.check(Sa,t,e.attempt(aD,t,n))}function pD(e){e.exit("gfmFootnoteDefinition")}function mD(e,t,n){const s=this;return Ue(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const c=s.events[s.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function _D(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function a(c,f){let p=-1;for(;++p<c.length;)if(c[p][0]==="enter"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._close){let h=p;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[p][1].end.offset-c[p][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[p][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[p][1].end)},_={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[p][1].start)},b=[["enter",g,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",_,f]],y=f.parser.constructs.insideSpan.null;y&&Mi(b,b.length,0,wu(y,c.slice(h+1,p),f)),Mi(b,b.length,0,[["exit",_,f],["enter",c[p][1],f],["exit",c[p][1],f],["exit",g,f]]),Mi(c,h-1,p-h+3,b),p=h+b.length-2;break}}for(p=-1;++p<c.length;)c[p][1].type==="strikethroughSequenceTemporary"&&(c[p][1].type="data");return c}function o(c,f,p){const h=this.previous,g=this.events;let _=0;return b;function b(x){return h===126&&g[g.length-1][1].type!=="characterEscape"?p(x):(c.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const E=Vs(h);if(x===126)return _>1?p(x):(c.consume(x),_++,y);if(_<2&&!n)return p(x);const N=c.exit("strikethroughSequenceTemporary"),M=Vs(x);return N._open=!M||M===2&&!!E,N._close=!E||E===2&&!!M,f(x)}}}class gD{constructor(){this.map=[]}add(t,n,s){vD(this,t,n,s)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let a=s.pop();for(;a;){for(const o of a)t.push(o);a=s.pop()}this.map.length=0}}function vD(e,t,n,s){let a=0;if(!(n===0&&s.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...s);return}a+=1}e.map.push([t,n,s])}}function yD(e,t){let n=!1;const s=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=s.length-1;s[o]=s[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function bD(){return{flow:{null:{name:"table",tokenize:SD,resolveAll:xD}}}}function SD(e,t,n){const s=this;let a=0,o=0,c;return f;function f(F){let B=s.events.length-1;for(;B>-1;){const P=s.events[B][1].type;if(P==="lineEnding"||P==="linePrefix")B--;else break}const D=B>-1?s.events[B][1].type:null,j=D==="tableHead"||D==="tableRow"?O:p;return j===O&&s.parser.lazy[s.now().line]?n(F):j(F)}function p(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(c=!0,o+=1),g(F)}function g(F){return F===null?n(F):ve(F)?o>1?(o=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),y):n(F):Le(F)?Ue(e,g,"whitespace")(F):(o+=1,c&&(c=!1,a+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),_(F)))}function _(F){return F===null||F===124||Qe(F)?(e.exit("data"),g(F)):(e.consume(F),F===92?b:_)}function b(F){return F===92||F===124?(e.consume(F),_):_(F)}function y(F){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(F):(e.enter("tableDelimiterRow"),c=!1,Le(F)?Ue(e,x,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):x(F))}function x(F){return F===45||F===58?N(F):F===124?(c=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),E):K(F)}function E(F){return Le(F)?Ue(e,N,"whitespace")(F):N(F)}function N(F){return F===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),M):F===45?(o+=1,M(F)):F===null||ve(F)?Q(F):K(F)}function M(F){return F===45?(e.enter("tableDelimiterFiller"),G(F)):K(F)}function G(F){return F===45?(e.consume(F),G):F===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),U):(e.exit("tableDelimiterFiller"),U(F))}function U(F){return Le(F)?Ue(e,Q,"whitespace")(F):Q(F)}function Q(F){return F===124?x(F):F===null||ve(F)?!c||a!==o?K(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):K(F)}function K(F){return n(F)}function O(F){return e.enter("tableRow"),ee(F)}function ee(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),ee):F===null||ve(F)?(e.exit("tableRow"),t(F)):Le(F)?Ue(e,ee,"whitespace")(F):(e.enter("data"),oe(F))}function oe(F){return F===null||F===124||Qe(F)?(e.exit("data"),ee(F)):(e.consume(F),F===92?de:oe)}function de(F){return F===92||F===124?(e.consume(F),oe):oe(F)}}function xD(e,t){let n=-1,s=!0,a=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,p=0,h,g,_;const b=new gD;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(f=!1,p!==0&&(Fy(b,t,p,h,g),g=void 0,p=0),h={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",h,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(s=!0,_=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",g,t]])),a=x.type==="tableDelimiterRow"?2:g?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(s=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],_=Jo(b,t,o,a,void 0,_),o=[0,0,0,0]),c[2]=n)):x.type==="tableCellDivider"&&(s?s=!1:(o[1]!==0&&(c[0]=c[1],_=Jo(b,t,o,a,void 0,_)),o=c,c=[o[1],n,0,0])):x.type==="tableHead"?(f=!0,p=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(p=n,o[1]!==0?(c[0]=c[1],_=Jo(b,t,o,a,n,_)):c[1]!==0&&(_=Jo(b,t,c,a,n,_)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(c[3]=n)}for(p!==0&&Fy(b,t,p,h,g),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=yD(t.events,n))}return e}function Jo(e,t,n,s,a,o){const c=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},Fs(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const p=Fs(t.events,n[1]);if(o={type:c,start:Object.assign({},p),end:Object.assign({},p)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=Fs(t.events,n[2]),g=Fs(t.events,n[3]),_={type:f,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",_,t]]),s!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,E=n[3]-n[2]-1;e.add(x,E,[])}}e.add(n[3]+1,0,[["exit",_,t]])}return a!==void 0&&(o.end=Object.assign({},Fs(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function Fy(e,t,n,s,a){const o=[],c=Fs(t.events,n);a&&(a.end=Object.assign({},c),o.push(["exit",a,t])),s.end=Object.assign({},c),o.push(["exit",s,t]),e.add(n+1,0,o)}function Fs(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const wD={name:"tasklistCheck",tokenize:kD};function CD(){return{text:{91:wD}}}function kD(e,t,n){const s=this;return a;function a(p){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),o)}function o(p){return Qe(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),c):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),c):n(p)}function c(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(p)}function f(p){return ve(p)?t(p):Le(p)?e.check({tokenize:ED},t,n)(p):n(p)}}function ED(e,t,n){return Ue(e,s,"whitespace");function s(a){return a===null?n(a):t(a)}}function TD(e){return lS([QA(),oD(),_D(e),bD(),CD()])}const AD={};function DD(e){const t=this,n=e||AD,s=t.data(),a=s.micromarkExtensions||(s.micromarkExtensions=[]),o=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),c=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);a.push(TD(n)),o.push(XA()),c.push($A(n))}const Pr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],qy={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Pr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Pr],h2:[["className","sr-only"]],img:[...Pr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Pr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Pr],table:[...Pr],ul:[...Pr,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},pr={}.hasOwnProperty;function RD(e,t){let n={type:"root",children:[]};const s={schema:t?{...qy,...t}:qy,stack:[]},a=ZS(s,e);return a&&(Array.isArray(a)?a.length===1?n=a[0]:n.children=a:n=a),n}function ZS(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return MD(e,n);case"doctype":return BD(e,n);case"element":return ND(e,n);case"root":return LD(e,n);case"text":return zD(e,n)}}}function MD(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",s=n.indexOf("-->"),o={type:"comment",value:s<0?n:n.slice(0,s)};return wa(o,t),o}}function BD(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return wa(n,t),n}}function ND(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const s=QS(e,t.children),a=OD(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&pr.call(e.schema.ancestors,n))){const f=e.schema.ancestors[n];let p=-1;for(o=!1;++p<f.length;)e.stack.includes(f[p])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?s:void 0;const c={type:"element",tagName:n,properties:a,children:s};return wa(c,t),c}function LD(e,t){const s={type:"root",children:QS(e,t.children)};return wa(s,t),s}function zD(e,t){const s={type:"text",value:typeof t.value=="string"?t.value:""};return wa(s,t),s}function QS(e,t){const n=[];if(Array.isArray(t)){const s=t;let a=-1;for(;++a<s.length;){const o=ZS(e,s[a]);o&&(Array.isArray(o)?n.push(...o):n.push(o))}}return n}function OD(e,t){const n=e.stack[e.stack.length-1],s=e.schema.attributes,a=e.schema.required,o=s&&pr.call(s,n)?s[n]:void 0,c=s&&pr.call(s,"*")?s["*"]:void 0,f=t&&typeof t=="object"?t:{},p={};let h;for(h in f)if(pr.call(f,h)){const g=f[h];let _=Wy(e,Yy(o,h),h,g);_==null&&(_=Wy(e,Yy(c,h),h,g)),_!=null&&(p[h]=_)}if(a&&pr.call(a,n)){const g=a[n];for(h in g)pr.call(g,h)&&!pr.call(p,h)&&(p[h]=g[h])}return p}function Wy(e,t,n,s){return t?Array.isArray(s)?jD(e,t,n,s):JS(e,t,n,s):void 0}function jD(e,t,n,s){let a=-1;const o=[];for(;++a<s.length;){const c=JS(e,t,n,s[a]);(typeof c=="number"||typeof c=="string")&&o.push(c)}return o}function JS(e,t,n,s){if(!(typeof s!="boolean"&&typeof s!="number"&&typeof s!="string")&&HD(e,n,s)){if(typeof t=="object"&&t.length>1){let a=!1,o=0;for(;++o<t.length;){const c=t[o];if(c&&typeof c=="object"&&"flags"in c){if(c.test(String(s))){a=!0;break}}else if(c===s){a=!0;break}}if(!a)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+s:s}}function HD(e,t,n){const s=e.schema.protocols&&pr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!s||s.length===0)return!0;const a=String(n),o=a.indexOf(":"),c=a.indexOf("?"),f=a.indexOf("#"),p=a.indexOf("/");if(o<0||p>-1&&o>p||c>-1&&o>c||f>-1&&o>f)return!0;let h=-1;for(;++h<s.length;){const g=s[h];if(o===g.length&&a.slice(0,g.length)===g)return!0}return!1}function wa(e,t){const n=eS(t);t.data&&(e.data=pa(t.data)),n&&(e.position=n)}function Yy(e,t){let n,s=-1;if(e)for(;++s<e.length;){const a=e[s],o=typeof a=="string"?a:a[0];if(o===t)return a;o==="data*"&&(n=a)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function UD(e){return function(t){return RD(t,e)}}function PD({storyName:e,fileName:t,authFetch:n,onPublish:s,publishingFile:a}){const[o,c]=ne.useState(null),[f,p]=ne.useState(!1),[h,g]=ne.useState("preview"),[_,b]=ne.useState(""),[y,x]=ne.useState(!1),[E,N]=ne.useState(!1),[M,G]=ne.useState(!1),[U,Q]=ne.useState(null),K=ne.useRef(null),O=ne.useRef(!1),ee=ne.useRef(null),oe=ne.useCallback(async()=>{if(!e||!t){c(null);return}const le=`${e}/${t}`,k=ee.current!==le;k&&(ee.current=le);try{const T=await n(`/api/stories/${e}/${t}`);if(T.ok){const X=await T.json();c(X),(k||!O.current)&&(b(X.content??""),k&&(N(!1),O.current=!1))}}catch{}},[e,t,n]);ne.useEffect(()=>{p(!0),oe().finally(()=>p(!1))},[oe]),ne.useEffect(()=>{if(!e||!t||h==="edit"&&E)return;const le=setInterval(oe,3e3);return()=>clearInterval(le)},[e,t,oe,h,E]);const de=ne.useCallback(async()=>{if(!(!e||!t)){x(!0);try{(await n(`/api/stories/${e}/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:_})})).ok&&(N(!1),O.current=!1,c(k=>k&&{...k,content:_}))}catch{}x(!1)}},[e,t,n,_]);ne.useEffect(()=>{if(h!=="edit")return;const le=k=>{(k.metaKey||k.ctrlKey)&&k.key==="s"&&(k.preventDefault(),de())};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[h,de]),ne.useEffect(()=>{if((o==null?void 0:o.status)!=="published-not-indexed"||!o.publishedAt)return;const le=new Date(o.publishedAt).getTime(),k=300*1e3,T=()=>{const C=Math.max(0,k-(Date.now()-le));Q(C)};T();const X=setInterval(T,1e3);return()=>clearInterval(X)},[o==null?void 0:o.status,o==null?void 0:o.publishedAt]);const F=U!==null&&U<=0,B=U!==null&&U>0?`${Math.floor(U/6e4)}:${String(Math.floor(U%6e4/1e3)).padStart(2,"0")}`:null;if(!e||!t)return S.jsx("div",{className:"h-full flex items-center justify-center text-muted",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-lg font-serif",children:"Select a file to preview"}),S.jsx("p",{className:"text-sm mt-1",children:"Click a story file in the sidebar"})]})});if(f&&!o)return S.jsx("div",{className:"h-full flex items-center justify-center text-muted",children:"Loading..."});const j=(h==="edit"?_:(o==null?void 0:o.content)??"").length,P=t==="genesis.md",L=t?/^plot-\d+\.md$/.test(t):!1,A=(o==null?void 0:o.status)==="published"||(o==null?void 0:o.status)==="published-not-indexed",I=P?1e3:L?1e4:null,Y=!A&&I!==null&&j>I;return S.jsxs("div",{className:"h-full flex flex-col",children:[S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"px-3 py-1.5 flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-muted",children:[S.jsxs("span",{children:[e,"/",t]}),(o==null?void 0:o.status)==="published"&&S.jsx("span",{className:"text-green-700 font-medium",children:"Published"}),(o==null?void 0:o.status)==="published-not-indexed"&&S.jsx("span",{className:"text-amber-700 font-medium",title:o.indexError,children:"Published (not indexed)"}),(o==null?void 0:o.status)==="pending"&&S.jsx("span",{className:"text-amber-700 font-medium",children:"Pending"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("span",{className:`text-xs font-mono ${Y?"text-error font-medium":"text-muted"}`,children:[j.toLocaleString(),I!==null?`/${I.toLocaleString()}`:" chars"]}),Y&&S.jsxs("span",{className:"text-error text-xs font-medium",children:[(j-I).toLocaleString()," over limit"]})]})]}),S.jsxs("div",{className:"flex px-3 gap-1",children:[S.jsx("button",{onClick:()=>g("preview"),className:`px-3 py-1 text-xs font-medium border-b-2 transition-colors ${h==="preview"?"border-accent text-accent":"border-transparent text-muted hover:text-foreground"}`,children:"Preview"}),S.jsxs("button",{onClick:()=>g("edit"),className:`px-3 py-1 text-xs font-medium border-b-2 transition-colors ${h==="edit"?"border-accent text-accent":"border-transparent text-muted hover:text-foreground"}`,children:["Edit",E&&S.jsx("span",{className:"ml-1 text-amber-600",children:"*"})]})]})]}),h==="preview"?S.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",style:{background:"var(--paper-bg)"},children:o!=null&&o.content?S.jsx("div",{className:"prose max-w-none",children:S.jsx(p3,{remarkPlugins:[k3,DD],rehypePlugins:[UD],children:o.content})}):S.jsx("p",{className:"text-muted italic",children:"No content"})}):S.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",style:{background:"var(--paper-bg)"},children:[S.jsx("textarea",{ref:K,value:_,onChange:le=>{b(le.target.value),N(!0),O.current=!0},className:"flex-1 min-h-0 w-full resize-none px-4 py-3 text-sm leading-relaxed focus:outline-none",style:{fontFamily:'"Geist Mono", ui-monospace, monospace',background:"var(--paper-bg)",color:"var(--text)"},spellCheck:!1}),S.jsxs("div",{className:"px-3 py-1.5 border-t border-border flex items-center justify-between",children:[S.jsx("span",{className:"text-xs text-muted",children:E?"Unsaved changes":"No changes"}),S.jsx("button",{onClick:de,disabled:!E||y,className:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent-dim disabled:opacity-50 disabled:cursor-not-allowed",children:y?"Saving...":"Save"})]})]}),S.jsx("div",{className:"px-3 py-2 border-t border-border flex items-center justify-between",children:t==="structure.md"?S.jsx("p",{className:"text-muted text-xs italic",children:"This is your story outline — not publishable. Ask AI to write the genesis next."}):(o==null?void 0:o.status)==="published-not-indexed"?S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[S.jsx("span",{className:"text-amber-700",children:"Published on-chain but not indexed on PlotLink"}),!F&&S.jsx("button",{onClick:async()=>{if(!(!e||!t||!o.txHash)){G(!0);try{(await(await n("/api/publish/retry-index",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyName:e,fileName:t,txHash:o.txHash,content:o.content,storylineId:o.storylineId})})).json()).ok&&(await n(`/api/stories/${e}/${t}/publish-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({txHash:o.txHash,storylineId:o.storylineId,contentCid:"",gasCost:""})}),oe())}catch{}G(!1)}},disabled:M,className:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent-dim disabled:opacity-50",children:M?"Retrying...":`Retry Index${B?` (${B})`:""}`}),L&&S.jsx("button",{onClick:()=>e&&t&&(s==null?void 0:s(e,t)),disabled:!!a,className:"px-3 py-1 border border-border text-xs rounded hover:bg-surface disabled:opacity-50",children:a===t?"Publishing...":"Retry Publish"}),o.txHash&&S.jsx("a",{href:`https://basescan.org/tx/${o.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted underline",children:"BaseScan"})]}),S.jsx("p",{className:"text-muted text-xs",children:F?L?"Index window expired. Use Retry Publish to create a new on-chain tx.":"Index window expired. Contact support or re-publish manually.":L?"Try Retry Index first (available for 5 min after publish). If that fails, Retry Publish creates a new on-chain tx.":"Retry Index is available for 5 min after publish."}),o.indexError&&S.jsx("p",{className:"text-error text-xs",children:o.indexError})]}):(o==null?void 0:o.status)==="published"?S.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[S.jsx("span",{className:"text-green-700",children:"Published"}),o.storylineId&&S.jsx("a",{href:(()=>{var T;const le=`https://plotlink.xyz/story/${o.storylineId}`;if(!L)return le;const k=o.plotIndex!=null&&o.plotIndex>0?o.plotIndex:parseInt(((T=t==null?void 0:t.match(/^plot-(\d+)\.md$/))==null?void 0:T[1])??"1");return`${le}/${k}`})(),target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View on PlotLink"}),o.txHash&&S.jsx("a",{href:`https://basescan.org/tx/${o.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted underline",children:"BaseScan"})]}):S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:()=>e&&t&&(s==null?void 0:s(e,t)),disabled:!!a||Y,className:"px-4 py-1.5 bg-accent text-white text-sm rounded hover:bg-accent-dim disabled:opacity-50 disabled:cursor-not-allowed",children:a===t?"Publishing...":"Publish to PlotLink"}),Y&&S.jsx("span",{className:"text-error text-xs",children:"Reduce content to publish"})]})})]})}const e0="plotlink-panel-ratio",ID=.6,Vy=300,kf=224,Ef=6;function FD(){try{const e=localStorage.getItem(e0);if(e){const t=parseFloat(e);if(t>0&&t<1)return t}}catch{}return ID}function Ky(e,t){if(t<=0)return e;const n=Vy/t,s=1-Vy/t;return n>=s?.5:Math.min(s,Math.max(n,e))}function qD({token:e,authFetch:t}){const[n,s]=ne.useState(null),[a,o]=ne.useState(null),[c,f]=ne.useState(null),[p,h]=ne.useState(""),[g,_]=ne.useState(FD),[b,y]=ne.useState([]),x=ne.useRef(new Set),E=ne.useRef(null),N=ne.useRef(!1);ne.useEffect(()=>{try{localStorage.setItem(e0,String(g))}catch{}},[g]),ne.useEffect(()=>{const B=()=>{if(!E.current)return;const D=E.current.getBoundingClientRect().width-kf-Ef;_(j=>Ky(j,D))};return window.addEventListener("resize",B),B(),()=>window.removeEventListener("resize",B)},[]);const M=ne.useCallback(()=>{const B=`_new_${Date.now()}`;y(D=>[...D,B]),s(B),o(null)},[]);ne.useEffect(()=>{if(b.length===0)return;const B=setInterval(async()=>{try{const D=await t("/api/stories");if(!D.ok)return;const j=await D.json(),P=new Set(j.stories.filter(L=>L.name!=="_example").map(L=>L.name));for(const L of P)!x.current.has(L)&&b.length>0&&(y(A=>A.slice(1)),s(L),o(null));x.current=P}catch{}},3e3);return()=>clearInterval(B)},[t,b]),ne.useEffect(()=>{t("/api/stories").then(B=>{if(B.ok)return B.json()}).then(B=>{B!=null&&B.stories&&(x.current=new Set(B.stories.filter(D=>D.name!=="_example").map(D=>D.name)))}).catch(()=>{})},[t]);const G=ne.useCallback((B,D)=>{s(B),o(D)},[]),U=ne.useRef(null),Q=ne.useCallback(async B=>{var D,j,P,L;U.current=B,s(B),o(null);try{const A=await t(`/api/stories/${B}`);if(A.ok&&U.current===B){const Y=(await A.json()).files||[],k=((D=Y.map(T=>{var X;return{file:T.file,num:(X=T.file.match(/^plot-(\d+)\.md$/))==null?void 0:X[1]}}).filter(T=>T.num!=null).sort((T,X)=>parseInt(X.num)-parseInt(T.num))[0])==null?void 0:D.file)??((j=Y.find(T=>T.file==="genesis.md"))==null?void 0:j.file)??((P=Y.find(T=>T.file==="structure.md"))==null?void 0:P.file)??((L=Y[0])==null?void 0:L.file);k&&U.current===B&&o(k)}}catch{}},[t]),K=ne.useCallback(B=>{B.preventDefault(),N.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const D=P=>{if(!N.current||!E.current)return;const L=E.current.getBoundingClientRect(),A=L.width-kf-Ef,I=P.clientX-L.left-kf;_(Ky(I/A,A))},j=()=>{N.current=!1,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",j)};window.addEventListener("mousemove",D),window.addEventListener("mouseup",j)},[]),O=ne.useCallback(async(B,D)=>{var j;f(D),h("Reading file...");try{const P=await t(`/api/stories/${B}/${D}`);if(!P.ok)throw new Error("Failed to read file");const L=await P.json(),A=L.content.match(/^#\s+(.+)$/m),I=A?A[1].slice(0,60):D.replace(".md","");let Y="Fiction";try{const C=await t(`/api/stories/${B}/structure.md`);if(C.ok){const pe=(await C.json()).content.match(/genre[:\s]+(.+)/i);pe&&(Y=pe[1].trim().slice(0,30))}}catch{}let le;if(D.match(/^plot-\d+\.md$/)){try{const C=await t(`/api/stories/${B}`);if(C.ok){const pe=(await C.json()).files.find(he=>he.file==="genesis.md"&&he.storylineId);le=pe==null?void 0:pe.storylineId}}catch{}if(!le){h("Error: Publish genesis first to create the storyline"),setTimeout(()=>{f(null),h("")},3e3);return}}h("Publishing...");const k=await t("/api/publish/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyName:B,fileName:D,title:I,content:L.content,genre:Y,storylineId:le})});if(!k.ok){const C=await k.json();throw new Error(C.error||"Publish failed")}const T=(j=k.body)==null?void 0:j.getReader(),X=new TextDecoder;if(T)for(;;){const{done:C,value:se}=await T.read();if(C)break;const he=X.decode(se).split(`
130
+ `).filter(be=>be.startsWith("data: "));for(const be of he)try{const Te=JSON.parse(be.slice(6));Te.step&&h(Te.message||Te.step),Te.step==="done"&&Te.txHash&&await t(`/api/stories/${B}/${D}/publish-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({txHash:Te.txHash,storylineId:Te.storylineId,plotIndex:Te.plotIndex,contentCid:Te.contentCid,gasCost:Te.gasCost,indexError:Te.indexError})})}catch{}}h("Published!")}catch(P){const L=P instanceof Error?P.message:"Publish failed";h(`Error: ${L}`)}finally{setTimeout(()=>{f(null),h("")},3e3)}},[t]),ee=ne.useCallback(B=>{B.startsWith("_new_")&&y(D=>D.filter(j=>j!==B))},[]),[oe,de]=ne.useState(new Set);ne.useEffect(()=>{t("/api/stories").then(D=>D.ok?D.json():null).then(D=>{D!=null&&D.stories&&de(new Set(D.stories.filter(j=>j.hasStructure).map(j=>j.name)))}).catch(()=>{});const B=setInterval(async()=>{try{const D=await t("/api/stories");if(D.ok){const j=await D.json();de(new Set(j.stories.filter(P=>P.hasStructure).map(P=>P.name)))}}catch{}},5e3);return()=>clearInterval(B)},[t]);const F=ne.useCallback(B=>{n===B&&(s(null),o(null))},[n]);return S.jsxs("div",{ref:E,className:"h-[calc(100vh-3.5rem)] flex",children:[S.jsx("div",{className:"w-56 border-r border-border flex-shrink-0",children:S.jsx(Lx,{authFetch:t,selectedStory:n,selectedFile:a,onSelectFile:G,onNewStory:M,untitledSessions:b})}),S.jsx("div",{className:"min-w-0 border-r border-border",style:{flex:`${g} 0 0`},children:S.jsx(rk,{token:e,storyName:n,authFetch:t,onSelectStory:Q,onDestroySession:ee,onArchiveStory:F,confirmedStories:oe})}),S.jsx("div",{onMouseDown:K,className:"flex-shrink-0 flex items-center justify-center hover:bg-border/50 transition-colors",style:{width:Ef,cursor:"col-resize",background:"var(--border)"},children:S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("div",{className:"w-0.5 h-0.5 rounded-full",style:{background:"var(--text-muted)"}}),S.jsx("div",{className:"w-0.5 h-0.5 rounded-full",style:{background:"var(--text-muted)"}}),S.jsx("div",{className:"w-0.5 h-0.5 rounded-full",style:{background:"var(--text-muted)"}})]})}),S.jsxs("div",{className:"min-w-0 flex flex-col",style:{flex:`${1-g} 0 0`},children:[S.jsx(PD,{storyName:n,fileName:a,authFetch:t,onPublish:O,publishingFile:c}),p&&S.jsx("div",{className:"px-3 py-1.5 bg-surface border-t border-border text-xs text-muted",children:p})]})]})}function WD({token:e,onComplete:t}){const[n,s]=ne.useState(!1),[a,o]=ne.useState(null),[c,f]=ne.useState(!1),p=async()=>{s(!0),o(null);try{const h=await fetch("/api/wallet/create",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),g=await h.json();if(!h.ok)throw new Error(g.error||"Wallet creation failed");f(!0)}catch(h){o(h instanceof Error?h.message:"Wallet creation failed")}s(!1)};return ne.useEffect(()=>{p()},[]),S.jsxs("div",{className:"mx-auto max-w-sm p-6 text-center",children:[S.jsx("h2",{className:"text-accent mb-1 text-lg font-bold",children:"Wallet Setup"}),S.jsx("p",{className:"text-muted mb-6 text-xs",children:"creating your OWS wallet for on-chain publishing"}),n&&S.jsx("p",{className:"text-accent text-sm",children:"creating wallet..."}),a&&S.jsxs("div",{className:"space-y-4",children:[S.jsx("div",{className:"rounded border border-red-700/30 p-3 text-xs text-red-700",children:a}),S.jsx("button",{onClick:p,className:"border-accent text-accent hover:bg-accent/10 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:"retry"})]}),c&&S.jsxs("div",{className:"space-y-4",children:[S.jsx("div",{className:"text-accent text-2xl",children:"✓"}),S.jsx("p",{className:"text-foreground text-sm font-medium",children:"wallet created"}),S.jsx("button",{onClick:t,className:"border-accent text-accent hover:bg-accent/10 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:"continue"})]})]})}function YD({token:e,onLogout:t}){const[n,s]=ne.useState("home"),[a,o]=ne.useState(0),c=ne.useCallback(async(f,p)=>fetch(f,{...p,headers:{...(p==null?void 0:p.headers)||{},Authorization:`Bearer ${e}`}}),[e]);return ne.useEffect(()=>{async function f(){try{if(!(await(await c("/api/wallet")).json()).exists){s("wallet-setup");return}const g=await c("/api/stories");if(g.ok){const _=await g.json();o(_.stories.filter(b=>b.name!=="_example").length)}}catch{}}f()},[e]),S.jsxs("div",{className:"flex h-screen flex-col",children:[S.jsxs("header",{className:"border-border flex h-14 items-center justify-between border-b px-4 flex-shrink-0",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("button",{onClick:()=>{n!=="wallet-setup"&&s("home")},className:"flex items-center gap-2 hover:opacity-80",children:S.jsx("span",{className:"text-accent text-sm font-bold tracking-tight",children:"PlotLink OWS"})}),S.jsx("span",{className:"text-muted text-[10px] uppercase tracking-wider",children:"writer"})]}),n!=="wallet-setup"&&S.jsxs("nav",{className:"flex items-center gap-4",children:[S.jsx("button",{onClick:()=>s("stories"),className:`text-xs transition-colors ${n==="stories"?"text-accent":"text-muted hover:text-foreground"}`,children:"stories"}),S.jsx("button",{onClick:()=>s("dashboard"),className:`text-xs transition-colors ${n==="dashboard"?"text-accent":"text-muted hover:text-foreground"}`,children:"dashboard"}),S.jsx("button",{onClick:()=>s("settings"),className:`text-xs transition-colors ${n==="settings"?"text-accent":"text-muted hover:text-foreground"}`,children:"settings"}),S.jsx("button",{onClick:t,className:"text-muted hover:text-foreground text-xs transition-colors",children:"logout"})]})]}),S.jsxs("main",{className:"flex-1 min-h-0",children:[n==="home"&&S.jsxs("div",{className:"mx-auto max-w-lg space-y-6 p-8",children:[S.jsxs("div",{className:"text-center space-y-2",children:[S.jsx("h1",{className:"text-2xl font-serif text-foreground",children:"Write. Publish. Earn."}),S.jsx("p",{className:"text-muted text-sm",children:"Claude CLI writes stories. You publish them on-chain."})]}),S.jsxs("div",{className:"text-center space-y-3",children:[S.jsx("button",{onClick:()=>s("stories"),className:"bg-accent text-white hover:bg-accent-dim px-6 py-2.5 rounded text-sm font-medium transition-colors",children:"Start Writing"}),a>0&&S.jsxs("p",{className:"text-muted text-xs",children:[a," ",a===1?"story":"stories"," in progress"]})]}),S.jsxs("div",{className:"rounded border border-border p-4 space-y-2 text-xs text-muted",children:[S.jsx("p",{className:"font-medium text-foreground text-sm",children:"How it works"}),S.jsxs("ol",{className:"space-y-1.5 list-decimal list-inside",children:[S.jsxs("li",{children:["Open the ",S.jsx("strong",{children:"Stories"})," tab — Claude CLI launches in the terminal"]}),S.jsx("li",{children:"Tell Claude your story idea — it brainstorms, outlines, and writes"}),S.jsx("li",{children:"Review the live preview as Claude creates files"}),S.jsxs("li",{children:["Click ",S.jsx("strong",{children:"Publish"})," to put your story on-chain"]}),S.jsxs("li",{children:["Earn 5% royalties on every trade at ",S.jsx("a",{href:"https://plotlink.xyz",target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"plotlink.xyz"})]})]})]}),S.jsx(Zy,{token:e})]}),n==="stories"&&S.jsx(qD,{token:e,authFetch:c}),n==="dashboard"&&S.jsx(Mx,{token:e}),n==="wallet-setup"&&S.jsx(WD,{token:e,onComplete:()=>s("home")}),n==="settings"&&S.jsx(Dx,{token:e,onLogout:t})]})]})}function VD(){const[e,t]=ne.useState(()=>localStorage.getItem("ows-token")),[n,s]=ne.useState(null),[a,o]=ne.useState(!0);ne.useEffect(()=>{fetch("/api/auth/status").then(h=>h.json()).then(h=>s(h.configured)).catch(()=>s(null))},[]),ne.useEffect(()=>{if(!e){o(!1);return}fetch("/api/auth/verify",{headers:{Authorization:`Bearer ${e}`}}).then(h=>{h.ok||(localStorage.removeItem("ows-token"),t(null))}).catch(()=>{localStorage.removeItem("ows-token"),t(null)}).finally(()=>o(!1))},[e]);const c=async h=>{try{const g=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({passphrase:h})}),_=await g.json();return g.ok?(localStorage.setItem("ows-token",_.token),t(_.token),null):_.error||"Login failed"}catch{return"Cannot connect to server"}},f=async h=>{try{const g=await fetch("/api/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({passphrase:h})}),_=await g.json();return g.ok?(localStorage.setItem("ows-token",_.token),t(_.token),s(!0),null):_.error||"Setup failed"}catch{return"Cannot connect to server"}},p=()=>{localStorage.removeItem("ows-token"),t(null)};return a||n===null?S.jsx("div",{className:"flex h-screen items-center justify-center",children:S.jsx("span",{className:"text-muted text-sm",children:"connecting..."})}):n?e?S.jsx(YD,{token:e,onLogout:p}):S.jsx(Tx,{onLogin:c}):S.jsx(Ax,{onSetup:f})}Ex.createRoot(document.getElementById("root")).render(S.jsx(vx.StrictMode,{children:S.jsx(VD,{})}));